RepositoryJupyter NotebookUSUnited States
krishk97

krishk97/ECE-C247-EEG-GAN

GAN and VAE implementations to generate artificial EEG data to improve motor imagery classification. Data based on BCI Competition IV, datasets 2a. Final project for UCLA's EE C247: Neural Networks and Deep Learning course.

168stars
44forks
2issues
0views

🧠 Sinh dữ liệu EEG giả lập bằng GAN & VAE để cải thiện phân loại motor imagery

Dự án môn học UCLA EE C247 triển khai 3 kiến trúc GAN và VAE trên dữ liệu EEG 22 kênh, 9 đối tượng, 4 nhiệm vụ motor imagery từ BCI Competition IV 2a.

Dự án này là bài tập cuối kỳ của môn EE C247: Neural Networks and Deep Learning tại UCLA. Mục tiêu chính: xây dựng dữ liệu EEG nhân tạo bằng Generative Adversarial Networks (GAN) và Variational Autoencoders (VAE), sau đó đánh giá tác động của dữ liệu sinh ra đến độ chính xác phân loại motor imagery (tưởng tượng chuyển động). Dữ liệu gốc lấy từ BCI Competition IV, Data sets 2a — 22 kênh EEG, 9 người tham gia, 4 lớp motor imagery (tay trái, tay phải, chân, lưỡi). Toàn bộ code viết bằng Python 3.6 + TensorFlow 2.x, huấn luyện trên Google Colab TPU.

✨ Điểm nổi bật

  • 3 kiến trúc GAN: DCGAN, Wasserstein GAN (WGAN), WGAN với Gradient Penalty (WGAN-GP) — cùng generator/discriminator nhưng khác hàm loss và kỹ thuật ổn định hóa.
  • VAE để học phân bố tiềm ẩn của tín hiệu EEG thô, kỳ vọng nắm bắt đặc trưng hữu ích.
  • Tiền xử lý đa dạng: sub-sampling (250 Hz → tần số não bộ 0-15 Hz), random/sequential cropping (cửa sổ 4s sau cue, thời gian phản ứng ~250ms), Continuous Wavelet Transform (CWT) trích xuất đặc trưng thời gian-tần số.
  • 2 kiến trúc CNN phân loại: Shallow CNN (Schirrmeister et al.) cho EEG thời gian thực, CNN truyền thống cho dữ liệu CWT (chỉ 5 kênh Fz, C3, Cz, C4, Pz).
  • So sánh augmentation truyền thống: sequential cropping cho accuracy cao nhất, sub-sampling và random cropping làm giảm accuracy so với baseline.
  • Đánh giá cross-subject: Shallow CNN trên sequential cropping generalize tốt ở subject 0, 1, 6, 7.
  • Pipeline hoàn chỉnh: từ tiền xử lý → huấn luyện generative models → sinh dữ liệu → augment vào tập huấn luyện → đánh giá phân loại.

💡 Vì sao đáng chú ý

Dự án minh họa rõ ràng quy trình kết hợp generative models với BCI — một bài toán thực tế nơi dữ liệu EEG thường ít, nhiễu, và tốn kháng thu thập. Việc thử nghiệm song song 3 biến thể GAN + VAE trên cùng một bộ dữ liệu và pipeline cho thấy sự đánh đổi: GAN (đặc biệt WGAN-GP) tái tạo tốt đặc trưng cục bộ, VAE học tốt phân bố toàn cục nhưng sinh mẫu kém thực tế hơn. Kết quả augmentation truyền thống (sequential cropping) đã vượt baseline là insight giá trị: đôi khi kỹ thuật đơn giản hiểu bản chất dữ liệu (cửa sổ phản ứng người) hiệu quả hơn generative models phức tạp. Code mở, notebook Colab-ready, phù hợp làm reference cho nghiên cứu EEG synthesis, data augmentation cho BCI, hoặc so sánh GAN/VAE trên tín hiệu sinh học chuỗi thời gian.


#EEG #GAN #WGAN-GP #VAE #BCI #MotorImagery #TensorFlow2 #OpenSource #TiniX

Similar Projects

Discover other similar projects and AI models.

RepositoryJupyter Notebook
amanchadha/coursera-gan-specialization

Programming assignments and quizzes from all courses within the GANs specialization offered by deeplearning.ai

482
Jul 1, 2021
RepositoryC++
koba-jon/pytorch_cpp

Deep Learning sample programs using PyTorch in C++

313
Jan 22, 2026
RepositoryPython
LixiangHan/GANs-for-1D-Signal

implementation of several GANs with pytorch

175
Apr 28, 2022
RepositoryPython
lilianweng/unified-gan-tensorflow

A Tensorflow implementation of GAN, WGAN and WGAN with gradient penalty.

125
Aug 27, 2018
RepositoryPython
sanghoon/tf-exercise-gan

Tensorflow implementation of different GANs and their comparisions

112
Feb 28, 2026
RepositoryJupyter Notebook
AI4Finance-Foundation/FinRL

FinRL®: Financial Reinforcement Learning. 🔥

16.8k
Oct 25, 2026
RepositoryJupyter Notebook
mozilla/TTS

:robot: :speech_balloon: Deep learning for Text to Speech (Discussion forum: https://discourse.mozilla.org/c/tts)

10.2k
Nov 9, 2023
RepositoryJupyter Notebook
kzbkzb/Python-AI

深度学习100例、深度学习DL、图片分类、目标识别、目标检测、自然语言处理nlp、文本分类、TensorFlow、PyTorch

3.2k
Sep 22, 2025
RepositoryJupyter Notebook
Data-Centric-AI-Community/fg-data-synthetic

Synthetic data generators for tabular and time-series data

1.7k
Sep 3, 2026