Introduction
Obesity and major depressive disorder (MDD) represent two of the most pressing public health challenges worldwide, with profound socioeconomic consequences. Globally, 890 million people worldwide were living with obesity, representing ~16% of the global population (World Health Organization, 2024), with rates exceeding 40% in countries like the United States and several Pacific Island nations (GBD 2021 Adult BMI Collaborators, 2025). Concurrently, MDD afflicts ~5% of the world’s population annually, with a lifetime prevalence of 11–15% across different regions (Bromet et al., Reference Bromet, Andrade, Hwang, Sampson, Alonso, de Girolamo and Kessler2011). As leading drivers of global morbidity and mortality, high body mass index (BMI) and MDD collectively account for ~160 million DALYs worldwide, alongside an immense economic burden (GBD 2019 Mental Disorders Collaborators, 2022; Xie et al., Reference Xie, Xiong, Yang, Yan, Shen, Qin and Sun2025). Epidemiological evidence consistently demonstrates that obesity significantly increases MDD risk, with meta-analyses indicating obese individuals face 1.2–1.6 times higher odds of developing MDD compared to normal-weight counterparts (Luppino et al., Reference Luppino, de Wit, Bouvy, Stijnen, Cuijpers, Penninx and Zitman2010; Mannan, Mamun, Doi, & Clavarino, Reference Mannan, Mamun, Doi and Clavarino2016; Pereira-Miranda et al., Reference Pereira-Miranda, Costa, Queiroz, Pereira-Santos and Santana2017). When these conditions co-occur, patients experience worse health outcomes, treatment resistance to both conditions, substantially reduced quality of life, and an increased risk of premature mortality, with psychological distress explaining up to 10% of this obesity-related mortality risk (Putra et al., Reference Putra, Daly, Sutin, Steptoe and Robinson2023). This detrimental synergy creates an urgent need for early identification of at-risk obese individuals, as timely intervention could significantly reduce the compounded burden on global healthcare systems and improve patient outcomes.
Despite growing recognition of the obesity-MDD link, current predictive approaches for MDD remain inadequate for obese populations. Existing prediction models primarily rely on psychological factors, sociodemographic variables, and general biomarkers developed for the broader population (Ma et al., Reference Ma, Xie, Deng, Wang, Xiang, Yao, Kang, Xu, Wang, Wang, Yang and Liu2024; Meng, Speier, Ong, & Arnold, Reference Meng, Speier, Ong and Arnold2021; Radford-Smith et al., Reference Radford-Smith, Anthony, Benz, Grist, Lyman, Miller and Probert2023). Recent efforts have incorporated genetic-risk scores, inflammatory markers (C-reactive protein and apolipoproteins), and basic metabolic indicators, achieving moderate predictive performance (AUCs: 0.66–0.72) in general populations (Radford-Smith et al., Reference Radford-Smith, Anthony, Benz, Grist, Lyman, Miller and Probert2023; Wang et al., Reference Wang, Liu, Zhang, Zhang, Du, Huang and Shen2017). However, these models overlook the unique metabolic landscape of obesity, which fundamentally alters the biological pathways potentially leading to MDD. Most studies have assumed a uniform obesity–MDD association, failing to account for the considerable metabolic heterogeneity among obese individuals. For example, metabolically healthy obese persons may differ significantly from those with dysregulated profiles (Jokela et al., Reference Jokela, Hamer, Singh-Manoux, Batty and Kivimäki2014), rendering general models less applicable. Moreover, previous studies are often limited by small sample sizes, short follow-up periods, and a lack of validation in independent cohorts, while the absence of causal inference frameworks further hinders mechanistic insights, underscoring the need for obesity-specific predictive tools.
Investigating metabolic stratification in obesity is crucial for improving the prediction of MDD risk, due to the complex interplay between these conditions. The complex relationship between obesity and MDD extends beyond simple weight metrics, with bidirectional interactions through multiple physiological pathways. Chronic inflammation, hypothalamic–pituitary–adrenal axis dysregulation, insulin resistance, and altered gut microbiota have all been implicated in this relationship (Milaneschi, Simmons, van Rossum, & Penninx, Reference Milaneschi, Simmons, van Rossum and Penninx2019). Crucially, these mechanisms vary substantially among obese individuals, challenging the outdated view of obesity as a metabolically homogeneous condition. Recent research has identified distinct metabolic phenotypes within obesity, ranging from metabolically healthy to severely dysregulated profiles – that may differentially influence MDD vulnerability (Brandão, Martins, & Monteiro, Reference Brandão, Martins and Monteiro2020). Traditional clinical criteria for metabolically healthy/unhealthy obesity, however, were developed for cardiometabolic outcomes and may inadequately capture neural and psychological risk factors. Blood metabolomics offers a particularly promising approach by providing comprehensive metabolic signatures that reflect both systemic processes and brain-specific pathways relevant to mood regulation (Pan et al., Reference Pan, Sha, Zhai, Luo, Xu, Meng and Li2025). This method captures thousands of small molecules representing diverse biological processes, potentially identifying novel predictive markers and therapeutic targets overlooked by conventional clinical measures or isolated biomarkers (Meng et al., Reference Meng, Pan, Sha, Zhai, Xing, Lingampelly, Sripathi, Wang and Li2024).
To address these critical gaps, our study challenges the longstanding assumption of uniform obesity–MDD associations by investigating baseline metabolic profiles as a key determinant for MDD risk stratification in obese individuals. We aimed to identify specific metabolic biomarkers that effectively stratify MDD risk and develop a robust prediction model tailored specifically for obese populations. Our approach leverages the UK Biobank (UKB)’s large European cohort, following 41,459 obese individuals for a median of 14.4 years, substantially longer than previous studies. We integrate comprehensive metabolomics data with various advanced machine learning (ML) techniques, including restricted cubic splines and mutual information analysis, to capture nonlinear relationships between metabolites and MDD. Crucially, we investigate causal pathways through mediation Mendelian randomization (MR) using large-scale European GWAS datasets and validate our findings on a temporal subset. This predictive model enables MDD risk stratification in obesity up to 9 years pre-diagnosis. Crucially, the identified metabolic mediators elucidate the obesity-MDD link and provide concrete targets for early intervention.
Methods
Data source and study sample
This was a prospective cohort and blood metabolomic study using data from UKB, a large-scale, long-term biomedical database of over half a million individuals aged 40–69 years from across the United Kingdom between 2006 and 2010. The reporting of this study adheres to the Transparent Reporting of a multivariable prediction model for Individual Prognosis Or Diagnosis (TRIPOD) statement, specifically the TRIPOD-AI extension for ML-based prediction models (Collins et al., Reference Collins, Moons, Dhiman, Riley, Beam, Van Calster and Logullo2024). At baseline, participants provided detailed information on their demographics, lifestyle factors, medical history, and family history through questionnaires and interviews. Biological samples, including blood, urine, and saliva, were also collected for biochemical and genetic analyses (Bycroft et al., Reference Bycroft, Freeman, Petkova, Band, Elliott, Sharp and Marchini2018).
Our study used the 2006–2010 survey as the baseline, including a total of 502,355 UKB participants. While metabolic biomarkers were available for a randomly selected subset of ~300,000 participants, we sequentially excluded individuals from the total population. First, we excluded nonobese participants and those with missing data on BMI (n = 380,176). Subsequently, we excluded those with missing data on metabolic biomarkers (n = 56,636), those with missing data on MDD or having MDD at baseline (n = 7,273), and those with missing data on demographic characteristics at baseline (n = 16,811). Finally, 41,459 obese participants were included in the analyses (Figure 1). The UKB has generic ethical approval from the Northwest Multi-center Research Ethics Committee (Ref: 11/NW/0382). For this study, data from the UKB resource were accessed under the application number 99946. All study participants provided informed consent.
The flow chart of this study.

Figure 1. Long description
The top section is a vertical flowchart showing participant attrition. It begins with All participants n equals 502,355. An arrow points to an exclusion box for Missing B M I n equals 3,302, Non-obese participants n equals 376,874, and Missing metabolic biomarkers n equals 56,636. This leaves All participants n equals 65,543. A second exclusion box removes Missing M D D and M D D at baseline n equals 7,273, leaving All participants n equals 58,270. A third exclusion box removes Missing demographic characteristics n equals 16,811, resulting in All participants in the final analysis n equals 41,459. Below this, a timeline arrow moves from left to right. At the Baseline 2006 to 2010 year mark, a group of icons represents individuals with obesity being tested for Blood Metabolites. The timeline continues through a Median follow-up period of 14.4 years to the Outcome Year. At this stage, a second group of icons shows some individuals shaded in dark red, labeled as M D D, corresponding to I C D 10 codes F 32.0-9 and F 33.0-9.
Definition of major depressive disorder
MDD phenotypes were ascertained using hospital inpatient records from Hospital Episode Statistics for England, Scottish Morbidity Record data for Scotland, Patient Episode Database for Wales (Zhao et al., Reference Zhao, Yang, Sahakian, Langley, Zhang, Kuo and Cheng2023), and the online Patient Health Questionnaire (PHQ)-9 (Davis et al., Reference Davis, Coleman, Adams, Allen, Breen, Cullen and Hotopf2020). Diagnoses were recorded according to the International Classification of Diseases (ICD-10) system codes, including depressive episode (F32.0–9) and recurrent depressive disorder (F33.0–9).
Definition of obesity
BMI is a commonly used index to classify obesity in adults, and obesity was defined as a BMI ≥ 30 (kg/m2), according to the World Health Organization (WHO) definition (World Health Organization, 2021). The formula utilized for BMI calculation is as follows:
Blood metabolic measurements
The UKB blood sample collection was undertaken at baseline in 22 local assessment centers across the United Kingdom between 2006 and 2010. The blood sample handling, storage, and experimental protocol have been previously described (Buergel et al., Reference Buergel, Steinfeldt, Ruyoga, Pietzner, Bizzarri, Vojinovic and Landmesser2022; Julkunen et al., Reference Julkunen, Cichońska, Tiainen, Koskela, Nybo, Mäkelä and Würtz2023). Concentrations of 279 blood metabolomic biomarkers were measured in a randomly selected subset of ~300,000 participants. Specifically, 30 biomarkers were measured from blood samples by clinical chemistry. Furthermore, plasma samples were collected and subjected to NMR-based metabolome profiling at baseline (Nightingale Health, Helsinki, Finland), yielding 249 metabolomic biomarkers (107 non-derived metabolites, 61 composite metabolites, and 81 ratio parameters) (Pan et al., Reference Pan, Sha, Zhai, Luo, Xu, Meng and Li2025). Blood metabolite levels were preprocessed using log-transformation. Biomarkers with more than 20% missing data were excluded. For the remaining biomarkers, missing values were handled using multiple imputation, resulting in a final set of 260 biomarkers included in the study (Supplementary Tables S1–S3).
Covariates
Age, sex, education level, race/ethnicity, Townsend deprivation index (TDI), activity metabolic equivalent task (defining low, medium, and high levels by aMET tertiles), sleep duration, fruit consumption, vegetable consumption, meat consumption, taking prescription medications (TPM), alcohol consumption, smoking status, cardiovascular disease (CVD), diabetes hypertension, and cancer were collected using standardized questionnaires and examination protocols during interviews (Allen et al., Reference Allen, Lacey, Lawlor, Pell, Gallacher, Smeeth and Collins2024). Alcohol consumption was categorized as never, previous, and current. Smoking status was classified as never, previous, and current. Histories of diabetes mellitus, hypertension, cancer, and cardiovascular disease were obtained through self-reported or prior medical diagnoses (ICD-10).
Machine learning model training and evaluation
The data from the derivation cohort comprising UKB were divided, with 90% utilized for training and 10% for internal validation, with model selection based on repeated undersampling and averaged metrics.
Missing data were handled using the Multiple Imputation by Chained Equations algorithm (Austin, White, Lee, & van Buuren, Reference Austin, White, Lee and van Buuren2021). The imputation models incorporated all 260 selected metabolites, demographic covariates, and the MDD outcome to ensure the preservation of the underlying data structure and complex relationships without introducing target leakage. To systematically select features for our predictive models, we employed a sequential analytical pipeline. First, we used restricted cubic splines (RCS) as an initial screening tool to assess the comprehensive dose–response associations between all 260 metabolites and MDD risk, which filtered out metabolites with no significant relationship to MDD. Second, building on the subset of metabolites identified by RCS, we applied mutual information (MI) analysis and point-biserial correlation (PBC) analysis in parallel to further evaluate their predictive dependencies with the binary MDD outcome. These two methods are highly complementary. Specifically, PBC captures the strength and direction of linear associations between continuous metabolite levels and MDD, whereas MI is sensitive to complex, nonlinear dependencies that linear correlation metrics might miss. Finally, by cross-comparing and integrating the top-ranked features from both MI and PBC, we identified a robust and prioritized set of metabolites. This combined approach ensures that both linear and nonlinear predictive signals are captured, providing a robust basis for developing the subsequent ML predictive models. We then constructed 14 predictive models based on the biomarkers identified through both methodologies, namely, Light Gradient Boosting Machine (LightGBM), Extreme Gradient Boosting (XGBoost), Random Forest Classifier (RF), Extremely Randomized Trees Classifier (ET), Gaussian Naive Bayes (GaussianNB), Logistic Regression (LR), k-Nearest Neighbors (KNN), Nu-Support Vector Classification (NuSVC), Quadratic Discriminant Analysis (QDA), Calibrated Classifier with Cross-Validation (CalibratedClassifierCV), Bagging Classifier (Bagging), Support Vector Machine (SVM), Decision Tree Classifier (DT), and Multi-Layer Perceptron (MLP) were used to predict MDD in obese individuals.
Several commonly used evaluation indices, such as area under the receiver operating characteristic (ROC) curve (AUC), accuracy, precision, recall, F1 score, calibration curves, and decision curve analysis (DCA), were used to evaluate the reliability of 14 models.
Furthermore, to evaluate the generalizability of the model, we conducted a temporal validation using data from the UKB repeat assessment phase (2012–2013). This independent validation set comprised 2,330 participants with obesity, with an MDD prevalence of 4.2%. The inclusion and exclusion criteria were identical to those applied to the primary derivation cohort. To ensure robust performance estimation, we employed bootstrap sampling during the evaluation process.
Feature selection and model explanation
Achieving interpretability in ML models is indeed a significant challenge, particularly as models grow more complex. The SHapley Additive exPlanations (SHAP) method is an approach that could rank the importance of input features and explain the results of the prediction model, and it is implemented to overcome the ‘black-box’ issue (Yi, Sun, & Wu, Reference Yi, Sun and Wu2024). The SHAP method offers global and local explanations for the model. The global explanation could give consistent and accurate attribution values for each feature within a model to show the associations between input features and MDD. The local explanation could demonstrate a specific prediction for an obese individual by inputting the specific data. Overall, the SHAP method provides a robust framework for understanding feature importance and clarifying the predictions made by these models.
Two-step Mendelian randomization framework for causal mediation analysis
Causal mediation analysis with MR was performed using the R packages ‘TwoSampleMR (version 0.5.7)’ and ‘Mendelian Randomization (v0.9.0)’. We employed a two-step Mendelian Randomization framework (Carter et al., Reference Carter, Sanderson, Hammerton, Richmond, Davey Smith, Heron and Howe2021) to investigate whether selected metabolic biomarkers mediate the causal pathway between BMI and MDD. We used ‘BMI’ (GWAS ID: ukb-b-19953 and ukb-b-2303) as the exposure variable, and ‘selected metabolic biomarkers’ were used as mediator variables. The main outcomes include ‘Major Depressive Disorder (GWAS ID: ebi-a-GCST005904, ebi-a-GCST009979)’, ‘Major depressive disorder in trauma exposed individuals (GWAS ID: ebi-a-GCST009980)’, and ‘Depression (GWAS ID: finn-b-F5_DEPRESSIO)’. The GWAS summary data were obtained from the IEU GWAS database (https://gwas.mrcieu.ac.uk/). Details of the exposure, mediators, and outcomes are presented in Supplementary Table S4. Lead SNPs significantly associated with the exposure traits were extracted from the GWAS summary data at genome-wide significance (P < 5 × 10−7) and selected as instrumental variables (IVs). IVs were pruned for linkage disequilibrium (r 2 < 0.001, distance 10,000 kb) and filtered for F > 10 (Supplementary Tables S5–S13). Causal estimates for the exposure-mediator, mediator-outcome, and exposure-outcome relationships were generated using inverse-variance weighted (IVW) analysis. The indirect effect (the mediation pathway) was estimated using the product of coefficients method (VanderWeele, Reference VanderWeele2016). Standard errors for the indirect effect were derived using the Delta method (Carter et al., Reference Carter, Gill, Davies, Taylor, Tillmann, Vaucher and Dehghan2019). Finally, the proportion mediated was calculated by dividing the indirect effect by the total effect.
Statistical analysis
We provided descriptive statistics for the baseline characteristics of the study population. Categorical variables were expressed as numbers and proportions, while continuous variables were reported as mean and standard deviation (mean ± SD).
We utilized RCS to assess the dose–response relationships between 260 blood metabolites and the future development of MDD. Mutual information analysis and point-biserial correlation analysis were further employed to screen potential features from meaningful metabolites obtained based on RCS. Pearson correlation analysis was used to examine intra-group correlations of metabolites. Additionally, pathway enrichment analysis was conducted using the MetaboAnalyst 6.0 platform ( https://dev.metaboanalyst.ca/home.xhtml ), utilizing its comprehensive functional databases (comprising 15 libraries with ~13,000 biologically meaningful metabolite sets) to reveal the biological pathways associated with the specific metabolites (FDR-adjusted P < 0.05).
Additionally, ML techniques were used to develop predictive models for identifying obese individuals at high risk of developing MDD based on accuracy, precision, recall, F1 score, and ROC curve. Fourteen widely used supervised learning algorithms were evaluated based on model hyperparameters, tuning procedures, and the training, validation, and testing protocols used to ensure robust and unbiased performance evaluation. Additionally, to assess the specificity of the metabolites identified in predicting future MDD in obese individuals, our predictive model was compared to models developed using biomarkers identified in previous studies conducted in the general population (Ma et al., Reference Ma, Xie, Deng, Wang, Xiang, Yao, Kang, Xu, Wang, Wang, Yang and Liu2024; Radford-Smith et al., Reference Radford-Smith, Anthony, Benz, Grist, Lyman, Miller and Probert2023).
Finally, causal mediation analysis with MR was performed to validate the robustness of the results from ML techniques, using BMI, metabolites, and MDD data obtained from the IEU GWAS database as exposure, mediators, and outcome, respectively.
All analyses were conducted using SAS software version 9.4, R version 4.4.2, Jupyter Notebook 6.5.4, or GraphPad Prism 9.0, unless specified. A two-sided P < 0.05 was considered statistically significant.
Results
Subject participation
A total of 41,459 participants (mean age 56.7 ± 7.9 years) were included in the study. Participants were classified into MDD and non-MDD groups. The MDD group had a lower mean age (56.1 ± 8.1 years) compared to the non-MDD group (56.8 ± 7.9 years), with different education levels. Males made up 51.6% of the total, but only 40.0% in the MDD group. Most participants identified as British (89.0%), with no significant ethnic differences (P = 0.625). MDD individuals had higher rates of current smoking (13.7% vs. 8.6%), while current drinkers were fewer (85.3% vs. 91.9%). Moreover, there was little difference in eating habits, except for meat intake (P < 0.001).
Sleep duration was slightly less for MDD participants (7.0 ± 1.4 hours) versus non-MDD (7.1 ± 1.1 hours). Medical history revealed that MDD participants had higher rates of CVD (12.4% vs. 8.3%), cancer (8.6% vs. 7.3%), hypertension (39.8% vs. 36.2%), and diabetes (16.4% vs. 10.9%), and used more prescription medications (73.2% vs. 52.2%). More details are in Table 1.
Demographic characteristics of the study population

Table 1. Long description
The table contains five columns: Characteristics, Total (N = 41,459), M D D Yes, M D D No, and P-value. Key data points include:
* Age: Mean 56.7 plus or minus 7.9 for the total group.
* Sex: 51.6 percent of the total population is male, but only 40.0 percent of the M D D Yes group is male.
* Race/ethnicity: Predominantly British at 89.0 percent across all groups (P = 0.625).
* Education: High levels of education are most common in the M D D No group (42.2 percent) compared to the M D D Yes group (34.4 percent).
* T D I (Townsend Deprivation Index): Median is -1.9 for the total group; the M D D Yes group shows higher deprivation with a median of -0.9.
* Alcohol and Smoking: 91.4 percent are current drinkers and 50.8 percent are never smokers. Current smoking is higher in the M D D Yes group (13.7 percent) than the M D D No group (8.6 percent).
* Diet: Median vegetable intake is 3.0 tablespoons per day and fruit intake is 2.0 pieces per day for both groups.
* Physical Activity: Summed a M E T levels show 50.3 percent of the M D D Yes group have moderate levels compared to 31.5 percent in the M D D No group.
* Health History: The M D D Yes group shows higher prevalence of T P M (73.2 percent vs 52.2 percent), C V D (12.4 percent vs 8.3 percent), Cancer (8.6 percent vs 7.3 percent), Hypertension (39.8 percent vs 36.2 percent), and Diabetes (16.4 percent vs 10.9 percent). All health history differences have P-values less than 0.001.
Unique metabolomic features in the blood of obese participants with future MDD
During a median follow-up period of 14.4 years, a total of 3,642 incident cases of MDD were documented among 41,459 obese individuals. Notably, the volcano plot preliminarily indicated potential metabolic differences between MDD and non-MDD individuals in the obese population (Figure 2a). Moreover, we further observed significant dose–response relationships between 99 metabolites and MDD in the RCS analyses (Supplementary Table S14).
Metabolic profiling and pathway enrichment analysis for predicting MDD risk in obese individuals. (A) Volcano plot illustrating significant metabolic differences between individuals with MDD and non-MDD in the obese population, highlighting 260 metabolites. (B) Integrate key features of developing MDD predictive models. The diamonds represent the 29 metabolites and demographic characteristics selected for developing predictive models. The intersecting diamond show the shared features of mutual information analysis and point-biserial correlation analysis. (C) Heatmap showing Pearson correlation among 14 metabolites selected from part B. (D) Enrichment analysis revealing key metabolic alterations and pathways associated with the identified metabolites, focusing on the top 25 enriched pathways.

Figure 2. Long description
The figure consists of four panels labeled A through D.
Panel A: A volcano plot showing Log sub 2 Fold Change on the x-axis from minus 0.04 to 0.04 and minus Log sub 10 P-value on the y-axis from 0 to 18. Data points are categorized by status: green for Down, blue for N S, and purple for Up. A horizontal dashed red line indicates the significance threshold.
Panel B: A dual radial network diagram. On the left, a blue central node labeled Point-biserial Correlation connects to various metabolites including D H A / T F A, Omega-3 / T F A, and Glyc A. On the right, an orange central node labeled Mutual Information connects to clinical factors like Age, Hypertension, and Education. Several central labels like Sex, Smoking, and Diabetes are shared between the two networks.
Panel C: A clustered correlation heatmap with a color scale from blue (minus 1.0) to red (1.0). The x and y axes list 15 metabolites including C T L I D L p, P U F A / M U F A, and T G T L M L D L p. Dendrograms on the top and left indicate hierarchical clustering, showing strong positive correlation blocks in red along the diagonal.
Panel D: A dot plot titled Overview of Enriched Metabolite Sets (Top 25). The y-axis lists biological pathways such as Synthesis, secretion, and inactivation of Glucagon-like Peptide-1 (G L P-1). The x-axis shows minus Log sub 10 P-value from 6 to 20. Dot size represents Enrichment Ratio (25 to 125), and color represents P-value from yellow (1.5e-05) to dark red (0.0e+00). The top-ranked pathway has the highest enrichment ratio and lowest P-value.
Then, mutual information analysis and point-biserial correlation analysis were further utilized to screen specific features from general information and 99 metabolites, and the top 20 features were cross-compared, leading to the identification of 14 metabolites for developing of predictive models (Figure 2b), including glucose, proteins (albumin and glycoprotein acetyls [GlycA]), fatty acids (omega-3 fatty acids to total fatty acids percentage (Omega-3/TFA), degree of unsaturation (DU), docosahexaenoic acid to total fatty acids percentage (DHA/TFA), monounsaturated fatty acids to total fatty acids percentage (MUFA/TFA), polyunsaturated fatty acids to total fatty acids percentage (PUFA/TFA), polyunsaturated fatty acids to monounsaturated fatty acids ratio (PUFA/MUFA), and lipids (triglycerides to total lipids in large LDL percentage [TGTLLLDLp], cholesterol to total lipids in IDL percentage [CTLIDLp], triglycerides to total lipids in medium LDL percentage [TGTLMLDLp], total lipids in VLDL [TLVLDL], and free cholesterol in small HDL [FCSHDL]). While Supplementary Figure S1 indicated the risk trends for MDD associated with these metabolic biomarkers and identified thresholds that distinguish high- from low-risk groups, some of which have relatively high correlations with each other (Figure 2c).
Furthermore, enrichment analysis underscored the dominance of metabolite alterations in shaping the metabolic profiles of participants destined to develop MDD, including regulation of hormone metabolism, gene expression and signaling, biological transcription and regulation, cell biogenesis, and small molecule biochemistry (P < 0.001) (Figure 2d). Notably, our analysis identified three major disrupted metabolic pathways: the synthesis, secretion, and inactivation of glucagon-like peptide-1 (GLP-1) and incretin, as well as α-Linolenic acid metabolism.
Developing models for early prediction of future MDD among obese individuals
Next, we developed predictive models for 3-, 5-, and 9-year MDD risks based on the 14 identified metabolites and demographic features. A total of 14 different ML algorithms were evaluated. To assess model robustness and account for variance, each algorithm underwent 10 independent training and testing iterations, from which the average AUC, accuracy, precision, recall, and F1 score were derived. Among all models, LightGBM consistently outperformed others across all prediction time frames, demonstrating the best predictive performance. For the 3-, 5-, and 9-year predictions, LightGBM achieved average AUCs of 0.810, 0.787, and 0.806, respectively, with consistently strong results for accuracy, precision, recall, and F1 scores (Figure 3a).
Comparison of 14 machine learning models and highlighting the superior performance of LightGBM in predicting long-term MDD risk. (A) Heatmap visualization of 14 model performance metrics for 3 - year, 5 - year, and 9 - year predictions for developing MDD. Rows represent machine learning models, and columns correspond to performance metrics: AUC, F1 score, recall, precision, and accuracy. Metrics are color-coded, with red indicating higher values and green indicating lower values. (B) ROC curves for 3 - year (red), 5 - year (blue), and 9 - year (green) LightGBM predictions of MDD risk. The x - axis represents the false positive rate, while the y - axis represents the true positive rate. (C) Comparative analysis of precision, accuracy, recall, and F1 score across the 3 - year, 5 - year, and 9 - year LightGBM predictions of MDD risk. Bubble size represents the magnitude of each metric, with larger bubbles indicating higher values. Performance metrics demonstrate slight variation across time horizons, with the highest values generally observed in short-term predictions (3-year).

Figure 3. Long description
Panel A is a radial diagram divided into three segments for 3-Years, 5-Years, and 9-Years. At the center of each segment is a dark grey arc. Moving outward, five concentric rings represent performance metrics: Accuracy, Precision, Recall, F 1 score, and A U C. The rings are color-coded from green 0.50 to red 0.82. Models labeled on the outer perimeter include LightGBM, XGBoost, R F, E T, G N B, L R, K N N, NuSVC, Q D A, C C V, Bagging, S V M, D T, and M L P.
Panel B is a line graph showing the Receiver Operating Characteristic curve. The X-axis is False Positive Rate from 0.0 to 1.0, and the Y-axis is True Positive Rate from 0.0 to 1.0. Three curves represent 3-year prediction A U C equals 0.844, 5-year prediction A U C equals 0.824, and 9-year prediction A U C equals 0.834. A diagonal dashed line represents random chance.
Panel C is a bubble chart grid comparing Precision, Accuracy, Recall, and F 1 Score across the three time intervals. Bubbles are sized and colored by value on a scale from 0.4 blue to 1.0 red. For the 3-year prediction, values range from 0.777 to 0.800. For the 5-year prediction, values range from 0.673 to 0.741. For the 9-year prediction, values range from 0.748 to 0.758.
After identifying LightGBM as the optimal algorithm during the initial screening (Supplementary Figures S2–S4), we performed extensive hyperparameter tuning to construct the final optimized predictive models. The final optimized LightGBM models demonstrated robust predictive performance, achieving an AUC of 0.844 (95% CI: 0.773–0.914), accuracy of 0.777, precision of 0.800, recall of 0.788, and F1 score of 0.794 for the 3-year prediction model, an AUC of 0.824 (95% CI: 0.771–0.875), accuracy of 0.722, precision of 0.741, recall of 0.673, and F1 score of 0.705 for the 5-year prediction model, and an AUC of 0.834 (95% CI: 0.796–0.871), accuracy of 0.758, precision of 0.748, recall of 0.755, and F1 score of 0.751 for the 9-year prediction model (Figure 3b,c). For the temporal validation, the LightGBM model once again achieved good predictive performance (Supplementary Figure S5 ), with AUCs (95% CIs) of 0.776 (0.679–0.932) for the 3-year risk prediction, 0.738 (0.526–0.944) for the 5-year risk prediction, and 0.767 (0.609–0.895) for the 9-year risk prediction, indicating that the final model showed great generalization performance.
Furthermore, to ensure the transparency and reliability of our missing data handling, we evaluated the proportion of imputed data and its impact on model performance. Before imputation, the overall mean proportion of missing data across the 260 included metabolites was 3.4%, with individual metabolite missingness ranging from 0% to strictly under 20%. We conducted a sensitivity analysis by training and evaluating the LightGBM models on a subset excluding participants with any missing metabolite values. The subset analysis yielded highly comparable predictive performance, achieving AUCs of 0.821, 0.809, and 0.818 for the 3-, 5-, and 9-year MDD predictions (Supplementary Figure S6), respectively, compared to 0.844, 0.824, and 0.834 in the imputed dataset. This minimal variance indicates that the imputation procedure did not introduce significant bias, confirming the robustness of our predictive models across all timeframes.
Validation of metabolite specificity for MDD in the obese population by comparative modeling
To verify the specificity of the identified metabolites for MDD in the obese population, we developed comparison LightGBM models using metabolites identified in the general population (Ma et al., Reference Ma, Xie, Deng, Wang, Xiang, Yao, Kang, Xu, Wang, Wang, Yang and Liu2024; Radford-Smith et al., Reference Radford-Smith, Anthony, Benz, Grist, Lyman, Miller and Probert2023).
Notably, the comparison models demonstrated marked inferiority compared to the predictive model based on the specific metabolites we identified (Supplementary Figure S7). The changes in AUC, accuracy, precision, recall, and F1 score for two reference models predicting MDD were as follows: AUCs ranged from 0.770 to 0.795 and 0.747 to 0.808 (Supplementary Figure S7a and 7b), accuracy from 0.693 to 0.731 and 0.667 to 0.736, precision from 0.690 to 0.766 and 0.720 to 0.797, recall from 0.645 to 0.668 and 0.631 to 0.698, and F1 score from 0.667 to 0.714 and 0.672 to 0.733 (Supplementary Figure S7c and 7d). Overall, our metabolite-based prediction models exhibit significant advantages in identifying MDD risk in obese populations, particularly in short-term predictions.
Model interpretation of metabolic biomarkers in MDD prediction using SHAP value analysis
Additionally, we used Tree SHAP algorithms to generate an importance ranking that explains the output of the LightGBM model based on SHAP values estimated for 14 selected metabolic biomarkers (Figure 4). With the help of the SHAP values, the individual predictions of the ML model can be explained, and it is possible to measure the global importance of individual features. In the 3-year prediction of MDD, we found that TLVLDL, glucose, and PUFA/TFA were the top three variables in the overall importance of predicting MDD (Figure 4a). In the 5-year prediction of MDD, we found that glucose, TLVLDL, and TGTLMLDLp were the top three variables in terms of overall importance in predicting MDD (Figure 4b). In the 9-year prediction of MDD, we found that glucose, TLVLDL, and TGTLLLDLp were the top three variables in predicting the overall importance of MDD (Figure 4c). Overall, glucose, TLVLDL, PUFA/TFA, TGTLMLDLp, and TGTLLLDLp emerged as the five most influential features within the entire cohort, highlighting their potential clinical value as reliable markers for MDD detection.
Temporal dynamics of metabolite contributions to MDD risk prediction in obese individuals: SHAP interpretability analysis. (A) 3 - year, (B) 5 - year, and (C) 9 - year predictions of MDD illustrate the evolution of metabolite importance over time. Each point represents the SHAP value for an individual obese patient, depicting the relationship between biomarker levels and MDD risk. Features are ranked in order of absolute contribution to the model output, with a vertical line at SHAP = 0 indicating the threshold between positive (red) and negative (blue) effects on MDD prediction. The central sunburst charts display the importance hierarchy of metabolites, with radius reflecting feature significance and a blue-red gradient indicating contribution magnitude, corresponding sequentially to the 14 metabolites displayed on the left.

Figure 4. Long description
The figure consists of three horizontal panels labeled A, B, and C, representing 3-year, 5-year, and 9-year predictions respectively. Each panel contains three components.
1. Feature List (Left): A vertical color-coded list of metabolic markers. Red indicates high importance and blue indicates lower importance. Key markers include Glucose, T L V L D L, P U F A / T F A, and Glyc A.
2. Importance Diagram (Center): A circular fan chart where the size and color of each wedge represent the relative importance of a feature. In Panel A (3-year), the top values are 0.320, 0.284, and 0.241. In Panel B (5-year), the top values are 0.247, 0.237, and 0.218. In Panel C (9-year), the top values are 0.213, 0.150, and 0.135. The wedges transition from dark red (highest) to light blue (lowest).
3. S H A P Value Plot (Right): A dot plot showing the impact on model output. The x-axis represents S H A P values ranging from -1.5 to 1.5. The y-axis lists features from high to low value. Each dot represents a data point, with pink/red dots indicating high feature values and blue dots indicating low feature values. A vertical gray line at 0.0 indicates no impact. In all panels, Glucose and T L V L D L show wide distributions, indicating significant impact on the prediction outcome.
Mediation Mendelian randomization of metabolic biomarkers
Furthermore, we performed causal mediation analysis with MR to assess the robustness of the results using 14 metabolic biomarkers to predict MDD risk in the obese population. Expectedly, the mediation MR analysis revealed a significant causal association between BMI and MDD, mediated by metabolic biomarkers (Prop: 10.0% for MUFA/TFA, −11.5% for glucose, 14.5% for DU, 9.7% for DHA/TFA, 6.0% for omega 3/TFA, 35.3% for PUFA/MUFA, and 24.8% for PUFA/TFA, all P ME < 0.05) (Supplementary Figure S8 and Supplementary Table S15). These findings greatly supported the findings that 14 metabolic biomarkers were utilized to predict MDD risk in the obese population, based on 14 ML algorithms.
Discussion
To the best of our knowledge, this was the first study using ML algorithms and novel metabolomic biomarkers to optimize stratified detection of MDD in obese individuals. We identified 14 specific metabolic biomarkers in the obese population and further developed and validated a LightGBM model that exhibits excellent performance for predicting MDD. Additionally, causal mediation analysis highlighted the intricate biological relationships between these biomarkers and MDD risk. In summary, we systematically revealed novel biomarkers that underpin the risk and resilience associated with MDD in the obese population, emphasizing their potential in addressing global public health priorities for integrated management of these intertwined conditions.
Historically, the link between obesity and MDD has been acknowledged, yet the underlying metabolic mechanisms remain less understood. Our findings reveal metabolic heterogeneity among obese individuals, indicating that not all obesity poses the same risk for MDD. By employing a comprehensive metabolomic approach and Mendelian randomization (MR), we demonstrated that metabolic dysregulation actively contributes to the onset of MDD rather than simply coexisting with it. This finding is particularly relevant in the debate over biological versus psychosocial determinants of MDD. Specifically, our SHAP and MR analyses convergently highlighted the causal roles of glucose, specific lipid fractions, and polyunsaturated fatty acids. Elevated glucose and specific lipoproteins indicate insulin resistance and dyslipidemia, which are associated with systemic inflammation, oxidative stress, and reduced brain-derived neurotrophic factor (BDNF) – all of which are implicated in MDD pathophysiology (Huang & Chen, Reference Huang and Chen2005; Meng, Wang, Wang, & Zou, Reference Meng, Wang, Wang and Zou2025; Porter & O’Connor, Reference Porter and O’Connor2022). Conversely, higher levels of omega-3 fatty acids provide resilience due to their anti-inflammatory effects on brain health (Su, Matsuoka, & Pae, Reference Su, Matsuoka and Pae2015). Furthermore, our pathway analysis identified the synthesis, secretion, and inactivation of GLP-1 and incretin as crucial disrupted pathways. Elevated levels of free fatty acids and inflammatory cytokines in obese individuals can impair GLP-1 secretion and receptor sensitivity (Nauck et al., Reference Nauck, Kahle, Baranov, Deacon and Holst2017; Pathak, Vasu, Flatt, & Irwin, Reference Pathak, Vasu, Flatt and Irwin2014). Given that GLP-1 has neuroprotective effects and influences mood regulation in the central nervous system (Zhang, Zhang, & Tian, Reference Zhang, Zhang and Tian2023). Its dysfunction may further exacerbate depressive symptoms. Together, these interconnected pathways provide a comprehensive biological explanation for the metabolic mediation of MDD risk in obesity.
We established a robust predictive framework that enhances the early identification of individuals at risk for MDD. To date, large-scale predictive studies of MDD have primarily focused on the general population, typically achieving moderate predictive performance with AUCs ranging from 0.658 to 0.720 (Ma et al., Reference Ma, Xie, Deng, Wang, Xiang, Yao, Kang, Xu, Wang, Wang, Yang and Liu2024; Radford-Smith et al., Reference Radford-Smith, Anthony, Benz, Grist, Lyman, Miller and Probert2023). By developing models specifically tailored to the obese population, we achieved remarkable predictive accuracy. Among the 14 distinct ML models evaluated, the LightGBM model exhibited a significant advantage across various timeframes (3-, 5-, and 9-year predictions), successfully passing independent temporal validation. Notably, the predictive performance of these models exceeded 80%, highlighting the superiority of integrating specific metabolomic data with advanced computational methods over traditional general-population models. However, we also observed a substantial performance discrepancy of ~20% across the 14 evaluated models, with the accuracy of simpler algorithms dropping to 60%. This gap underscores the complex, nonlinear nature of the metabolomic data associated with MDD risk. Traditional algorithms often struggle to capture intricate biological interactions and are highly sensitive to the multicollinearity prevalent among lipid and fatty acid fractions. In contrast, advanced tree-based ensemble methods like LightGBM excel in handling complex tabular data, effectively managing nonlinear relationships and feature interactions without requiring manual specification. Furthermore, SHAP analysis enhances model interpretability by ranking clinical feature importance. Although LightGBM natively handles missing data, relying on this for primary predictors may reduce prognostic accuracy. Therefore, we recommend confirmatory testing or clinical imputation for missing top-ranked features, while leveraging the model’s intrinsic robustness to handle missing data among lower-ranked metabolites. By focusing on these specific metabolic signatures, clinicians could better stratify patients according to their risk profiles, enabling earlier and more tailored interventions.
Moreover, MR was utilized to investigate the biological causal pathways linking obesity to MDD through these complex metabolic biomarkers, thereby reinforcing the validity of our ML predictions. While the MR analysis revealed that the proportion of the obesity-MDD effect mediated by individual metabolites is relatively modest, these magnitudes are highly consistent with the complex and multifactorial etiology of MDD (Cui et al., Reference Cui, Li, Wang, Wu, Liu, Yu and Li2024). This finding is particularly relevant in the ongoing debate over biological versus psychosocial determinants of MDD. By pinpointing these specific metabolic pathways, we enhance our understanding of how physiological dysregulation directly interconnects with psychological vulnerability. In other words, metabolic disturbances, marked by altered lipid and amino acid profiles, are not merely passive bystanders or epiphenomena coexisting with obesity, but active, causal contributors to the pathogenesis of MDD.
While the LightGBM model natively manages missing values by determining optimal directions during tree construction, sole reliance on this feature for primary predictors may reduce prognostic certainty. Therefore, for features identified as critical by SHAP analysis, we advise that missing or unreliable values trigger confirmatory retesting or standardized clinical imputation rather than model-based default assumptions. For lower-ranked metabolites, however, the model’s intrinsic resilience to sparsity is sufficient to maintain predictive validity, ensuring the tool’s robustness and utility even in the absence of comprehensive metabolomic profiling.
Our novel investigation has several strengths. First, the UKB comprises over 500,000 participants, providing a robust foundation for statistical analyses and enhancing the credibility of the research. Second, it offers a rich array of blood data, enabling comprehensive analyses of the complex interplay between obesity and MDD, thus aiding in the elucidation of potential biological mechanisms. Third, the use of a prospective cohort design allows for more effective identification of causal relationships by observing changes in metabolic biomarkers before the onset of MDD. Finally, the application of multiple ML algorithms demonstrates exceptional predictive performance in 3-, 5-, and 9-year prediction models. A high level of predictive capability facilitates the early identification of obese individuals at high risk for MDD, informing clinical interventions and personalized treatment strategies.
Our study has several limitations that should be acknowledged. First, the UKB predominantly comprises individuals from the United Kingdom, limiting racial and geographic diversity. Although we conducted temporal validation within the same biobank, true external validation in independent, multi-ethnic cohorts is necessary to confirm the generalizability of our findings. Second, despite adjusting for a comprehensive set of covariates, the potential for residual or unmeasured confounding remains, which could influence the observed associations. Third, the long-term follow-up introduces challenges such as participant attrition and unrecorded dynamic changes in health status or metabolic profiles, potentially adding uncertainty to our risk assessments. Finally, our study focused on overall incident MDD without differentiating clinical subtypes. Given the clinical heterogeneity of MDD, future research is warranted to explore whether specific metabolic signatures map onto distinct depressive phenotypes.
Conclusion
Overall, our study elucidates the intricate relationship between obesity and MDD through an innovative blend of metabolomic profiling and ML techniques. We identified a set of novel metabolic biomarkers that can reliably predict MDD risk in obese individuals utilizing an advanced ML algorithm, and help to determine the underlying molecular mechanisms associated with MDD. Our findings highlight the critical importance of metabolic health in mental health outcomes, suggesting that targeted interventions in metabolic pathways could be pivotal in mitigating the intertwined burdens of obesity and MDD, thereby addressing the escalating mental health crisis.
Data availability statement
For the data of the UK Biobank, please visit https://www.ukbiobank.ac.uk/. This study was conducted under project number 99946. Code used for analysis is available online at https://github.com/Li-OmicsLab-MPU/Obesity-MDD.
Acknowledgments
The authors would like to thank each of the survey teams and study participants who made this analysis possible. This research has been conducted using the UK Biobank Resource under Application Number 99946. This submission was approved with the submission approval ID fca.4ca7.d09f.b. There were no participants or public involvement in the design, conduct, reporting, interpretation, or dissemination of this study.
Author contribution
Conceptualization: X.B.Z., A.X., N.L., L.Z., and K.F.L. Data curation: X.B.Z., A.X., C.K.L., L.H.W., H.Y., and H.H.Y.T. Formal analysis: X.B.Z., A.X., and Y.Q.D. Funding acquisition: L.Z. and K.F.L. Investigation: X.B.Z., A.X., H.Y.C., C.K.L., L.H.W., H.Y., and H.H.Y.T. Methodology: X.B.Z. and A.X. Project administration: N.L., L.Z., and K.F.L. Software: X.B.Z., A.X., and Y.Q.D. Supervision: N.L., L.Z., and K.F.L. Validation: X.B.Z., A.X., and H.Y.C. Visualization: X.B.Z. and A.X. Writing – original draft: X.B.Z. and A.X. Writing – review and editing: N.L., L.Z., and K.F.L. All authors reviewed the manuscript.
Funding statement
This work was supported by the Joint Research Funding Program between the Macau Science and Technology Development Fund and the Department of Science and Technology of Guangdong Province (FDCT-GDST, 0009/2024/AGJ) and the National Natural Science Foundation of China (NSFC, 82273748).
Competing interests
The authors declare no competing interests.