Skip to content

Addzyyy/eeg-emotion-recognition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EEG Emotion Recognition with Efficient Deep Learning

Efficient emotion classification from EEG signals using a MobileNetV3-inspired architecture with spatial attention mechanisms.

Overview

Traditional EEG emotion recognition approaches rely on manual feature engineering and large deep learning models that require powerful GPUs, making them impractical for real-world deployment. This project addresses these limitations by adapting Google's MobileNetV3 architecture (originally designed for image recognition on resource-constrained devices) to work directly with EEG signals.

Key Results

Metric Accuracy Parameters vs. State-of-the-art
Arousal Classification 65.45% 640x fewer parameters (vs Topic & Russo)
Valence Classification 62.26% 640x fewer parameters (vs Topic & Russo)

The model achieves competitive accuracy while being significantly more efficient for training, with dramatically reduced parameter count and GPU memory requirements.

Channel Reduction Analysis

Baseline MobileNetV3:

Baseline Channel Results

With Spatial Attention Enhancement:

Spatial Attention Channel Results

Key Findings:

  • Using only 14 EEG channels outperformed the full 32-channel setup across both models
  • Spatial attention mechanism improved results over baseline (Arousal: 63.47% → 65.46%, Valence: 61.25% → 62.26%)
  • Best performance: 14 channels with spatial attention achieving 65.46% (Arousal) and 62.26% (Valence)

Key Innovations

  • Adapted MobileNetV3 for EEG: Modified depthwise separable convolutions for 1D EEG signal processing
  • Spatial Attention Mechanism: Improved results over baseline MobileNetV3 by focusing on relevant EEG channels
  • Channel Reduction: Demonstrated that better results can be achieved using fewer EEG channels
  • Efficiency-First Design: 640x fewer learnable parameters compared to state-of-the-art models, significantly reducing training costs

Dataset

Experiments conducted using the DEAP Dataset:

  • Subjects: 32 participants
  • Trials: 1,280 video/music trials
  • EEG Channels: 32 channels (three profiles tested: 32, 14, 10 channels)
  • Labels: Valence and Arousal ratings (1-9 scale) converted to binary via median split
  • Experimental Setup: Subject-dependent 80/20 split with 10-fold cross-validation

Model Architecture

Base: MobileNetV3-inspired 1D CNN with depthwise separable convolutions

Key Innovation: Spatial Attention enhancement combining Squeeze-and-Excitation with spatial feature maps for improved EEG channel selection

Design Goal: Resource-efficient architecture optimized for training efficiency with potential for edge deployment optimization

Classification: Binary classification for Valence (positive/negative) and Arousal (high/low)

Spatial Attention Mechanism

Spatial Attention Mechanism

The spatial attention mechanism combines channel-wise Squeeze-and-Excitation attention with spatial feature maps, allowing the model to learn which EEG channels are most relevant for emotion classification.

Network Configuration

MobileNetV3 Architecture Details

MobileNetV3-Small adapted for 1D EEG signals with depthwise separable convolutions, h-swish activations, and SE blocks.

Comparison with State-of-the-Art

State-of-the-Art Comparison

Key Highlights:

  • MobileNet (This work): 0.062M parameters with 62.26% (Valence) / 65.46% (Arousal) accuracy
  • No manual feature engineering required, unlike most state-of-the-art approaches
  • 640x fewer parameters than Topic & Russo while maintaining competitive performance
  • More efficient than EEGNet with significantly better accuracy (65.46% vs 60.78% for Arousal)
  • Achieves strong results with only 14 EEG channels vs. 32 channels used by most studies

This demonstrates that efficient architectures can achieve competitive results with dramatically reduced training requirements compared to state-of-the-art models, eliminating the need for powerful cloud GPUs during training. The model does not require manual feature engineering, though inference optimization (e.g., data compression) would be needed for real-time edge deployment.

Technologies

Python PyTorch

  • Deep Learning: PyTorch
  • Data Processing: NumPy, Pandas
  • Visualization: Matplotlib
  • Development: Jupyter Notebooks

Installation

# Clone the repository
git clone https://github.com/Addzyyy/eeg-emotion-recognition.git
cd eeg-emotion-recognition

# Install dependencies
pip install -r requirements.txt

Quick Start

# Open the main notebook
jupyter notebook EEG_Emotions.ipynb

Note: The DEAP dataset requires registration and download from the official website.

Project Structure

eeg-emotion-recognition/
    EEG_Emotions.ipynb              # Main notebook
    notebooks/                       # Additional experiments
       Gramian_Angular_Field.ipynb # GAF transformation experiments
       time_series_1Dcnn.ipynb     # 1D CNN baseline
       time_series_cnn_recurrenceplot.ipynb
    archived/                        # Archived experiments

Research Contribution

This work demonstrates that:

  1. Efficiency matters: Deep learning models for EEG can be dramatically compressed without significant accuracy loss
  2. Less is more: Reduced EEG channel sets can achieve competitive or better results
  3. Transfer learning works: Computer vision architectures (MobileNetV3) can be successfully adapted for time-series EEG data
  4. Training efficiency: The reduced parameter count significantly lowers training costs and GPU memory requirements compared to state-of-the-art approaches

Key Findings & Limitations

Observations from this work:

  • Channel reduction paradox: Using fewer EEG channels (14 vs 32) improved accuracy but had minimal impact on model complexity. The efficiency gains come primarily from the architecture choice rather than channel reduction.
  • Training vs inference efficiency: This CNN architecture reduced training complexity (fewer learnable parameters) more significantly than inference complexity (mult-adds remain high due to raw EEG data length).
  • Spatial attention design: A single average pooling layer in the SE block performed better than combining average and max pooling in this implementation.
  • Practical alternative: The model outperforms EEGNet on emotion recognition tasks while maintaining similar parameter efficiency.

Trade-offs:

  • This work prioritized training efficiency over maximizing accuracy
  • There is an accuracy gap compared to state-of-the-art models (particularly those using manual feature engineering)
  • The efficiency gains are primarily in training (reduced parameters) rather than inference (mult-adds remain high due to raw EEG data length)
  • Future work on data compression could enable true edge deployment for real-time inference

Citation

If you use this work in your research, please cite:

@thesis{fulton2022eeg,
  title={Efficient EEG Emotion Recognition using MobileNetV3 with Spatial Attention},
  author={Fulton, Adam},
  year={2022},
  school={Macquarie University}
}

License

This project is licensed under the MIT License - see the LICENSE file for details.


Thesis project exploring training-efficient deep learning architectures for EEG-based emotion recognition.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •