This project implements a real-time American Sign Language (ASL) recognition system using a sensor-based data glove and Machine Learning. It captures hand gestures via an ESP32 microcontroller, processes the data, and classifies the sign using a trained Neural Network. The detected sign is then converted to speech using Text-to-Speech (TTS).
- Real-time Recognition: Instantly translates sensor data into ASL signs.
- Smart Data Glove: Utilizes an ESP32 with multiple sensors (Flex, Gyroscope, Accelerometer) to capture precise hand movements.
- Deep Learning Model: Powered by a TensorFlow/Keras model (
asl_model_best.h5) trained on the ASL Sensor Dataglove Dataset. - Text-to-Speech (TTS): Audible feedback using
pyttsx3for improved accessibility. - Robust Preprocessing: Uses
StandardScalerto normalize incoming sensor data for accurate predictions.
- ESP32 Microcontroller
- Data Glove equipped with:
- 5 Flex Sensors (for finger bending)
- IMU (Inertial Measurement Unit) providing:
- Quaternions (Orientation)
- Gyroscope (Angular velocity)
- Accelerometer (Linear acceleration)
- Python 3.7+
- TensorFlow / Keras
- NumPy
- Joblib
- PySerial
- Pyttsx3 (for TTS)
-
Clone the Repository (if applicable) or download the project files.
-
Install Dependencies: Open a terminal/command prompt and run:
pip install tensorflow numpy joblib pyserial pyttsx3
Before running the system, you must configure the Serial Port connection to your ESP32.
- Connect your ESP32 to your computer via USB.
- Find the COM port number (e.g.,
COM3,COM9,/dev/ttyUSB0):- Windows: Device Manager -> Ports (COM & LPT).
- Linux/Mac: Run
ls /dev/tty*in terminal.
- Open
realtime_asl.pyin a text editor. - Update Line 15 with your specific COM port:
SERIAL_PORT = "COM9" # Change to your port, e.g., "COM3"
- Ensure
BAUD_RATEmatches your ESP32 firmware setting (default:115200).
- Ensure the ESP32 is connected and transmitting data.
- Run the main script:
python realtime_asl.py
- System Status:
[INFO] Listening to ESP32...: Connection successful, waiting for data.Detected Sign: A: Shows the currently recognized sign.- Audio: The system will speak the detected sign.
realtime_asl.py: Main execution script. Handles serial communication, prediction, and TTS.asl_model_best.h5: Pre-trained Deep Learning model for sign classification.scaler.pkl: StandardScaler object for normalizing input data (must match training scaling).label_encoder.pkl: Encoder to translate model output indices back to Text labels (e.g., 0 -> 'A').ASL-Sensor-Dataglove-Dataset/: Directory containing the dataset used for training.
The system expects a CSV-formatted string from the serial port with 23 values:
Timestamp, User_ID, Flex_1...Flex_5, Quat_W...Quat_Z, Gyro_X...Gyro_Z, Acc_X...Acc_Z, AccBody_X...AccBody_Z, AccWorld_X...AccWorld_Z
The script ignores the first 2 values (Timestamp, User_ID) and uses the remaining 21 features for prediction.
SerialException/ Port not found:- Check your USB connection.
- Verify the correct COM port is set in the code.
- Close any other applications (like Arduino IDE serial monitor) using the port.
- Incorrect Predictions:
- Ensure the sensors are calibrated.
- Verify the order of sensors in your ESP32 code matches the Python script expectations.
- Subhra Sameer Dash
This project is licensed under the MIT License - see the LICENSE file for details.