This research focuses on analyzing brainwave activity in children with Autism Spectrum Disorder (ASD) during cognitive tasks. We built a complete pipeline from preprocessing EEG data to training machine learning and neural network models that classifies whether a child is ASD or typically developing (TD).
EEG_Research_Project/
βββ scripts/ # Preprocessing utilities
βββ ml_models/ # Traditional ML models (SVM, KNN, RF, Ensemble)
βββ nn_models/ # Neural network models
βββ preprocessing/ # EEG data cleaning and PSD computation
βββ docs/ # Final research paper with embedded figures and tables
βββ README.md # Project overview
βββ requirements.txt # Environment setup
βββ LICENSE
βββ .gitignore
This study explores how EEG signals can be used to detect ASD in children, especially during academic tasks like Block Matching, Block Sorting, and Number Matching. We extracted frequency based features using the Welch method, trained multiple models, and compared their performance.
- EEG data was collected from children aged 4β15 using the MUSE headband.
- Electrodes used: AF7, AF8, TP9, TP10
- Sample rate: 256 Hz
- Tasks performed:
- Block Matching (BM)
- Block Sorting (BS)
- Number Matching (NM)
- Import CSV EEG Data with
RAW
columns - Clean Missing Values using forward/backward fill and mean
- Convert to MNE Format at 256 Hz
- Apply ICA to remove noise and muscle artifacts
- Compute Band Power (Delta, Theta, Alpha, Beta, Gamma) via Welchβs method
- Save Clean Features to CSV for modeling
- TimeβFrequency Analysis (TFA) β Generated visual spectrograms from raw EEG to explore task-specific changes in power across time and frequency bands. These plots helped interpret brainwave dynamics but were not used directly as ML inputs.
We trained and tuned the following classifiers:
- Support Vector Machine (SVM)
- K-Nearest Neighbors (KNN)
- Random Forest (RF)
- Soft Voting Ensemble (SVM + KNN + RF)
- We used permutation importance across all models to find key EEG features.
- Plotted:
- Top 2 most influential features
- Least impactful features
- Accuracy
- Precision
- Recall
- F1-Score
Two NN models were developed using TensorFlow/Keras:
- Model 1 β Classifies ASD vs TD using EEG data from specific tasks
- Model 2 β Classifies ASD vs TD using EEG data regardless of the task (task-agnostic)
Each model is structured using fully connected layers with training curves and performance summaries.
ml_models/
βββ 01_asd_vs_td_classification.ipynb β ML Model 1
βββ 01_asd_vs_td_classification.py
βββ 02_asd_vs_td_task_agnostic_model.ipynb β ML Model 2
βββ 02_asd_vs_td_task_agnostic_model.py
nn_models/
βββ 01_asd_vs_td_classification.ipynb β NN Model 1
βββ 01_asd_vs_td_classification.py
βββ 02_asd_vs_td_task_agnostic_model.ipynb β NN Model 2
βββ 02_asd_vs_td_task_agnostic_model.py
pip install -r requirements.txt
- Frontal brain regions (AF7, AF8) were highly important in differentiating ASD vs TD.
- Traditional ML models (especially ensemble) achieved ~92% accuracy.
- Neural networks showed consistent performance across tasks (~83%).