An AI-powered web application that predicts student mental health risk levels using XGBoost, built with Streamlit.
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.
| 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 |
- 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
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
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
| 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"
)git clone https://github.com/yourusername/mindtrack.git
cd mindtrackpip install streamlit xgboost scikit-learn joblib matplotlib seaborn pandas numpypython mindtrack_model.pyThis generates mindtrack_model.pkl and saves 4 evaluation graphs.
streamlit run mindtrack_app.pyOpen your browser at http://localhost:8501
streamlit
xgboost
scikit-learn
joblib
matplotlib
seaborn
pandas
numpy
| 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 |
| 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 |
- Streamlit — Web app framework
- XGBoost — ML model
- Pandas — Data processing
- NumPy — Numerical computing
- Matplotlib — Charts and graphs
- Seaborn — Statistical visualizations
- Scikit-learn — Model evaluation
- Joblib — Model persistence
This project is licensed under the MIT License.
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."