Skip to content

Kalana-S/Depression-Prediction-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Depression Prediction App (Flutter)

Depression Prediction App is a cross-platform Flutter application that estimates an individual's depression risk score using an offline Machine Learning model.
The app collects lifestyle, academic, and psychological inputs and performs on-device inference using TensorFlow Lite, ensuring privacy, speed, and zero internet dependency.

⚠️ Disclaimer: This application provides a learning-based risk estimate and is not a medical diagnosis
If you have concerns about mental health, please consult a qualified professional.


πŸš€ Key Features

πŸ“ User Input Form

  • Clean and structured UI for collecting:
    • Personal details
    • Academic & work pressure
    • Lifestyle habits
    • Mental health indicators
  • Slider-based and dropdown-based inputs for usability

πŸ€– Offline AI Prediction

  • Fully on-device inference
  • No API calls, no cloud processing
  • Instant risk score output
  • Model runs entirely offline

πŸ“Š Risk Estimation

  • Outputs a probability score (0–100%)
  • Visual risk classification:
    • 🟒 Low Risk
    • 🟠 Moderate Risk
    • πŸ”΄ High Risk
  • Clear disclaimer shown with every prediction

πŸ—‚οΈ Prediction History

  • Stores past predictions locally
  • Users can review:
    • Risk score
    • Risk level
    • Timestamp
  • Data stored using a local database (SQLite)

πŸ“ˆ Progress Tracking

  • Dedicated Progress Chart screen
  • Visualizes depression risk trends over time
  • Helps users observe changes and patterns

πŸŒ— Dark & Light Theme

  • Supports both Dark Mode and Light Mode
  • Theme toggle available directly from the AppBar
  • Theme changes applied instantly

πŸ” Privacy-First Design

  • Works fully offline
  • No data transmission
  • No account or login required
  • All predictions and history remain on the device

πŸ€– Machine Learning: Depression Risk Model

Model Overview

  • Logistic Regression (Calibrated)
  • Outputs a well-calibrated probability score

ML Stack

  • scikit-learn – training & evaluation
  • Isotonic Calibration – probability reliability
  • TensorFlow / TensorFlow Lite – mobile inference

Training Details

  • Feature scaling using StandardScaler
  • Model evaluated using ROC-AUC
  • Final model exported to TensorFlow Lite
  • Scaler parameters (mean, scale) exported separately

πŸ“‚ Dataset

  • Mental health survey dataset
  • ~27,000+ records
  • Mixed numerical & categorical features

🧩 Final Feature Set (Model Input Order)

⚠️ Feature order is critical and strictly preserved between training and Flutter inference.

1. Gender
2. Age
3. Academic Pressure
4. CGPA
5. Study Satisfaction
6. Sleep Duration
7. Dietary Habits
8. Suicidal Thoughts
9. Work / Study Hours
10. Financial Stress
11. Family History of Mental Illness

πŸ“± Flutter + ML Architecture

User Input (Flutter UI)
   ↓
Ordered Feature Vector (11 values)
   ↓
StandardScaler (mean & scale)
   ↓
TensorFlow Lite Logistic Regression
   ↓
Sigmoid Probability Output
   ↓
Risk Level Classification
   ↓
Local Database Storage

πŸ› οΈ Technologies Used

πŸ“± App Development

  • Flutter (Dart)

πŸ€– Machine Learning

  • scikit-learn
  • TensorFlow Lite
  • TensorFlow

πŸ—„οΈ Local Storage

  • SQLite (via Flutter DB helper)

πŸ“¦ Flutter Packages

  • tflite_flutter
  • sqflite
  • path_provider

🧰 Tools

  • Android Studio
  • VS Code
  • Google Colab
  • Flutter SDK

πŸ“¦ Installation & Setup

  1. Clone this repository:
    git clone https://github.com/Kalana-S/Depression-Prediction-App.git
    cd Depression-Prediction-App
    
  2. Get all dependencies:
    flutter pub get
    
  3. Run the app:
    flutter run
    
  4. (Optional) Build a release APK:
    flutter build apk --release
    

πŸŽ₯ App Demo (Screen Recording)

Full app workflow β€” UI β†’ Input β†’ Offline Prediction β†’ History β†’ Progress Chart

Screen_Record.webm

πŸ’‘ Usage

  1. Open the app.
  2. Enter personal, academic, and lifestyle details.
  3. Tap Estimate Risk.
  4. View:
    • Risk percentage
    • Risk level (Low / Moderate / High)
  5. Check:
    • History for past predictions
    • Progress Chart for trends over time
  6. All predictions run offline.

πŸ” Ethics & Disclaimer

  • This app is for educational and research purposes only
  • Not intended for clinical diagnosis
  • Encourages awareness, not medical decision-making

🀝 Contribution

Contributions are welcome!
If you have improvements or ideas, feel free to fork the repository and submit a pull request.


πŸ“œ License

This project is open-source and available under the MIT License.


πŸ’‘ Built with Flutter, powered by offline AI using TensorFlow Lite.

About

A lightweight Flutter app featuring an offline machine learning model designed to predict whether the user may have 'Depression.' This application is intended solely for educational and self-reflection purposes. It is not a substitute for medical advice or diagnosis.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors