Abstract
Humans are exposed to a multitude of environmental chemical mixtures (ECMs) in daily life that may influence depression risk. While prior studies have shown individual ECM exposures to depression, the cumulative and interactive effects of multiple co-exposures remain poorly characterized. This study aimed to develop an interpretable machine learning (ML) model to predict depression risk from ECMs and reveal their interactions mediated through endogenous metabolites and proteins. Using NHANES 2011–2016 data, we analyzed serum and urinary ECMs from 1333 adults, with depression assessed via PHQ-9 scores. Nine ML models were evaluated, with a random forest model showing the best performance (AUC: 0.967, and F1 score: 0.91) in predicting depression risk from ECM exposures. Shapley Additive Explanations (SHAP) identified serum cadmium and cesium, and urinary 2-hydroxyfluorene as the most influential predictors among 52 ECMs. An individualized depression risk assessment model was developed based on SHAP values for key ECMs. Mediation network analysis implicated oxidative stress and inflammation as crucial pathways relating ECMs to depression. This study presents an interpretable ML approach for elucidating cumulative environmental risks for depression, advancing our understanding of complex chemical-health interactions and potentially informing targeted interventions and prevention strategies for depression related to environmental exposures.
Introduction
According to the 2021 Global Burden of Disease study, mental disorders ranked among the top 10 leading causes of global health burden [1, 2]. As a highly prevalent mental disorder, depression constitutes a primary cause of global disability and suicide [3, 4]. Core symptoms of depression include mood changes such as sadness, cognitive impairments and somatic complaints, all of which substantially interfere with daily life, study, and work [5]. Understanding the factors contributing to depression is crucial for informing effective policy development and improving service delivery [6]. The pathogenesis of depression is multifaceted, influenced by genetic, environmental factors and behavioral factors [4, 7]. Although genetic factors account for approximately 30–40% of the risk, identifying modifiable environmental contributors remains pivotal for preventive strategies [8,9,10,11].
Environmental chemical exposures (ECMs) encompass various chemicals and compounds we encounter daily. The impact of these substances on health can range from benign to severely detrimental, even in minute quantities may also cause serious harm [11, 12]. Human exposure to ECMs occurs via multiple pathways, including dermal absorption, oral intake, and inhalation of contaminated air [13]. ECMs exhibit environmental persistence and bioaccumulative potential, facilitating their deposition in human tissues and contributing to chronic health outcomes, including cardiopulmonary impairments and neuropsychiatric disorders [8, 14, 15]. Potential biological mechanisms linking ECMs to depression include neurotoxicity, endocrine disruption, and increased oxidative stress pathways [16, 17]. Recent studies have shown that ECMs are associated with depression. For example, lead exposure has been associated with increased risks of depressive symptoms [18]. Cadmium exposure correlates with a higher prevalence of depressive symptoms and anxiety [19, 20]. Mercury, known for its neurotoxic effects, has been implicated in the development of mood disorders and depression [21,22,23]. Additionally, per- and polyfluoroalkyl substances (PFAS) have also been associated with depression [24, 25]. However, existing epidemiological research predominantly investigates single chemical exposures, inadequately capturing the cumulative and interactive effects inherent in real-world environmental scenarios [26]. Studies exploring prenatal exposure to nonpersistent chemicals suggest complex interactions between chemical mixtures and maternal mental health outcomes, including postpartum depression [27, 28]. The high dimensionality, complex co-exposure patterns, and potential nonlinearity in chemical exposure data pose significant analytical challenges to traditional epidemiological methodologies.
Machine learning (ML), driven by advancements in computational capabilities and growing availability of exposomic datasets, is increasingly recognized as a powerful analytical approach to address these methodological limitations [29]. ML techniques effectively handle the complexities inherent to high-dimensional, nonlinear, and intercorrelated exposure data, demonstrating robust predictive power across diverse toxicological endpoints [30]. For example, support vector machines have successfully classified neurotoxic potentials among structurally diverse solvents, probabilistic classifiers have accurately inferred neurotoxicity from broad chemical classes, and gradient boosting frameworks have efficiently screened previously uncharacterized environmental chemicals for neurotoxic risks [31,32,33]. Despite these advances, ML applications in environmental health have largely focused on neurotoxicology and have rarely been applied to complex psychiatric outcomes such as depression [34]. Furthermore, most current models consider chemicals individually, neglecting interactive or cumulative effects common in environmental mixtures [35]. Additionally, interpretable ML methods, like Shapley Additive Explanations (SHAP), improve model transparency, making results more accessible and actionable for clinical and public health applications [36]. These gaps highlight an urgent need for the development of interpretable, mixture-aware ML frameworks tailored to population-level environmental health data. Such advanced models will enhance the reliability of depression risk assessments, facilitate early detection of environmental determinants, and support evidence-based preventive strategies, thereby significantly advancing public mental health outcomes.
In this study, we used data from NHANES 2011–2016 to develop an interpretable machine learning framework predicting depression risk from ECMs. We effectively identified critical ECMs related to depression. Multiple ML algorithms, including neural networks and traditional models, were evaluated for predictive accuracy and interpretability. Using SHAP, the models clarified individual and interactive ECM contributions. Our findings provide actionable insights into public health interventions targeting environmental risk factors for depression.
Materials and methods
A brief study design is depicted in Fig. 1. The detailed methods are described below.
A The cross-sectional data of NHANES 2011–2016 adults. The data covers demographics, questionnaires, laboratory results, and physical exams, covering 1333 participants. Participants were divided into two groups based on PHQ-9 scores: those with scores ≥10 were classified as depressed (N = 126), and those with scores <10 as non-depressed (N = 1207); (B) Data Pre-processing, Generation and Model Analysis. Data was pre-processed and split into training (80%) and validation (20%) sets, with Recursive Feature Elimination (RFE) used to identify significant features from the ECM dataset. Various machine learning models, such as Random Forest (RF), Support Vector Machine (SVM), k-Nearest Neighbors (KNN), AdaBoost, and Multi-Layer Perceptron (MLP), etc., were trained and validated. C Explaining Machine Learning Models: Interpreting SHAP Analyses. SHAP values were applied to interpret the models. The analysis clarified the importance of each feature and its impact on predictions. Additionally, mediation and partial correlation network analyses examined pathways linking ECMs to depression.
Participants of the study
The National Health and Nutrition Examination Survey (NHANES) was approved by the National Center for Health Statistics Institutional Review Board, and all participants provided written informed consent. This research adheres to the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) guidelines [37, 38]. Our study initially considered a combined sample of approximately 15,000 participants from three consecutive NHANES cycles (2011–2016), with each cycle collecting data for about 5000 individuals annually. The inclusion criteria required participants to be aged ≥18 and to have complete Patient Health Questionnaire-9 (PHQ-9) status information for depression diagnosis confirmation [39]; Exclusion criteria included participants missing ECM data for more than two consecutive years or with substantial missing data across ECM measurements, reducing the effective sample size. Additionally, for variables with values below the limits of detection (LOD), participants were included if data were available after appropriate NHANES corrections. Ultimately, 1333 participants meeting these criteria were included in the final analysis (Fig. 1, Figure S1, Supplementary Table 1).
Measurement of ECMs and outcomes
In this study, we focused on five categories of environmental chemicals: polycyclic aromatic hydrocarbons (PAHs), metals, per- and polyfluoroalkyl substances (PFAS), phthalate esters (PAEs), and phenols, as potential determinants of depression. Although NHANES assesses over 300 environmental chemicals, not all were consistently measured across all cycles. To minimize missing data and improve the robustness of our analysis, we selected chemicals from the 2011–2016 cycles with more complete exposure data in these categories. This limitation excluded other potentially relevant chemicals, such as pesticides, due to insufficient data coverage. Some of the analyzed compounds had values below the limits of detection (LOD) according to the U.S. CDC reports on human environmental chemical exposures (https://www.cdc.gov/exposurereport/pdf/FourthReport_UpdatedTables_Volume1_Jan2019-508.pdf) [40]. Urinary creatinine levels were used for dilution correction, and ECM concentrations were naturally logarithm-transformed to achieve normality [41].
Depression was assessed using the Patient Health Questionnaire-9 (PHQ-9), a standardized and validated tool included in the NHANES dataset for mental health assessment. The PHQ-9 consists of nine items that measure the frequency of depressive symptoms over the past two weeks, with each item scored from 0 (not at all) to 3 (nearly every day). Total scores range from 0–27, with higher scores indicating more severe depressive symptoms. For this study, we followed established PHQ-9 thresholds, defining a score of 10 or above as indicative of moderate to severe depressive symptoms, which is widely used as a cutoff for depression diagnosis in epidemiological studies [39]. This approach allowed us to classify participants as depressed or non-depressed based on clinically relevant criteria, enhancing the outcome’s reliability and relevance for evaluating associations with environmental chemical exposures.
Abnormal values and missing data
Abnormal values were adjusted using the Winsor2 command in the R software, which sets a threshold between the first and ninety-ninth percentiles to readjust other outliers. There were no missing outcome variables. Covariates with less than 20% missing data were imputed using the k-nearest neighbors (KNN) method, while those with more than 20% missing values were excluded.
Feature selection with recursive feature elimination
To optimize feature selection for our machine learning models, we used Recursive Feature Elimination (RFE) with a 10-fold cross-validation control function to identify important features for depression risk prediction. Initially, 84 features (52 chemical exposure variables and 32 demographic and clinical covariates) were included in the machine learning models. First, we implemented RFE with the Random Forest (RF) algorithm as the primary model, evaluating feature subset sizes of 5, 10, and 15 using general control functions (caretFuncs). Subsequently, we applied an alternative RFE process using RF-specific controls (rfFuncs) to test feature subset sizes of 6, 8, and 10. The difference between these two approaches is that the RF-specific controls (rfFuncs) are tailored to optimize feature selection specifically for the RF model, potentially enhancing the interpretability and stability of selected features [42]. Model performance was evaluated with Root Mean Square Error (RMSE), R-squared, and Mean Absolute Error (MAE). RMSE was prioritized in model selection to identify feature sets that minimized prediction error. To ensure robustness, RFE was integrated within a bootstrap framework by iterating the feature selection process over multiple bootstrap samples, which helped validate the consistency of selected features and offered insights into the stability of ECM-depression associations across resampled datasets. This integration was achieved by repeatedly applying the RFE steps over resampled datasets, allowing us to confirm the reproducibility of selected features in predicting depression risk [43].
Machine learning for the prediction of depression
Due to the complexity of the underlying mechanisms, it is crucial to explore diverse algorithmic approaches to address the challenge of accurately predicting neurotoxicity. Therefore, we applied nine supervised machine learning algorithms to model depression risk based on chemical exposure profiles. These included neural network (NN), multilayer perceptron (MLP), gradient boosting machine (GBM), AdaBoost, extreme gradient boosting (XGBoost), random forest (RF), decision tree (DT), support vector machine (SVM), and logistic regression (LR). The neural architectures (NN, MLP) are capable of learning complex nonlinear representations [44]. Ensemble methods (GBM, AdaBoost, XGBoost, RF) combine multiple weak learners to enhance generalization and reduce overfitting [45]. DT offers transparent rule-based partitioning, SVM constructs maximum-margin classifiers in high-dimensional spaces, and LR provides a probabilistic linear baseline [46]. This diverse algorithmic selection facilitates robust comparative evaluation across distinct model families. To predict depression risk based on ECM data, we employed a 10-fold cross-validation (CV) approach instead of a single 80–20% train-test split to provide more precise estimates of model performance and reduce variance in the evaluation metrics. The dataset was divided into ten folds, with each fold used as a testing set once while the other nine folds served as the training set, ensuring that all samples contributed to both training and testing. To prevent data leakage and ensure an unbiased model evaluation, the Recursive Feature Elimination (RFE) process was applied exclusively within the training data for each fold, meaning that feature selection was performed anew within each training subset before testing on the corresponding validation fold. This approach avoided including any information from the test set in feature selection, ensuring that the results were not biased by data leakage [47].
Statistical analysis
We utilized R software (version 4.1.3, available at www.r-project.org) for data processing and model evaluation in statistical analyses. Continuous variables were presented as medians and standard deviations, while categorical variables were reported as numbers and percentages. Univariate logistic regression analysis examined the associations between each ECM and depression risk. Each ECM variable was analyzed independently to assess its impact on depression, which was selected based on established relevance in depression studies. To comprehensively and accurately evaluate the performance of the model, we also use a variety of indicators for evaluation, including area under the curve (AUC) with 95% confidence intervals (95% CI), accuracy score, average precision score (APS), precision, sensitivity/recall, specificity, negative predictive value (NPV), false positive rate (FPR), false negative rate (FNR), false discovery rate (FDR), F1 score, and Brier score.
Results
Characteristics of subjects
Among 1333 eligible adults with complete PHQ-9 data, the mean (SD) age was 46.88 (0.92) years, and 695 (50.1%) were female (Table 1). Using NHANES sampling weights, this sample is representative of approximately 19.2 million noninstitutionalized U.S. residents, allowing for population-level inferences. Those with depression were generally older (mean age 47.95 vs. 46.78 years), had a higher BMI (30.80 vs. 28.36), and had lower education levels (36.94vs. 28.71%). Additionally, they had higher rates of being widowed, divorced, or separated (28.14vs. 17.04%) among those with depression.
Univariate logistic regression
Univariate logistic regression analysis revealed several significant associations between ECMs and depression. Higher cadmium levels were associated with a more than twofold increase in depression likelihood (OR = 2.41, 95% CI: 1.80-3.23, P < 0.0001). Elevated lead levels also increased depression odds (OR = 1.21, 95% CI: 1.04-1.42, P = 0.02). Conversely, higher mercury levels were associated with lower odds of depression (OR = 0.79, 95% CI: 0.68–0.92, P = 0.004). Benzophenone-3, Triclosan, Ethylparaben, and 1-hydroxypyrene also showed significant associations (all P < 0.05) (Supplementary Table 2).
Recursive feature elimination (RFE)
We applied Recursive Feature Elimination (RFE) to identify the most relevant features for predicting depression. During this process, each variable was evaluated based on its contribution to the model’s predictive performance, measured by Root Mean Square Error (RMSE) and R-squared values. Variables that achieved an RMSE of 0.2874 or lower and an R-squared of 0.01506 or higher were considered for inclusion. After assessing combinations of variables, we selected a final subset of six key features - Total Arsenic, Arsenous Acid, Blood Cadmium, Cesium, 2,5-dichlorophenol, and 1-Hydroxynaphthalene - to balance model performance with interpretability (Table 2).
Testing and comparison of ML models’ performance
We evaluated the trained models to identify depression based solely on environmental chemical exposure (ECM) data. The RF model achieved the highest accuracy (0.9800), sensitivity (0.9800), specificity (0.9980), positive predictive value (PPV = 0.9850), and negative predictive value (NPV = 0.9800), demonstrating its robustness in predicting depression within this ECM-focused framework. The KNN and SVM models also performed well, with KNN achieving an accuracy of 0.9151 and SVM an accuracy of 0.9110. The NN model showed moderate performance, while Adaboost and XGBoost had lower accuracies and prediction values, underscoring the potential of the RF, KNN, and SVM models as strong predictors when analyzing ECM data (Fig. 2A).
A Comprehensive model comparison from nine metrics. B ROC comparison among ten models. ECMs used in the model included total arsenic, arsenous acid, blood cadmium, blood cesium, 2,5-dichlorophenol, and 1-hydroxynaphthalene. The RF model demonstrated the highest predictive accuracy with an AUC of 0.967 and an F1 score of 0.91. SHAP values were used to interpret the models, highlighting the most significant ECMs contributing to depression risk prediction. Abbreviations: ROC receiver operating curve, SVM support vector machine, NN neural networks, MLP multilayer perceptron, LR logistics regression, NB naive bayes, RF random forest, KNN k-nearest neighbor, GBM gradient boosting machine, DP detection precision, SE sensitivity, SP specificity, PPV positive predictive value, NPV negative predictive value, AP apparent prevalence, DR detection rate.
Notably, these results were obtained without including demographic or clinical variables, such as age, marital status, sex, or health conditions, isolating the effect of ECMs on depression risk prediction. To avoid potential bias, model evaluation incorporated cross-validation, ensuring that feature selection and testing were isolated within each fold, thereby preventing data leakage and supporting the reliability of these high accuracy and AUC values. The RF model also achieved the highest area under the curve (AUC = 0.967, 95% CI: 0.939-1.000), followed by KNN (AUC = 0.945, 95% CI: 0.838–0.983) and SVM (AUC = 0.943, 95% CI: 0.841–0.974), while the NN model displayed moderate performance with an AUC of 0.666 (95% CI: 0.619–0.699) (Fig. 2B).
Feature importance and interpretation of personalized predictions
Using SHAP values, we analyzed the impact of specific features on the RF model’s predictions for depression. The most significant features were cadmium (0.016), cesium (0.012), and 2-hydroxyfluorene (0.012). Lead, 2,5-dichlorophenol, and serum total folate also had positive contributions but to a lesser extent, while arsenous acid and 1-hydroxynaphthalene negatively influenced the predictions (Fig. 3A). Additionally, we used restricted cubic splines (RCS) to the SHAP significant features without adjusting for any variables. The RCS results highlighted the nonlinear relationships between these key features and depression risk. For instance, urine cadmium had an increasing effect on depression risk as its levels rose. Similarly, higher cesium levels were associated with an increased risk of depression. The impact of 2-hydroxyfluorene on depression showed a more complex pattern, with risk increasing at moderate exposure levels and stabilizing at higher levels. Serum total folate exhibited a positive correlation with depression risk, while blood mercury, arsenous acid, and mono (carboxypentyl) phthalate also had significant relationships with depression risk (Figure S2). The decision plot shows the contribution of each feature to the model’s final prediction for each participant, with each line representing individual participant data. All lines converge at the model’s base value of 0.959, indicating the predicted outcome before accounting for individual feature contributions (Fig. 3B, Figure S3).
AThis panel illustrates the ranking of mean absolute SHAP values for each feature in the model, reflecting their overall importance in predicting depression. B SHAP Summary Plot: This figure shows the distribution of SHAP values for individual predictions, with positive SHAP values (red) indicating an increase in the prediction of depression and negative SHAP values (blue) indicating a decrease. Features with higher SHAP values have a more significant impact on the model’s prediction, demonstrating the cumulative effect of feature contributions on the final output. Personalized depression risk can then be predicted using the following equation: Base value + ∑ (SHAP value feature × feature value). Base Value: The average model output across the entire dataset before accounting for specific feature contributions. Feature Value: The actual measured value of each feature for an individual.
Mediation of association and network of ECMs to depression by internal proteins
A mediation analysis was used to explore the potential mechanisms between depression and the top 15 features of the RF model. This analysis aimed to identify biochemical mediators that might explain associations between ECMs and depression risk. Specifically, fasting plasma glucose (FPG), hemoglobin A1c (HbA1c), alanine aminotransferase (ALT), aspartate aminotransferase (AST), total bilirubin (TBIL), alkaline phosphatase (ALP), total protein (TP), albumin (ALB), globulin (GLB), creatinine (CRE), uric acid (UA), blood urea nitrogen (BUN), triglycerides (TG), total cholesterol (TC), high-density lipoprotein (HDL), low-density lipoprotein (LDL), and lactate dehydrogenase (LDH) were evaluated as potential mediators in these ECM-depression relationships (Fig. 4A, Supplementary Table 3). To further underscore the relationships between ECMs and these mediators, we conducted a regularized partial correlation network analysis on the mediation scores. This network analysis used a regularization method to manage the high dimensionality and intercorrelation of variables, identifying statistically significant correlations and clustering ECMs within the same category. For example, heavy metals such as lead (Pb), cadmium (Cd), and mercury (Hg) clustered together, demonstrating strong positive correlations. These metals also exhibited strong positive correlations with FPG and negative correlations with blood insulin levels, suggesting potential metabolic pathways underlying the ECM-depression association (Fig. 4B).
A The mediation effects of environmental chemical exposures (ECMs) on depression via various endogenous proteins. The x-axis represents different ECMs, while the y-axis represents the mediation effect, which is quantified as a percentage. Only significant mediation effects with a threshold of P < 0.05 are included. B Mediation network between ECMs and endogenous proteins. The nodes represent ECMs and internal proteins, while the edges (connecting lines) indicate significant mediation pathways. FPG fasting plasma glucose, HbA1c hemoglobin A1c, Alt alanine aminotransferase, AST aspartate aminotransferase, TBIL total bilirubin, ALP alkaline phosphatase, TP total protein, ALB albumin, GLB globulin, CRE creatinine, UA uric acid, BUN blood urea nitrogen, TG triglycerides, TC total cholesterol, HDL high-density lipoprotein, LDL low-density lipoprotein, LDH lactate dehydrogenase.
Discussion
This study examined the associations between ECMs and depression in US adults from the NHANES (2011–2016). By deploying machine learning (ML) models, including Random Forest (RF), Support Vector Machine (SVM), and others, we identified significant ECMs associated with depression and explored underlying mechanisms. The RF model demonstrated superior predictive performance for depression. SHAP analysis identified cadmium, cesium, and 2-hydroxyfluorene as critical predictors, while mediation analysis indicated that systemic inflammation and oxidative stress pathways play essential roles in the ECM-depression relationship.
The univariate logistic regression analysis revealed associations between specific ECMs and depression. Elevated cadmium levels (OR = 2.41, 95% CI: 1.80–3.23) were strongly correlated with an increased risk of depression, corroborating previous studies that cadmium’s neurotoxic effects and its role in inducing oxidative stress and disrupting neurotransmitter functions [48, 49]. Similarly, higher lead levels (OR = 1.21, 95% CI: 1.04–1.42) were associated with an increased risk of depression. This result is consistent with earlier research on lead’s detrimental cognitive and psychological impacts [22, 50]. Conversely, higher mercury levels (OR = 0.79, 95% CI: 0.68–0.92) were associated with a decreased risk of depression. This finding diverges from some previous research emphasizing mercury’s neurotoxic potential [51,52,53]. The discrepancy may result from variations in study populations, mercury exposure levels, and forms of mercury, such as methylmercury versus inorganic mercury, which have distinct neurotoxic effects [54].
SHAP analysis showed cadmium, cesium, and 2-hydroxyfluorene as the most important features in the RF model’s depression predictions. These findings are consistent with the heavy metals to depressive disorders [49, 55]. Cadmium is known to induce oxidative stress and alter neurotransmitter dynamics, thereby contributing to depressive pathology [8]. Although less studied, cesium and 2-hydroxyfluorene may similarly impact neural pathways and mental health outcomes. The RCS analysis provided nuanced insights into the nonlinear relationships between these key ECMs and depression risk. The dose-response relationship for cadmium indicated an escalating risk of depression with increasing exposure, reflecting its cumulative toxicological impact [56]. Similarly, cesium exposure displayed a progressive risk pattern, while the relationship between 2-hydroxyfluorene and depression exhibited complexity, with risk increasing at moderate levels and stabilizing at higher exposures, necessitating further investigation [57].
Mediation analysis identified systemic inflammation and oxidative stress pathways as significant mediators in the ECM-depression nexus. Key inflammatory biomarkers, such as C-reactive protein (CRP) and interleukin-6 (IL-6), were highlighted, underscoring the pivotal role of inflammatory processes in the pathogenesis of depression [58]. These findings are in line with studies emphasizing the impact of environmental toxins on systemic inflammation and mental health outcomes [59]. The regularized partial correlation network analysis revealed strong intra-category associations among ECMs, particularly between lead, cadmium, and mercury. These elements clustered together and exhibited positive correlations with fasting plasma glucose (FPG) and negative correlations with blood insulin levels, suggesting a synergistic effect on metabolic and psychological health [11]. Previous research supports these findings, indicating that heavy metals can disrupt metabolic processes, which in turn can influence mental health [8, 15]. These findings carry important public health implications. Clarifying ECMs as modifiable risk factors for depression highlights potential targets for preventive interventions. Regulatory measures to limit environmental exposure to identified chemicals—particularly cadmium, lead, and cesium—could effectively mitigate depression incidence. Implementation of community-level screening programs designed to identify individuals at heightened exposure risk, coupled with targeted health education initiatives, could further reduce the population burden of depression linked to these environmental factors [60, 61].
Despite these valuable insights, several limitations warrant consideration. First, the ECMs analyzed here represent only a subset of environmental exposures, highlighting the importance of future studies incorporating broader chemical spectra. Second, the cross-sectional nature of NHANES data precludes definitive conclusions regarding causality between ECMs and depression. Third, the assessment of depression was based on symptom scores rather than clinical diagnosis, which may affect the accuracy of our findings. Additionally, some environmental chemicals were excluded due to detection limits, indicating a need for more sensitive detection methods. Finally, potential confounders, such as genetic predispositions and social factors, may not have been fully accounted for, which could influence the results.
To address these limitations and advance understanding of ECM-depression relationships, future research should prioritize prospective cohort designs capable of establishing causal inferences. Methodological advancements in interpretable machine learning, particularly leveraging Shapley Additive Explanations (SHAP), will be critical for enhancing model transparency and clinical translation. Future studies should also expand their scope to include diverse demographic cohorts and varied environmental contexts, thereby strengthening the external validity and translational relevance of findings, ultimately informing precise and targeted preventive strategies in population mental health.
Conclusions
This study harnessed machine learning to uncover significant associations between multiple environmental chemical exposures and depression, with the random forest model outperforming others. Interpretable machine learning using SHAP further identified cadmium, cesium, and 2-hydroxyfluorene as the top risk factors for depression. Mediation analysis illuminated systemic inflammation and oxidative stress as pivotal pathways linking ECMs to depression. Our work underscores the potential of machine learning to inform environmental health policy and intervention. The findings call for public health strategies to mitigate exposure to these chemicals and highlight the need for further research into their mechanistic roles in depression.
Data availability
The raw data from NHANES are available at https://www.cdc.gov/nchs/nhanes/index.htm. Other data during model training and analysis are available upon request. The code and processed data used to support the findings of this study are publicly available at https://github.com/Biolg/NHANES-data-Environmental-Chemical-Exposures.
References
Szücs A, Van Der Lubbe SCC, Arias De La Torre J, Valderas JM, Hay SI, Bisignano C, et al. The epidemiology and burden of ten mental disorders in countries of the association of southeast Asian nations (ASEAN), 1990–2021: findings from the global burden of disease study 2021. Lancet Public Health. 2025;10:e480–91.
Kieling C, Buchweitz C, Caye A, Silvani J, Ameis SH, Brunoni AR, et al. Worldwide prevalence and disability from mental disorders across childhood and adolescence: evidence from the global burden of disease study. JAMA Psychiatry. 2024;81:347.
Simon GE, Moise N, Mohr DC. Management of depression in adults: a review. JAMA. 2024. https://doi.org/10.1001/jama.2024.5756.
Tian R, Ge T, Kweon H, Rocha DB, Lam M, Liu JZ, et al. Whole-exome sequencing in UK biobank reveals rare genetic architecture for depression. Nat Commun. 2024;15:1755.
Zhai X, Tong HHY, Lam CK, Xing A, Sha Y, Luo G, et al. Association and causal mediation between marital status and depression in seven countries. Nat Hum Behav. 2024;8:2392–405.
Li J, Tan Y, Zheng Z, Feng C, Fang W, Huang X et al. Reduced neural suppression at occipital cortex in subthreshold depression. Transl. Psychiatry 2025; 15. https://doi.org/10.1038/s41398-025-03446-9.
McCarron RM, Shapiro B, Rawles J, Luo J. Depression. Ann Intern Med. 2021;174:ITC65–ITC80.
van den Bosch M, Meyer-Lindenberg A. Environmental exposures and depression: biological mechanisms and epidemiological evidence. Annu Rev Public Health. 2019;40:239–59.
Crous-Bou M, Gascon M, Gispert JD, Cirach M, Sánchez-Benavides G, Falcon C, et al. Impact of urban environmental exposures on cognitive performance and brain structure of healthy individuals at risk for alzheimer’s dementia. Environ Int. 2020;138:105546.
Kranzler HR, Davis CN, Feinn R, Jinwala Z, Khan Y, Oikonomou A, et al. Gene × environment effects and mediation involving adverse childhood events, mood and anxiety disorders, and substance dependence. Nat Hum Behav. 2024;8:1–12.
Guo J, Garshick E, Si F, Tang Z, Lian X, Wang Y, et al. Environmental toxicant exposure and depressive symptoms. JAMA Netw Open. 2024;7:e2420259.
Lefèvre-Arbogast S, Chaker J, Mercier F, Barouki R, Coumoul X, Miller GW, et al. Assessing the contribution of the chemical exposome to neurodegenerative disease. Nat Neurosci. 2024;27:812–21.
James AA, OShaughnessy KL. Environmental chemical exposures and mental health outcomes in children: a narrative review of recent literature. Front Toxicol. 2023;5:1290119.
Mallah MA, Changxing L, Mallah MA, Noreen S, Liu Y, Saeed M, et al. Polycyclic aromatic hydrocarbon and its effects on human health: An overeview. Chemosphere. 2022;296:133948.
Jacobson MH, Ghassabian A, Gore AC, Trasande L Exposure to environmental chemicals and perinatal psychopathology. Biochemical pharmacolo 2022; 195. https://doi.org/10.1016/j.bcp.2021.114835.
Meng Q, Mitra S, Del Rosario I, Jerrett M, Janzen C, Devaskar SU, et al. Urinary polycyclic aromatic hydrocarbon metabolites and their association with oxidative stress among pregnant women in Los Angeles. Env Health. 2024;23:68.
Cao L, Wang D, Zhu C, Wang B, Cen X, Chen A, et al. Polycyclic aromatic hydrocarbon exposure and atherosclerotic cardiovascular disease risk in urban adults: the mediating role of oxidatively damaged DNA. Environ Pollut. 2020;265:114860.
Ishitsuka K, Yamamoto-Hanada K, Yang L, Mezawa H, Konishi M, Saito-Abe M, et al. Association between blood lead exposure and mental health in pregnant women: results from the Japan environment and children’s study. NeuroToxicology. 2020;79:191–9.
Nguyen HD, Kim M-S. Interactions between cadmium, lead, mercury, and arsenic and depression: a molecular mechanism involved. J Affect Disord. 2023;327:315–29.
Wu Y, Wu Q, Pan R, Yi W, Li Y, Jin X, et al. Phenotypic aging mediates the association between blood cadmium and depression: a population-based study. Env Sci Pollut Res Int. 2023;30:44304–15.
Gokoel AR, Zijlmans WCWR, Covert HH, Abdoel Wahid F, Shankar A, MacDonald-Ottevanger MS, et al. Influence of prenatal exposure to mercury, perceived stress, and depression on birth outcomes in suriname: results from the mekitamara study. Int J Env Res Public Health. 2020;17:4444.
Stroustrup A, Hsu H-H, Svensson K, Schnaas L, Cantoral A, Solano González M, et al. Toddler temperament and prenatal exposure to lead and maternal depression. Env Health. 2016;15:71.
Mohammad Abu-Taweel G, Al-Fifi Z. Protective effects of curcumin towards anxiety and depression-like behaviors induced mercury chloride. Saudi J Biol Sci. 2021;28:125–34.
Schildroth S, Claus Henn B, Vines AI, Geller RJ, Lovett SM, Coleman CM, et al. Per- and polyfluoroalkyl substances (PFAS), perceived stress, and depressive symptoms in a prospective cohort study of black women. Sci Total Env. 2024;929:172445.
Yi W, Xuan L, Zakaly HMH, Markovic V, Miszczyk J, Guan H, et al. Association between per- and polyfluoroalkyl substances (PFAS) and depression in U.S. adults: a cross-sectional study of NHANES from 2005–2018. Environ Res 2023; 238:117188.
Roberts H. Multiple environmental exposures along daily mobility paths and depressive symptoms: a smartphone-based tracking study. Environ. Int 2021;156:106635.
Hernandez-Castro I, Eckel SP, Howe CG, Aung MT, Kannan K, Robinson M, et al. Organophosphate ester flame retardant chemicals and maternal depression during pregnancy. Environ Res. 2024;259:119581.
Jacobson MH, Hamra GB, Monk C, Crum RM, Upadhyaya S, Avalos LA, et al. Prenatal exposure to nonpersistent environmental chemicals and postpartum depression. JAMA Psychiatry. 2024;81:67.
Singh AV, Bhardwaj P, Laux P, Pradeep P, Busse M, Luch A, et al. AI and ML-based risk assessment of chemicals: predicting carcinogenic risk from chemical-induced genomic instability. Front Toxicol. 2024;6:1461587.
Petrick LM, Shomron N. AI/ML-driven advances in untargeted metabolomics and exposomics for biomedical applications. Cell Rep. Phys Sci. 2022;3:100978.
Basant N, Gupta S, Singh KP. Predicting the acute neurotoxicity of diverse organic solvents using probabilistic neural networks based QSTR modeling approaches. NeuroToxicology. 2016;53:45–52.
Hao Y, Duan Z, Liu L, Xue Q, Pan W, Liu X, et al. Development of an interpretable machine learning model for neurotoxicity prediction of environmentally related compounds. Env Sci Technol. 2025;59:11108–20.
Zhang L, Yao T, Luo J, Yi H, Han X, Pan W, et al. ChemNTP: advanced prediction of neurotoxicity targets for environmental chemicals using a siamese neural network. Env Sci Technol. 2024;58:22646–56.
Reuben A, Manczak EM, Cabrera LY, Alegria M, Bucher ML, Freeman EC, et al. The interplay of environmental exposures and mental health: setting an agenda. Env Health Perspect. 2022;130:025001.
Zhang F, Wang Z. Peijnenburg WJGM, Vijver MG. Machine learning-driven QSAR models for predicting the mixture toxicity of nanoparticles. Env Int. 2023;177:108025.
Lee BK, Mayhew EJ, Sanchez-Lengeling B, Wei JN, Qian WW, Little KA, et al. A principal odor map unifies diverse tasks in olfactory perception. Science. 2023;381:999–1006.
Chen T-C, Parker JD, Clark J, Shin H-C, Rammon JR, Burt VL National health and nutrition examination survey: estimation procedures, 2011-2014. Vital Health Stat 2 2018; 1–26.
Patel UJ, Godecker AL, Giles DL, Brown HW. Updated prevalence of urinary incontinence in women: 2015-2018 national population-based survey. Data Female Pelvic Med Reconstr Surg. 2022;28:181–7.
Negeri ZF, Levis B, Sun Y, He C, Krishnan A, Wu Y, et al. BMJ_PHQ9: updated systematic review and individual participant data meta-analysis. BMJ. 2021;375:n2183.
Zhang Y, Dong T, Hu W, Wang X, Xu B, Lin Z, et al. Association between exposure to a mixture of phenols, pesticides, and phthalates and obesity: comparison of three statistical models. Env Int. 2019;123:325–36.
Barr DB, Wilder LC, Caudill SP, Gonzalez AJ, Needham LL, Pirkle JL. Urinary creatinine concentrations in the U.S. population: implications for urinary biologic monitoring measurements. Env Health Perspect. 2005;113:192–200.
Sanavia T, Aiolli F, Da San Martino G, Bisognin A, Di Camillo B. Improving biomarker list stability by integration of biological knowledge in the learning process. BMC Bioinforma. 2012;13:S22.
Lee Y, Cappellato M, Di Camillo B. Machine learning-based feature selection to search stable microbial biomarkers: application to inflammatory bowel disease. Gigascience. 2022;12:giad083.
Sarker IH Deep Learning: A Comprehensive Overview on Techniques, Taxonomy, Applications and Research Directions. Sn Comput. Sci. 2021; 2. https://doi.org/10.1007/s42979-021-00815-1.
Sheridan RP, Wang WM, Liaw A, Ma J, Gifford EM. Extreme gradient boosting as a method for quantitative structure–activity relationships. J Chem Inf Model. 2016;56:2353–60.
Luna JM, Gennatas ED, Ungar LH, Eaton E, Diffenderfer ES, Jensen ST, et al. Building more accurate decision trees with the additive tree. Proc Natl Acad Sci USA. 2019;116:19887–93.
Nordin N, Zainol Z, Mohd Noor MH, Chan LF. An explainable predictive model for suicide attempt risk using an ensemble learning and shapley additive explanations (SHAP) approach. Asian J Psychiatr. 2023;79:103316.
Wu Y, Song J, Zhang Q, Yan S, Sun X, Yi W, et al. Association between organophosphorus pesticide exposure and depression risk in adults: a cross-sectional study with NHANES data. Env Pollut. 2023;316:120445.
Borroni E, Pesatori AC, Bollati V, Buoli M, Carugno M. Air pollution exposure and depression: a comprehensive updated systematic review and meta-analysis. Environ Pollut. 2022;292:118245.
Zhou R, Huang C, Bi N, Li L, Li C, Gu X, et al. Chronic pb exposure induces anxiety and depression-like behaviors in mice via excitatory neuronal hyperexcitability in ventral hippocampal dentate gyrus. Env Sci Technol. 2023;57:12222–33.
Kim KW, Sreeja SR, Kwon M, Yu YL, Kim MK. Association of blood mercury level with the risk of depression according to fish intake level in the general korean population: findings from the korean national health and nutrition examination survey (KNHANES) 2008-2013. Nutrients. 2020;12:189.
Luz DA, Cartágenes S, de C, da Silveira CCS, de M, Pinheiro BG, et al. Methylmercury plus ethanol exposure: how much does this combination affect emotionality?. Int J Mol Sci. 2021;22:13131.
Ng THH, Mossey JM, Lee BK. Total blood mercury levels and depression among adults in the United States: national health and nutrition examination survey 2005-2008. PLoS One. 2013;8:e79339.
Tang L, Liu M, Tian J. Volatile organic compounds exposure associated with depression among U.S. adults: results from NHANES 2011–2020. Chemosphere. 2024;349:140690.
Fu Z, Liu Q, Liang J, Weng Z, Li W, Xu J, et al. Air pollution, genetic factors and the risk of depression. Sci Total Environ. 2022;850:158001.
Choi KW, Stein MB, Nishimi KM, Ge T, Coleman JRI, Chen C-Y, et al. An exposure-wide and mendelian randomization approach to identifying modifiable factors for the prevention of depression. AJP. 2020;177:944–54.
Duman RS, Sanacora G, Krystal JH. Altered connectivity in depression: GABA and glutamate neurotransmitter deficits and reversal by novel treatments. Neuron. 2019;102:75–90.
Okekunle AP, Asowata JO, Lee JE, Akpa OM. Association of environmental tobacco smoke exposure with depression among non-smoking adults. BMC Public Health. 2021;21:1755.
Sun Y, Headon KS, Jiao A, Slezak JM, Avila CC, Chiu VY, et al. Association of antepartum and postpartum air pollution exposure with postpartum depression in southern California. JAMA Netw Open. 2023;6:e2338315.
Tang H, Miri Rekavandi A, Rooprai D, Dwivedi G, Sanfilippo FM, Boussaid F, et al. Analysis and evaluation of explainable artificial intelligence on suicide risk assessment. Sci Rep. 2024;14:6163.
Ukachukwu M, Uzoamaka N, Elochukwu N. Application of Machine Learning to Air Pollution Studies: A Systematic Review. J Energy Res Rev 2023;15:1–11.
Funding
This research was funded by The Science and Technology Development Funds (FDCT) of Macao (0033/2023/RIB2), and a grant from Macao Polytechnic University (RP/FCA-14/2023) under the submission approval ID [fca.da7e.915b.9].
Author information
Authors and Affiliations
Contributions
GL, WX, YS, and X Zhao were responsible for investigation, methodology, validation, and writing the original draft. X Zhai handled the investigation, validation, and formal analysis. ZL and WM developed the software used in the study. HP provided conceptualization. JLi and JJi were responsible for data curation. KLi and LiY were involved in conceptualization, design, and manuscript review, and provided funding support. All authors reviewed and approved the final manuscript.
Corresponding authors
Ethics declarations
Competing interests
The authors declare no competing interests.
Ethics approval and consent to participate
This study was approved by the Institutional Review Board (IRB) (Approval ID: MPU-FCA-08-12-23) and conformed to the World Medical Association Declaration of Helsinki—Ethical Principles for Medical Research Involving Human Subjects. The informed written consent from the participants was waived due to the use of deidentified data from publicly available databases.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License, which permits any non-commercial use, sharing, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if you modified the licensed material. You do not have permission under this licence to share adapted material derived from this article or parts of it. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by-nc-nd/4.0/.
About this article
Cite this article
Luo, G., Xu, W., Sha, Y. et al. An interpretable machine learning model predicts the interactive and cumulative risks of different environmental chemical exposures on depression. Transl Psychiatry 15, 450 (2025). https://doi.org/10.1038/s41398-025-03651-6
Received:
Revised:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41398-025-03651-6



