AI Powered Mental Health Prediction System using Python Machine Learning (ML)
An AI-powered mental health prediction system is a software application that utilises machine learning algorithms to analyse psychological and behavioural data. Based on this analysis, the system predicts a user’s mental health status, facilitating early detection and awareness.
The system is developed using Python, one of the most popular languages for AI and data science, and trained on mental health survey datasets to achieve reliable prediction accuracy.
🛠️ Tech Stack Used
Frontend / Web Interface:
- Django (Python Web Framework) – Used to create the web interface for user input, displaying predictions, and managing data
- HTML5, CSS3, JavaScript – For rendering and styling web pages
- Bootstrap (optional) – For responsive UI components
- Django Templates – For dynamic web page rendering
🧠Machine Learning / Backend Logic:
- scikit-learn – Machine Learning library used to implement algorithms like Logistic Regression, Decision Tree, Random Forest, KNN
- NumPy→ For numerical operations and matrix manipulation
- Pandas → For handling and preprocessing datasets
- joblib → To save and load the trained machine learning model
🗃️ Database:
- SQLite – Lightweight relational database used to store user data and predictions
- Django ORM (Object Relational Mapper) – Handles interaction between Django models and the SQLite database
⚙️Tools & Environment:
- Python 3.x – Core programming language used
- PyCharm – IDE for development
- Virtualenv / pip – For managing dependencies
✅ Key Features
- User Authentication System
Secure signup, login, logout, and password management for both users and administrators. - Mental Health Prediction
Uses a machine learning model to predict mental health risk based on user inputs. - Multiple Risk Categories
Classifies users into Healthy, Low Risk, Moderate Risk, and High Risk categories. - Risk Percentage Calculation
Provides a normalised risk percentage for better interpretation of results. - Personalized Suggestions
Offers guidance and recommendations based on predicted mental health status. - Prediction History Tracking
Allows users to view past prediction records for self-monitoring. - User Profile Management
Enables users to view and update their personal information. - Admin Dashboard
Displays total users, risk distribution, and overall system statistics. - User Management
Admin can view, search, filter, and manage registered users. - Secure and User-Friendly Interface
Designed with a clean, intuitive layout for easy navigation and usability.
AI-Powered Mental Health Prediction in Python & ML: Output Screenshot
Login Page

Signup/Registration

Dashboard

Prediction Form

Prediction Result

How to run the AI-Powered Mental Health Prediction System using Python Machine Learning (ML)
1. Download the zip file of the AI-Powered-Mental-Health-Prediction-ML-Projectin Python
2. Extract the file, copy Mental_Health_Prediction the folder and paste it on the desktop
3. Open PyCharm and import the project into PyCharm
4. Install four libraries (if not installed)
|
1 2 3 4 |
pip install joblib pip install numpy pip install scikit-learn pip install pandas |
5. Run the Project using the following command
python manage.py runserver
Now, click the URL http://127.0.0.1:800,0 and the Project will run
Login Details
*************User************
Username: john123
Password: Test@123
Or register a new user.
