Skip to content

wasimgi/EEG-Epilepsy-Detection

Repository files navigation

EEG Epilepsy Detection with Streamlit

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”.


🧠 Overview

The full pipeline consists of:

  1. EEG signal preprocessing

    • 19-channel EEG recordings from epilepsy and non-epilepsy subjects
    • Segmentation into 1-minute windows
    • Normalization (mean–std scaling per segment)
  2. Time–frequency representation

    • Short-Time Fourier Transform (STFT) to generate scalograms from each EEG segment
  3. Feature enhancement

    • Sobel filters applied to the scalograms to emphasize edges and sharp transitions relevant to epileptic activity
  4. 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
  5. 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 Detected
      • No Epilepsy Detected

📂 Project Structure (example)

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" 

About

Epilepsy detection from EEG using STFT-based scalograms, Sobel filtering, and a VGG16 deep learning model. Includes a Streamlit web app where users upload an EEG scalogram image and get an instant prediction: “Epilepsy Detected” or “No Epilepsy Detected”

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors