This directory contains the machine learning models that power the NeuroWarn BCI system's prediction capabilities.
- LSTM Neural Networks - Deep learning models for EEG signal processing
- Data Preprocessing - Scalers and data transformation utilities
- Training Notebooks - Jupyter notebooks documenting the model development process
- Saved Models - Pre-trained models ready for deployment
- model.keras - Primary model used by the backend for real-time predictions
- best_model_weights.keras - Best performing model weights from training
- scaler.joblib - StandardScaler for normalizing input data
- emotiv_latest.csv - Latest collected EEG data
- emotiv_no_ohe.csv - EEG data without one-hot encoding
- testset.csv - Test dataset for model evaluation
- Data Collection: EEG data is collected from the Emotiv Insight headset via Cortex API
- Preprocessing: Raw EEG data is normalized using StandardScaler
- Model Input: Processed data is fed into the LSTM model in a sliding window of 5 time steps
- Prediction: Model outputs command predictions (forward, left, right, backward)
- Backend Integration: Predictions are sent to the backend for wheelchair control
The models are automatically loaded by the backend's ai_copypaste.py file. The system:
- Loads the pre-trained model and scaler
- Collects EEG data in real-time
- Processes the data using the scaler
- Makes predictions using the model
- Sends commands to control the wheelchair
The LSTM model architecture consists of:
- Input layer accepting 5 channels of EEG data
- LSTM layers for temporal pattern recognition
- Dense layers for classification
- Output layer predicting movement commands
To train a new model:
- Collect EEG data using the Emotiv headset
- Save the data to CSV format
- Run the training notebook (LSTM_Model_Multi_Var.ipynb)
- Save the resulting model as model.keras
- Save the scaler as scaler.joblib