A LSTM Keypoint Model deployed on Flask that detects real time dynamic sign language (ASL animals) on browser.
Explore AlphaSign, the static version of our sign language game here.
- Cow
- Elephant
- Butterfly
- Gorilla
- Bird
signpose_video_demo.mp4
Breakdown of Train Test Split using Stratified Sampling (to ensure even distribution of train and test data)
# LSTM Sequential Model using Keras
model = Sequential()
model.add(LSTM(64, return_sequences=True, activation='relu', input_shape=(30,258))) #each video has input shape of 30 frames of 258 keypoints: X.shape (Handpose + Bodypose)
model.add(Dropout(0.2))
model.add(LSTM(128, return_sequences=True, activation='relu'))
model.add(Dropout(0.2))
model.add(LSTM(64, return_sequences=False, activation='relu')) #next layer is a dense layer so we do not return sequences here
model.add(Dense(64, activation='relu'))
model.add(Dense(32, activation='relu'))
model.add(Dense(actions.shape[0], activation='softmax'))
# Compile defines the loss function, the optimizer and the metrics.
model.compile(optimizer='Adam', loss='categorical_crossentropy', metrics=['categorical_accuracy'])
- Train & Test Categorical Accuracy over epochs
- Train & Test Loss over epochs (early stopping implemented to prevent overfitting)
- Train Confusion Matrix
- Test Confusion Matrix
git clone https://github.com/ngzhili/LSTM_Keypoint_Sign_Language_Detector.git
conda create -n <VENV_NAME> python=3.8
conda activate <VENV_NAME>
pip install -r requirements.txt
cd <PATH/TO/Sign-Language-Image-Recognition>
flask run