This project focuses on enhancing EEG-based emotion classification (valence/arousal) using graph signal processing and advanced Graph Neural Networks (GNNs). It combines PLV-based brain connectivity, spectral GNNs, and deep graph embeddings to capture functional dynamics in EEG signals.
.
├── preprocessing.py # EEG preprocessing & PSD feature extraction
├── spectral_gnn.py # Basic Spectral GNN using ChebConv layers
├── showcase_pool.py # Pooling strategy comparison (TopK, SAG, Mean)
├── graph_embeddings.py # Advanced embedding model with GAT + GCN + Residuals
├── accurate.py # Aggregates accuracy across subjects
├── report.pdf # [Include if exists: detailed project report]
- Dataset: DEAP Dataset
- Signals: 32-channel EEG
- Labels: Valence and Arousal (binary classification)
- Segments: 2-second windows (256 samples at 128 Hz)
- Bandpass Filtering: 4–48 Hz
- Artifact Removal: ICA using Fp1
- Feature Extraction: PSD (theta, alpha, beta, gamma bands)
- Output: Subject-wise CSV files
- Computes Phase Locking Value (PLV) to build EEG connectivity graphs
- Uses ChebConv-based Spectral GNN for classification
- Trains with 70/30 train/test split
- Tests TopK, SAG, and Mean pooling
- Logs training loss, accuracy, confusion matrices
- Saves pooling-wise visualizations
- Architecture: GAT ➜ 3x GCNConv ➜ Residuals ➜ Projection ➜ Classification
- Integrates: Learning rate scheduling, early stopping, t-SNE
- Outputs: Visual embeddings + metrics
- Computes average and subject-wise accuracy
- Saves logs to file
GATConv→GCNConvx3 (with residuals)Pooling: TopK/SAG/Mean2x Projection Layers→ Final Classification- Visual embedding via t-SNE
- PLV-based graph construction outperforms raw signal-based models
- TopK/SAG pooling shows better performance for complex emotional states
- Graph embeddings improve classification and reveal meaningful cluster patterns
- Brain connectivity graphs (PLV)
- Confusion matrices
- t-SNE embeddings
- Training loss/accuracy curves
python preprocessing.py --subject s01 --deap_dataset_path <path> --datafiles_path <path>python spectral_gnn.py --subject s01 --datafiles_path <path> --label_type valencepython showcase_pool.py --subject s01 --datafiles_path <path>python graph_embeddings.py --subject s01 --datafiles_path <path> --label_type arousalpython accurate.pyA detailed report (report.pdf) is included outlining:
- Literature background
- Methodology
- Results
- Conclusions
- Replace PSD with Fractal Dimensions in preprocessing
- Include more frequency-specific channel weightings
- Explore multimodal emotion classification
Create a requirements.txt with:
numpy
pandas
matplotlib
scipy
scikit-learn
torch
torchvision
torchaudio
torch-geometric
networkx
seaborn
mne
tqdm
Install them with:
pip install -r requirements.txt- Initialize Git:
git init- Add all files:
git add .- Commit:
git commit -m "Initial commit with EEG-GNN pipeline"- Connect to GitHub:
git remote add origin https://github.com/Pushya04/eeg-gnn-emotion-recognition.git- Push:
git branch -M main
git push -u origin mainThis project is licensed under the MIT License. See the LICENSE file for details.
If you use this work, please cite:
@misc{pushya2025eeggnn,
author = {Pushya Mithra},
title = {EEG Emotion Recognition using Spectral Graph Neural Networks},
year = 2025,
howpublished = {\url{https://github.com/Pushya04/eeg-gnn-emotion-recognition}}
}