Abstract
Mental health disorders present a growing global concern, yet predictive models often overlook age-specific variations in risk factors. This study introduces an explainable artificial intelligence (XAI) framework for age-stratified mental health risk prediction using Shapley Additive Explanations (SHAP). Using the Open Sourcing Mental Illness (OSMI) dataset, the study stratifies individuals into five different age groups (18-55+ years) and applies machine learning models - Random Forest, extreme gradient boosting, and support vector machine - enhanced with SHAP to identify key predictors across life stages. The findings reveal significant variations in risk factors: younger adults (18-24) are influenced by social support, while familial history and past mental health disorders gain prominence in middle-aged groups (25-54). For older adults (55+), social networks and environmental stressors become critical. Unlike traditional «black box» AI models, SHAP provides interpretable insights, ensuring transparency in predictive decision-making. This study contributes to the literature by demonstrating that mental health risks are not static but evolve with age, necessitating tailored interventions. The framework advances age-specific predictive modelling and offers actionable insights for policymakers and clinicians, particularly in resource-constrained settings. By addressing the limitations of conventional AI approaches, this research establishes a foundation for personalised, explainable, and effective mental health risk assessment across diverse populations. The integration of XAI with age stratification sets a new benchmark for mental health research, highlighting the transformative potential of AI-driven, context-sensitive solutions in addressing the global burden of mental health disorders. Mental health disorders present a growing global concern, yet predictive models often overlook age-specific variations in risk factors. This study introduces an explainable artificial intelligence (XAI) framework for age-stratified mental health risk prediction using Shapley Additive Explanations (SHAP). Using the Open Sourcing Mental Illness (OSMI) dataset, the study stratifies individuals into five different age groups (18-55+ years) and applies machine learning models - Random Forest, extreme gradient boosting, and support vector machine - enhanced with SHAP to identify key predictors across life stages. The findings reveal significant variations in risk factors: younger adults (18-24) are influenced by social support, while familial history and past mental health disorders gain prominence in middle-aged groups (25-54). For older adults (55+), social networks and environmental stressors become critical. Unlike traditional «black box» AI models, SHAP provides interpretable insights, ensuring transparency in predictive decision-making. This study contributes to the literature by demonstrating that mental health risks are not static but evolve with age, necessitating tailored interventions. The framework advances age-specific predictive modelling and offers actionable insights for policymakers and clinicians, particularly in resource-constrained settings. By addressing the limitations of conventional AI approaches, this research establishes a foundation for personalised, explainable, and effective mental health risk assessment across diverse populations. The integration of XAI with age stratification sets a new benchmark for mental health research, highlighting the transformative potential of AI-driven, context-sensitive solutions in addressing the global burden of mental health disorders.