- Noise Augmentation: Adds Gaussian noise to keypoints (simulates sensor noise)
- Scale Augmentation: Slightly scales keypoints (handles different body sizes)
- Shift Augmentation: Shifts keypoints (handles positioning variations)
- Dropout Augmentation: Randomly zeros keypoints (simulates occlusion)
- Result: 5x more training data per video (1 original + 5 augmented)
- Deeper LSTM Network: 4 LSTM layers (128→256→256→128 units)
- Batch Normalization: After each LSTM layer for stable training
- Dropout Regularization: 0.2-0.4 dropout rates to prevent overfitting
- L2 Regularization: Weight decay (0.001) to reduce overfitting
- Better Activation: Using
tanhfor LSTMs (better gradient flow) - Dense Layers: 256→128→64 units with proper regularization
- K-Fold Cross-Validation: 3-fold stratified cross-validation
- Stratified Splits: Ensures balanced class distribution in each fold
- Best Model Selection: Automatically selects the best performing fold
- Result: More robust model that generalizes better
- Learning Rate Scheduling:
ReduceLROnPlateaureduces LR when stuck - Early Stopping: Stops training if validation doesn't improve (patience=25)
- Model Checkpointing: Saves best model weights automatically
- Adam Optimizer: Tuned hyperparameters (LR=0.001, beta1=0.9, beta2=0.999)
- Classification Report: Precision, Recall, F1-score per class
- Confusion Matrix: Visual representation of classification errors
- Per-Class Accuracy: Shows which words are recognized best
- Top-2 Accuracy: (Removed - not available in standard Keras)
- Prediction Smoothing: Uses deque with majority voting (last 5 predictions)
- Confidence Thresholding: Only shows predictions with ≥30% confidence
- Consensus Requirement: Needs at least 2 votes for a prediction
- Dynamic Model Loading: Automatically uses best available model (Advanced > Improved > Original)
- Accuracy: Should improve from ~60-70% to 85-95% with proper training
- Robustness: Better handling of variations in lighting, positioning, body size
- Generalization: Cross-validation ensures model works on unseen data
- Stability: Prediction smoothing reduces flickering in real-time detection
python train-advanced-model.py --data-dir training-data --epochs 200 --batch-size 16 --augment 5 --folds 3Or use the batch file:
START-ADVANCED-TRAINING.batThe realtime-detection.py script will automatically detect and use the advanced model if available:
python realtime-detection.pylstm-model-advanced/: Best model from cross-validationbest_model.hdf5: Model weightswords.txt: List of recognized wordstraining_log.csv: Training history for each fold
--epochs: Number of training epochs (default: 200)--batch-size: Batch size (default: 16)--augment: Augmentation multiplier (default: 5)--folds: Cross-validation folds (default: 3, use 5 for more robust)
- Training time will be longer due to cross-validation and augmentation
- Each fold trains independently, so 3 folds = 3x training time
- With 5x augmentation, dataset size increases significantly
- Monitor GPU/CPU usage - training is computationally intensive
- More Data: Collect more videos per word (aim for 50+ per class)
- Transfer Learning: Use pre-trained pose estimation models
- Ensemble Models: Combine multiple models for final prediction
- Temporal Attention: Add attention mechanisms to focus on important frames
- 3D CNNs: Consider 3D convolutions for spatio-temporal features