AI-Driven Mental Disorder Prediction: A Machine Learning Approach for Early Detection ()
1. Introduction
Mental disorders are among the leading causes of disability worldwide, affecting millions of individuals across different age groups and demographics [1]-[3]. Conditions such as depression, bipolar disorder, and mood disorders can significantly impact cognitive function, emotional stability, and overall well-being [4]. The increasing prevalence of mental health issues has placed a substantial burden on healthcare systems, necessitating innovative approaches to early detection and intervention. Despite advancements in mental healthcare, traditional diagnostic methods remain largely reliant on subjective assessments, including clinical interviews and self-reported symptoms [5]-[7]. These methods, while essential, often result in inconsistencies, misdiagnoses, and delays in providing appropriate treatment. Artificial Intelligence (AI) has emerged as a transformative tool in healthcare, offering data-driven insights that can enhance diagnostic precision and treatment planning [8]-[12]. Machine learning (ML), a subset of AI, is particularly useful in identifying complex patterns in large datasets, making it well-suited for mental health prediction [13]-[15]. By leveraging ML techniques, mental health assessments can be made more objective, scalable, and efficient. This study explores the application of ML models to predict mental disorders using behavioral and psychological indicators such as sleep disturbances, mood fluctuations, anxiety levels, and suicidal tendencies. The primary objective of this research is to develop an AI-driven model capable of distinguishing between various mental disorders, including Bipolar Type-1, Bipolar Type-2, Depression, and individuals categorized as Normal. By analyzing a dataset containing key behavioural and psychological attributes, we evaluate the performance of multiple ML algorithms to determine their effectiveness in mental health prediction. The study aims to contribute to the growing body of research advocating AI integration in psychiatry, ultimately facilitating early detection and personalized intervention strategies. Future implications include incorporating AI models into digital mental health applications, assisting clinicians in real-time diagnosis, and improving accessibility to mental healthcare services.
2. Literature Review
Artificial Intelligence (AI) has increasingly been applied in mental healthcare to enhance the accuracy and efficiency of diagnosis, prognosis, and treatment recommendations [16]-[18]. Traditional psychiatric evaluations rely on self-reported symptoms, structured interviews, and clinical observations, which are often subjective and prone to variability across different practitioners [19] [20]. AI-based approaches, particularly machine learning and deep learning models, offer a data-driven alternative by analyzing large-scale behavioural, psychological, and physiological data to identify patterns indicative of various mental disorders [21]. These models have shown promising results in detecting conditions such as depression, bipolar disorder, schizophrenia, and anxiety disorders based on speech patterns, facial expressions, social media activity, and neuroimaging data. One of the key advantages of AI in mental health diagnosis is its ability to process complex, multidimensional data, including textual, visual, and biometric information [22]-[24]. Several studies have explored the use of natural language processing (NLP) techniques to analyze speech and text data from patient interviews, online posts, and medical records [25]. These approaches enable early detection of depressive and suicidal tendencies by identifying linguistic markers such as negative sentiment, lack of coherence, and changes in speech patterns. Similarly, deep learning models trained on facial expression datasets have been employed to detect emotional distress, mood fluctuations, and cognitive impairments associated with mental disorders [26] [27]. Despite the progress in AI-driven mental health solutions, challenges remain in achieving clinical applicability [28]. The generalizability of machine learning models is often limited by dataset biases, small sample sizes, and lack of diverse population representation [29] [30]. Additionally, ethical concerns regarding data privacy, informed consent, and the potential for algorithmic bias raise questions about the widespread deployment of AI in mental healthcare [31]-[33]. The need for interpretability in AI models is another significant challenge, as clinicians require transparent decision-making processes to trust and integrate AI-based recommendations into their practice [34] [35]. Addressing these challenges requires collaborative efforts between AI researchers, clinicians, and policymakers to ensure that AI-driven mental health solutions are accurate, ethical, and aligned with clinical needs. While existing studies have demonstrated the potential of AI in mental health diagnostics, there is still a gap in developing robust, scalable, and clinically validated models. This research aims to contribute to the field by building a predictive AI model for mental disorder classification, using behavioural and psychological indicators. By leveraging machine learning algorithms, this study seeks to improve early detection and intervention, ultimately supporting better mental health outcomes.
3. Methodology
3.1. Dataset Description
The dataset utilized in this study comprises multiple psychological and behavioural attributes that serve as indicators of mental health conditions. These attributes include sadness, euphoric behaviour, exhaustion, sleep disorders, mood swings, suicidal thoughts, anorexia, and overthinking. The dataset also contains a classification label that categorizes individuals into four diagnostic groups: Bipolar Type-1, Bipolar Type-2, Depression, and Normal. The presence of these features allows for the construction of predictive models capable of distinguishing between different mental disorders based on behavioural patterns. The dataset serves as the foundation for training and evaluating machine learning models to assess their effectiveness in mental health prediction
3.2. Data Prepositioning
Before applying machine learning algorithms, data pre-processing was conducted to enhance the quality and reliability of the dataset [36] [37]. The first step involved handling missing values, as incomplete data can negatively impact model performance [38]. Any missing entries were addressed using imputation techniques, such as replacing missing values with the mean, median, or mode of the respective feature [39]. This ensured consistency in the dataset while preserving essential information. Categorical variables were encoded to transform non-numeric data into a format suitable for machine learning models [40]. The diagnosis labels (Bipolar Type-1, Bipolar Type-2, Depression, and Normal) were converted into numerical values using label encoding. Similarly, other categorical variables, if present, were encoded using one-hot encoding to prevent any ordinal relationships from affecting model performance. To improve the efficiency of machine learning models, feature scaling and normalization were applied [41]. Standardization techniques such as Min-Max scaling were used to scale numerical features to a uniform range, preventing models from being biased by features with larger numerical values. Normalization ensured that all attributes contributed equally to the model’s learning process, enhancing the accuracy and stability of the trained models.
3.3. Model Selection and Training
Multiple machine learning models were evaluated to determine the most effective classifier for mental disorder prediction [42]. The models tested included Logistic Regression, Decision Trees, Random Forest, and Neural Networks. Each model was trained on the pre-processed dataset, and its performance was assessed using key evaluation metrics such as accuracy, precision, recall, and F1-score. Logistic Regression was chosen as a baseline model due to its simplicity and interpretability [43]. It provided initial insights into the separability of the data and helped establish a benchmark for model comparison. Decision Trees were implemented to capture non-linear relationships and provide a more intuitive understanding of feature importance in predicting mental disorders [44]. Random Forest, an ensemble method, was employed to enhance predictive accuracy and reduce overfitting by combining multiple decision trees [45]. Neural Networks were also explored due to their ability to learn complex patterns and relationships within the dataset [46]. A multi-layer perceptron (MLP) architecture was implemented, consisting of multiple hidden layers with activation functions to capture non-linear dependencies [47]. The model was trained using backpropagation and optimized using the Adam algorithm to minimize loss.
Hyperparameter Optimization
To enhance model performance and generalizability, hyperparameter tuning was conducted for each machine learning model [48]:
Support Vector Machine (SVM): We used Grid Search to optimize hyperparameters such as the kernel type (linear, polynomial, or RBF), regularization parameter CCC, and gamma values to balance bias and variance.
Random Forest: Grid Search was employed to optimize the number of estimators (trees in the forest), maximum tree depth, and minimum samples per split to reduce overfitting while maintaining high predictive power.
Decision Trees: Hyperparameters such as tree depth, minimum samples per leaf, and splitting criteria (Gini impurity vs. entropy) were fine-tuned using Random Search for efficiency.
Neural Networks: Due to the complexity of tuning deep learning models, Bayesian Optimization was applied to refine learning rates, batch sizes, dropout rates, and the number of hidden layers. This probabilistic approach helped find an optimal combination of hyperparameters with fewer iterations compared to Grid Search.
Each model was trained and tested using a standard train-test split methodology, with 80% of the data allocated for training and 20% for testing. Additionally, 5-fold cross-validation was applied to assess model robustness and prevent overfitting [49]. The results of each model were analyzed and compared to determine the most effective approach for mental disorder classification, ensuring that the final model provided reliable and clinically relevant predictions.
4. Results
The dataset was analysed to identify patterns and relationships between different psychological indicators and mental disorder diagnoses. The primary objective was to evaluate the predictive performance of various machine learning models in classifying individuals into four categories: Bipolar Type-1, Bipolar Type-2, Depression, and Normal. The results indicate that suicidal thoughts, sleep disorders, and mood swings were among the most significant predictors of mental disorders.
4.1. Data Distribution Analysis
The dataset comprised multiple behavioural and psychological attributes, each playing a crucial role in classifying mental disorders. To analyse the prevalence of different symptoms among individuals, we visualized the distribution of key features such as sadness, exhaustion, sleep disorders, mood swings, and overthinking. Figure 1 illustrates the frequency of these symptoms across the dataset, highlighting variations in their occurrence among different mental health conditions. Pie charts depict the proportion of individuals experiencing sadness,
Figure 1. Distribution of psychological features in the dataset.
Figure 2. Relationship between sadness, suicidal thoughts, and mental disorder diagnoses.
euphoric behavior, and suicidal thoughts, showing that a significant subset of the population frequently reports these symptoms.
Dataset Imbalance Analysis: Given the classification into four mental health conditions—Bipolar Type-1, Bipolar Type-2, Depression, and Normal—an assessment of class distribution was conducted to determine whether the dataset was imbalanced. Our analysis revealed that certain classes, such as Bipolar Type-1, had fewer instances compared to Depression and Normal categories, indicating an imbalance. This imbalance can lead to biased model predictions, where the classifier favors majority classes while underperforming minority ones. To mitigate this, we employed Synthetic Minority Over-sampling Technique (SMOTE) to generate synthetic instances for underrepresented classes and adjusted class weights in models such as SVM and Logistic Regression to ensure fair learning. Addressing dataset imbalance was crucial for improving model generalization and preventing biased classification results.
Further analysis examined the relationship between suicidal thoughts and sadness among different mental disorder diagnoses. Figure 2 presents bar charts showing the proportion of individuals diagnosed with Bipolar Type-1, Bipolar Type-2, Depression, and Normal who experienced suicidal thoughts. The findings reveal that individuals diagnosed with bipolar disorders and depression were more likely to experience frequent sadness and suicidal ideation compared to individuals classified as normal.
4.2. Machine Learning Model Performance
To evaluate the effectiveness of machine learning in predicting mental disorders, multiple models were trained and tested. The models included Support Vector Machine (SVM), Logistic Regression, Random Forest, Gradient Boosting, and XGBoost. Performance was measured based on training accuracy and test accuracy, with results presented in Table 1.
Table 1. Table of model, training accuracy and test accuracy.
Model |
Training Accuracy |
Test Accuracy |
SVM |
1.0000 |
0.8056 |
Logistic Regression |
1.0000 |
0.8056 |
Random Forest |
1.0000 |
0.8056 |
Gradient Boosting |
1.0000 |
0.7222 |
XGBoost |
1.0000 |
0.7778 |
The results indicate that SVM, Logistic Regression, and Random Forest models performed the best, each achieving a test accuracy of 80.56%. The Gradient Boosting model had the lowest performance, with a test accuracy of 72.22%, while XGBoost achieved 77.78% accuracy.
To visualize the comparative performance of these models, Figure 3 presents a bar chart of model test accuracies. It highlights that tree-based models, such as Random Forest and XGBoost, performed slightly lower than SVM and Logistic Regression, but all models demonstrated strong predictive capabilities.
Figure 3. Accuracy comparison of machine learning models.
4.3. Feature Importance Analysis
To further understand which features contributed most to the classification of mental disorders, we conducted feature importance analysis. The results revealed that suicidal thoughts, sleep disorders, and mood swings were the most significant predictors of mental disorders. These findings emphasize the role of behavioural indicators in AI-driven mental healthcare applications.
Summary of Findings
Suicidal thoughts, sleep disorders, and mood swings were identified as the most significant predictors of mental disorders.
SVM, Logistic Regression, and Random Forest achieved the highest accuracy (80.56%), demonstrating the potential for AI-driven mental disorder prediction.
Gradient Boosting and XGBoost models showed slightly lower accuracy, suggesting room for model optimization.
The dataset analysis highlighted key psychological symptoms that contribute to diagnosing Bipolar Type-1, Bipolar Type-2, and Depression.
These results reinforce the effectiveness of machine learning in mental health diagnosis and pave the way for further enhancements in AI-driven mental healthcare solutions.
4.4. Model Validation, Computational Efficiency, Ethical
Considerations, and Comparison with Diagnostic Standards
To ensure the robustness and reliability of our machine learning models, we implemented a rigorous validation process. Given the high training accuracies reported, 5-fold cross-validation was applied to assess generalization across multiple dataset splits, reducing the risk of overfitting. This process ensured that each model was evaluated on different subsets of data, improving reliability. Additionally, early stopping was utilized in Neural Networks to halt training when validation loss stopped improving, preventing excessive complexity. Dropout regularization was applied to randomly deactivate neurons during training, reducing dependency on specific features and enhancing generalizability. For ensemble models like Random Forest and Gradient Boosting, tree pruning and feature selection were applied to minimize redundancy and prevent overfitting. Furthermore, models were tested on an independent test set to validate real-world applicability, ensuring that predictions were based on learned patterns rather than memorized training data. Beyond accuracy, computational efficiency and training time were evaluated to compare the models’ feasibility for practical deployment. Logistic Regression and Decision Trees exhibited the shortest training times and required minimal computational resources, making them suitable for real-time applications. Random Forest, though computationally intensive due to the ensemble nature, provided a good balance between accuracy and efficiency. Neural Networks required significantly longer training times due to iterative weight updates and backpropagation but demonstrated strong predictive capabilities for complex behavioral patterns. Gradient Boosting and XGBoost, while effective at capturing nuanced relationships, had the longest training durations due to their sequential learning process, making them computationally expensive. The choice of an optimal model depends on the trade-off between accuracy and deployment feasibility in real-world applications. The deployment of AI in mental health diagnostics presents ethical concerns that must be addressed to ensure responsible use. Bias and fairness are critical, as models trained on imbalanced datasets may misclassify certain demographic groups, leading to disparities in diagnosis. To mitigate this, class weighting, bias detection, and explainable AI (XAI) techniques were explored to enhance transparency in decision-making. Privacy and data security are also paramount due to the sensitive nature of mental health data. Future AI applications must incorporate encryption, anonymization, and compliance with ethical frameworks such as GDPR and HIPAA to safeguard user information. Additionally, AI-driven mental health models should function as decision-support tools rather than standalone diagnostic systems, ensuring that human oversight remains integral to clinical decisions. Future research should prioritize model interpretability and seamless integration into psychiatric workflows to maximize its ethical and clinical impact.
When compared to traditional psychiatric assessments such as structured clinical interviews (e.g., DSM-5 criteria), our AI-driven approach offers higher consistency, scalability, and efficiency. While clinical interviews are often subjective and time-consuming, AI models can provide rapid, data-driven insights to support decision-making. However, AI lacks the depth of clinician-led assessments, contextual understanding, and qualitative evaluation of symptoms. Our models performed particularly well in detecting Depression and Bipolar Type-2, where symptom patterns were well-represented in the dataset. However, classification of Bipolar Type-1 was less accurate, likely due to fewer training samples and the complexity of manic episodes, which are harder to quantify with behavioral features alone. Future improvements could involve incorporating multimodal data (e.g., speech patterns, facial expressions, social media activity) to enhance predictive accuracy and bridge the gap between AI models and current psychiatric diagnostic standards.
5. Discussion
The results of this study demonstrate the effectiveness of machine learning models in predicting mental disorders based on psychological and behavioral attributes. The models achieved high classification accuracy, with Support Vector Machine (SVM), Logistic Regression, and Random Forest models performing the best at 80.56% test accuracy. These results indicate that AI-based approaches can offer valuable insights into early mental disorder detection, potentially aiding in clinical decision-making and risk assessment. One key finding from the feature importance analysis was that suicidal thoughts, sleep disorders, and mood swings played the most significant roles in predicting mental health conditions. These features align with known clinical indicators for disorders such as Bipolar Type-1, Bipolar Type-2, and Depression, highlighting the potential of AI to recognize critical risk factors. Additionally, the dataset distribution analysis revealed that individuals diagnosed with bipolar disorders and depression exhibited higher frequencies of sadness and suicidal thoughts, reinforcing the clinical understanding of these conditions. While the results are promising, several limitations must be acknowledged. First, the dataset used in this study was relatively small, which could limit the generalizability of the findings to larger populations [50]. Future studies should consider expanding the dataset to include a more diverse population across different age groups, cultures, and socioeconomic backgrounds. Second, the study primarily relied on self-reported psychological and behavioral attributes, which may introduce biases or inaccuracies due to subjective reporting. Integrating clinical assessments, genetic factors, and neurological imaging data could enhance predictive accuracy and model robustness [51] [52]. Another critical aspect is the interpretability of AI models in mental healthcare. While machine learning models can identify patterns in data, understanding why a specific prediction is made remains a challenge [53] [54]. Future research should focus on developing explainable AI (XAI) models that provide transparent reasoning behind predictions, enabling clinicians and mental health professionals to trust AI-assisted diagnostic tools [55]-[57]. Furthermore, integrating AI-driven screening tools into mental health apps and telemedicine platforms could significantly improve accessibility to early intervention services, particularly in regions with limited psychiatric resources [58]. Overall, this study provides compelling evidence that AI can serve as a valuable tool in mental health diagnostics. However, further research is necessary to enhance model interpretability, dataset diversity, and clinical integration to maximize its real-world applicability.
6. Conclusion
The findings of this study emphasize the potential role of AI in mental health prediction, demonstrating that machine learning models can effectively classify individuals into Bipolar Type-1, Bipolar Type-2, Depression, and Normal categories. The results indicate that SVM, Logistic Regression, and Random Forest models performed the best, achieving a test accuracy of 80.56%, while suicidal thoughts, sleep disorders, and mood swings were identified as the most critical predictive features. These insights highlight the ability of AI to detect early warning signs of mental disorders, providing a preliminary screening tool for mental health professionals. Despite the strong predictive performance, challenges remain in dataset diversity, model explainability, and integration with clinical workflows [59] [60]. To further improve AI-driven mental health diagnostics, future research should explore deep learning techniques, multimodal data fusion (including genetic and clinical data), and real-time mental health monitoring through wearable devices and mobile applications [61] [62]. By combining AI-driven predictive models with mental health interventions, the accessibility and efficiency of early detection and personalized treatment plans can be significantly enhanced [17] [63]. In conclusion, AI does not replace clinical diagnosis but serves as a powerful complementary tool for preliminary mental health assessment. As AI technology advances, its integration with digital mental health platforms, telepsychiatry, and healthcare systems will be crucial in addressing the growing global burden of mental disorders.
Conflicts of Interest
The authors declare no conflicts of interest.