Skip to content

Charul04/MindTrack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🧠 MindTrack — Student Mental Health Early Warning System

An AI-powered web application that predicts student mental health risk levels using XGBoost, built with Streamlit.

Python Streamlit XGBoost License


📌 Overview

MindTrack is a machine learning web application that analyzes student behavioral and academic data to detect mental health risk levels before a crisis occurs. It classifies students into three risk categories — Low Risk, At-Risk, and High Risk — enabling counselors and institutions to intervene early.

Built for the DEV Season of Code Hackathon 2026.


🖥️ App Preview

Overview Model Performance Live Predictor
KPI dashboard with risk distribution charts 97.7% accuracy, ROC-AUC 0.999, feature importance Real-time risk prediction with probability breakdown

✨ Features

  • Overview Dashboard — Total student stats, risk distribution bar chart, donut breakdown, and key indicator comparisons
  • Model Performance — Accuracy, F1 Score, ROC-AUC metrics, confusion matrix, ROC curves, and feature importance analysis
  • Live Predictor — Input any student's profile and get an instant color-coded risk assessment with probability scores
  • Professional Dark UI — Custom CSS injection for a polished, production-grade interface

🗂️ Project Structure

mindtrack/
│
├── mindtrack_app.py              # Main Streamlit web application
├── mindtrack_model.py            # XGBoost model training + graph generation
├── mindtrack_dataset_final.csv   # Cleaned & merged dataset (27,971 rows)
├── mindtrack_model.pkl           # Saved XGBoost model (generated after training)
└── README.md

📊 Dataset

The final dataset is a merge of two sources:

  • Student Mental Health Survey — Depression, anxiety, panic attacks, CGPA, year of study
  • Student Stress Factors Dataset — Sleep quality, academic performance, study load, stress levels
Property Value
Total Rows 27,971
Features 12
Target Risk_Level (0=Low, 1=At-Risk, 2=High)
Null Values 0
Encoding All columns integer/float

Features used: Age, Gender, CGPA, Academic_Pressure, Study_Satisfaction, Sleep_Quality, Dietary_Habits, Suicidal_Thoughts, Study_Hours, Financial_Stress, Family_History, Depression


🤖 Model

Property Value
Algorithm XGBoost Classifier
Accuracy 97.7%
F1 Score (weighted) 0.977
ROC-AUC (macro) 0.999
Train/Test Split 80% / 20%
Saved with Joblib

Key hyperparameters:

XGBClassifier(
    n_estimators     = 300,
    max_depth        = 6,
    learning_rate    = 0.07,
    subsample        = 0.8,
    colsample_bytree = 0.8,
    eval_metric      = "mlogloss"
)

🚀 Getting Started

1. Clone the repository

git clone https://github.com/yourusername/mindtrack.git
cd mindtrack

2. Install dependencies

pip install streamlit xgboost scikit-learn joblib matplotlib seaborn pandas numpy

3. Train the model first

python mindtrack_model.py

This generates mindtrack_model.pkl and saves 4 evaluation graphs.

4. Run the Streamlit app

streamlit run mindtrack_app.py

Open your browser at http://localhost:8501


📦 Dependencies

streamlit
xgboost
scikit-learn
joblib
matplotlib
seaborn
pandas
numpy

📈 Graphs Generated by Model Script

File Description
feature_importance.png Top features ranked by XGBoost gain
confusion_matrix.png Predicted vs actual class heatmap
roc_curves.png ROC curves for all 3 risk classes
actual_vs_predicted.png Side-by-side distribution comparison

🎯 Risk Level Classification

Level Label Description
0 🟢 Low Risk Student appears mentally healthy
1 🟡 At-Risk Moderate indicators — counseling recommended
2 🔴 High Risk Strong indicators — immediate support needed

🏗️ Built With


📄 License

This project is licensed under the MIT License.


🙋‍♂️ Author

Built with ❤️ for DEV Season of Code Hackathon 2026

"1 in 5 students suffers silently. MindTrack detects risk weeks in advance — so schools can intervene before crisis hits."

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages