Preprint
Article

This version is not peer-reviewed.

Comparative Analysis of Explainable AI for Depression Risk Assessment Based on Digital Behavior of University Students

Submitted:

31 May 2026

Posted:

02 June 2026

You are already at the latest version

Abstract
Depression among university students has emerged as a significant mental health concern worldwide. Traditional assessment methods primarily rely on self-reported questionnaires and clinical evaluations, which may not provide scalable and continuous monitoring. Recent advances in machine learning have created opportunities to identify depression-related behavioral patterns through digital activity data. However, many predictive models operate as black-box systems that provide limited interpretability. This study presents a comparative analysis of explainable artificial intelligence (XAI) approaches for depression risk assessment using digital behavior data collected from university students. Logistic Regression and Random Forest classifiers were developed using behavioral indicators including screen time duration, social media usage frequency, nighttime device usage, sleep patterns, self-perceived digital dependency, and perceived academic impact. Model performance was evaluated using accuracy, precision, recall, and F1-score metrics. SHapley Additive exPlanations (SHAP) were applied to improve transparency and interpretability. Experimental results indicate that Logistic Regression achieved 94.74% accuracy, while Random Forest achieved 100% accuracy on the testing dataset. SHAP analysis identified academic impact as the most influential predictor of depression risk. The findings demonstrate that explainable machine learning models can support transparent and ethical depression risk assessment in higher education environments.
Keywords: 
;  ;  ;  ;  

1. Introduction

Mental health is increasingly recognized as a critical factor affecting academic success and overall well-being among university students. Depression is one of the most important psychological concerns in higher education and has been associated with decreased academic performance, reduced motivation, social withdrawal, and an increased risk of dropout [1,2].
Although established assessment tools such as the Patient Health Questionnaire-9 (PHQ-9) are widely used, traditional depression screening methods still depend heavily on self-reporting and periodic evaluation. As a result, they may fail to identify students who are reluctant to seek support or disclose psychological difficulties [2].
At the same time, the widespread use of smartphones and social media platforms has generated large volumes of behavioral data that may provide useful indicators of mental health conditions. Previous research has shown that behavioral and lifestyle factors related to digital engagement are associated with depressive symptoms among university students [3].
Machine learning has emerged as a promising approach for analyzing behavioral patterns and predicting mental health risks. Recent reviews have highlighted the growing use of machine learning methods in student mental health research and their potential for early risk detection [4]. However, many predictive models prioritize accuracy over transparency, which limits trust and practical adoption in educational and healthcare settings.
To address this issue, Explainable Artificial Intelligence (XAI) techniques have been proposed to improve the interpretability of machine learning models. In particular, SHapley Additive exPlanations (SHAP) provide a principled method for explaining feature contributions in model predictions [3]. This study therefore proposes an explainable machine learning framework that combines Logistic Regression, Random Forest, and SHAP analysis to assess depression risk among university students.

3. Methodology

3.1. Research Design

This study employed a quantitative research design using supervised machine learning techniques to assess depression risk among university students based on digital behavior indicators. Data were collected through an online questionnaire distributed to university students, resulting in 94 valid responses for analysis. Six digital behavioral features were selected as predictor variables, namely screen time duration, social media usage frequency, nighttime device usage, sleep patterns, self-perceived digital dependency, and perceived academic impact. Depression risk categories were derived from PHQ-9 scores and transformed into a binary classification problem, where scores ranging from 0 to 9 were categorized as Low Risk and scores ranging from 10 to 27 were categorized as High Risk.

3.2. Machine Learning Models

3.2.1. Logistic Regression

Logistic Regression estimates the probability of depression risk using:
P ( Y = 1 | X ) = 1 1 + e z
where z represents the weighted combination of predictor variables.

3.2.2. Random Forest

Random Forest is an ensemble learning algorithm that constructs multiple decision trees and combines their predictions through majority voting.
SHAP was applied to both machine learning models to provide feature-level explanations and improve model transparency. The dataset was divided using an 80:20 train-test split ratio. Model performance was evaluated using Accuracy, Precision, Recall, and F1-score.

4. Results and Discussion

4.1. Model Performance

The Logistic Regression model achieved an accuracy of 94.74%, indicating its effectiveness in classifying depression risk among university students based on digital behavioral features. In comparison, the Random Forest model achieved 100.00% accuracy on the testing dataset, outperforming Logistic Regression. The higher accuracy of Random Forest suggests that the model was better able to capture complex relationships among the predictor variables. However, the perfect classification result should be interpreted cautiously due to the relatively small dataset size, which may increase the risk of overfitting.
Table 1. Model Performance Comparison.
Table 1. Model Performance Comparison.
Model Accuracy
Logistic Regression 94.74%
Random Forest 100.00%

4.2. Classification Results

Figure 1 illustrates the SHAP summary plot for the Logistic Regression model. The plot shows the contribution of each feature to the prediction outcome, where positive SHAP values increase the likelihood of a high depression risk prediction and negative values decrease it. The results indicate that sleep patterns and digital dependency have the greatest influence on the model’s predictions, followed by social media usage and academic impact. Students exhibiting higher levels of digital dependency generally contribute more positively to depression risk predictions, while healthier sleep patterns are associated with lower predicted risk. These findings suggest that behavioral habits related to sleep and technology use play an important role in depression risk assessment.
Figure 2 presents the SHAP summary plot for the Random Forest model. The results show that academic impact is the most influential feature affecting depression risk predictions, as evidenced by its substantially larger SHAP values compared to other variables. High academic impact values are strongly associated with increased depression risk predictions. Digital dependency, screen time, and social media usage also contribute to the model’s decisions, although to a much lesser extent. In contrast, sleep patterns and nighttime device usage have relatively small effects on prediction outcomes. These findings highlight the significant role of academic challenges and digital behaviors in identifying students at risk of depression.
Table 2 summarizes the feature importance scores generated by the Random Forest model. Academic impact achieved the highest importance score of 0.7546, making it the most significant predictor of depression risk among all features considered in this study. Digital dependency, social media usage, and screen time contributed moderately to the model, while sleep patterns and nighttime device usage showed lower importance values. These findings are consistent with the SHAP analysis, which also identified academic impact as the primary factor influencing model predictions.
The results indicate that digital behavioral indicators can provide meaningful information for depression risk assessment among university students. Both machine learning models demonstrated strong predictive performance, with Random Forest achieving higher accuracy than Logistic Regression. The superior performance of Random Forest suggests that nonlinear relationships exist among behavioral variables and can be effectively captured through ensemble learning approaches. However, the perfect classification result should be interpreted cautiously because of the relatively small dataset size and the potential risk of overfitting.
To improve transparency and interpretability, SHapley Additive exPlanations (SHAP) were applied to both models. The SHAP analysis for Logistic Regression indicated that variations in sleep behavior and digital dependency strongly influenced model predictions. For the Random Forest model, academic impact emerged as the most influential factor contributing to depression risk classification.
The SHAP analyses provide additional insight into how behavioral features affect prediction outcomes. Academic impact, digital dependency, and social media usage were identified as the most important variables associated with depression risk. These findings are consistent with previous research suggesting that digital behavior and its effects on academic performance may be linked to student mental health challenges. The integration of explainability techniques strengthens trust in predictive systems by allowing users to understand the factors driving model decisions. As a result, explainable machine learning models have the potential to support transparent and responsible depression risk assessment in higher education environments.

5. Conclusions

This study presented a comparative analysis of explainable machine learning models for depression risk assessment based on the digital behavior of university students. Logistic Regression achieved an accuracy of 94.74%, while Random Forest achieved 100% accuracy on the testing dataset. SHAP analysis identified academic impact, digital dependency, and social media usage as the most influential predictors of depression risk. These findings demonstrate the potential of combining machine learning and Explainable Artificial Intelligence (XAI) techniques to provide transparent, interpretable, and ethical approaches for mental health assessment in higher education environments.

Acknowledgments

The authors would like to express their sincere gratitude to Dr. Lihour Nov for his valuable guidance, constructive feedback, and continuous support throughout this research. His supervision and encouragement greatly contributed to the successful completion of this study.

References

  1. Liu, X.; Guo, Y.; Zhang, W.; Gao, W. Influencing Factors, Prediction and Prevention of Depression in College Students: A Literature Review. World J. Psychiatry 2022, vol. 12(no. 7), 860–873. [Google Scholar] [CrossRef] [PubMed]
  2. Auerbach, R. P.; et al. WHO World Mental Health Surveys International College Student Project. J. Abnorm. Psychol. 2018, vol. 127(no. 4), 623–638. [Google Scholar] [CrossRef] [PubMed]
  3. Lundberg, S. M.; Lee, S. I. A Unified Approach to Interpreting Model Predictions. Adv. Neural Inf. Process. Syst. 2017, vol. 30, 4765–4774. [Google Scholar]
  4. Ben Hassine, S.; Zhang, M.; Smith, S. Machine Learning Methods in Student Mental Health Research: An Ethics-Centered Systematic Literature Review. Appl. Sci. 2024, vol. 14(no. 24). [Google Scholar]
  5. Cox, D. R. The Regression Analysis of Binary Sequences. J. R. Stat. Soc. 1958, vol. 20(no. 2), 215–232. [Google Scholar] [CrossRef]
  6. Breiman, L. Random Forests. Mach. Learn. 2001, vol. 45(no. 1), 5–32. [Google Scholar] [CrossRef]
Figure 1. SHAP summary plot for Logistic Regression.
Figure 1. SHAP summary plot for Logistic Regression.
Preprints 216252 g001
Figure 2. SHAP summary plot for Random Forest.
Figure 2. SHAP summary plot for Random Forest.
Preprints 216252 g002
Table 2. Random Forest Feature Importance.
Table 2. Random Forest Feature Importance.
Feature Importance
Academic Impact 0.7546
Digital Dependency 0.0717
Social Media Usage 0.0679
Screen Time 0.0591
Sleep Patterns 0.0292
Night Usage 0.0176
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.
Copyright: This open access article is published under a Creative Commons CC BY 4.0 license, which permit the free download, distribution, and reuse, provided that the author and preprint are cited in any reuse.
Prerpints.org logo

Preprints.org is a free preprint server supported by MDPI in Basel, Switzerland.

Subscribe

Disclaimer

Terms of Use

Privacy Policy

Privacy Settings

© 2026 MDPI (Basel, Switzerland) unless otherwise stated