Skip to content

Commit afaa9ce

Browse files
upload a page for my project: brainhack_EEG_depression_ml_dl/index.md (#389)
* upload a page for my project * Add cover image and update of index.md * Update content/en/project/brainhack_EEG_depression_ml_dl/index.md * Update content/en/project/brainhack_EEG_depression_ml_dl/index.md * Update content/en/project/brainhack_EEG_depression_ml_dl/index.md --------- Co-authored-by: Lune Bellec <lune.bellec@umontreal.ca>
1 parent 123e779 commit afaa9ce

2 files changed

Lines changed: 118 additions & 0 deletions

File tree

424 KB
Loading
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
type: "project" # DON'T TOUCH THIS ! :)
3+
4+
date: "2025-06-15"
5+
6+
title: "Decoding Depression via EEG Biomarkers: A Neurocomputational Approach using Machine and Deep Learning"
7+
8+
names: [Wei-Xuan Chai]
9+
10+
github_repo: https://github.com/ChaiWeiXuan/brainhack-EEG-depression-ml-dl
11+
12+
website:
13+
14+
tags: [EEG, depression, svm, eegnet]
15+
16+
summary: "This project was conducted as part of Brainhack School 2025. It aimed to classify major depressive disorder (MDD) using temporal-domain EEG features (i.e., band power), applying both machine learning (SVM) and deep learning (EEGNet) models."
17+
18+
image: "cover img.png"
19+
20+
---
21+
22+
## Project definition
23+
24+
### Background
25+
26+
This project was inspired by a clinical case from Shanghai Ruijin Hospital, where Brain-Computer Interface (BCI) technology was applied to treat severe depression. That real case made me wonder about the potential of neural decoding in understanding and supporting mental health.
27+
28+
As someone interested in both neuroscience and BCI, I believe it is essential to master machine learning and deep learning techniques—especially when working with high-dimensional signals like EEG or other neuroimaging data. This project is my personal attempt to explore how machine learning (SVM) and deep learning (EEGNet) models perform in classifying major depressive disorder (MDD) based on EEG band power features.
29+
30+
31+
### Tools
32+
33+
The project will rely on the following technologies:
34+
35+
1. Programming & Environment
36+
- Python
37+
- Jupyter Notebook: Used for data preprocessing and training the SVM machine learning model.
38+
- Google Colab: Used for training the EEGNet deep learning model.
39+
40+
2. Libraries & Frameworks
41+
- scikit-learn, gridsearchCV: For machine learning models.
42+
- MNE: For EEG data processing and visualization.
43+
- numpy, pandas, matplotlib: For data manipulation and plotting.
44+
- tensorflow, keras: For deep learning models.
45+
46+
3. External Models / Resources
47+
- Brainhack School Modules: Working with MNE-Python and EEG-BIDS [page](https://school-brainhack.github.io/modules/mne_python/)
48+
- Brainhack School Modules: Machine learning for neuroimaging [page](https://school-brainhack.github.io/modules/machine_learning_neuroimaging/)
49+
- EEGNet implementation from ARL (Army Research Laboratory) EEGModels Project [page](https://github.com/vlawhern/arl-eegmodels)
50+
51+
52+
### Data
53+
This project uses the MDD Patients and Healthy Controls EEG Data (New), downloaded from [page](https://figshare.com/articles/dataset/EEG_Data_New/4244171/2).
54+
- The dataset includes 30 Healthy Controls (H) and 34 Major Depressive Disorder (MDD) participants.
55+
- Each participant completed three conditions:
56+
- Eyes Closed (EC)
57+
- Eyes Open (EO)
58+
- P300 Task (TASK)
59+
60+
For this analysis, we used:
61+
- Only the 5-minute EC EEG data
62+
- Successfully downloaded: 28 H and 30 MDD subjects
63+
64+
65+
### Deliverables
66+
67+
At the end of this project, we will have:
68+
1. Preprocessing & Bandpower Feature.ipynb
69+
2. Machine Learning_SVM.ipynb
70+
3. Deep Learning_EEGNet.ipynb
71+
These deliverables reflect the full pipeline from raw EEG preprocessing to both traditional ML and DL models training.
72+
73+
74+
## Results
75+
76+
### Progress overview
77+
78+
This project started with the goal of integrating what I’ve previously learned—EEG preprocessing, machine learning, and deep learning—into a single end-to-end pipeline. While I had prior experience working with EEG data and individual modeling techniques, I had never tried building an entire classification workflow on my own, from data preparation to model comparison.
79+
80+
I began by preprocessing the EEG data using MNE-Python and extracting temporal-domain features (band power). Then I implemented an SVM classifier, followed by a deep learning model based on EEGNet. Although the EEGNet part was more challenging due to model tuning and GPU limitations, I still managed to get a working prototype on Google Colab.
81+
82+
Beyond modeling, I also learned how to structure a project repository, push updates to GitHub, and write clear documentation—sometimes after a few frustrating errors (and moments of panic). But overall, it was a fun and fulfilling learning experience, and a solid first attempt at decoding mental health signals using both machine learning and deep learning techniques.
83+
84+
85+
### Tools I learned during this project
86+
87+
- Learned to preprocess EEG signals and extract bandpower features using MNE.
88+
- Applied classical machine learning models (SVM) with scikit-learn and gridsearchCV.
89+
- Implemented and trained a deep learning EEG model (EEGNet) with TensorFlow and Keras.
90+
- Developing, testing, and executing the entire analysis pipeline using Jupyter Notebooks and Google Colab as interactive environments
91+
92+
93+
### Results
94+
95+
Preliminary results suggested that SVM achieved higher accuracy (> 0.95) compared to EEGNet (~0.8), possibly due to limited hyperparameter tuning and model optimization in this early-stage exploration. While deep learning provides promising end-to-end modeling capabilities, classical approaches like SVM may still offer superior performance when the dataset is small and features are carefully extracted.
96+
97+
98+
#### Deliverable 1: Preprocessing & Bandpower Feature
99+
100+
An EEG preprocessing pipeline was implemented using MNE-Python, followed by the extraction of frequency-domain features (band power) for classification purposes.
101+
102+
103+
#### Deliverable 2: Machine Learning_SVM
104+
105+
A Support Vector Machine (SVM) model was trained and evaluated based on the extracted band power features. Grid search with 10-fold cross-validation was used to tune key hyperparameters (e.g., C, gamma). Several trials were conducted, including the integration of feature selection and dimensionality reduction using PCA. However, these modifications did not improve the accuracy, suggesting that the original band power features already effectively captured discriminative patterns related to depression in the EEG data, or that such techniques may not be beneficial in this particular case.
106+
107+
108+
#### Deliverable 3: Deep Learning_EEGNet
109+
110+
An EEGNet model [page](https://github.com/vlawhern/arl-eegmodels) was trained and evaluated using preprocessed EEG epoch data, without extracting band power features. The model was implemented on Google Colab with GPU support. Hyperparameter tuning was conducted using both Keras Tuner and manual for-loop implementations, each within a 10-fold cross-validation framework. Due to time constraints, only minimal tuning was performed, which may explain the lower performance (~80% accuracy). Nevertheless, this pipeline demonstrates how CNN-based architectures can be applied end-to-end to EEG data.
111+
112+
113+
114+
## Conclusion and acknowledgement
115+
116+
This project was my first attempt at an EEG decoding pipeline, from preprocessing, feature extraction, to model training with SVM and EEGNet. Though basic, it revealed skill gaps in computational neuroscience and BCI, guiding my future learning.
117+
118+
I appreciate the supportive learning environment and resources from Brainhack School 2025, including video tutorials and coding notebooks. Special thanks to the researchers who shared the MDD EEG dataset on Figshare and the EEGNet developers for their open-source contribution. This project reflects the power of open science and community collaboration.

0 commit comments

Comments
 (0)