{"id":22363890,"url":"https://github.com/amrzhd/eeg-mscnn","last_synced_at":"2025-10-19T04:29:51.087Z","repository":{"id":253003026,"uuid":"842157710","full_name":"amrzhd/EEG-MSCNN","owner":"amrzhd","description":"This project explores the impact of Multi-Scale CNNs on the classification of EEG signals in Brain-Computer Interface (BCI) systems. By comparing the performance of two models, EEGNet and MSTANN, the study demonstrates how richer temporal feature extractions can enhance CNN models in classifying EEG signals","archived":false,"fork":false,"pushed_at":"2024-08-14T11:55:16.000Z","size":61,"stargazers_count":74,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-08T07:23:48.098Z","etag":null,"topics":["bci","bci-systems","deep-learning","eeg-signals","eegnet","machine-learning","multi-scale-features","signal-processing"],"latest_commit_sha":null,"homepage":"https://medium.com/@amrzhd/enhancing-eeg-based-bci-classification-with-multi-scale-cnns-a-comparative-analysis-a0712417132b","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amrzhd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-13T19:38:49.000Z","updated_at":"2025-01-17T19:45:24.000Z","dependencies_parsed_at":"2025-01-16T14:18:06.437Z","dependency_job_id":"bc2651af-b4a0-4158-b083-b1dc8bd873f4","html_url":"https://github.com/amrzhd/EEG-MSCNN","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"ec457e9a9561052452f536875ce12f42df637ba4"},"previous_names":["amrzhd/eeg-mscnn"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrzhd%2FEEG-MSCNN","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrzhd%2FEEG-MSCNN/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrzhd%2FEEG-MSCNN/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amrzhd%2FEEG-MSCNN/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amrzhd","download_url":"https://codeload.github.com/amrzhd/EEG-MSCNN/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239433901,"owners_count":19637806,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bci","bci-systems","deep-learning","eeg-signals","eegnet","machine-learning","multi-scale-features","signal-processing"],"created_at":"2024-12-04T17:17:34.603Z","updated_at":"2025-10-19T04:29:50.998Z","avatar_url":"https://github.com/amrzhd.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Enhancing EEG-based BCI Classification with Multi-Scale CNNs: A Comparative Analysis\n\n## Overview\nThis project explores the impact of Multi-Scale Convolutional Neural Networks (CNNs) on the classification of EEG signals in Brain-Computer Interface (BCI) systems. By comparing the performance of two models, EEGNet and MSTANN, the study demonstrates how richer temporal feature extractions can enhance CNN models' accuracy in classifying EEG signals.\n\n## Models\n### EEGNet\nEEGNet is a specialized CNN model designed for EEG signal classification. It consists of a temporal convolutional layer followed by depthwise and separable convolutions that handle spatial filtering. The final fully connected layer integrates the features for classification. The architecture is optimized for efficiency, making it suitable for real-time BCI applications.\n\n![EEGNet Architecture](https://drive.google.com/uc?export=view\u0026id=1mWfOeVIOi5nSba6tOWRaVlQioJ6cmGvC)\n\n### MSTANN\nThe Multi-Scale Temporal Attention Neural Network (MSTANN) is an advanced model that enhances EEGNet by incorporating multi-scale temporal feature extraction. The model uses three 1D convolutional layers with kernel sizes of 3, 11, and 19 to capture different temporal patterns in the EEG data. These feature maps are then concatenated and further processed for classification, making MSTANN adept at capturing nuanced temporal features.\n\n![MSTANN Architecture](https://drive.google.com/uc?export=view\u0026id=15vBuAUMYisOPryKNCydT_-pqWAziJXhR)\n\n## Dataset\nThe EEG data utilized in this project is sourced from the [BCI Competition IV 2a](http://www.bbci.de/competition/iv/#dataset2a) dataset. Key characteristics of the dataset include:\n\n- **Participants**: 9\n- **Electrodes**: 22 Ag/AgCl\n- **Sampling Frequency**: 250 Hz\n- **Epoched Data**: [2, 6] seconds\n- **Frequency Range**: 0.5 - 100 Hz\n- **Band-Pass Filtered**: 4 - 40 Hz (Using IIR Filter)\n- **Classes**: Left Hand, Right Hand, Foot, Tongue\n\n### List of Events\nThe following events are annotated in the dataset:\n\n- **'1023'**: Rejected trial\n- **'1072'**: Eye movements\n- **'276'**: Idling EEG (eyes open)\n- **'277'**: Idling EEG (eyes closed)\n- **'32766'**: Start of a new run\n- **'768'**: Start of a trial\n- **'769'**: Cue onset **Left** (class 1)\n- **'770'**: Cue onset **Right** (class 2)\n- **'771'**: Cue onset **Foot** (class 3)\n- **'772'**: Cue onset **Tongue** (class 4)\n\nEvents 769, 770, 771, and 772 were selected for classification.\n\n## Training Setup\nThe models were trained using the following parameters:\n\n- **Optimizer**: Adam\n- **Batch Size**: 64\n- **Epochs**: 500\n- **Learning Rate**: 0.001\n- **Loss Function**: Cross Entropy\n\n## Conclusion\nThis project highlights the potential of multi-scale CNNs in enhancing EEG-based BCI classification. By comparing EEGNet and MSTANN, it demonstrates how richer temporal feature extraction can improve model performance in EEG signal classification.\n\n## References\nIf you use this code or the models in your work, please cite the original papers of the orignal models:\n\n- [Lawhern, V. J., Solon, A. J., Waytowich, N. R., Gordon, S. M., Hung, C. P., \u0026 Lance, B. J. (2018). EEGNet: a compact convolutional neural network for EEG-based brain–computer interfaces. Journal of neural engineering, 15(5), 056013.](https://iopscience.iop.org/article/10.1088/1741-2552/aace8c)\n\n- [Wu, R., Jin, J., Daly, I., Wang, X., \u0026 Cichocki, A. (2023). Classification of motor imagery based on multi-scale feature extraction and the channeltemporal attention module. IEEE Transactions on Neural Systems and Rehabilitation Engineering.](https://ieeexplore.ieee.org/iel7/7333/4359219/10180110.pdf)\n\nIf you used the dataset in your work, please cite the original paper of it:\n\n[Brunner, C., Leeb, R., Müller-Putz, G., Schlögl, A., \u0026 Pfurtscheller, G. (2008). BCI Competition 2008–Graz data set A. Institute for knowledge discovery (laboratory of brain-computer interfaces), Graz University of Technology, 16, 1-6.](https://lampz.tugraz.at/~bci/database/001-2014/description.pdf)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrzhd%2Feeg-mscnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famrzhd%2Feeg-mscnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famrzhd%2Feeg-mscnn/lists"}