{"id":22479548,"url":"https://github.com/arkanivasarkar/eeg-data-augmentation-using-variational-autoencoder","last_synced_at":"2025-10-05T03:09:21.715Z","repository":{"id":40494634,"uuid":"417104301","full_name":"arkanivasarkar/EEG-Data-Augmentation-using-Variational-Autoencoder","owner":"arkanivasarkar","description":"Improving performance of motor imagery classification using variational-autoencoder and synthetic EEG signals","archived":false,"fork":false,"pushed_at":"2024-11-25T00:09:00.000Z","size":30,"stargazers_count":38,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-25T01:18:25.778Z","etag":null,"topics":["data-augmentation","eeg-signals","eegnet","keras","keras-tensorflow","motor-imagery-classification","synthetic-dataset-generation","variational-autoencoder"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arkanivasarkar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-14T11:31:33.000Z","updated_at":"2024-11-25T00:09:04.000Z","dependencies_parsed_at":"2022-09-20T03:52:01.495Z","dependency_job_id":null,"html_url":"https://github.com/arkanivasarkar/EEG-Data-Augmentation-using-Variational-Autoencoder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkanivasarkar%2FEEG-Data-Augmentation-using-Variational-Autoencoder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkanivasarkar%2FEEG-Data-Augmentation-using-Variational-Autoencoder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkanivasarkar%2FEEG-Data-Augmentation-using-Variational-Autoencoder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arkanivasarkar%2FEEG-Data-Augmentation-using-Variational-Autoencoder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arkanivasarkar","download_url":"https://codeload.github.com/arkanivasarkar/EEG-Data-Augmentation-using-Variational-Autoencoder/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228483592,"owners_count":17927363,"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":["data-augmentation","eeg-signals","eegnet","keras","keras-tensorflow","motor-imagery-classification","synthetic-dataset-generation","variational-autoencoder"],"created_at":"2024-12-06T15:15:38.932Z","updated_at":"2025-10-05T03:09:16.678Z","avatar_url":"https://github.com/arkanivasarkar.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EEG Data Augmentation using Variational Autoencoder \n\nThis repository contains the implementation of a variational autoencoder (VAE) for generating synthetic EEG signals, and investigating how the generated signals can affect the performance of motor imagery classification. \n\nIt is referred by the literature - Ahuja, C., \u0026 Sethia, D. (2024). Harnessing Few-Shot Learning for EEG signal classification: a survey of state-of-the-art techniques and future directions. Frontiers in human neuroscience, 18, 1421922. https://doi.org/10.3389/fnhum.2024.1421922\n\u003c/br\u003e\n\n## Dataset\nThe dataset is obtained from [BCI Competition IV - Data sets 2a](http://www.bbci.de/competition/iv/#datasets). It consists of 22 channels EEG data of 9 subjects with 4 different classes of motor-imagery tasks. The signals are of 0.5-100 Hz, with a sampling rate 250Hz, and are filtered with a notch filter.\n\u003c/br\u003e\n\n## Methods\nThe EEG signals acquired from the dataset were augmented using a variational autoencoder (VAE). It was seen that a 2D CNN based VAE performs better than a 1D CNN based VAE for this case. The augmented EEG signals were saved and later used for training the classifier.\n\nThe [EEGNet](https://www.researchgate.net/publication/310953136_EEGNet_A_Compact_Convolutional_Network_for_EEG-based_Brain-Computer_Interfaces) architecture was used for performing motor imagery classification. Two EEGNet models were trained, one with the actual EEG signals from the dataset and one with the generated signals, and their classification performances were tested using a test dataset from the same origin.\n\nAll models were trained using NVIDIA MX-150 GPU. \n\u003c/br\u003e\n\n## Results\nThe classification performances using original as well as augmented signals are shown below.\n\n- Performance when trained with actual signals:\n\n|              | **Precision** | **recall** | **f1-score** |\n|:------------:|:-------------:|:----------:|:------------:|\n| 0            | 0.81          | 0.74       | 0.78         |\n| 1            | 0.70          | 0.81       | 0.75         |\n| 2            | 0.64          | 0.68       | 0.66         |\n| 3            | 0.80          | 0.68       | 0.74         |\n\n**Accuracy :** 0.73\n\u003c/br\u003e\n\u003c/br\u003e\n- Performance when trained with generated signals:\n\n|              | **Precision** | **recall** | **f1-score** |\n|:------------:|:-------------:|:----------:|:------------:|\n| 0            | 1.00          | 0.52       | 0.69         |\n| 1            | 0.89          | 0.92       | 0.90         |\n| 2            | 0.90          | 0.98       | 0.94         |\n| 3            | 0.82          | 1.00       | 0.90         |\n\n**Accuracy :** 0.88\n\nIt can be seen that the classifcation performance is increased when augmented EEG data is used for training the classifier.\n\u003c/br\u003e\n\n## References\n\n1. Lawhern, Vernon \u0026 Solon, Amelia \u0026 Waytowich, Nicholas \u0026 Gordon, Stephen \u0026 Hung, Chou \u0026 Lance, Brent. (2016). EEGNet: A Compact Convolutional Network for EEG-based Brain-Computer Interfaces. Journal of Neural Engineering. 15. 10.1088/1741-2552/aace8c. \n2. Aznan, Nik \u0026 Atapour Abarghouei, Amir \u0026 Bonner, Stephen \u0026 Connolly, Jason \u0026 Al Moubayed, Noura \u0026 Breckon, Toby. (2019). Simulating Brain Signals: Creating Synthetic EEG Data via Neural-Based Generative Models for Improved SSVEP Classification. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkanivasarkar%2Feeg-data-augmentation-using-variational-autoencoder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farkanivasarkar%2Feeg-data-augmentation-using-variational-autoencoder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farkanivasarkar%2Feeg-data-augmentation-using-variational-autoencoder/lists"}