This document provides instructions for using our research code, specifically focused on training and evaluating models for surface electromyography (sEMG) signal classification. The codebase includes scripts for data collection, processing, model training, and evaluation.
- Data Collection
- Data Loading and Processing
- Model Training and Evaluation
- Model Explanations
- Grasp Modes
Data is collected using an Arduino setup, which captures sEMG signals. The dataCollection.py
script is used to read and store this data.
- Load and preprocess sEMG data using the
sEMGDataset
class. ComputeBasicFeatures
transform is applied for initial feature extraction.
- Python 3.x
- Libraries: PyTorch, NumPy, Pandas (complete list in
requirements.txt
) - sEMG dataset in the specified format
- Install Python 3.x and all required libraries.
- Clone the repository and navigate to the project directory.
- Prepare your dataset according to the format used in
dataCollection.py
.
- Data Loading: Utilize the
sEMGDataset
class fromdatasetLoading.py
to load your dataset. - Preprocessing: Apply the
ComputeBasicFeatures
for initial data processing. - Model Initialization: Initialize the
HybridModel
frommodeling/hybridModel.py
. - Training Configuration: Set up the training environment using the Adam optimizer with a learning rate of 0.001.
- Execute Training: Run the training loop for the desired number of epochs (default is 10).
- Monitoring: Monitor training progress and performance on a validation set.
- After training, evaluate the model's performance on a separate test dataset.
- Document the model's accuracy, precision, recall, and F1-score.
- Instructions for saving the trained model to a file.
- Guidelines for loading the model for future inference tasks.
- The LSTM model is designed to handle sequential data, capturing temporal dependencies in sEMG signals.
- This model combines Convolutional Neural Networks (CNNs) for feature extraction with LSTM layers for sequence modeling, suitable for complex sEMG patterns.
The system classifies sEMG signals into five grasp modes:
- Cylindrical Grasp
- Tip Grasp
- Hook Grasp
- Palmar Grasp
- Lateral Grasp
Each mode has distinct applications in prosthetic control and robotics.
For further inquiries or support, please contact Sebastian Levy at [email protected]