This project implements an end-to-end Brain-Computer Interface (BCI) pipeline for EEG signal classification. The workflow combines signal preprocessing, artifact removal, spatial feature extraction, and machine learning to classify neural activity from multi-channel EEG recordings.
The objective is to predict feedback events from EEG signals while mitigating noise and physiological artifacts.
Training and testing EEG recordings are loaded from CSV files using chunked processing to efficiently handle large datasets.
- Removes power-line interference at 50 Hz.
- Butterworth filter
- Frequency range: 1–40 Hz
These steps suppress noise while retaining relevant EEG frequency components.
Eye-movement artifacts are removed using EOG regression.
For each EEG channel:
- Linear regression is trained using EOG measurements.
- Predicted ocular artifacts are subtracted from EEG signals.
- Cleaned signals are retained for downstream analysis.
Class imbalance is addressed through random resampling to ensure equal representation of feedback-event classes.
CSP is applied to cleaned EEG channels to learn spatial filters that maximize variance differences between classes.
Configuration:
- Channels used: First 8 EEG channels
- Components: 4 CSP features
The resulting features provide compact and discriminative representations of neural activity.
A Support Vector Machine (SVM) classifier is trained using:
- Linear kernel
- Balanced class weights
- Probability estimation enabled
The model is evaluated using a train-validation split and classification metrics.
For unseen test recordings:
- Apply preprocessing
- Remove EOG artifacts
- Extract CSP features
- Generate prediction probabilities
- Create submission file
Output format:
IdFeedBack,Prediction
FB00001,0.81
FB00002,0.24
...
- Python
- Pandas
- NumPy
- SciPy
- MNE
- Scikit-Learn
- Joblib
- EEG Signal Processing
- Brain-Computer Interfaces
- Common Spatial Patterns (CSP)
- Artifact Removal
- Support Vector Machines
- Signal Filtering
- Feature Engineering
- Riemannian geometry-based classifiers
- Filter Bank CSP (FBCSP)
- Deep-learning-based EEG decoding
- Hyperparameter optimization
- Subject-independent evaluation