Introduction
Depression, a mental and emotional disorder, has drawn global attention due to its significant personal, social, and economic burden (Thapar, Eyre, Patel, & Brent, Reference Thapar, Eyre, Patel and Brent2022). In recent years, depression has emerged as one of the leading causes of global disease burden (Mathers & Loncar, Reference Mathers and Loncar2006; Yan et al., Reference Yan, Zhang, Wang, Yan, Liu, Tian and Tian2024; Zhang et al., Reference Zhang, Jia, Yang, Sun, Shi and Wang2024), affecting over 350 million individuals worldwide (Smith, Reference Smith2014). Depression has a profound impact on daily quality of life and physical health (Penninx, Milaneschi, Lamers, & Vogelzangs, Reference Penninx, Milaneschi, Lamers and Vogelzangs2013). The typical symptoms include persistent feelings of sadness and a diminution of interest in those activities that were previously pleasurable (Kandola et al., Reference Kandola, Ashdown-Franks, Hendrikse, Sabiston and Stubbs2019). People with depression often experience feelings of being overwhelmed, worried, stressed, and tired (Al Yahyaei et al., Reference Al Yahyaei, Al Omari, Abu Sharour, Cayaban, Shebani, Al Hashmi, ALBashtawy, Alkhawaldeh and Alhalaiqa2024). Furthermore, substantial evidence suggests that depression heightens the likelihood of multiple diseases, such as hypertension, heart disease, obesity, stroke, diabetes, and even overall mortality (Penninx et al., Reference Penninx, Milaneschi, Lamers and Vogelzangs2013).
Greenspace is broadly defined as an integral component of the human living environment, comprising parks, gardens, urban greenery, street trees, and other elements (Heo & Bell, Reference Heo and Bell2023). Although a clear direct cause-and-effect relationship between greenspace and health has not been definitively established, increasing evidence indicates that greenspace exposure is strongly linked to significant health benefits, including reductions in all-cause mortality, cardiovascular disease rates, diabetes, and mental disorders (Bodicoat et al., Reference Bodicoat, O’Donovan, Dalton, Gray, Yates, Edwardson, Hill, Webb, Khunti, Davies and Jones2014; Yang et al., Reference Yang, Zhao, Hu, Browning, Heinrich, Dharmage, Jalaludin, Knibbs, Liu, Luo, James, Li, Huang, Chen, Zeng, Hu, Yu and Dong2021). The World Health Organization highlights the intricate and interconnected relationship between greenspace and health, expressing optimism that greenspace initiatives can be leveraged to improve public health (Kumar et al., Reference Kumar, Druckman, Gallagher, Gatersleben, Allison, Eisenman, Hoang, Hama, Tiwari, Sharma, Abhijith, Adlakha, McNabola, Astell-Burt, Feng, Skeldon, de Lusignan and Morawska2019). Globally, greenspace is under pressure from urbanization, land development, and environmental changes, while its health benefits are attracting increasing attention.
An increasing body of epidemiological studies has investigated the relationship between greenspace exposure and depression in humans. For example, a cross-sectional study conducted in Carmona, Spain, revealed that adults with access to greenspace at home exhibited a reduced risk of anxiety and depression (Braçe et al., Reference Braçe, Garrido-Cumbrera, Foley, Correa-Fernández, Suárez-Cáceres and Lafortezza2020). Similarly, a survey of urban residents in China observed an inverse correlation between urban green coverage and the prevalence of depressive symptoms among middle-aged and older adults (Zhou, Zheng, Yun, & Wang, Reference Zhou, Zheng, Yun and Wang2022). The majority of these studies rely on macro-level urban statistics to determine whether individuals live in a greenspace environment. However, such approaches may not accurately reflect the actual degree of exposure to greenspace among the population. By utilizing remote sensing data from NASA, researchers can collect detailed and precise information about greenspace, enabling a more accurate analysis of the relationship between greenspace and depressive symptoms. Consequently, in recent years, some studies have employed remote sensing data from NASA to identify the greenspace conditions that people might be exposed to (Fossa et al., Reference Fossa, D’Souza, Bergmans, Zivin and Adar2024; Gascon et al., Reference Gascon, Sánchez-Benavides, Dadvand, Martínez, Gramunt, Gotsens, Cirach, Vert, Molinuevo, Crous-Bou and Nieuwenhuijsen2018). These studies have offered important insights by examining greenspace as a factor in its relationship with depression. However, greenspace is still considered an isolated factor, meaning its broader context within multifactorial influences remains less thoroughly explored. It is crucial to acknowledge that depression is a multifactorial mental health condition influenced by numerous biological, psychological, and environmental determinants.
The rapid pace of urbanization has given rise to a spectrum of public health challenges, encompassing environmental pollution, vegetation depletion, and the deterioration of natural ecosystems (Gianfredi et al., Reference Gianfredi, Buffoli, Rebecchi, Croci, Oradini-Alacreu, Stirparo, Marino, Odone, Capolongo and Signorelli2021). Amidst accelerating urban expansion and the escalating degradation of vegetation, research on the relationship between urban greenspace and depression remains predominantly focused on greenspace as a singular variable, failing to comprehensively address the complex interplay among multiple determinants, including greenspace, in influencing depressive symptomatology. This is largely due to the inherent limitations of traditional statistical methods. To address this gap, we leveraged machine learning (ML) modeling to identify the determinants of depression and evaluate the significance of residential greenspace within this framework. Conducting an in-depth assessment of the effects of residential greenspace on depressive symptoms and its significance will deepen our understanding of depression prevention, thereby advancing public health initiatives.
Methods
Population data collection and processing
This study utilized data from the China Health and Retirement Longitudinal Study (CHARLS), a nationally representative cohort established in 2011 to monitor health trajectories, socioeconomic conditions, family dynamics, and pension provisions among middle-aged and elderly populations, with data collected in 2018. Employing a multistage stratified probability sampling strategy, the CHARLS survey initially enrolled 19,817 participants. To derive the final analytic sample, we applied sequential exclusion criteria following rigorous quality control procedures. First, participants with missing demographic variables, missing health-related variables, or incomplete responses to the 10-item Center for Epidemiological Studies Depression Scale (CES-D10) were excluded (n = 10,031). Second, participants residing in rural areas or those who could not be matched with environmental data were excluded (n = 5,903). Finally, participants aged younger than 45 years or older than 60 years were excluded (n = 2,341). After these exclusions, 1,542 urban middle-aged adults were included in the final analysis, as shown in Supplementary Figure S1. All personal identifiers had been removed, and ethical clearance was previously secured by the CHARLS database. Our secondary analysis adhered to CHARLS’s data use and confidentiality guidelines. Since only anonymized, open-access data were analyzed and no new data collection was involved, further review by an institutional ethics board was not necessary.
Greenness acquisition and assessment
The Moderate Resolution Imaging Spectroradiometer (MODIS), an advanced remote-sensing instrument developed by NASA, provides long-term and comprehensive observations of the Earth’s surface. To accurately quantify vegetation cover, we utilized two key satellite vegetation indices: the normalized difference vegetation index (NDVI) and enhanced vegetation index (EVI), both derived from MODIS pre-calculated products. Specifically, NDVI and EVI were obtained from 2018 MODIS remote-sensing products, corresponding to the year of the fourth wave of CHARLS. These indices are computed based on the reflectance of the Earth’s surface in the visible (red) and near-infrared bands. Notably, EVI incorporates the blue band to mitigate atmospheric contamination from smoke and thin clouds, correcting for refractive index error (Zhang et al., Reference Zhang, Fan, Zhang, Li, Liu, Hu, Knibbs, Dadvand, Jalaludin, Browning, Zhao, Heinrich, He, Chen, Zhou, Dong and Yang2023). Both NDVI and EVI values range from −1 to 1, with higher values indicating denser vegetation cover.
In order to precisely delineate green areas surrounding residential locations, we established buffer zones with radii of 250, 500, and 1000 m, respectively, centered on the residential areas, and calculated the average NDVI and EVI in these areas. These buffer zones represent varying levels of greenspace accessibility, approximately corresponding to a 5-minute walking distance, a 5- to 10-minute walking distance, and a 10- to 15-minute walking distance from home, respectively (James, Hart, Banay, & Laden, Reference James, Hart, Banay and Laden2016; Zhang et al., Reference Zhang, Fan, Zhang, Li, Liu, Hu, Knibbs, Dadvand, Jalaludin, Browning, Zhao, Heinrich, He, Chen, Zhou, Dong and Yang2023). These walking-time descriptions were used only as intuitive interpretations of spatial scale rather than as exact measures of individual walking time. Based on the latitude and longitude coordinates of urban areas across China, six key vegetation indices were extracted, including NDVI250m, NDVI500m, NDVI1km, EVI250m, EVI500m, and EVI1km, as illustrated in Supplementary Figure S1. These indices were subsequently matched to all study samples based on region names, serving as the greenness characteristics for each sample in the analysis.
Target variable
In this study, depressive symptoms among urban middle-aged individuals were assessed using the CES-D10 scale. The CES-D10 scale comprises the following 10 items, each evaluating the frequency of specific experiences: (1) I tend to get upset by relatively minor occurrences; (2) I find it difficult to maintain focus on tasks; (3) I often feel low; (4) I have difficulty completing tasks; (5) I regularly feel optimistic about the future; (6) I often feel scared; (7) I have trouble sleeping; (8) I often feel pleasant; (9) I often experience loneliness; and (10) I feel like I cannot move on with my life. Responses to each item were scored on a 4-point Likert scale: 0 (Rarely or None), 1 (Somewhat or A Little), 2 (Occasionally or a Moderate Amount of Time), and 3 (Most of the Time). The total score ranges from 0 to 30, where lower scores reflect less severe depressive symptoms (Cheng, Chen, McBride, & Phillips, Reference Cheng, Chen, McBride and Phillips2016). In this study, participants with a CES-D10 total score of 10 or higher were classified as exhibiting potential depressive symptoms, consistent with the cutoff widely used in studies of depressive symptoms among Chinese middle-aged and older adults (Fu, Si, & Guo, Reference Fu, Si and Guo2022; Jiang, Zhu, & Qin, Reference Jiang, Zhu and Qin2020; Lei et al., Reference Lei, Sun, Strauss, Zhang and Zhao2014).
Independent variables
Potential factors linked to depressive symptoms in urban middle-aged individuals were grouped into three categories: demographic, health-related, and environmental characteristics. Data on demographic and health-related factors were obtained from the CHARLS database, while environmental data were sourced from the MODIS dataset. Demographic characteristics included age, marital status, gender, religious beliefs, and the prevalence of chronic diseases. Health-related characteristics encompassed a comprehensive range of factors, such as hospitalization history, medical treatment, incidence of falls, pain levels, sleep duration, napping habits, frequency of physical activity, internet usage, social activity engagement, impairments in basic activities of daily living (BADL), impairments in instrumental activities of daily living (IADL), life satisfaction, satisfaction with child relationships, and income levels. Environmental characteristics were represented by six vegetation indices: NDVI250m, NDVI500m, NDVI1km, EVI250m, EVI500m, and EVI1km. Variable classification and supplementary explanation are presented in Supplementary Table S1.
Feature screening and model construction
This study employed a multistep analytical approach to identify key factors influencing depressive symptoms in urban middle-aged adults, as illustrated in Supplementary Figure S2. First, demographic characteristics of the participants were analyzed using a Chi-square test, with statistical significance set at P < 0.05. Second, the maximum relevance minimum redundancy (mRMR) method was applied to the training set to preliminarily screen health-related and greenness characteristics associated with depressive symptoms. The mRMR method integrates two key measures to evaluate feature importance: (1) identifying independent variables with the greatest correlation to the dependent variable to ensure significant predictive contributions, and (2) minimizing redundancy among independent variables to reduce inter-feature correlations. Chi-square tests were utilized to assess associations between features and depressive symptoms, while Pearson correlation coefficients were used to quantify redundancy between features. The mRMR method ultimately outputted an importance ranking of all intrinsic and greenness features.
Subsequently, five ML methods, including Support Vector Machines (SVM), Multilayer Perceptron (MLP), Random Forest (RF), Naive Bayes (NB), and Logistic Regression (LR), were employed in combination with a fivefold cross-validation strategy to identify key influencing factors associated with depressive symptoms. Hyperparameter tuning details are provided in the Supplementary Materials. Features were incrementally integrated into the models, and the optimal area under the curve (AUC) was used to determine the most parsimonious set of features with the highest predictive power. Finally, a joint model was constructed by integrating significant demographic characteristics with the identified intrinsic and greenness characteristics.
Model establishment and performance evaluation
To assess the diagnostic efficacy of the ML models, the test set was evaluated using a comprehensive set of metrics, including AUC, Accuracy, Precision, Recall, and F1-score. Details on the strategies used for the prevention of overfitting are provided in the Supplementary Materials. Furthermore, Shapley Additive Explanations (SHAP) values were utilized to interpret the models exhibiting the highest predictive performance. SHAP, a model-agnostic interpretability framework, elucidates the decision-making logic of the models, quantifies the contribution of individual features, and supports the precise formulation of targeted interventions (Supplementary Figure S1).
Data analysis
All ML algorithms were developed using Python (version 3.7.3) and the scikit-learn library. The computational environment was configured with the following specifications: a 1.4 GHz quad-core Intel Core i5 CPU, 128 GB of memory, and the macOS Monterey 12.6.1 operating system.
Results
Feature screening and model construction
As presented in Table 1, among the 1,542 urban middle-aged adults included in the study, 623 individuals (40.40%) exhibited depressive symptoms. The majority of the participants were married (92.74%). Nearly half of the study population (48.90%) reported having at least one chronic disease. In the training set, statistically significant differences were observed in gender and chronic disease prevalence between individuals with and without depressive symptoms (P < 0.05). These findings indicated that middle-aged urban women and individuals with chronic medical conditions were at a higher risk of experiencing depressive symptoms.
An analysis of demographic characteristics among individuals with and without depressive symptoms in both the training and validation sets

Table 1. Long description
A complex data table organized into eight columns. The first column lists demographic characteristics, followed by a Total percentage column. The remaining columns are split into two main groups: Train set and Validation set. Each set includes three sub-columns: Without depressive symptoms percentage, With depressive symptoms percentage, and p-value.
Key demographic findings include:
* Gender: Significant differences in both sets. In the Train set, women represent 63.32 percent of those without symptoms versus 69.91 percent with symptoms (p-value 0.028). In the Validation set, women represent 59.25 percent without symptoms versus 69.01 percent with symptoms (p-value 0.046).
* Age: No significant differences. Participants are split into groups younger than 53 and 53 or older. In the total sample, 58.37 percent are 53 or older.
* Marital status: Significant difference only in the Validation set (p-value 0.023), where 96.23 percent of those without symptoms are married compared to 90.64 percent of those with symptoms.
* Religion: No significant differences across either set, with approximately 90 percent of all participants reporting no religious affiliation.
* Chronic disease: Highly significant differences in both sets. In the Train set, 53.10 percent of those with depressive symptoms have a chronic disease compared to 46.09 percent without (p-value 0.027). In the Validation set, 57.31 percent of those with symptoms have a chronic disease compared to 43.49 percent without (p-value 0.006).
Bold values indicate significant differences.
Chi-squared test for all demographics characteristics.
*P < 0.05, **P < 0.01.
Feature selection and key predictors of depressive symptoms
The relative importance ranking of health-related and greenness features screened by the mRMR algorithm is presented in Supplementary Table S2 and Figure S3. The predictive performance of each ML model reached its peak when incorporating six features, as indicated by the AUC values. These findings suggested that the following health-related and greenness characteristics were potentially predictive of depressive symptoms in urban middle-aged adults: life satisfaction, EVI250m, social activity, pain, sleep duration, and IADL.
Predictive performance of ML models
The evaluation metrics and receiver operating characteristic (ROC) curves for the health-related and greenness feature models are presented in Table 2 and Figure 1, respectively. The results demonstrated that the five ML models achieved satisfactory predictive performance on the test set. Among these, the SVM model exhibited optimal and robust predictive performance, achieving an AUC of 0.763 and an accuracy of 0.734. These findings indicated that selected health-related and greenness characteristics were significant factors in identifying depressive symptoms among urban middle-aged individuals.
Predictive performance of five models for depressive symptoms using health-related factors and greenspace characteristics in the training and validation sets

Table 2. Long description
The table consists of seven columns: Data sets, Model, Accuracy, Precision, Recall, F 1-score, and A U C.
Training set results (values include plus or minus standard deviation):
* R F: Accuracy 0.700 plus or minus 0.02, Precision 0.713 plus or minus 0.03, Recall 0.700 plus or minus 0.02, F 1-score 0.678 plus or minus 0.03, A U C 0.735 plus or minus 0.03.
* M L P: Accuracy 0.701 plus or minus 0.03, Precision 0.700 plus or minus 0.03, Recall 0.701 plus or minus 0.03, F 1-score 0.691 plus or minus 0.03, A U C 0.730 plus or minus 0.03.
* S V M: Accuracy 0.709 plus or minus 0.03, Precision 0.720 plus or minus 0.03, Recall 0.709 plus or minus 0.03, F 1-score 0.689 plus or minus 0.03, A U C 0.738 plus or minus 0.03.
* N B: Accuracy 0.698 plus or minus 0.03, Precision 0.706 plus or minus 0.04, Recall 0.698 plus or minus 0.03, F 1-score 0.679 plus or minus 0.03, A U C 0.729 plus or minus 0.03.
* L R: Accuracy 0.693 plus or minus 0.02, Precision 0.692 plus or minus 0.02, Recall 0.693 plus or minus 0.02, F 1-score 0.682 plus or minus 0.02, A U C 0.730 plus or minus 0.03.
Validation set results:
* R F: Accuracy 0.719, Precision 0.717, Recall 0.719, F 1-score 0.697, A U C 0.753.
* M L P: Accuracy 0.708, Precision 0.701, Recall 0.708, F 1-score 0.702, A U C 0.746.
* S V M: Accuracy 0.734, Precision 0.733, Recall 0.734, F 1-score 0.716, A U C 0.763.
* N B: Accuracy 0.713, Precision 0.704, Recall 0.713, F 1-score 0.701, A U C 0.743.
* L R: Accuracy 0.715, Precision 0.708, Recall 0.715, F 1-score 0.708, A U C 0.757.
ROC curves for all models. (a) ROC curves of the five models on the training set. (b) ROC curves of the five models on the validation set. (c) ROC curves of the five models on the training set after incorporating demographic features. (d) ROC curves of the five models on the validation set after incorporating demographic features.

Figure 1. Long description
A four-panel grid of Receiver Operating Characteristic R O C curves. Each graph plots the False Positive Rate on the x-axis from 0.0 to 1.0 against the True Positive Rate on the y-axis from 0.0 to 1.0. A diagonal dashed line represents random chance. Five models are represented in each panel: N B (green), L R (cyan), R F (purple), M L P (brown), and S V M (blue).
* Panel a: Training set. Curves show a concave increase, reaching a True Positive Rate of 0.6 at a False Positive Rate of 0.2. Legend values range from 0.729 to 0.738.
* Panel b: Validation set. Curves are more jagged than panel a. Legend values range from 0.743 to 0.763, with S V M performing highest.
* Panel c: Training set with demographic features. The curves follow a similar smooth trajectory to panel a. Legend values range from 0.730 to 0.736.
* Panel d: Validation set with demographic features. Curves show the highest overall performance, with the S V M curve (blue) visibly higher than others, reaching a value of 0.776 in the legend.
All legend values include a plus or minus 0.03 margin of error for the training sets (panels a and c).
Notably, the SVM model continued to demonstrate superior performance, achieving an AUC of 0.776 and an accuracy of 0.739 (Table 3) when two demographic characteristics, gender and chronic disease, were integrated with the health-related and greenness characteristics. Nevertheless, the integration of demographic factors yielded merely marginal performance gains across the five ML models when benchmarked against both health-related and greenness models. The ROC curves of the combined models are illustrated in Figure 1.
Integration of demographic differences into the ML framework for assessing their impact on predicting depressive symptoms and evaluating predictive performance across training and validation sets

Table 3. Long description
A table with seven columns: Data sets, Model, Accuracy, Precision, Recall, F 1-score, and A U C.
Training set results (mean plus or minus standard deviation):
* Combined_R F: Accuracy 0.693 plus or minus 0.03, Precision 0.713 plus or minus 0.04, Recall 0.693 plus or minus 0.03, F 1-score 0.666 plus or minus 0.03, A U C 0.736 plus or minus 0.03.
* Combined_M L P: Accuracy 0.691 plus or minus 0.02, Precision 0.689 plus or minus 0.03, Recall 0.691 plus or minus 0.02, F 1-score 0.683 plus or minus 0.02, A U C 0.730 plus or minus 0.03.
* Combined_S V M: Accuracy 0.700 plus or minus 0.02, Precision 0.708 plus or minus 0.03, Recall 0.700 plus or minus 0.02, F 1-score 0.682 plus or minus 0.02, A U C 0.735 plus or minus 0.03.
* Combined_N B: Accuracy 0.698 plus or minus 0.03, Precision 0.705 plus or minus 0.03, Recall 0.698 plus or minus 0.03, F 1-score 0.680 plus or minus 0.03, A U C 0.730 plus or minus 0.03.
* Combined_L R: Accuracy 0.693 plus or minus 0.02, Precision 0.692 plus or minus 0.02, Recall 0.693 plus or minus 0.02, F 1-score 0.682 plus or minus 0.02, A U C 0.730 plus or minus 0.03.
Validation set results:
* Combined_R F: Accuracy 0.726, Precision 0.734, Recall 0.726, F 1-score 0.697, A U C 0.764.
* Combined_M L P: Accuracy 0.739, Precision 0.733, Recall 0.739, F 1-score 0.731, A U C 0.763.
* Combined_S V M: Accuracy 0.739, Precision 0.737, Recall 0.739, F 1-score 0.723, A U C 0.776.
* Combined_N B: Accuracy 0.721, Precision 0.714, Recall 0.721, F 1-score 0.710, A U C 0.750.
* Combined_L R: Accuracy 0.715, Precision 0.708, Recall 0.715, F 1-score 0.708, A U C 0.757.
Importance of greenspace
This study utilized SHAP values from five models (Figure 2) to assess the relative significance of greenspace in relation to depressive symptoms. Different predictive model algorithms exhibited some variability in feature importance rankings; however, across all five models, greenspace consistently ranked among the top predictors. Notably, EVI250m, a key indicator of greenspace coverage, ranked among the top predictors. The SHAP summary plots further indicated that higher EVI250m values were generally associated with lower predicted depressive symptom risk, suggesting a negative association between residential greenspace coverage within the 250-m buffer and depressive symptoms. This finding underscored the critical role of greenspace in preventing the development of depressive symptoms. Specifically, negative associations were observed between depressive symptoms and life satisfaction, sleep duration, EVI250m, social activity, and gender. In contrast, a positive association was identified between depressive symptoms and the remaining variables.
SHAP value summary plots and feature importance visualizations. (a, b) Summary plots of SHAP values and charts of feature importance for the LR model. (c, d) Summary plots of SHAP values and charts of feature importance for the MLP model. (e, f) Summary plots of SHAP values and charts of feature importance for the NB model. (g, h) Summary plots of SHAP values and charts of feature importance for the RF model. (i, j) Summary plots of SHAP values and charts of feature importance for the SVM model.

Figure 2. Long description
A multi-panel layout with five rows, each containing a bar chart on the left and a S H A P summary plot on the right.
Row 1 (a, b) for L R model: The bar chart shows Pain as the most important feature with a mean absolute S H A P value near 0.200, followed by Life satisfaction and I A D L. The summary plot shows high Pain values (red dots) correlate with positive S H A P values, while high Life satisfaction correlates with negative S H A P values.
Row 2 (c, d) for M L P model: Similar to L R, Pain leads importance at approximately 0.175. The summary plot shows a dense cluster of blue dots (low feature value) for Pain on the negative side of the zero line.
Row 3 (e, f) for N B model: Pain remains the top feature, but I A D L rises to second place. The summary plot shows a distinct separation where high I A D L values (red) are spread widely across the positive S H A P impact range.
Row 4 (g, h) for R F model: I A D L is the most important feature, followed by Life satisfaction and Pain. The summary plot for I A D L shows a clear split with high values (red) having a strong positive impact and low values (blue) having a negative impact.
Row 5 (i, j) for S V M model: Pain is the primary feature at 0.16 importance. The summary plot shows Life satisfaction and I A D L have broad distributions of impact compared to other features.
Common features across all panels include Sleep time, E V I sub 250m, Social activities, Chronic disease, and Gender. The S H A P summary plots use a color scale from blue (low) to red (high) to indicate feature values.
Discussion
The primary objective of this study was to utilize the advantages of ML models, which address the inherent limitations of traditional statistical methods, to identify and predict the effects of various factors, with particular emphasis on individual greenspace conditions obtained from the NASA satellite database, on depressive symptoms. Furthermore, the study also aimed to assess the contribution of insufficient greenspace to depressive symptoms relative to other influencing factors. After evaluating and comparing five ML models, the SVM algorithm was identified as the optimal model for predicting depressive symptoms based on influencing factors, achieving a robust AUC of 0.763 on the test set. A preliminary chi-square analysis of demographic variables revealed significant differences in gender and the prevalence of chronic diseases between subjects with and without depressive symptoms. To assess the influence of demographic factors on predictive performance, we incorporated these factors into the ML analysis. The results demonstrated that the SVM algorithm maintained consistently superior performance, achieving an AUC of 0.776 on the test set. Moreover, health-related characteristics and greenspace metrics constituted strong predictors of depressive symptoms in middle-aged urban populations, while demographic characteristics showed no statistically significant contribution to the predictive performance of the model. Notably, the predictive performance of our ML models exceeded that reported in previous studies that utilized RF, LR, and XGBoost to predict depression, with reported AUC values ranging from 0.700 to 0.712 (Ai, Li, Ji, & Zhang, Reference Ai, Li, Ji and Zhang2024). This may suggest that our method of predicting the influences on depressive symptoms using this model is feasible and reliable. As mentioned previously, the relationship between greenspace exposure and depression has been explored in several epidemiological studies; however, analyses of the complex interactions among key health-related factors and of the relative importance of greenspace remain limited. We used multiple ML models and SHAP-based interpretation to evaluate the relative importance of greenspace alongside socioeconomic, behavioral, and health-related factors. Moreover, rather than merely confirming a protective association, our study shows that EVI within a 250-m residential buffer ranked among the top predictors of depressive symptoms, highlighting the importance of nearby greenspace.
While a few previous studies have reported higher AUC values than those observed in our research, for example, studies predicting depressive symptoms in older adults with chronic diseases (Zheng, Zhang, & Liu, Reference Zheng, Zhang and Liu2024) and among Chinese nurses (You et al., Reference You, Li, Yan, Yao, Wang and Wang2023), it is important to highlight that these studies focused primarily on individual and clinical factors, whereas our study additionally considered environmental factors in the predictive models. The onset of depression is commonly acknowledged to be closely linked to environmental quality (Galea et al., Reference Galea, Ahern, Rudenstine, Wallace and Vlahov2005). Research has shown that spending 90 minutes walking in a natural setting significantly reduces neural activity in the frontal cortex of the brain, a region strongly implicated in depression (Bratman et al., Reference Bratman, Hamilton, Hahn, Daily and Gross2015). Individuals situated within forest environments exhibit diminished concentrations of total hemoglobin and oxyhemoglobin, which engenders a subjective sensation of ‘comfort and relaxation’ (Joung et al., Reference Joung, Kim, Choi, Lim, Park, Woo and Park2015).
A variety of mechanisms have been proposed to elucidate the relationship between greenspace and depression, such as enhancing air quality, reducing stress, fostering social cohesion, promoting physical activity, and other related factors (Hartig, Mitchell, de Vries, & Frumkin, Reference Hartig, Mitchell, de Vries and Frumkin2014). The quality of vegetation cover within a 500 m radius of the residence was analyzed in conjunction with biomarkers such as norepinephrine, dopamine, and others. The findings demonstrated that exposure to natural environments significantly promotes biological stress recovery, highlighting the restorative potential of nearby greenery (Egorov et al., Reference Egorov, Griffin, Converse, Styles, Sams, Wilson, Jackson and Wade2017). These studies, together with our findings, underscore the therapeutic potential of greenspace in promoting both physiological and psychological relaxation, alleviating negative emotional states, and ultimately contributing to a reduction in the prevalence of depressive disorders. However, as existing research has predominantly examined the isolated effects of individual greenspace-related factors on depression, the present study seeks to extend this work by also considering health-related characteristics, thereby contributing to a more holistic understanding of their impact on mental health outcomes.
We assessed vegetation cover using multiple buffer sizes, including NDVI250m, NDVI500m, NDVI1000m, EVI250m, EVI500m, and EVI1000m. Among these, EVI250m emerged as the most influential variable in predicting depressive symptoms. Notably, the ML models ranked EVI250m as one of the top predictors among all factors influencing depression, underscoring its significant contribution. Consistent with our findings, a study of older adults on residential greenspace and major depression has shown that the 250 m buffer exhibits a stronger negative association with major depression compared to the 1 km buffer (Fossa et al., Reference Fossa, D’Souza, Bergmans, Zivin and Adar2024). Moreover, older women residing in areas with the highest levels of surrounding greenery exhibit a 13% reduced risk of depression compared to those living in areas with the lowest levels (Banay et al., Reference Banay, James, Hart, Kubzansky, Spiegelman, Okereke, Spengler and Laden2019). In addition, in a Finnish population, residential greenness, as measured by NDVI100m, showed a significant negative correlation with depression (Gonzales-Inca et al., Reference Gonzales-Inca, Pentti, Stenholm, Suominen, Vahtera and Käyhkö2022). Taken together, these findings, combined with our results, suggest that the inverse association between greenspace and depressive symptoms is more significant when the buffer zones are spatially closer to residential areas.
It has been shown that greenspace helps alleviate depressive symptoms and reduce the incidence of depression across diverse populations, including expectant mothers (McEachan et al., Reference McEachan, Prady, Smith, Fairley, Cabieses, Gidlow, Wright, Dadvand, van Gent and Nieuwenhuijsen2016), postpartum women (Sun et al., Reference Sun, Molitor, Benmarhnia, Avila, Chiu, Slezak, Sacks, Chen, Getahun and Wu2023), American (Fossa et al., Reference Fossa, D’Souza, Bergmans, Zivin and Adar2024) and Italian (Ricciardi et al., Reference Ricciardi, Spano, Tinella, Lopez, Clemente, Bosco and Caffò2023) seniors, as well as children and adolescents (Vanaken & Danckaerts, Reference Vanaken and Danckaerts2018). Our discovery of a significant negative relationship between greenspace exposure and depressive symptoms further adds to the literature by extending this evidence to middle-aged adults.
We observed associations between depressive symptoms and life satisfaction, social activity, sleep duration, pain, and IADL. The predictors of depression identified by the ML models in the present study align with the established literature. Between depression and life satisfaction, a clear linear association was identified (Koivumaa-Honkanen et al., Reference Koivumaa-Honkanen, Kaprio, Honkanen, Viinamäki and Koskenvuo2004; Nes et al., Reference Nes, Czajkowski, Røysamb, Orstavik, Tambs and Reichborn-Kjennerud2013), with individuals reporting lower life satisfaction demonstrating a higher likelihood of depressive symptoms. Increased participation in social activities was associated with reduced depressive symptoms (Wang, Feng, Liu, & Lu, Reference Wang, Feng, Liu and Lu2020), although the degree of reduction varied depending on the type of activity (Croezen, Avendano, Burdorf, & van Lenthe, Reference Croezen, Avendano, Burdorf and van Lenthe2015). Some studies (Ouyang & Sun, Reference Ouyang and Sun2019; Zhai, Zhang, & Zhang, Reference Zhai, Zhang and Zhang2015) have found a bidirectional relationship between sleep quality and depression. A U-shaped relationship was found between sleep duration and depression, with an optimal sleep duration of 8 hours corresponding to the lowest risk of depressive symptoms (Dong, Xie, & Zou, Reference Dong, Xie and Zou2022). The intricate interplay between pain and depression has been established, wherein pain exacerbates both physical and psychological symptoms, contributing to heightened emotional distress and instability (IsHak et al., Reference IsHak, Wen, Naghdechi, Vanle, Dang, Knosp, Dascal, Marcia, Gohar, Eskander, Yadegar, Hanna, Sadek, Aguilar-Hernandez, Danovitch and Louy2018). Impairments in IADLs, which hinder daily functioning, were found to elevate the risk of depression (Köttl et al., Reference Köttl, Fallahpour, Hedman, Nygård and Kottorp2021). These findings collectively emphasize the significant role of health-related factors in the etiology of depression, underscoring the necessity of a multifaceted approach to its prevention and management.
While this study indicates the significance of greenspace in relation to depression, several limitations must be acknowledged. First, causal relationships between greenspace and depressive symptoms cannot be established due to the cross-sectional nature of the data. Second, while EVI and NDVI offer objective proxies for quantifying greenspace, their methodological limitations – such as spectral saturation effects and scale dependency – merit consideration (Gascon et al., Reference Gascon, Cirach, Martínez, Dadvand, Valentín, Plasència and Nieuwenhuijsen2016). For instance, NDVI exhibits reduced accuracy in densely vegetated areas (Zhen et al., Reference Zhen, Chen, Yin, Chavanon, Lauret, Guilleux, Henke, Qin, Cao, Li, Lu and Gastellu-Etchegorry2021), while EVI is susceptible to topographical influences (Matsushita et al., Reference Matsushita, Yang, Chen, Onda and Qiu2007). Moreover, both indices reflect greenspace at a regional scale and cannot differentiate vegetation types, thereby precluding an analysis of the association between specific vegetation characteristics and depression. Additionally, our assessment was confined to greenspace within a 250–1,000 m residential radius, lacking data on smaller-scale environments (e.g. home gardens) and larger-scale areas (e.g. urban parks beyond 1,000 m). Third, spatial autocorrelation in model residuals was not assessed, and spatial clustering was not explicitly adjusted for. Future studies should incorporate multilevel environmental data, additional neighborhood-level characteristics, and spatial models to better account for spatial dependence. Finally, the focus on middle-aged adults in China may restrict the generalizability of the results to other demographic groups and geographical contexts.
Conclusion
In conclusion, this study highlights the significant association between residential greenspace and a lower risk of depressive symptoms among middle-aged adults in urban China. Among the various health-related factors analyzed, greenspace stands out as an important factor associated with mental health. Notably, its potential beneficial association with fewer depressive symptoms is substantially amplified when greenspace is situated in close proximity to residential areas. To further substantiate and deepen these findings, future research should prioritize longitudinal studies and randomized controlled trials encompassing diverse geographic regions and population groups.
Abbreviations
- AUC
-
Area under the curve
- BADL
-
Basic activities of daily living
- CES-D10
-
10-item Center for Epidemiological Studies Depression Scale
- CHARLS
-
China Health and Retirement Longitudinal Study
- EVI
-
Enhanced vegetation index
- IADL
-
Instrumental activities of daily living
- LR
-
Logistic Regression
- ML
-
Machine learning
- MLP
-
Multilayer perceptron
- MODIS
-
Moderate Resolution Imaging Spectroradiometer
- mRMR
-
Maximum relevance minimum redundancy
- NB
-
Naive Bayes
- NDVI
-
Normalized difference vegetation index
- RF
-
Random Forest
- ROC
-
Receiver operating characteristic
- SHAP
-
Shapley Additive Explanations
- SVM
-
Support vector machines
Supplementary material
The supplementary material for this article can be found at http://doi.org/10.1017/S0033291726105923.
Data availability statement
CHARLS: Data on depressive symptoms among urban middle-aged adults in China are available at http://charls.pku.edu.cn. MODIS: Greenspace data used in this study are available at https://modis.ornl.gov/data/modis_webservice.html. Additional derived data or analysis code supporting the findings of this study are available upon request.
Acknowledgments
The authors gratefully acknowledge the China Health and Retirement Longitudinal Study (CHARLS) team for providing access to comprehensive, high-quality data, which were indispensable to this study. We also extend our sincere thanks to NASA for granting access to MODIS satellite data, which facilitated the detailed analysis of greenspace coverage.
Author contributions
Conceptualization: S.L., B.C., and Y.W.; Data curation: S.L., X.L., and R.D.; Formal analysis: S.L. and J.L.; Funding acquisition: X.Z. and Y.W.; Investigation: J.L., B.C., S.L., and D.Y.; Methodology: S.L.; Software: S.L.; Supervision: X.Z. and Y.W.; Validation: X.L.; Visualization: J.L.; Writing – original draft: S.L., J.L., and B.C.; Writing – review and editing: X.Z. and Y.W.
Funding statement
This work was funded by the Science and Technology Project of Liaoning Province, China (2026JH2/101300064), the Youth Clinical Research Program of the Shanghai Municipal Health Commission (20244Y0040), and the Yangfan Program of the Shanghai Science and Technology Commission (24YF2757800).
Competing interests
The authors declare that they have no recognized financial conflicts of interest or personal relationships that might have influenced the outcomes presented in this article.
Ethical standards
The data used in this study were obtained from the China Health and Retirement Longitudinal Study (CHARLS). The original CHARLS survey has been approved by the Peking University Health Science Center Ethics Committee. As this study uses publicly available secondary data, no additional ethical approval was required.