This project detects epilepsy from EEG recordings by converting signals into time–frequency scalograms, enhancing them with Sobel filtering, and classifying them using a VGG16-based deep learning model. A Streamlit web app allows users to upload a scalogram image and receive an instant prediction: “Epilepsy Detected” or “No Epilepsy Detected”.
The full pipeline consists of:
-
EEG signal preprocessing
- 19-channel EEG recordings from epilepsy and non-epilepsy subjects
- Segmentation into 1-minute windows
- Normalization (mean–std scaling per segment)
-
Time–frequency representation
- Short-Time Fourier Transform (STFT) to generate scalograms from each EEG segment
-
Feature enhancement
- Sobel filters applied to the scalograms to emphasize edges and sharp transitions relevant to epileptic activity
-
Deep learning model
- VGG16 (pretrained on ImageNet) used as a feature extractor
- Custom fully-connected layers for binary classification: epileptic vs non-epileptic
- Trained with Adam optimizer and binary cross-entropy
- Achieves ~83% validation accuracy on the scalogram dataset
-
Web deployment
- A Streamlit app (
app.py) loads a saved model (model.h5) - User uploads an EEG scalogram image (PNG/JPG)
- The app outputs a clear prediction:
Epilepsy DetectedNo Epilepsy Detected
- A Streamlit app (
project-root/
│
├── app.py # Streamlit app for epilepsy detection
├── model.h5 # Trained VGG16-based model (not included in repo)
├── logo.png # Optional logo for the app header
├── Signal_Processing.ipynb # EEG preprocessing & STFT scalogram generation
├── VGG16+ANN.ipynb # Model training notebook
├── requirements.txt
└── README.md
"# EEG-Epilepsy-Detection"
"# EEG-Epilepsy-Detection"
"# EEG-Epilepsy-Detection"
"# EEG-Epilepsy-Detection"
"# EEG-Epilepsy-Detection"