Skip to content

rozin-not-found/DepreSense

Repository files navigation

DepreSense: AI-Powered EEG Depression Detection Platform

DepreSense is a full-stack, clinical-grade artificial intelligence platform designed to detect Major Depressive Disorder (MDD) from electroencephalogram (EEG) signals. By leveraging deep learning and explainable AI (XAI), the platform enables clinicians to upload EEG recordings and receive interpretable, data-driven depression predictions through a secure and interactive web dashboard.


Key Features

  • AI-Driven EEG Analysis: Detects depressive markers using spatial and temporal brainwave patterns extracted from standard .edf EEG recordings.
  • CNN-Souping Architecture: Utilizes an ensemble Convolutional Neural Network (CNN) architecture, improving robustness, generalization, and prediction stability across varying patient data.
  • Explainable AI (SHAP): Integrates SHAP (SHapley Additive exPlanations) to visualize channel-level feature importance, enabling transparent and interpretable clinical insights.
  • Full-Stack Clinical Dashboard: A secure web application allowing clinicians to upload EEG data, analyze results instantly, and manage patient records.
  • Cloud-Native Infrastructure: Engineered for scalability using a serverless deployment model via Google Cloud Run and Firebase.
  • Secure Authentication: Implements Firebase authentication with OTP email verification and strict role-based access control (RBAC).

System Architecture

The system follows a modern decoupled architecture, ensuring scalability and maintainability.

  • Frontend: React 18, TypeScript, Vite, TailwindCSS
  • Backend: FastAPI, Python 3.11, Pydantic, Uvicorn
  • Machine Learning: TensorFlow, PyTorch, MNE-Python, SciPy, SHAP
  • Infrastructure: Firebase Auth, Firestore, Google Cloud Run, Docker

Machine Learning Pipeline

  1. Signal Preprocessing:
    • Bandpass Filtering (0.5–45Hz)
    • Notch Filtering (50Hz) to remove powerline noise
    • Segmentation into temporal epochs
  2. Feature Extraction: Spectrogram generation using Short-Time Fourier Transform (STFT) and Continuous Wavelet Transform (CWT).
  3. Inference: Processing through the CNN-Souping Deep Learning Model.
  4. Explainability: SHAP GradientExplainer evaluates the directional influence and importance of standard 10-20 system EEG channels (e.g., Fp1, Fp2, F7, F8, Fz, Cz, Pz).

Average inference time: ~5.7 seconds per EEG recording.


How to Run Locally

Prerequisites

  • Python 3.11.x
  • Node.js (v18+)

1. Start the Backend API

Navigate to the backend directory, initialize the environment, and start the server:

cd backend
python -m venv .venv
# On Windows use: .\.venv\Scripts\activate
# On macOS/Linux use: source .venv/bin/activate
pip install -r requirements.txt
python -m uvicorn app.main:app --host 127.0.0.1 --port 8000 --reload

2. Start the Frontend Application

In a separate terminal instance, navigate to the frontend directory and start the Vite development server:

cd frontend/mindsense-dashboard-main
npm install
npm run dev

3. Access the Platform

  • Clinical Dashboard: http://localhost:8080 (or port specified by Vite)
  • Backend REST API Documentation: http://localhost:8000/docs

Disclaimer

DepreSense is a research and educational project. It is not intended to replace professional clinical diagnosis, psychiatric evaluation, or medical advice.

Developed as a Final Year Project at Taylor’s University — School of Computer Science.

About

A full-stack, clinical-grade AI platform that detects Major Depressive Disorder (MDD) from EEG signals using deep learning and explainable AI.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors