# Using Machine Learning and Nationwide Population-Based Data to Unravel Predictors of Treated Depression in Farmers

Pascal Petit, Vincent Bonneterre, Nicolas Vuillerme

► To cite this version:

Pascal Petit, Vincent Bonneterre, Nicolas Vuillerme. Using Machine Learning and Nationwide Population-Based Data to Unravel Predictors of Treated Depression in Farmers. Mental Illness, 2025, 2025, pp.5570491. 10.1155/mij/5570491. hal-05035976

HAL Id: hal-05035976

https://hal.science/hal-05035976v1

Submitted on 16 Apr 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Research Article

# Using Machine Learning and Nationwide Population-Based Data to Unravel Predictors of Treated Depression in Farmers

Pascal Petit ID,<fnref n="1" /> Vincent Bonneterre ID,<fnref n="2" />,<fnref n="3" /> and Nicolas Vuillerme ID,<fnref n="1" />,<fnref n="4" />

Correspondence should be addressed to Pascal Petit; pascal.petit@univ-grenoble-alpes.fr

Received 9 July 2024; Accepted 20 March 2025

Academic Editor: Stefania Chiappini

Copyright © 2025 Pascal Petit et al. Mental Illness published by John Wiley & Sons Ltd. This is an open access article under the terms of the Creative Commons Attribution License, which permits use, distribution and reproduction in any medium, provided the original work is properly cited.

Farmers are exposed to numerous stressors that can negatively impact their mental health, leading to conditions such as depression. However, most studies examining depression risk in farmers are limited by small sample sizes, narrow geographic coverage, and a focus predominantly on male farmers and general agricultural contexts. To complement these traditional studies, big data and machine learning (ML) can advantageously be harnessed. While ML algorithms have shown high accuracy in identifying depression predictors in mental health research, no study has yet applied ML in farmers. We aimed to identify key predictors of depression among the entire French farmer workforce across professional categories, activities, and sexes using ML (XGBoost). A secondary analysis of large-scale administrative health databases (TRACTOR project) was conducted. Potential predictors (n = 128 for farm managers and 123 for farmworkers) included a broad range of sociodemographic, health, lifestyle, and occupational variables. The predictor's importance was determined using Shapley's additive explanation. There were 83,592 depression cases among 1,088,561 farm managers and 149,285 depression cases among 5,831,302 farmworkers. Models performed well, with F1 scores ranging from 0.65 to 0.94. We noted differences, even though several predictors were common across populations, activities, and/or sexes. The top predictors of depression included working year, age, sex, experience, job security, income, and preexisting health conditions. The working year, which reflects the cumulative impact of external factors (e.g., harsh weather) on farmers' mental health, emerged as the most important predictor. These findings highlight the potential of ML applied to real-world data for identifying modifiable predictors, thus enhancing early detection and prevention strategies. By differentiating predictors across farming groups, our results suggest that tailored mental health interventions could be developed to better address the unique needs of various farming populations. These insights could inform the development of clinical tools (e.g., risk calculators) to assist in clinical decision-making.

# 1. Introduction

Depressive disorder, commonly referred to as depression, affects around 280 million people in the world [1]. Farmers, an understudied population, are exposed to numerous stressors that can negatively impact their mental health and lead to depression [2–9]. A broad range of socio-demographic, lifestyle, health, and occupational factors have

been reported, including sex, age, poor work-life balance, pesticide exposure, and factors outside the farmer's control (e.g., weather conditions). Factors of depression differ between females and males, occupational groups (e.g., farm-workers and self-employed farmers), and between farming activities [10, 11].

Identifying factors that may be detrimental to the mental health of farmers is essential. Investigation of the underlying

<footnote n="1">¹Univ. Grenoble Alpes, AGEIS, Grenoble, France</footnote>

<footnote n="2">²CHU Grenoble Alpes, Centre Régional de Pathologies Professionnelles et Environnementales, Grenoble, France</footnote>

<footnote n="3">³Univ. Grenoble Alpes, CNRS, UMR 5525, VetAgro Sup, Grenoble INP, CHU Grenoble Alpes, TIMC, Grenoble, France</footnote>

<footnote n="4">⁴Institut Universitaire de France, Paris, France</footnote>
risk factors for depression may improve the identification of vulnerable populations and guide future efforts for targeted prevention strategies. Given the heterogeneous nature of agricultural practices, identifying specific and common risk factors between professional categories, farming activities, and sexes is essential for recommending relevant and effective preventive measures [11–13]. However, most studies on depression risk factors in agriculture consider the sector as a whole [2, 3, 5, 8, 14, 15], with limited research focusing on specific occupational groups, farming activities, or sex differences [11]. Among farming activities, existing studies primarily focus on dairy farming, identifying young age, female sex, job demands, animal disease, and the challenge of balancing family and work roles as key risk factors [16–19]. To our knowledge, only a handful of studies have examined depression risk factors in other farming sectors, including one for crop and fruit farmers [20], one for forestry workers [8], one for poultry workers [21], one for sheep farmers [22], and one for agricultural producers [23]. Across these studies, young age [8, 23], female sex [21], and pesticide exposure [22] emerged as major risk factors. This highlights the urgent need for more research investigating depression risk factors across different occupational groups, farming activities, and sexes. This need is further emphasized by the fact that many existing studies are limited in sample size and geographical scope, often focusing on male farmers [3, 5, 8]. In addition, cohort studies are more resource-intensive than administrative health databases that are routinely collected, are population-based, and can span multiple decades [12, 24, 25]. Hence, the reuse of routinely collected digital administrative health data can be a valuable digital prevention tool and represents a complementary approach to traditional cohort studies [12]. However, the use of routinely collected administrative health data is still limited in the agricultural field [12].

Advances in artificial intelligence (AI) and the analysis of real-world data are opening up new perspectives in public health, such as the identification of risk factors [12, 25–27]. Many approaches exist for investigating predictors of a health outcome. Machine learning (ML) is one of these approaches [28]. In addition, ML methods can be used in combination with explainable AI approaches to determine the predictor's importance.

To our knowledge, no study has yet investigated predictors of depression among farmers using ML and nationwide data. In a previous study, we investigated whether certain farming activities were more strongly associated with depression than other activities among the entire French farm managers' (FMs') workforce, but without investigating the factors contributing to the observed risks [10]. To complement and go beyond this previous work, a secondary analysis was conducted. In the current study, the importance of over 120 potential factors associated with depression was assessed in the entire French farming workforce, encompassing both FMs and farmworkers. By applying ML to compare a wide range of predictors across different farming populations, activities, and sexes, we aim to deepen our understanding of the key predictors contributing to depression among farmers.

## 2. Materials and Methods

2.1. *Study Design, Population, and Exposure.* Administrative health data, including sociodemographic, farming activity, and health data, routinely collected by the National Health Insurance Fund for Agricultural Workers and Farmers (MSA) over 2002–2016, were used as part of the TRACTOR project (TRACking and moniToring Occupational Risks in agriculture) [10, 29]. Data were obtained and managed from October 2018 to December 2020 [29] and analyzed for this study from September 2023 to March 2025. This study followed the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) reporting guidelines (Table S1).

All FMs and farmworkers who had worked for at least 1 year (FMs) and or 1 day (farmworkers) between 2002 and 2016 were included. FMs encompass all self-employed farmers, while farmworkers refer to individuals hired by FMs to assist with farm operations, including seasonal workers. Information about family helpers was not available. Each year, during their mandatory enrollment in MSA, farmers report the specific farming activity they engaged in the previous year, selecting from 26 possible categories (e.g., crop farming) for FMs [10] and 22 for farmworkers (Table S2).

2.2. *Choice of Primary Measure.* Data on drug prescription reimbursement were available between 2012 and 2016. Antidepressant (ATD) prescription reimbursements were identified using the ATC (Anatomical Therapeutic Chemical Classification System) code N06A (“antidepressant”) and used as a proxy for depression [30]. Farmers (i.e., FMs and farmworkers) were considered depression cases if they had at least one ATD prescription reimbursement between 2012 and 2016. Only data (e.g., sociodemographic and farming activity) prior to the first ATD prescription or end of follow-up (December 31, 2016) were considered.

2.3. *Statistical Analysis.* Extreme gradient boosting (XGBoost) [31] was used to identify key predictors of ATD prescriptions for each of the farming activities (one independent model for each activity). The ATD prescription (yes or no) was used as a dependent variable in the model. Subgroup analyses for each sex category (independently for females and males) were conducted. Separate analyses were conducted for FMs and farmworkers to account for differences in available variables, coding systems, and data structures between these two farming populations. Each model included 21 potential independent variables for FMs and 13 for farmworkers (Table 1). Collinear covariates with a variance inflation factor (VIF) > 2.5 were excluded from the analysis. One-hot encoding was applied to all categorical variables with more than two categories, with the elimination of one category for each variable to avoid multicollinearity, leading to a total of 128 potential predictors for FMs and 123 for farmworkers. Continuous variables were standardized by removing the mean and scaling them to unit variance before ML. There was no missing data.
<table><caption>TABLE 1: List of variables considered in the analyses.</caption><thead><tr><th>Dependent variable</th><th>Modality</th><th>Farming population</th></tr></thead><tbody><tr><td>ATD prescription</td><td>2 categories: yes or no</td><td>FM, farmworkers</td></tr><tr><td><strong>Independent variables—potential covariates selected based on VIF</strong></td><td></td><td></td></tr><tr><td>Sex<sup>a</sup></td><td>2 categories: female or male</td><td>FM, farmworkers</td></tr><tr><td>Age</td><td>Continuous</td><td>FM, farmworkers</td></tr><tr><td>Family status<sup>b</sup></td><td>2 categories: single or as a couple</td><td>FM</td></tr><tr><td>Number of years of experience</td><td>Continuous</td><td>FM, farmworkers</td></tr><tr><td>Median farm surface</td><td>Continuous</td><td>FM</td></tr><tr><td>Number of years performing the considered activity</td><td>Continuous</td><td>FM, farmworkers</td></tr><tr><td>Number of farms</td><td>2 categories: 1 farm or &gt;1 farm</td><td>FM</td></tr><tr><td>Farm location</td><td>96 categories: administrative departments</td><td>FM, farmworkers</td></tr><tr><td>Farm type (farm clustering)</td><td>2 categories: individual farm or farm with work partners</td><td>FM</td></tr><tr><td>Partner work status</td><td>2 categories: partner not helping farm manager or partner helping FM with farming tasks</td><td>FM</td></tr><tr><td>Median number of associates</td><td>Continuous</td><td>FM</td></tr><tr><td>Median number of employees</td><td>Continuous</td><td>FM</td></tr><tr><td>Secondary activity</td><td>2 categories: no secondary activity performed or at least one secondary activity performed</td><td>FM</td></tr><tr><td>Number of helping family members</td><td>2 categories: 0 or ≥ 1</td><td>FM</td></tr><tr><td>Lack of job security</td><td>2 categories: has never been unemployed during the observation period (prior to the first antidepressant prescription or end of follow-up) or has been unemployed at least once during the observation period (prior to the first antidepressant prescription or end of follow-up)</td><td>FM</td></tr><tr><td>Median insurance premium</td><td>Continuous</td><td>FM</td></tr><tr><td>Insurance scheme</td><td>2 categories: being or not being affiliated to the FM insurance scheme</td><td>FM</td></tr><tr><td>Work status</td><td>2 categories: working as a FM or as a solidarity contributor</td><td>FM</td></tr><tr><td>Working years<sup>c</sup></td><td>15 categories: 2002, 2003, ..., 2016</td><td>FM, farmworkers</td></tr><tr><td>Seasonal work</td><td>2 categories: yes or no</td><td>Farmworkers</td></tr><tr><td>Having a permanent job</td><td>2 categories: yes or no</td><td>Farmworkers</td></tr><tr><td>Being a middle manager or senior executive</td><td>2 categories: yes or no</td><td>Farmworkers</td></tr><tr><td>Contract income</td><td>Continuous</td><td>Farmworkers</td></tr><tr><td>Percentage of partial time</td><td>Continuous</td><td>Farmworkers</td></tr><tr><td>Company size</td><td>5 categories: &lt; 20, 20–49, 50–149, 150–299, and &gt; 299 workers</td><td>Farmworkers</td></tr><tr><td>Number of preexisting medical comorbidities<sup>d</sup></td><td>Continuous</td><td>FM, farmworkers</td></tr><tr><td>Preexisting disability</td><td>2 categories: did not become disabled before the first antidepressant prescription (or end of follow-up) or became disabled before the first antidepressant prescription (or end of follow-up)</td><td>FM</td></tr></tbody></table>

Abbreviations: FM: farm manager, VIF: variance inflation factor.

<sup>a</sup>The analysis was adjusted on sex only for “both sexes”; otherwise, the sex was used for subgroup analyses.

<sup>b</sup>If the family status changed during the observation period, the most frequent family status was used.

<sup>c</sup>For individuals with an antidepressant prescription, only the working years prior to the first antidepressant prescription have been taken into account.

<sup>d</sup>For individuals with an antidepressant prescription, only the comorbidities declared prior to the first antidepressant prescription have been taken into account.

Downsampling was used to produce a balanced 70%/30% train/test split. No farmers contributed to both the training and test datasets. The training split was used to generate the learned models, while the testing dataset was used for the validation phase to assess the performance of each model to predict the class labels (i.e., having an ATD prescription or not having an ATD prescription). Nested cross-validation was used for each model to limit overfitting. More specifically, each model underwent a 10-fold nested crossvalidation. Hence, within each training dataset, a fold was defined at the individual level; that is, all farmers in a training dataset were randomly divided into 10-folds, or groups.
A random search approach was used to determine the optimal combination of hyperparameters for maximizing area under the receiver operator characteristic (AUROC) in order to generate the best model parameters. Multiple tuning hyperparameter values were used for each model. The XGBoost tuning was applied for each of the farming activities, with 26 datasets for FMs and 22 for farmworkers. The same procedure was also conducted independently for females and males. XGBoost tuning using a random search approach was performed by determining the optimal learning rate (eta), minimum loss reduction (gamma), maximum depth of a tree (max_depth), minimum sum of instance weight (hessian) needed in a child (min_child_weight), subsample ratio of the training instance (subsample), and subsample ratio of columns when constructing each tree (colsample_bytree). However, due to computational burden, not all combinations of tuning hyperparameters were considered. Thirty random sets of hyperparameters were tested for each dataset (26 × 3 = 78 in total for FMs and 22 × 3 = 66 in total for farmworkers), with hyperparameters lying in the following ranges: eta: [0.001-0.50]; gamma: [0-5.0]; max_depth: [1.0-20]; min_child_weight: [1.0-10]; subsample: [0.6-1.0]; learning_rate: [0.1-1.0]; and colsample_bytree: [0.6-1.0]. Final tuning parameters were selected using the best out-of-fold AUROC. To maintain a balance between positive and negative weights, we set the scale_pos_weight parameter to the ratio of negative (no ATD prescription reimbursement) to positive (≥ 1 ATD prescription reimbursement) depression cases. This XGBoost parameter facilitates class-weighted or cost-sensitive learning, enhancing the model's ability to account for misclassification in the minority class (i.e., class imbalance) [32].

Evaluation metrics, including AUROC and F1 score, were calculated for each model. To address the interpretability of ML models and determine the predictor's importance, an explainable AI approach was used. The predictor's importance was investigated using Shapley's additive explanation (SHAP), which shows the contribution of each predictor based on its marginal contribution [33]. This approach indicates to what extent and in which direction a certain predictor influences the model. When a predictor directed the model toward ATD prescriptions, it was considered a promoting predictor; when it directed the model toward no ATD prescription, it was considered a mitigating predictor.

All statistical analyses were performed using R software 4.3.0 (R Core Team, Vienna, Austria) for Windows 10. The *partition()* function from the R package *splitTools* to create the splits, the training, and the test sets, respectively [34]. The *create_folds()* function from *splitTools* was used to create random crossvalidated folds. The 10-fold nested crossvalidation was performed using the *MLCrossValidation()* function from the *mlexperiments* package [35]. The XGBoost learner was created using the *LearnerXgboost()* function from the *mllrnrs* package [36]. The *xgboost* package was used to create the XGBoost models using tuned hyperparameters and to calculate SHAP values [37]. The *predictions()* function from the *mlexperiments* package was used for the outcome prediction on the holdout test dataset. The *performance()* function from the *mlexperiments* package

was used to assess the prediction performance on the hold-
out test dataset. The *caret* library was used to compute the
confusion matrix and the other model performance metrics
[38]. The distribution, mean, and confidence intervals of
the AUROC were computed with the *roc()* and *auc()* func-
tions from the *pROC* package [39].

3. Results

3.1. *Population Characteristics.* Among the 1,088,561 FMs included in this study, 83,592 (8%) had at least one ATD prescription reimbursement between 2012 and 2016 (Table 2). The proportion of FMs with an ATD prescription who worked over 2002–2016 ranged from 8.5% in 2002 to 8.2% in 2012, before declining to 7.9% in 2013 and to 6.9% in 2016 (Figure S1). Selective serotonin reuptake inhibitors (SSRIs) accounted for the majority of prescribed ATDs (64.6%), with escitalopram, paroxetine, and amitriptyline being the most commonly prescribed (Figure S2).

The proportion of FMs with an ATD prescription ranged from 5% to 9% in all activities, with the exception of salt works (4.6%), unspecified small animal farming (4.3%), and rural craftsperson (0.3%) (Figure 1). The highest proportion of FMs with an ATD prescription was found in poultry and rabbit farming (9.0%), dairy farming (8.9%), and cow farming (8.9%), respectively. In contrast, the lowest proportions of FMs with an ATD prescription were observed in salt works (4.6%), unspecified small animal farming (4.3%), and rural craftsperson (0.3%).

Geographically, ATD prescription rates among FMs were heterogeneous across mainland France (Figure S3). The lowest rates (<7%) were primarily concentrated in the south and southeast (Table 2), while the highest rates (>8%) were mainly observed in central and northern regions.

Among the 5,831,302 farmworkers included in this study, 149,285 (2.6%) had at least one ATD prescription reimbursed between 2012 and 2016 (Table 3). The proportion of farmworkers with an ATD prescription remained stable at around 5.5% between 2002 and 2011, before declining to 4.6% in 2013 and 0.8% in 2016 (Figure S4). As with FMs, SSRIs were the most frequently prescribed ATDs (64.6%), with escitalopram, paroxetine, and fluoxetine being the most common (Figure S5).

Across different farming activities, ATD prescription rates among farmworkers ranged from 1.5% to 4.8% (Figure 2). The highest proportions were found in stationary sawmills (4.8%), forestry (4.8%), and gardeners and park rangers (4.6%). In contrast, the lowest rates were observed in construction rural craftsperson (1.8%), shellfish farming (1.8%), and viticulture (1.5%).

Regional variations were also evident among farm-
workers, with heterogeneous ATD prescription rates across
mainland France (Figure S3). The lowest proportions
(<2.3%) were primarily found in eastern France (Table 3),
whereas the highest rates (>8%) were mostly observed in
the North and Corsica.

3.2. *Model Performance.* Models performed well, with *F1* scores ranging from 0.65 to 0.92 for FMs and from 0.79 to
<table><caption>TABLE 2: Characteristics of the farm manager population, TRACTOR project, France, 2002–2016.</caption><thead><tr><th></th><th>FM without ATD prescription<br>(n = 1,004,969)</th><th>FM with ≥1 ATD prescription<br>(n = 83,592)</th></tr></thead><tbody><tr><td>Sex</td><td></td><td></td></tr><tr><td>Female</td><td>300,488 (29.9)</td><td>36,775 (44.0)</td></tr><tr><td>Male</td><td>704,481 (70.1)</td><td>46,817 (56.0)</td></tr><tr><td>Age, mean (SD), year</td><td>46.3 (14.2)</td><td>49.2 (13.4)</td></tr><tr><td>Family status<sup>a</sup></td><td></td><td></td></tr><tr><td>Single</td><td>445,810 (43.7)</td><td>30,129 (36.0)</td></tr><tr><td>As a couple</td><td>573,503 (56.3)</td><td>53,463 (64.0)</td></tr><tr><td>First year of the farm's establishment, mean (IQR), year</td><td>1994 (17.0)</td><td>1992 (14.0)</td></tr><tr><td>Farm surface, median (IQR), hectares</td><td>15.3 (4.41)</td><td>25.3 (4.98)</td></tr><tr><td>Number of working years, median (IQR), year</td><td>8.00 (10.0)</td><td>10.0 (8.00)</td></tr><tr><td>Work location (region)</td><td></td><td></td></tr><tr><td>Auvergne-Rhône-Alpes</td><td>109,074 (10.9)</td><td>8466 (10.1)</td></tr><tr><td>Bourgogne-Franche-Comté</td><td>60,534 (6.02)</td><td>5353 (6.40)</td></tr><tr><td>Bretagne</td><td>74,714 (7.43)</td><td>6533 (7.82)</td></tr><tr><td>Centre-Val de Loire</td><td>45,605 (4.54)</td><td>4205 (5.03)</td></tr><tr><td>Corse</td><td>4962 (0.49)</td><td>373 (0.45)</td></tr><tr><td>Grand Est</td><td>75,685 (7.53)</td><td>6154 (7.36)</td></tr><tr><td>Hauts-de-France</td><td>44,519 (4.43)</td><td>3872 (4.63)</td></tr><tr><td>Île-de-France</td><td>12,964 (1.29)</td><td>1115 (1.33)</td></tr><tr><td>Normandie</td><td>73,932 (7.36)</td><td>6662 (7.97)</td></tr><tr><td>Nouvelle-Aquitaine</td><td>165,286 (16.4)</td><td>15,031 (18.0)</td></tr><tr><td>Occitanie</td><td>155,192 (15.4)</td><td>11,673 (14.0)</td></tr><tr><td>Provence-Alpes-Côte d'Azur</td><td>96,241 (9.58)</td><td>7178 (8.59)</td></tr><tr><td>Pays de la Loire</td><td>76,451 (7.61)</td><td>6178 (7.39)</td></tr><tr><td>Number of farms</td><td></td><td></td></tr><tr><td>1 farm</td><td>995,030 (97.6)</td><td>81,204 (97.1)</td></tr><tr><td>> 1 farm</td><td>24,283 (2.38)</td><td>2388 (2.86)</td></tr><tr><td>Farm type (farm clustering)</td><td></td><td></td></tr><tr><td>Individual farm</td><td>758,320 (74.4)</td><td>70,336 (84.1)</td></tr><tr><td>Farm with work partners</td><td>260,993 (25.6)</td><td>13,256 (15.9)</td></tr><tr><td>Work status</td><td></td><td></td></tr><tr><td>Working as a farm manager</td><td>902,024 (88.5)</td><td>71,632 (85.7)</td></tr><tr><td>Working as a solidarity contributor</td><td>117,289 (11.5)</td><td>11,960 (14.3)</td></tr><tr><td>Partner work status</td><td></td><td></td></tr><tr><td>No help from romantic partner</td><td>902,024 (88.5)</td><td>71,632 (85.7)</td></tr><tr><td>Help provided by romantic partner</td><td>117,289 (11.5)</td><td>11,960 (14.3)</td></tr><tr><td>Number of associates, median (IQR), No.</td><td>1.00 (0.50)</td><td>1.00 (1.00)</td></tr><tr><td>Helping family members</td><td></td><td></td></tr><tr><td>No help from family members</td><td>1,019,276 (99.9)</td><td>83,584 (99.9)</td></tr><tr><td>Help from family members</td><td>37 (0.004)</td><td>8 (0.01)</td></tr><tr><td>Secondary activity (work diversification)</td><td></td><td></td></tr><tr><td>No secondary activity performed</td><td>622,662 (61.1)</td><td>69,536 (83.2)</td></tr><tr><td>At least one secondary activity performed</td><td>396,651 (38.9)</td><td>14,056 (16.8)</td></tr><tr><td>Lack of job security</td><td></td><td></td></tr><tr><td>Has never been unemployed during the observation period<br>(prior to the first antidepressant prescription or end of follow-up)</td><td>1,017,387 (99.8)</td><td>83,380 (99.7)</td></tr><tr><td>Has been unemployed at least once during the observation period<br>(prior to the first antidepressant prescription or end of follow-up)</td><td>1905 (0.2)</td><td>213 (0.3)</td></tr></tbody></table>
<table><caption>TABLE 2: Continued.</caption><thead><tr><th></th><th>FM without ATD prescription<br>(n = 1,004,969)</th><th>FM with ≥1 ATD prescription<br>(n = 83,592)</th></tr></thead><tbody><tr><td>Median yearly insurance premium, median (IQR), euro</td><td>5026 (9941)</td><td>6117 (10624)</td></tr><tr><td>Employees, median (IQR), No.</td><td>0.00 (0.50)</td><td>0.00 (0.50)</td></tr><tr><td>Insurance scheme</td><td></td><td></td></tr><tr><td>Not being affiliated to the farm manager insurance scheme</td><td>338,578 (33.2)</td><td>9028 (10.8)</td></tr><tr><td>Being affiliated to the farm manager insurance scheme</td><td>680,735 (66.8)</td><td>74,564 (89.2)</td></tr><tr><td>Preexisting disability</td><td></td><td></td></tr><tr><td>Did not become disabled prior to the first antidepressant<br>prescription or end of follow-up</td><td>1,015,793 (99.7)</td><td>82,679 (98.9)</td></tr><tr><td>Became disabled prior to the first antidepressant prescription<br>or end of follow-up</td><td>3520 (0.35)</td><td>913 (1.09)</td></tr><tr><td>Number of preexisting comorbidities (LTIs)</td><td></td><td></td></tr><tr><td>No comorbidity prior to the first antidepressant<br>prescription or end of follow-up</td><td>647,288 (64.4)</td><td>38,513 (46.1)</td></tr><tr><td>1 comorbidity prior to the first antidepressant<br>prescription or end of follow-up</td><td>255,021 (25.4)</td><td>28,234 (33.8)</td></tr><tr><td>&gt; 1 comorbidity prior to the first antidepressant<br>prescription or end of follow-up</td><td>102,660 (10.2)</td><td>16,845 (20.2)</td></tr></tbody></table>

Abbreviations: FM: farm manager, IQR: interquartile range, LTI: long-term illness, SD: arithmetic standard deviation.

0.94 for farmworkers (Table S3). In FMs, for most activities (92%), the mean AUROC was greater than 0.80 for the analyses considering all FMs, while it was greater than 0.80 for 77% and 85% of the activities for females and males, respectively. In farmworkers, the mean AUROC ranged from 0.80 to 0.92 when considering the entire population, while it ranged from 0.82 to 0.93 for females and from 0.80 to 0.91 for males, respectively.

### 3.3. *Predictor's Importance.*
Figures 3 and 4 present the most important predictors based on the mean absolute SHAP value (maSHAP) along with their most frequent impact, defined as the percentage of activities for which the predictor directed the model toward ATD prescriptions or not, for FMs and farmworkers, respectively. The results for independent subgroup analyses of females and males are presented in Figures S6, S7, S8, and S9, respectively. The detailed analysis of the most important predictors by sex category for each of the 26 farming activities for FMs and each of the 22 activities for farmworkers is available in Figures S10, S11, S12, S13, S14, and S15 and Table S4. Many of the most important predictors were similar across farming populations, activities, and sexes.

Regarding FMs, the most important predictors of depression were the working years, in particular 2016, which was a promoting predictor (directing toward ATD prescriptions) for 50% of the activities (maSHAP = 1.63), in particular crop farming, fruit arboriculture, viticulture, and dairy farming. Being male (maSHAP = 0.07) was a mitigating predictor (directing toward no ATD prescriptions) for most activities (89%). Performing a secondary activity in parallel to a main agricultural practice (work diversification) was often a promoting predictor (maSHAP = 0.17) (69% of all

activities), with the exception of crop farming, salt works, unspecified animal farming, and unspecified specialized farming. Age was a mitigating predictor for most activities (73%), with the exception of unspecified large animal farmers and female crop farmers. Being a solidarity contributor, that is, a FM who farms on a small surface (< 12.5 ha) and/or who works less than 1200 hour/year, was mostly a promoting predictor (maSHAP = 0.09) (81% of all activities), except for crop farming. Having employees (maSHAP = 0.07), the number of preexisting comorbidities (maSHAP = 0.05), and having work associates (maSHAP = 0.02) were found to be promoting predictors for most activities. Being single (maSHAP = 0.05) was a promoting predictor in 46% and 19% of the activities for females and males, respectively.

Among farmworkers, the most important predictors of depression were the working years, in particular 2016, which was a promoting predictor for all activities (maSHAP = 0.66). In contrast, the number of years of experience was a mitigating predictor across all activities (maSHAP = 0.44). Age (maSHAP = 0.28) was also a mitigating predictor for most activities (68%), except for those working in forestry, wood-related industries, gardeners, park rangers, and administrative roles. Median yearly income (maSHAP = 0.07) and holding a permanent job (maSHAP = 0.04) were generally mitigating predictors, whereas preexisting comorbidities (maSHAP = 0.07) and seasonal employment (maSHAP = 0.04) were promoting predictors in most activities where these variables were selected. Although sex was not a strong predictor of depression among farmworkers, some differences were observed. Unlike males, the number of years of experience was a promoting predictor for females working in forestry. Sex-related disparities were also noted for age. In females, age was a promoting predictor in gardening, landscaping, agricultural work companies, and forestry,

<footnote>ªIf the family status changed during the observation period, the most frequent family status was used.</footnote>
<figure><img src="image_2.png" /><figcaption>FIGURE 1: Number of farm managers with and without an antidepressant prescription by activity for each sex category. ATD: antidepressant. The percentages on the left of the bars on the right part of the graph refer to the proportion of males and females for each activity.</figcaption></figure>

whereas in males, it was a promoting predictor for park rangers, as well as those engaged in administrative jobs, horse-related activities, large animal farming, and mushroom farming.

## 4. Discussion

The XGBoost algorithm was used to compare 128 variables to identify key predictors of depression in the entire French FM population. While several predictors of depression were shared across farming populations, activities, and sexes, notable differences were observed, consistent with previous findings [11]. Among FMs, the most important predictors included working years, sex, age, engagement in a secondary activity (i.e., work diversification), and work status. In farmworkers, key predictors were working years, years of experience, age, job security, job type, income, and preexisting health conditions.

### 4.1. Possible Outside/External Factors.
Farmers' works are highly dependent on external conditions (e.g., weather conditions and disease outbreaks), for which they have no control. Of the top predictors of depression, the working years emerged as the most important. The working year could reflect a risk from previous years if there was a lag between adverse events and their repercussions on mental health. The working year may also be a proxy for external conditions outside the farmer's control, conflating multiple external events that cumulatively impact farmers' mental health, such as harsh weather (e.g., drought) [3, 4, 11], commodity price fluctuations [3–5, 40], or new government policies and regulations [4, 11].

The increasing severity and frequency of extreme weather events due to climate change pose major challenges for agriculture, as they can disrupt farm productivity [11]. Water scarcity, a direct consequence of climate change, has profound implications for farmers, affecting crop yields and livestock conditions, increasing production costs, and creating immediate financial pressures [11]. To mitigate the impact of drought, farmers often face heavier workloads, implementing measures such as night watering or securing and transporting additional water [11]. Droughts and heat

waves also contribute to shifts in pest populations and disease outbreaks, leading to more frequent and severe infections that can result in reduced production, crop loss, and livestock failure [3, 11, 41]. In cases of widespread disease, farmers may be forced to cull animals, a process associated with increased risk of depression [19]. As climate change intensifies, the growing pressure to adapt farming practices and production methods may further contribute to stress, given the close interdependence between agricultural output and financial stability [3, 11]. Notably, the year 2016 emerged as a top predictor, being a promoting predictor for 50% of the activities in FMs, especially truck farming, fruit arboriculture, crop farming, viticulture, dairy farming, and poultry and rabbit farming, and across all activities in farmworkers. The year 2016 was particularly challenging for agriculture, as extreme weather conditions and a financial crisis led to substantial losses in crop and wine production [42, 43]. In addition, the sector faced a sharp decline in animal product prices, especially for dairy and poultry, along with a rise in the agricultural unemployment rate [42, 43]. France has also experienced other severe weather events, including the 2003 heatwave [44, 45], droughts in 2009, 2012, and 2014–2016 [44, 46], as well as major floods in 2002 and 2010 [44]. Beyond climatic challenges, the agricultural sector was also impacted by the global financial and food crisis of 2007–2008 [47], the global milk price crisis of 2015 [46], and several disease outbreaks (e.g., between 2015 and 2016) that resulted in animal culling [48].

Economic crises can lead to deterioration of mental health [3–5], with, for instance, the worldwide economic crisis of 2007/2008 that affected agriculture, and in particular dairy farmers [47, 49, 50]. Incidentally, we observed that working in 2007/2008 was a promoting predictor for dairy farmers. During a crisis, farmers can be faced with decreasing demand, higher input costs and market pressure, and low commodity prices, which can lead to irregular or lower income. Fluctuations in market prices for agricultural products contribute to income uncertainty. Greater financial hardship is associated with higher depression risks [2–5, 7, 8, 14, 49].
<table><caption>TABLE 3: Characteristics of the farmworker population, TRACTOR project, France, 2002–2016.</caption><thead><tr><th></th><th>Farmworkers without ATD prescription (n = 5,682,017)</th><th>Farmworkers with ≥ 1 ATD prescription (n = 149,285)</th></tr></thead><tbody><tr><td>Sex</td><td></td><td></td></tr><tr><td>Female</td><td>2,436,708 (42.9)</td><td>79,076 (53.0)</td></tr><tr><td>Male</td><td>3,245,309 (57.1)</td><td>70,209 (47.0)</td></tr><tr><td>Age, mean (SD), year</td><td>28.1 (13.2)</td><td>38.7 (12.2)</td></tr><tr><td>Work status</td><td></td><td></td></tr><tr><td>Being a seasonal worker</td><td>2,681,323 (47.2)</td><td>21,340 (14.3)</td></tr><tr><td>Not being a seasonal worker</td><td>3,000,694 (52.8)</td><td>127,945 (85.7)</td></tr><tr><td>Job type</td><td></td><td></td></tr><tr><td>Having a permanent job</td><td>924,425 (16.3)</td><td>93,062 (62.3)</td></tr><tr><td>Not having a permanent job</td><td>4,757,592 (83.7)</td><td>56,223 (37.7)</td></tr><tr><td>Work type</td><td></td><td></td></tr><tr><td>Being an employee</td><td>5,530,981 (97.3)</td><td>133,455 (89.5)</td></tr><tr><td>Being a middle manager or senior executive</td><td>151,036 (2.72)</td><td>15,830 (10.6)</td></tr><tr><td>Contract income, median (IQR), euros</td><td>3195 (11446)</td><td>11,142 (20101)</td></tr><tr><td>Number of working years, median (IQR), year</td><td>2.17 (3.78)</td><td>2.00 (4.70)</td></tr><tr><td>Percentage of partial time, median (IQR)</td><td>2.49 (12.1)</td><td>8.92 (23.0)</td></tr><tr><td>Work location (region)</td><td></td><td></td></tr><tr><td>Auvergne-Rhône-Alpes</td><td>74,9379 (11.9)</td><td>13,916 (8.37)</td></tr><tr><td>Bourgogne-Franche-Comté</td><td>389,911 (6.19)</td><td>8848 (5.32)</td></tr><tr><td>Bretagne</td><td>413,129 (6.56)</td><td>13,658 (8.22)</td></tr><tr><td>Centre - Val de Loire</td><td>310,244 (4.92)</td><td>9037 (5.44)</td></tr><tr><td>Corse</td><td>23,634 (0.38)</td><td>1219 (0.73)</td></tr><tr><td>Grand Est</td><td>718,946 (11.4)</td><td>13,048 (7.85)</td></tr><tr><td>Hauts-de-France</td><td>299,554 (4.76)</td><td>9952 (5.99)</td></tr><tr><td>Île-de-France</td><td>233,861 (3.71)</td><td>10,279 (6.19)</td></tr><tr><td>Normandie</td><td>223,991 (3.56)</td><td>8674 (5.22)</td></tr><tr><td>Nouvelle-Aquitaine</td><td>962,419 (15.3)</td><td>27,704 (16.7)</td></tr><tr><td>Occitanie</td><td>730,912 (11.6)</td><td>19,257 (11.6)</td></tr><tr><td>Provence-Alpes-Côte d'Azur</td><td>674,860 (10.7)</td><td>17,657 (10.6)</td></tr><tr><td>Pays de la Loire</td><td>568,834 (9.03)</td><td>12,913 (7.77)</td></tr><tr><td>Company size</td><td></td><td></td></tr><tr><td>Working in a company with fewer than 20 workers</td><td>4,830,168 (85.0)</td><td>117,747 (78.9)</td></tr><tr><td>Working in a company with between 20 and 49 workers</td><td>345,398 (6.08)</td><td>10,851 (7.27)</td></tr><tr><td>Working in a company with between 50 and 149 workers</td><td>225,507 (3.97)</td><td>8381 (5.61)</td></tr><tr><td>Working in a company with between 150 and 299 workers</td><td>116,656 (2.05)</td><td>4242 (2.84)</td></tr><tr><td>Working in a company with over 299 workers</td><td>164,287 (2.89)</td><td>8063 (5.40)</td></tr><tr><td>Number of preexisting comorbidities (LTIs)</td><td></td><td></td></tr><tr><td>No comorbidity prior to the first antidepressant prescription or end of follow-up</td><td>5,005,585 (88.1)</td><td>89,217 (59.8)</td></tr><tr><td>1 comorbidity prior to the first antidepressant prescription or end of follow-up</td><td>616,172 (10.8)</td><td>41,680 (27.9)</td></tr><tr><td>>1 comorbidity prior to the first antidepressant prescription or end of follow-up</td><td>60,260 (1.06)</td><td>18,388 (12.3)</td></tr></tbody></table>

Abbreviations: IQR: interquartile range, LTI: long-term illness, SD: arithmetic standard deviation.

An introduction or a change in economic policies can also influence farmers' mental health [11]. For example, the removal of the EU Milk Quota System in 2015 increased financial uncertainty, particularly among dairy farmers.

Since its introduction in 1984, this policy served as a safeguard, stabilizing milk prices by protecting against lower priced competition from outside Europe [11]. Navigating intricate regulatory frameworks requires substantial time
<figure><img src="image_3.png" /><figcaption>FIGURE 2: Number of farmworkers with and without an antidepressant prescription by activity for each sex category. ATD: antidepressant. The percentages on the left of the bars on the right part of the graph refer to the proportion of males and females for each activity.</figcaption></figure>

and cognitive effort, often resulting in stress [11, 51]. Studies have shown that adherence to governmental policies, including the completion of paperwork and undergoing inspections, serves as a major stressor for farmers, contributing to heightened anxiety and a sense of marginalization [11, 51].

## 4.2. Possible Individual Factors.
In line with existing literature, younger age was identified as a promoting predictor, whereas older age was mainly a mitigating predictor of depression [2, 6, 8, 11, 17, 23, 52]. Previous studies suggest that young farmers, particularly those with limited experience in handling the challenges of farm work, are more vulnerable to physical and mental occupational injuries due to lower resilience and fewer coping mechanisms [11]. Consistent with existing literature [3, 5, 6, 8, 15, 17, 21, 28], sex also emerged as a strong predictor, but only among FMs, with female sex being a promoting predictor of depression in most activities (89%). There were differences between both sexes. Being single was a promoting predictor for female FMs in 46% of the activities, which is consistent with existing literature [5, 53]. In contrast, it was a promoting factor for male FMs in 19% of the activities. Having a romantic partner who does not help with farming tasks was found to be a promoting predictor in female FMs for 27% of the activities and a mitigating predictor in male FMs for 54% of the activities. In published literature, social isolation, loneliness, and being single were associated with depression, which could play a role in our findings, in particular for females [2–9, 11, 28]. Regarding male farmers, a study showed that poor work–life balance (role conflict between work and family) was associated with depression in males only [17]. Our findings may also potentially reflect differences between males and females regarding lifestyle factors (e.g., diet, physical activity, and smoking), coping mechanisms, resilience, and the will to access care, with females being more susceptible or willing to seek help than males [3, 11, 54]. Consistent with our findings, the number of previous health conditions and having a previous injury were promoting predictors in all farmers [5, 28].

## 4.3. Possible Occupational Factors.
Psychosocial risks in agriculture generally arise from suboptimal working conditions, which may result from factors such as work design, organization, management, or the social context of the workplace [11]. Having employees was found to be a promoting predictor for most activities (77%) in FMs. FMs managing employees may experience managing problems such as administrative issues (absenteeism management and financial responsibility), interpersonal conflict, and poor workplace relationships with their employees, which were shown to be risk factors for depression [3, 8, 11, 52]. Interpersonal conflicts may also play a role in the fact that having work associates was also a promoting predictor for 46% of the activities in FMs. A study reported that being a member of a farming organization (farm clustering) was protective against social stress, while performing only one agricultural practice (e.g., pig farming) was protective against financial stress [55]. Performing a secondary activity in parallel to a main agricultural practice (diversification) was often (69% of the activity) a promoting predictor. Having more than one activity could imply more responsibilities, more paperwork, more irregular income, and/or more working hours, which are risk factors for depression [3]. In FMs, the number of years of experience was generally a promoting factor, in particular in forestry, dairy farming, mixed cattle farming, and crop farming, which is consistent with previous findings [5, 11]. Previous studies suggest that older farmers have increased susceptibility to the physical demands of farm tasks and heightened sensitivity to stressors stemming from structural factors, especially those related to the farm's future [11]. In addition, older farmers often continue working beyond retirement age due to farm responsibilities and concerns about the future of agriculture [11, 17]. In contrast, in line with the literature [11], the number of years of experience served as a mitigating predictor for farmworkers across all activities. This may be because, with increased experience, resilience and coping mechanisms tend to improve [11]. Farming on a small surface (< 12.5 ha), working fewer than 1200 h/year, and being a seasonal worker were promoting
<figure><img src="image_4.png" /></figure>

FIGURE 3: Most important predictors and their impact according to SHAP values among farm managers. ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescription (depressive disorder, in red) or no ATD prescription (no depressive disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.

<figure><img src="image_5.png" /></figure>

FIGURE 4: Most important predictors and their impact according to SHAP values among farmworkers. ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescription (depressive disorder, in red) or no ATD prescription (no depressive disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.

predictors, possibly due to lower income, job insecurity, and/or vulnerability to economic crises and extreme weather events [11, 56]. In contrast, the median yearly income and holding a permanent job were mainly mitigating predictors among farmworkers.

4.4. *Strengths and Limitations of This Work.* One of the main strengths of our study was the use of large training datasets for developing prediction models while retaining a large independent validation dataset to assess performance. Our findings amplify and go beyond prior work by shedding
some light on specific predictors for depression among farmers based on their professional categories (i.e., FMs and farmworkers), farming activities, and sexes. To our knowledge, this is the first nationwide study using ML to identify associated predictors of depression among farmers that examines differences by farming population, activities, and sexes [28, 57]. XGBoost is a flexible, nonlinear tree-based ML algorithm designed to prioritize model simplicity, which helps prevent overfitting and enhances generalization capacity [31]. Widely recognized in data science and healthcare, XGBoost has consistently outperformed many other ML algorithms [58–61]. Its ability to capture nonlinear relationships and efficiently handle missing data further strengthens its application in diverse contexts [31, 62]. We selected XGBoost over other ML algorithms due to these advantages, as well as its high accuracy in predicting depressive symptoms and disorders [32, 62–65]. In addition, XGBoost offers a more robust modeling process compared to single ML models, such as logistic regression or support vector machines [64]. It is also computationally more efficient than neural networks [64], and its high speed and performance make it a dominant tool for analyzing structured data in applied ML [32]. In addition, to address the interpretability of ML models and to determine the importance of key predictors, cutting-edge explainable AI was used, which, to our knowledge, has never been done before for studying depression in agriculture. According to a recent study, the generalizability and reliability of findings using ML may be better than those from studies based on conventional parametric statistical techniques and a smaller sample size [28].

While using administrative health data is less expensive and less time-consuming than using data recorded specifically for epidemiological purposes (e.g., cohort studies), their accuracy is sometimes limited in comparison to cohort studies [12, 24, 25]. Some of the limitations of our study come from the administrative nature of the data used, in particular the identification of depression cases and the limited range of confounders available. We decided to classify depression solely based on ATD reimbursement data to focus on farmers who are actively receiving treatment. This approach, which has been used in other studies (e.g., [30]), allows us to identify individuals who may be at an earlier or milder stage of depression, which aligns with a prevention-focused perspective aimed at detecting early predictors of depression before it progresses to major depressive disorder. To minimize misclassification, we could have integrated ATD reimbursement data with long-term disease declaration data. The MSA includes information on diagnoses of long-term conditions eligible for full reimbursement, including mental health disorders such as major depressive disorder [10]. However, the long-term disease data is limited to major depressive disorder and suffers from issues like imprecise diagnoses, incomplete case reporting, and the potential for double reporting [66]. Additionally, the long-term disease declaration system is unique to France, limiting its applicability in other countries. Moreover, the MSA does not capture any clinical information related to consultations, prescriptions, hospitalizations, or examinations [29]. Therefore, relying on ATD reimbursement data may help to minimize

the risk of underreporting and related biases. However, using ATD prescription reimbursement as a proxy for depression is not optimal because only FMs under medical care can be identified, because ATDs are not always used to treat depression, and because the rates of ATD use are lower in rural communities than in individuals living in urban areas [3, 10, 67]. Hence, the number of FMs suffering from depression reported in this study is likely to be inaccurately estimated [10]. ATDs are predominantly used for the treatment of depressive disorders but can also be used to treat other diseases, including anxiety disorders, insomnia, and pain [68]. Indications for the ATD prescriptions were not available, but most ATDs prescribed were SSRIs, which are the most used ATD class for mental health problems [68, 69]. This limitation may have influenced our results, particularly by introducing a lack of specificity (potential false positives), which could have led to stronger observed associations than the true relationships due to misclassification of depression cases. Conversely, a lack of sensitivity (potential false negatives) cannot be ruled out, as farmers tend to exhibit lower healthcare-seeking behavior for mental health issues compared to the general population [11, 70]. This may be attributed to the stigma surrounding mental health in rural communities, which can deter farmers from disclosing their symptoms to healthcare providers [11], as well as to limited access to mental health services in these areas, reducing the likelihood of depression diagnoses being recorded in administrative data. As a result, true depression cases may be missed, introducing further misclassification that could weaken the associations between identified predictors and depression relative to their true magnitude.

Another limitation associated with the use of administrative health data is the lack of certain confounders, notably pesticide exposure, family history of depression, access to care, and harmful lifestyle factors. The MSA, being an insurance scheme designed solely for payment purposes, does not collect data on chemical (e.g., pesticide), physical, or biological exposures, nor does it capture other key variables relevant to epidemiological studies. These include smoking and alcohol consumption history, education level, diet, farming practices (e.g., conventional vs. organic), lifestyle habits, secondary occupations, and personal or family histories of diseases or exposure to specific risk factors from previous jobs [29]. Many of these factors are recognized as depression risk factors [2–4, 9]. For example, farmers often cite alcohol use as a primary coping mechanism for managing stress [71]. To mitigate potential confounding arising from the absence of these confounders in MSA data, we included several variables in our models, such as “number of farms” and “partner’s work status,” which may serve as proxies for more complex socioeconomic contexts. However, the inability to adjust for unmeasured confounders remains a concern, as it may introduce bias in the estimation of predictor effects, though the extent of this bias is difficult to quantify in the absence of these variables.

Because agricultural practices can differ between countries, the generalizability of some of our findings may be limited. Access to more recent data (post-2016) was not possible due to both mandatory and technical constraints.
Specifically, as part of the TRACTOR project, only 5 years of
medical data were available. Obtaining access to more recent
data would require new authorization from both the ethics
committee and the MSA, a process that could take several
months. Furthermore, MSA is permitted to retain only the
five most recent years of medical data. Additionally, MSA
altered its anonymization process between 2017 and 2018,
making it impossible to link pre-2017-2018 data with newer
records, resulting in the loss of follow-up data from 2002 to
2016. While our findings could be strengthened by incorpo-
rating more recent data (post-2016) and investigating
whether predictors have shifted over time, no other study
on mental health issues has yet accessed more recent MSA
data. Despite the limitation of using data only up to 2016,
our findings remain relevant, as several identified predictors
continue to hold importance today. However, a similar anal-
ysis with more recent data would be valuable, as emerging
stressors might alter the ways in which depression manifests
in farmers. The COVID-19 pandemic, for example, has
exacerbated underlying mental health challenges, with
potentially long-lasting and delayed effects [56, 72]. Addi-
tional stressors, such as workforce shortages, increasing
extreme weather events, the growing shift to organic farming
(the green transition), and greater technological integration
in agriculture (mechanization and digitalization) [11], could
also impact mental health. Moreover, the rising administra-
tive burden linked to more stringent regulations is another
important factor [11]. New policies, such as the European
Union-Mercosur free trade agreement or the imposition of
tariffs on agricultural products entering the US from April
2, 2025, may also have major implications for farmers' men-
tal health.

4.5. *Public Health Implications.* Depression among farmers represents a major public health concern, yet it is largely preventable. Identifying key predictors is essential for informed clinical decision-making and effective care planning [73]. Our findings shed some light on predictors that may be detrimental to farmers’ mental health. Since depression is strongly associated with an elevated risk of suicide [11, 74–76], which remains a critical issue within farming communities [5, 77], understanding these predictors is vital not only for preventing depression but also indirectly for reducing suicide risk. Our results highlight the variability in treated depression predictors across different professional categories, farming activities, and sexes. This underscores the need for targeted and tailored support systems that account for these disparities. For instance, farming activities particularly vulnerable to external factors, such as climate change, may require structural adaptations and policy interventions to enhance resilience [77]. In addition, future research exploring sex- and activity-related differences in depression predictors among farmers may benefit from a closer examination of social disparities and sex role socialization, which may shape the manifestation of depressive symptoms [28, 54]. Our findings may inform ongoing mental health prevention strategies in agriculture, especially considering the alarming suicide rate among French farmers, with one suicide every 2 days in 2018 [11]. In response,

the MSA and the French government have implemented
various policy measures, such as the EGalim laws, which
ensure that farmers’ revenues reflect production costs by
integrating them into the purchase price of agricultural
products [11]. Additionally, the MSA has developed several
mental health programs, including Agri’écoute, a free 24/7
helpline; the “Et si on parlait du travail?” initiative, which
fosters collaborative discussions, and dedicated research
grants to support mental health in agriculture [11]. While
prevention efforts are essential, they must be complemented
by effective interventions [1, 4]. To ensure that our findings
contribute to policy and practice, we will present them
nationally to the MSA, agricultural mental health stake-
holders, and all 35 local MSA offices, as we did with a previ-
ous work [10]. These presentations will facilitate discussions
with healthcare providers and local actors engaged in mental
health promotion, fostering exchanges that align our find-
ings with on-the-ground experiences. This collaborative
approach could help shape future research and interventions
tailored to at-risk farming groups (e.g., solidarity contribu-
tors) at a local level. Additionally, MSA actors may integrate
and leverage our results to enhance or expand existing men-
tal health initiatives.

4.6. *Clinical Implications.* While external validation remains necessary to assess its clinical utility, this study offers several important clinical implications. Indeed, by identifying key depression predictors within farming populations—differen- tiated by professional category, activity, and sex—our find- ings contribute to a more nuanced understanding of the diverse predictors influencing farmers’ mental health. These insights could help address disparities both within and across farming communities and inform targeted mental health interventions. Identifying predictors specific to differ- ent farming groups may enable healthcare providers to prioritize interventions based on individual risk profiles, ultimately improving outcomes and mitigating mental health deterioration in vulnerable subpopulations. For example, understanding whether and how particular farm- ing tasks—such as crop production or animal husband- dry—affect depression risk among farmers and farmworkers across sexes could lead to more personalized and effective mental health strategies. By distinguishing pre- dictors according to farming population, activity, and sex, our findings can support the development of tailored, group-specific approaches, ensuring that both preventive and clinical interventions account for occupational and sex-related differences in mental health expression and cop- ing mechanisms. Furthermore, our results may contribute to advancements in AI-driven mental healthcare by providing clinicians with valuable insights into the complex clinical manifestations of depression. This knowledge could facilitate the identification of high-risk individuals through tools such as digital phenotyping and help differentiate depression subtypes (e.g., exogenous depression) [56]. Additionally, these predictors could aid in the development of clinical decision-support tools, such as risk calculators, to enhance healthcare providers’ ability to identify at-risk individuals and recommend appropriate interventions [27, 78]. Such
insights could also inform personalized screening and inter-
vention strategies, including addressing modifiable depres-
sion predictors and providing targeted social support for
farmers. Finally, given the accessibility barriers many
farmers face in seeking in-person mental healthcare [11],
telehealth presents promising opportunities for remote clin-
ical interventions [56, 79, 80]. By integrating digital tools
into mental healthcare frameworks, clinicians may be better
equipped to deliver timely, tailored support to farmers who
might otherwise struggle to access conventional services.

5. Conclusion

AI has great potential to reshape our understanding of men-
tal disorders and how to prevent them. Leveraging AI to
analyze real-world big data offers an unprecedented oppor-
tunity for digital public health [26], clinical decision-mak-
ing, and care planning. This work illustrates the usefulness
of ML in identifying important predictors of depression in
farmers. Our findings could act as a starting point for iden-
tifying potential targets for prevention and intervention.
Combining the use of big data and AI with cohort enrich-
ment and interpretation by experts from various fields
(e.g., psychiatrists) may broaden the path of research. In
the future, such an approach could be implemented in rou-
tine to systematically compare a broad array of socio-demo-
graphic, health, individual, and occupational variables as
predictors of depression at a population scale, providing
real-time insights that would benefit and support a digital
depression surveillance system for farmers and guide future
efforts for depression prevention. The presented approach
could also be generalized to other health issues (e.g., neuro-
degenerative diseases and musculoskeletal disorders) and
other populations.

Data Availability Statement

The data that supports the findings of this study is not pub-
licly available. Because of the individual and medical nature
of the data, restrictions apply to its availability. A reasonable
request to the Mutualité Sociale Agricole (MSA) can be
made. In addition, permission from the French independent
administrative authority protecting privacy and personal
data (CNIL) is also required. Further information is avail-
able from the corresponding author upon request.

Ethics Statement

This study was conducted in accordance with the Declara-
tion of Helsinki, and ethics approval was obtained from
the French independent administrative authority responsible
for safeguarding privacy and personal data (CNIL) (authori-
zation number: MMS/SBM/AE171001). The need for
informed consent was waived by CNIL (i.e., ethics commit-
tee) for the TRACTOR project because data analyses were
only descriptive and results were reported at a large collec-
tive scale (i.e., farming activity level), because data were
pseudonymized, and because measures were undertaken to
prevent the risk of reidentification of individuals.

Disclosure

The funder played no role in the study design, data collec-
tion, analysis and interpretation of data, or the writing of
this manuscript.

Conflicts of Interest

The authors declare no conflicts of interest.

Author Contributions

Pascal Petit: conceptualization, methodology, software, valida-
tion, formal analysis, investigation, data curation, writing—ori-
ginal draft, writing—review and editing, visualization,
supervision, project administration, and funding acquisition.
Vincent Bonneterre: writing—review and editing, supervision,
and project administration. Nicolas Vuillerme: conceptualiza-
tion, validation, writing—review and editing, supervision, pro-
ject administration, funding acquisition, and resource.

Funding

This work was partially supported by funding from the French government, managed by the National Research Agency (ANR) under the France 2030 program (ANR-23-IACL-0006) and under the “Investissements d’avenir” program (ANR-10-AIRT-05 and ANR-15-IDEX-02).

Acknowledgments

The authors thank the Mutualité Sociale Agricole (MSA), their representatives, and their chosen intermediaries within the framework of the TRACTOR and STOP projects for their help in understanding and accessing MSA data. In particular, the authors would like to thank Nadia Joubert, Damien Ozenfant, Véronique Danguy, Delphine Burguet, Marc Parmentier, Patrick Le Bourhis, Ileana Radoi, Gaëtan Deffontaines, Jean-Marc Soulat, and Bernard Salles, head of MSA’s scientific committee. The authors also thank the ANSES (French Agency for Food, Environmental and Occupational Health & Safety), in particular Jean-Luc Volatier, Fabrizio Botta, Maïté Brugioni, Ohri Yamada, Alexandra Papadopoulos, and Henri Bastos for their support regarding the TRACTOR project. The authors thank Pierrick Bedouch and Sébastien Chanoine for giving the authors access to the Thériaque database.

Supporting Information

Additional supporting information can be found online in
the Supporting Information section. (*Supporting Information*) Table S1 provides the STROBE reporting guidelines. Table S2 provides the list and definition of farm-
ing activities available using MSA databases for farm-
workers. Table S3 shows the model performance for each
model by farming activity and sex. Table S4 provides the
absolute mean SHAP value of each predictor selected in
the final model by farming activity and sex. Figure S1 shows
the evolution of the number and proportion of depression
cases among farm managers depending on the working year and sex. Figure S2 presents, for each sex, the number and proportion of depression cases among farm managers by antidepressant drug and class. Figure S3 presents the number of farmers with and without an antidepressant prescription by French departments for each sex category and farming population. Figure S4 shows the evolution of the number and proportion of depression cases among farmworkers depending on the working year and sex. Figure S5 presents, for each sex, the number and proportion of depression cases among farmworkers by antidepressant drug and class. Figure S6 presents, for female farm managers, the most important predictors based on the mean absolute Shapley's additive explanation value along with their most frequent impact on the model. Figure S7 presents, for male farm managers, the most important predictors based on the mean absolute Shapley's additive explanation value along with their most frequent impact on the model. Figure S8 presents, for female farmworkers, the most important predictors based on the mean absolute Shapley's additive explanation value along with their most frequent impact on the model. Figure S9 presents, for male farmworkers, the most important predictors based on the mean absolute Shapley's additive explanation value along with their most frequent impact on the model. Figure S10 presents, for the entire farm manager population and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model. Figure S11 presents, for female farm managers and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model. Figure S12 presents, for male farm managers and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model. Figure S13 presents, for the entire farmworker population and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model. Figure S14 presents, for female farmworkers and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model. Figure S15 presents, for male farmworkers and for each farming activity, the most important predictors based on the mean absolute Shapley's additive explanation value along with their impact on the model.

## References

[1] M. Pearce, L. Garcia, A. Abbas, et al., "Association Between Physical Activity and Risk of Depression: A Systematic Review and Meta-Analysis," *JAMA Psychiatry* 79, no. 6 (2022): 550-559, https://doi.org/10.1001/jamapsychiatry.2022.0609.

[2] O. E. Onwuameze, S. Paradiso, C. Peek-Asa, K. J. Donham, and R. H. Rautiainen, "Modifiable Risk Factors for Depressed Mood Among Farmers," *Annals of Clinical Psychiatry: Official Journal of the American Academy of Clinical Psychiatrists* 25, no. 2 (2013): 83-90.

[3] S. Daghagh Yazd, S. A. Wheeler, and A. Zuo, "Key Risk Factors Affecting Farmers' Mental Health: A Systematic Review," *International Journal of Environmental Research and Public Health* 16, no. 23 (2019): 4849, https://doi.org/10.3390/ijerph16234849.

[4] T. Younker and H. L. Radunovich, "Farmer Mental Health Interventions: A Systematic Review," *International Journal of Environmental Research and Public Health* 19, no. 1 (2021): https://doi.org/10.3390/ijerph19010244.

[5] D. B. Reed and D. T. Launcho, "Risk for Depressive Symptoms and Suicide Among U.S. Primary Farmers and Family Members: A Systematic Literature Review," *Workplace Health & Safety* 68, no. 5 (2020): 236-248, https://doi.org/10.1177/2165079919888940.

[6] C. Kolstrup, P. Lundqvist, and S. Pinzke, "Psychosocial Work Environment Among Employed Swedish Dairy and Pig Farmworkers," *Journal of Agromedicine* 13, no. 1 (2008): 23-36, https://doi.org/10.1080/10599240801986157.

[7] C. Lunner Kolstrup, M. Kallioniemi, P. Lundqvist, H. R. Kymäläinen, L. Stallones, and S. Brumby, "International Perspectives on Psychosocial Working Conditions, Mental Health, and Stress of Dairy Farm Operators," *Journal of Agromedicine* 18, no. 3 (2013): 244-255, https://doi.org/10.1080/1059924X.2013.796903.

[8] S. Battams, A. M. Roche, J. A. Fischer, N. K. Lee, J. Cameron, and V. Kostadinov, "Workplace Risk Factors for Anxiety and Depression in Male-Dominated Industries: A Systematic Review," *Health Psychology and Behavioral Medicine* 2, no. 1 (2014): 983-1008, https://doi.org/10.1080/21642850.2014.954579.

[9] S. Vierttiö, O. Kiviruusu, M. Piirtola, et al., "Factors Contributing to Psychological Distress in the Working Population, With a Special Reference to Gender Difference," *BMC Public Health* 21, no. 1 (2021): 611, https://doi.org/10.1186/s12889-021-10560-y.

[10] P. Petit, G. Gandon, M. Dubuc, N. Vuillerme, and V. Bonneterre, "Agricultural Activities and Risk of Treatment for Depressive Disorders Among the Entire French Agricultural Workforce: The TRACTOR Project, a Nationwide Retrospective Cohort Study," *Lancet Regional Health-Europe* 31 (2023): 100674, https://doi.org/10.1016/j.lanepe.2023.100674.

[11] E. Donohoe, F. Camonita, V. Tageo, et al., "Mental Health in Agriculture: Preventing and Managing Psychosocial Risks for Farmers and Farm Workers," in *European Agency for Safety and Health at Work (EU-OSHA) Report* (Publications Office of the European Union, 2024), https://doi.org/10.2802/3310639.

[12] P. Petit and N. Vuillerme, "Leveraging Administrative Health Databases to Address Health Challenges in Farming Populations: Scoping Review and Bibliometric Analysis (1975-2024)," *JMIR Public Health and Surveillance* 11 (2025): e62939, https://doi.org/10.2196/62939.

[13] E. T. Sturm, C. Castro, A. Mendez-Colmenares, et al., "Risk Factors for Brain Health in Agricultural Work: A Systematic Review," *International Journal of Environmental Research and Public Health* 19, no. 6 (2022): https://doi.org/10.3390/ijerph19063373.

[14] B. Sanne, A. Mykletun, B. E. Moen, A. A. Dahl, and G. S. Tell, "Farmers Are at Risk for Anxiety and Depression: The Hordaland Health Study," *Occupational Medicine* 54, no. 2 (2004): 92-100, https://doi.org/10.1093/occmed/kqh007.

[15] G. B. Petarli, M. Cattafesta, M. C. M. Viana, O. M. P. A. Bezerra, E. Zandonade, and L. B. Salaroli, "Depression in Brazilian Farmers: Prevalence and Associated Factors," *Journal of Mental Health* 33, no. 1 (2024): 127-135, https://doi.org/10.1080/09638237.2022.2069701.
[16] Y. Liang, K. Wang, B. Janssen, C. Casteel, M. Nonnenmann, and D. S. Rohlman, "Examination of Symptoms of Depression Among Cooperative Dairy Farmers," *International Journal of Environmental Research and Public Health* 18, no. 7 (2021): https://doi.org/10.3390/ijerph18073657.

[17] M. Sato, H. Kato, M. Noguchi, H. Ono, and K. Kobayashi, "Gender Differences in Depressive Symptoms and Work Environment Factors Among Dairy Farmers in Japan," *International Journal of Environmental Research and Public Health* 17, no. 7 (2020): 2569, https://doi.org/10.3390/ijerph17072569.

[18] A. Guillien, L. Laurent, T. Soumagne, et al., "Anxiety and Depression Among Dairy Farmers: The Impact of COPD," *International Journal of Chronic Obstructive Pulmonary Disease* 13 (2018): 1-9, https://doi.org/10.2147/COPD.S143883.

[19] M. Olff, M. W. Koeter, E. H. Van Haaften, P. H. Kersten, and B. P. Gersons, "Impact of a Foot and Mouth Disease Crisis on Post-Traumatic Stress Symptoms in Farmers," *The British Journal of Psychiatry: The Journal of Mental Science* 186, no. 2 (2005): 165-166, https://doi.org/10.1192/bjp.186.2.165.

[20] Y. Joo and S. Roh, "Risk Factors Associated With Depression and Suicidal Ideation in a Rural Population," *Environmental Health and Toxicology* 31 (2016): e2016018, https://doi.org/10.5620/eht.e2016018.

[21] P. A. Okiki, A. O. Ogbimi, and W. E. Edafiadhe, "Effects of Air-Borne Hazards on the Physical and Psychological Health of Nigerian Poultry Workers," *Journal of Biology, Agriculture and Healthcare* 3, no. 7 (2013): 102-110.

[22] J. Cancino, K. Soto, J. Tapia, et al., "Occupational Exposure to Pesticides and Symptoms of Depression in Agricultural Workers. A Systematic Review," *Environmental Research* 231, Part 2 (2023): 116190, https://doi.org/10.1016/j.envres.2023.116190.

[23] T. N. Le, W. Zhang, E. Brown, J. Crum, and A. Wong, "Risks and Protective Factors for Depression and Suicide Among Hawai'i Agricultural Producers," *Journal of Agromedicine* 28, no. 4 (2023): 734-745, https://doi.org/10.1080/1059924X.2023.2226131.

[24] N. Gavrielov-Yusim and M. Friger, "Use of Administrative Medical Databases in Population-Based Research," *Journal of Epidemiology and Community Health* 68, no. 3 (2014): 283-287, https://doi.org/10.1136/jech-2013-202744.

[25] I. Landi, B. S. Glicksberg, H. C. Lee, et al., "Deep Representation Learning of Electronic Health Records to Unlock Patient Stratification at Scale," *NPJ Digital Medicine* 3, no. 1 (2020): 96, https://doi.org/10.1038/s41746-020-0301-z.

[26] Z. Shakeri Hossein Abad, A. Kline, M. Sultana, et al., "Digital Public Health Surveillance: A Systematic Scoping Review," *NPJ Digital Medicine* 4, no. 1 (2021): 41, https://doi.org/10.1038/s41746-021-00407-6.

[27] A. A. Jamali, C. Berger, and R. Spiteri, "Identification of Depression Predictors From Standard Health Surveys Using Machine Learning," *Current Research in Behavioral Sciences* 7 (2024): 100157, https://doi.org/10.1016/j.crbeha.2024.100157.

[28] E. P. Handing, C. Strobl, Y. Jiao, L. Feliciano, and S. Aichele, "Predictors of Depression Among Middle-Aged and Older Men and Women in Europe: A Machine Learning Approach," *Lancet Regional Health-Europe* 18 (2022): 100391, https://doi.org/10.1016/j.lanepe.2022.100391.

[29] P. Petit, D. Bosson-Rieutort, C. Maugard, et al., "The TRACTOR Project: TRACking and MoniToring Occupational Risks in Agriculture Using French Insurance Health Data (MSA)," *Annals of Work Exposures and Health* 66, no. 3 (2022): 402-411, https://doi.org/10.1093/annweh/wxab083.

[30] T. Rosenström, T. W. Fawcett, A. D. Higginson, et al., "Adaptive and Non-Adaptive Models of Depression: A Comparison Using Register Data on Antidepressant Medication During Divorce," *PLoS One* 12, no. 6 (2017): e0179495, https://doi.org/10.1371/journal.pone.0179495.

[31] T. Chen and C. Guestrin, "Xgboost: A Scalable Tree Boosting System," in *Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining* (ACM, 2016), 785-794, https://doi.org/10.1145/2939672.2939785.

[32] S. M. Nam, T. A. Peterson, K. Y. Seo, H. W. Han, and J. I. Kang, "Discovery of Depression-Associated Factors From a Nationwide Population-Based Survey: Epidemiological Study Using Machine Learning and Network Analysis," *Journal of Medical Internet Research* 23, no. 6 (2021): e27344, https://doi.org/10.2196/27344.

[33] S. M. Lundberg, G. Erion, H. Chen, et al., "From Local Explanations to Global Understanding With Explainable AI for Trees," *Nature Machine Intelligence* 2, no. 1 (2020): 56-67, https://doi.org/10.1038/s42256-019-0138-9.

[34] M. Mayer, "splitTools: Tools for Data Splitting. R Package Version 1.0.1" CRAN, 2023, https://CRAN.R-project.org/package=splitTools.

[35] L. Kapsner, "mlexperiments: Machine Learning Experiments. R package version 0.0.3" CRAN, 2024, https://CRAN.R-project.org/package=mlexperiments.

[36] L. Kapsner, "mllrnrs: R6-Based ML Learners for 'mlexperiments'," in *R package version 0.0.3* (CRAN, 2024), https://CRAN.R-project.org/package=mllrnrs.

[37] T. Chen and T. He, "xgboost: Extreme Gradient Boosting. R Package Version 1.7.7.1" CRAN, 2024, https://CRAN.R-project.org/package=xgboost.

[38] M. Kuhn, "Building Predictive Models in R Using the caret Package," *Journal of Statistical Software* 28, no. 5 (2008): 1-26, https://doi.org/10.18637/jss.v028.i05.

[39] X. Robin, N. Turck, A. Hainard, et al., "pROC: An Open-Source Package for R and S+ to Analyze and Compare ROC Curves," *BMC Bioinformatics* 12 (2011): 77, https://doi.org/10.1186/1471-2105-12-77.

[40] S. Singhal and F. Tarp, "Commodity Price Volatility and the Psychological Well-Being of Farmers," *American Journal of Agricultural Economics* 107, no. 1 (2025): 269-289, https://doi.org/10.1111/ajae.12468.

[41] T. Ben-Ari, J. Boé, P. Ciais, R. Lecerf, M. Van der Velde, and D. Makowski, "Causes and Implications of the Unforeseen 2016 Extreme Yield Loss in the Breadbasket of France," *Nature Communications* 9, no. 1 (2018): 1627, https://doi.org/10.1038/s41467-018-04087-x.

[42] G. Lubatti, H. Casset-Hervio, and D. Reynaud, *Agriculture in 2016* (INSEE, 2017), https://www.insee.fr/en/statistiques/3134845.

[43] Eurostat, *Agriculture, Forestry and Fishery Statistics. 2017 Edition* (Eurostat, 2017), https://doi.org/10.2785/570022.

[44] A. Devot, L. Royer, B. Arvis, et al., *Research for AGRI Committee-The Impact of Extreme Climate Events on Agriculture Production in the EU* (European Parliament, Policy Department for Structural and Cohesion Policies, 2023), https://doi.org/10.2861/97024.

[45] M. Desriers, "L'agriculture française depuis cinquante ans: des petites exploitations familiales aux droits à paiement unique" 2007, INSEE, https://www.insee.fr/fr/statistiques/1372289?sommaire=1372309.
[46] G. Lubatti and H. Casset-Hervio, *Agriculture in 2015* (INSEE, 2016), https://www.insee.fr/en/statistiques/2511885.

[47] P. Charrières and T. Sauvaget, "Intrants agricoles – En 2022, une hausse historique du prix des intrants," *Agreste Synthèses conjoncturelles n° 403*, avril 2023 (2023, Agreste, Paris, https://agreste.agriculture.gouv.fr/agreste-web/download/publication/publie/SynCpr23403/consyn403202304-Intrants.pdf.

[48] M. Delpont, C. Guinat, J. L. Guérin, E. Le Leu, J. P. Vaillancourt, and M. C. Paul, "Biosecurity Measures in French Poultry Farms Are Associated With Farm Type and Location," *Preventive Veterinary Medicine* 195 (2021): 105466, https://doi.org/10.1016/j.prevetmed.2021.105466.

[49] L. Malard, J. F. Chastang, and I. Niedhammer, "Changes in Major Depressive and Generalized Anxiety Disorders in the National French Working Population Between 2006 and 2010," *Journal of Affective Disorders* 178 (2015): 52-59, https://doi.org/10.1016/j.jad.2015.02.027.

[50] D. Parmar, C. Stavropoulou, and J. P. Ioannidis, "Health Outcomes During the 2008 Financial Crisis in Europe: Systematic Literature Review," *BMJ* 354 (2016): i4588, https://doi.org/10.1136/bmj.i4588.

[51] S. H. Whitaker, "The Impact of Government Policies and Regulations on the Subjective Well-Being of Farmers in Two Rural Mountain Areas of Italy," *Agriculture and Human Values* 41, no. 4 (2024): 1791-1809, https://doi.org/10.1007/s10460-024-10586-z.

[52] J. M. Rudolphi, R. L. Berg, and A. Parsaik, "Depression, Anxiety and Stress Among Young Farmers and Ranchers: A Pilot Study," *Community Mental Health Journal* 56, no. 1 (2020): 126-134, https://doi.org/10.1007/s10597-019-00480-y.

[53] A. K. Carruth and C. A. Logan, "Depressive Symptoms in Farm Women: Effects of Health Status and Farming Lifestyle Characteristics, Behaviors, and Beliefs," *Journal of Community Health* 27, no. 3 (2002): 213-228, https://doi.org/10.1023/a:1015206224421.

[54] D. Cirillo, S. Catuara-Solarz, C. Morey, et al., "Sex and Gender Differences and Biases in Artificial Intelligence for Biomedicine and Healthcare," *NPJ Digital Medicine* 3, no. 1 (2020): 81, https://doi.org/10.1038/s41746-020-0288-5.

[55] A. Deegan and S. Dunne, "An Investigation Into the Relationship Between Social Support, Stress, and Psychological Well-Being in Farmers," *Journal of Community Psychology* 50, no. 7 (2022): 3054-3069, https://doi.org/10.1002/jcop.22814.

[56] S. Chiappini, G. Sampogna, A. Ventriglio, et al., "Emerging Strategies and Clinical Recommendations for the Management of Novel Depression Subtypes," *Expert Review of Neurotherapeutics* 25, no. 4 (2025): 443-463, https://doi.org/10.1080/14737175.2025.2470973.

[57] A. B. R. Shatte, D. M. Hutchinson, and S. J. Teague, "Machine Learning in Mental Health: A Scoping Review of Methods and Applications," *Psychological Medicine* 49, no. 9 (2019): 1426-1448, https://doi.org/10.1017/S0033291719000151.

[58] T. D. Bennett, R. A. Moffitt, J. G. Hajagos, et al., "Clinical Characterization and Prediction of Clinical Severity of SARS-CoV-2 Infection Among US Adults Using Data From the US National COVID Cohort Collaborative," *JAMA Network Open* 4, no. 7 (2021): https://doi.org/10.1001/jamanetworkopen.2021.16901.

[59] M. Jiang, Y. Li, C. Jiang, L. Zhao, X. Zhang, and P. E. Lipsky, "Machine Learning in Rheumatic Diseases," *Clinical Reviews in Allergy & Immunology* 60, no. 1 (2021): 96-110, https://doi.org/10.1007/s12016-020-08805-6.

[60] A. Moore and M. Bell, "XGBoost, A Novel Explainable AI Technique, in the Prediction of Myocardial Infarction: A UK Biobank Cohort Study," *Clinical Medicine Insights. Cardiology* 16 (2022): 11795468221133611, https://doi.org/10.1177/11795468221133611.

[61] J. B. Guimbaud, A. P. Siskos, A. K. Sakhi, et al., "Machine Learning-Based Health Environmental-Clinical Risk Scores in European Children," *Communications Medicine* 4, no. 1 (2024): 98, https://doi.org/10.1038/s43856-024-00513-y.

[62] Z. Tian, W. Qu, Y. Zhao, et al., "Predicting Depression and Anxiety of Chinese Population During COVID-19 in Psychological Evaluation Data by XGBoost," *Journal of Affective Disorders* 323 (2023): 417-425, https://doi.org/10.1016/j.jad.2022.11.044.

[63] S. R. B. S. Gomes, M. von Schantz, and M. Leocadio-Miguel, "Predicting Depressive Symptoms in Middle-Aged and Elderly Adults Using Sleep Data and Clinical Health Markers: A Machine Learning Approach," *Sleep Medicine* 102 (2023): 123-131, https://doi.org/10.1016/j.sleep.2023.01.002.

[64] A. Sharma and W. J. M. I. Verbeke, "Improving Diagnosis of Depression With XGBOOST Machine Learning Model and a Large Biomarkers Dutch Dataset (n = 11,081)," *Frontiers in Big Data* 3 (2020): 15, https://doi.org/10.3389/fdata.2020.00015.

[65] Y. Zhang, C. Stewart, Y. Ranjan, et al., "Large-Scale Digital Phenotyping: Identifying Depression and Anxiety Indicators in a General UK Population With Over 10,000 Participants," *Journal of Affective Disorders* 375 (2025): 412-422, https://doi.org/10.1016/j.jad.2025.01.124.

[66] C. Quantin, A. Roussot, J. Besson, et al., "Étude des algorithmes de repérage de la dépression dans le SNIIRAM par le réseau REDSIAM," *Revue Française Des Affaires Sociales* 1, no. 2 (2016): 201-225, https://doi.org/10.3917/rfas.162.0201.

[67] S. Leventhal Perek, K. Thomas, A. Gaver, A. Matalon, and H. Yeshua, "Comparison of Antidepressant Use Between Adult Populations Living in Urban and Rural Communities in Israel," *Family Practice* 36, no. 1 (2019): 21-26, https://doi.org/10.1093/fampra/cmy085.

[68] E. Haller, B. Watzke, E. Blozik, et al., "Antidepressant Prescription Practice and Related Factors in Switzerland: A Cross-Sectional Analysis of Health Claims Data," *BMC Psychiatry* 19, no. 1 (2019): https://doi.org/10.1186/s12888-019-2178-4.

[69] Y. H. Sheu, C. Magdamo, M. Miller, S. Das, D. Blacker, and J. W. Smoller, "AI-Assisted Prediction of Differential Response to Antidepressant Classes Using Electronic Health Records," *NPJ Digital Medicine* 6, no. 1 (2023): 73, https://doi.org/10.1038/s41746-023-00817-8.

[70] E. King, K. Lamont, C. Wendelboe-Nelson, et al., "Engaging the Agricultural Community in the Development of Mental Health Interventions: A Qualitative Research Study," *BMC Psychiatry* 23, no. 1 (2023): https://doi.org/10.1186/s12888-023-04806-9.

[71] C. Proctor and N. Hopkins, "Stressors and Coping Strategies in Rural Farmers: A Qualitative Study," *Journal of Agromedicine* 28, no. 3 (2023): 415-424, https://doi.org/10.1080/1059924X.2023.2173691.

[72] D. C. Rose, F. Shortland, J. Hall, et al., "The Impact of COVID-19 on Farmers' Mental Health: A Case Study of the UK," *Journal of Agromedicine* 28, no. 3 (2023): 346-364, https://doi.org/10.1080/1059924X.2022.2137616.

[73] S. M. Shortreed, R. L. Walker, E. Johnson, et al., "Complex Modeling With Detailed Temporal Predictors Does Not Improve Health Records-Based Suicide Risk Prediction," *NPJ
*Digital Medicine* 6, no. 1 (2023): 47, https://doi.org/10.1038/s41746-023-00772-4.

[74] K. Aaltonen, R. Sund, C. Hakulinen, S. Pirkola, and E. Isometsä, "Variations in Suicide Risk and Risk Factors After Hospitalization for Depression in Finland, 1996-2017," *JAMA Psychiatry* 81, no. 5 (2024): 506-515, https://doi.org/10.1001/jamapsychiatry.2023.5512.

[75] J. Lundberg, T. Cars, E. Lampa, et al., "Determinants and Outcomes of Suicidal Behavior Among Patients With Major Depressive Disorder," *JAMA Psychiatry* 80, no. 12 (2023): 1218-1225, https://doi.org/10.1001/jamapsychiatry.2023.2833.

[76] S. Marwaha, E. Palmer, T. Suppes, E. Cons, A. H. Young, and R. Upthegrove, "Novel and Emerging Treatments for Major Depression," *Lancet* 401, no. 10371 (2023): 141-153, https://doi.org/10.1016/S0140-6736(22)02080-3.

[77] A. A. Arif, O. Adeyemi, S. B. Laditka, J. N. Laditka, and T. Borders, "Suicide Mortality Rates in Farm-Related Occupations and the Agriculture Industry in the United States," *American Journal of Industrial Medicine* 64, no. 11 (2021): 960-968, https://doi.org/10.1002/ajim.23287.

[78] C. Kraus, B. Kadriu, R. Lanzenberger, C. A. Zarate Jr., and S. Kasper, "Prognosis and Improved Outcomes in Major Depression: A Review," *Psychiatry* 9, no. 1 (2019): 127, https://doi.org/10.1038/s41398-019-0460-3.

[79] J. Freund, C. Buntrock, L. Braun, et al., "Digital Prevention of Depression for Farmers? A Qualitative Study on Participants' Experiences Regarding Determinants of Acceptance and Satisfaction With a Tailored Guided Internet Intervention Program," *Internet Interventions* 29 (2022): 100566, https://doi.org/10.1016/j.invent.2022.100566.

[80] J. Thielecke, C. Buntrock, J. Freund, et al., "How to Promote Usage of Telehealth Interventions for Farmers' Mental Health? A Qualitative Study on Supporting and Hindering Aspects for Acceptance and Satisfaction With a Personalized Telephone Coaching for Depression Prevention," *Internet Interventions* 34 (2023): 100671, https://doi.org/10.1016/j.invent.2023.100671.
# Supplementary information

## Title

Using Machine Learning and Nationwide Population-based Data to Unravel Predictors of Treated Depression in Farmers

## Authors

Pascal Petit, Vincent Bonneterre, Nicolas Vuillerme

## Table of contents

### Supplementary

<table><tr><td>Supplementary Figure 1: Number of farm managers with and without an antidepressant prescription depending on their working year</td><td>2</td></tr><tr><td>Supplementary Figure 2: Number of farm managers with antidepressant prescription per agent and sex</td><td>3</td></tr><tr><td>Supplementary Figure 3: Number of farmers with and without an antidepressant prescription by French departments for each sex category and farming population</td><td>4</td></tr><tr><td>Supplementary Figure 4: Number of farmworkers with and without an antidepressant prescription depending on their working year</td><td>5</td></tr><tr><td>Supplementary Figure 5: Number of farmworkers with antidepressant prescription per agent and sex</td><td>6</td></tr><tr><td>Supplementary Figure 6: Most important predictors and their impact according to SHAP values among female farm managers</td><td>7</td></tr><tr><td>Supplementary Figure 7: Most important predictors and their impact according to SHAP values among male farm managers</td><td>8</td></tr><tr><td>Supplementary Figure 8: Most important predictors and their impact according to SHAP values among female farmworkers</td><td>9</td></tr><tr><td>Supplementary Figure 9: Most important predictors and their impact according to SHAP values among male farmworkers</td><td>10</td></tr><tr><td>Supplementary Figure 10: Most important predictors and their impact according to SHAP values by farming activity among FMs</td><td>11</td></tr><tr><td>Supplementary Figure 11: Most important predictors and their impact according to SHAP values by farming activity in female FMs</td><td>12</td></tr><tr><td>Supplementary Figure 12: Most important predictors and their impact according to SHAP values by farming activity among male FMs</td><td>13</td></tr><tr><td>Supplementary Figure 13: Most important predictors and their impact according to SHAP values by farming activity in farmworkers</td><td>14</td></tr><tr><td>Supplementary Figure 14: Most important predictors and their impact according to SHAP values by farming activity among female farmworkers</td><td>15</td></tr><tr><td>Supplementary Figure 15: Most important predictors and their impact according to SHAP values by farming activity among male farmworkers</td><td>16</td></tr><tr><td>Supplementary Table 1: STROBE Statement Checklist</td><td>17</td></tr><tr><td>Supplementary Table 2: List and definition of agricultural activities available using MSA databases for employees</td><td>18</td></tr><tr><td>Supplementary Table 3: Model performance for each activity and each sex</td><td>19</td></tr><tr><td>Supplementary Table 4: SHAP values for each activity and each sex</td><td>19</td></tr></table>
<figure><img src="image_6.png" /><figcaption>Supplementary Figure 1: Number of farm managers with and without an antidepressant prescription depending on their working year</figcaption></figure>

ATD: antidepressant
<figure><img src="image_7.png" /><figcaption>Supplementary Figure 2: Number of farm managers with antidepressant prescription per agent and sex</figcaption></figure>
<figure><img src="image_8.png" /><figcaption>Supplementary Figure 3: Number of farmers with and without an antidepressant prescription by French departments for each sex category and farming population
ATD: antidepressant, FM: farm manager.</figcaption></figure>
<figure><img src="image_9.png" /><figcaption>Supplementary Figure 4: Number of farmworkers with and without an antidepressant prescription depending on their working year</figcaption></figure>

ATD: antidepressant
<figure><img src="image_10.png" /><figcaption>Supplementary Figure 5: Number of farmworkers with antidepressant prescription per agent and sex</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>Supplementary Figure 6: Most important predictors and their impact according to SHAP values among female farm managers</figcaption></figure>

ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescriptions (depression disorder, in red) or no ATD prescriptions (no depression disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_12.png" /><figcaption>Supplementary Figure 7: Most important predictors and their impact according to SHAP values among male farm managers</figcaption></figure>

ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescriptions (depression disorder, in red) or no ATD prescriptions (no depression disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_13.png" /><figcaption>Supplementary Figure 8: Most important predictors and their impact according to SHAP values among female farmworkers</figcaption></figure>

ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescriptions (depression disorder, in red) or no ATD prescriptions (no depression disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_14.png" /><figcaption>Supplementary Figure 9: Most important predictors and their impact according to SHAP values among male farmworkers</figcaption></figure>

ATD: antidepressant. The impact refers to the percentage of activities for which the predictor directed the model toward ATD prescriptions (depression disorder, in red) or no ATD prescriptions (no depression disorder, in green). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_15.png" /><figcaption>Supplementary Figure 10: Most important predictors and their impact according to SHAP values by farming activity among FMs</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_16.png" /><figcaption>Supplementary Figure 11: Most important predictors and their impact according to SHAP values by farming activity in female FMs</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_17.png" /><figcaption>Supplementary Figure 12: Most important predictors and their impact according to SHAP values by farming activity among male FMs</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_18.png" /><figcaption>Supplementary Figure 13: Most important predictors and their impact according to SHAP values by farming activity in farmworkers</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_19.png" /><figcaption>Supplementary Figure 14: Most important predictors and their impact according to SHAP values by farming activity among female farmworkers</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<figure><img src="image_20.png" /><figcaption>Supplementary Figure 15: Most important predictors and their impact according to SHAP values by farming activity among male farmworkers</figcaption></figure>

The predictors that directed the model toward ATD prescriptions (depression disorder) are represented in red (risk factors), while predictors that directed the model toward no ATD prescriptions (no depression disorder) are displayed in green (protective factors). The SHAP values provided correspond to the absolute mean SHAP values of all activities with their associated 95% CI.
<table><caption>Supplementary Table 1: STROBE Statement Checklist</caption><thead><tr><th></th><th>Item No</th><th>Recommendation</th><th>Page</th></tr></thead><tbody><tr><td rowspan="2">Title and abstract</td><td rowspan="2">1</td><td>(a) Indicate the study's design with a commonly used term in the title or the abstract</td><td>1, 2</td></tr><tr><td>(b) Provide in the abstract an informative and balanced summary of what was done and what was found</td><td>2</td></tr><tr><td colspan="4"><strong>Introduction</strong></td></tr><tr><td>Background/rationale</td><td>2</td><td>Explain the scientific background and rationale for the investigation being reported</td><td>3, 4</td></tr><tr><td>Objectives</td><td>3</td><td>State specific objectives, including any prespecified hypotheses</td><td>3, 4</td></tr><tr><td colspan="4"><strong>Methods</strong></td></tr><tr><td>Study design</td><td>4</td><td>Present key elements of study design early in the paper</td><td>4, 5</td></tr><tr><td>Setting</td><td>5</td><td>Describe the setting, locations, and relevant dates, including periods of recruitment, exposure, follow-up, and data collection</td><td>4, 5</td></tr><tr><td rowspan="2">Participants</td><td rowspan="2">6</td><td>(a) Give the eligibility criteria, and the sources and methods of selection of participants. Describe methods of follow-up</td><td>4, 5</td></tr><tr><td>(b) For matched studies, give matching criteria and number of exposed and unexposed</td><td>DNA</td></tr><tr><td>Variables</td><td>7</td><td>Clearly define all outcomes, exposures, predictors, potential confounders, and effect modifiers. Give diagnostic criteria, if applicable</td><td>4-6, Suppl. Mat.</td></tr><tr><td>Data sources/ measurement</td><td>8*</td><td>For each variable of interest, give sources of data and details of methods of assessment (measurement). Describe comparability of assessment methods if there is more than one group</td><td>4-6, Suppl. Mat.</td></tr><tr><td>Bias</td><td>9</td><td>Describe any efforts to address potential sources of bias</td><td>4-6</td></tr><tr><td>Study size</td><td>10</td><td>Explain how the study size was arrived at</td><td>4-6, Suppl. Mat.</td></tr><tr><td rowspan="3">Quantitative variables</td><td rowspan="3">11</td><td>Explain how quantitative variables were handled in the analyses. If applicable, describe which groupings were chosen and why</td><td>4-6, Suppl. Mat.</td></tr><tr><td>(a) Describe all statistical methods, including those used to control for confounding</td><td>5-7, Suppl. Mat.</td></tr><tr><td>(b) Describe any methods used to examine subgroups and interactions</td><td>5-7, Suppl. Mat.</td></tr><tr><td rowspan="3">Statistical methods</td><td rowspan="3">12</td><td>(c) Explain how missing data were addressed</td><td>5</td></tr><tr><td>(d) If applicable, explain how loss to follow-up was addressed</td><td>DNA</td></tr><tr><td>(e) Describe any sensitivity analyses</td><td>DNA</td></tr><tr><td colspan="4"><strong>Results</strong></td></tr><tr><td rowspan="3">Participants</td><td rowspan="3">13*</td><td>(a) Report numbers of individuals at each stage of study-e.g., numbers potentially eligible, examined for eligibility, confirmed eligible, included in the study, and analyzed</td><td>7-10, Suppl. Mat.</td></tr><tr><td>(b) Give reasons for non-participation at each stage</td><td>DNA</td></tr><tr><td>(c) Consider use of a flow diagram</td><td>DNA</td></tr><tr><td rowspan="3">Descriptive data</td><td rowspan="3">14*</td><td>(a) Give characteristics of study participants (e.g., demographic, clinical, social) and information on exposures and potential confounders</td><td>7-10, Tables 2-3, Suppl. Mat.</td></tr><tr><td>(b) Indicate number of participants with missing data for each variable of interest</td><td>DNA</td></tr><tr><td>(c) Summarize follow-up time (e.g., average and total amount)</td><td>5</td></tr><tr><td>Outcome data</td><td>15*</td><td>Report numbers of outcome events or summary measures over time</td><td>11-14, Suppl. Mat.</td></tr><tr><td rowspan="3">Main results</td><td rowspan="3">16</td><td>(a) Give unadjusted estimates and, if applicable, confounder-adjusted estimates and their precision (e.g., 95% confidence interval). Make clear which confounders were adjusted for and why they were included</td><td>11-14, Suppl. Mat.</td></tr><tr><td>(b) Report category boundaries when continuous variables were categorized</td><td>DNA</td></tr><tr><td>(c) If relevant, consider translating estimates of relative risk into absolute risk for a meaningful time period</td><td>DNA</td></tr><tr><td>Other analyses</td><td>17</td><td>Report other analyses done-e.g., analyses of subgroups and interactions, and sensitivity analyses</td><td>11-14, Suppl. Mat.</td></tr><tr><td colspan="4"><strong>Discussion</strong></td></tr><tr><td>Key results</td><td>18</td><td>Summarize key results with reference to study objectives</td><td>15</td></tr><tr><td>Limitations</td><td>19</td><td>Discuss limitations of the study, taking into account sources of potential bias or imprecision. Discuss both direction and magnitude of any potential bias</td><td>18-21</td></tr><tr><td>Interpretation</td><td>20</td><td>Give a cautious overall interpretation of results considering objectives, limitations, multiplicity of analyses, results from similar studies, and other relevant evidence</td><td>15-23</td></tr><tr><td>Generalizability</td><td>21</td><td>Discuss the generalizability (external validity) of the study results</td><td>19, 21</td></tr><tr><td colspan="4"><strong>Other information</strong></td></tr><tr><td>Funding</td><td>22</td><td>Give the source of funding and the role of the funders for the present study and, if applicable, for the original study on which the present article is based</td><td>27</td></tr></tbody></table>

*Give information separately for exposed and unexposed groups.

DNA: does not applied, Suppl. Mat.: supplementary materials.
<table><caption>Supplementary Table 2: List and definition of agricultural activities available using MSA databases for employees</caption><thead><tr><td>Activity name</td><td>Definition</td><td>Example of task</td></tr></thead><tbody><tr><td>Unspecified farming (e.g., mixed farming, cereal farming, potato farming, pasture)</td><td>Cultivation of plants (e.g., cereals, potatoes, rice) as well as grassland and grazing operations</td><td>Monitoring and controlling pests and diseases, fertilizing, harvesting and post-harvest handling, grading, soil and water management, tractor driving</td></tr><tr><td>Viticulture</td><td>Cultivation and harvesting of grapes, and winemaking</td><td>Monitoring and controlling pests and diseases, fertilizing, soil and water management, canopy management, monitoring fruit development and characteristics, harvesting and post-harvest handling, and vine pruning</td></tr><tr><td>Vinification</td><td>Production of wine</td><td>Selection of the fruit, fruit fermentation into alcohol, and bottling of the finished liquid</td></tr><tr><td>Sylviculture/forestry (e.g., thinning, pruning)</td><td>Controlling the growth, composition/structure, as well as quality of forests</td><td>Thinning, pruning, and spacing</td></tr><tr><td>Resin extraction</td><td>Incising the outer layers of a pine tree in order to collect the sap or resin</td><td>Tool handling</td></tr><tr><td>Unspecified specialized crop farming (e.g., soy farming, fruit arboriculture, truck farming)</td><td>Cultivation of plants (e.g., vegetables) and fruits for food as well as practice of growing and harvesting fruits, vegetables, and flowers for sale</td><td>Layering, cutting, grafting, pruning, mulching, weed management, removing damaged or diseased branches, fertilizing trees, monitoring, controlling pests and diseases, proper crop selection, soil and water management, harvesting, and post-harvest handling</td></tr><tr><td>Mushroom farming</td><td>Cultivation of mushrooms for food</td><td>Planting, pest and disease management, harvesting, and post-harvest handling</td></tr><tr><td>Large animal farming (e.g., cattle, ovine, pig)</td><td>Raising and breeding of large animals such as wild cattle, pig, ovine, or llama as livestock and for products (e.g., milk) production</td><td>Maintain equipment and buildings, breeding, milking, wool production, maintenance of the property, mustering, bulk handling, spread manure, feeding, monitoring the animals for signs of illness, assist in artificial insemination, transporting stock to farms or processing plants, shearing and drenching livestock, sterilizing machines, and collecting, grading and packaging produce, and assisting with calving</td></tr><tr><td>Small animal farming (e.g., poultry, rabbit, fish, bee)</td><td>Raising and breeding of small animals such as poultry, rabbits, fish, frogs, bees, insects, minks, beavers, or snails</td><td>Feeding, breeding, disease prevention, assist in artificial insemination, gathering eggs, cleaning rooms and equipment/facility maintenance</td></tr><tr><td>Training, dressage, stud farming</td><td>Activity including raising and breeding of domestic horses as well as training and dressage of domestic equines</td><td>Feeding, breeding, assist in artificial insemination, disease prevention, teaching, maintenance of the property, and tourism</td></tr><tr><td>Shellfish farming (e.g., oyster farming, scallop aquaculture)</td><td>Cultivation and harvest of aquatic invertebrates, such as oysters, clams, and mussels</td><td>Breeding, rearing, harvesting, using a rack, processing, and shipment</td></tr><tr><td>Cooperatives (e.g., provision of supplies)</td><td>Employees of agricultural cooperatives (e.g., provision of supplies, slaughterhouse)</td><td>Animal handling, tool handling, vehicle driving</td></tr><tr><td>Gardener, park ranger</td><td>Persons entrusted with protecting and preserving lands</td><td>Law enforcement, education, firefighting, maintenance, administration</td></tr><tr><td>Gamekeeper, fishery officer</td><td>Person who manages an area of countryside (e.g., areas of woodland, moorland, waterway or farmland) to make sure that there is enough game for hunting, or fish for fishing, and acts as guide to those pursuing them</td><td>Gamekeeping, maintenance, administration</td></tr><tr><td>Salt works/salt evaporation pond</td><td>Production of salt from sea water</td><td>Harvesting, and filtering</td></tr><tr><td>Wood production (e.g., lopping)</td><td>Harvesting of round wood (trunk and branch wood) from coniferous (softwood) and non-coniferous (hardwood) trees</td><td>Harvesting, lopping, and transport</td></tr><tr><td>Stationary sawmill (e.g., edging, trimming, decking, debarking)</td><td>Cutting logs into lumber using large bandsaw blades</td><td>Edging, trimming, decking, debarking, use of machines</td></tr><tr><td>Agricultural work companies (e.g., pesticide applications, harvest reaping)</td><td>Companies that assist or perform farm works such as harvest reaping</td><td>Harvest reaping, harrowing, sowing seeds, pesticide application, tilling, and clearing</td></tr><tr><td>Gardening and landscaping companies</td><td>Companies that perform gardening and landscaping work</td><td>Gardening, landscaping, chainsaw and skidder operation, climbing on trees, monitoring and controlling pests and diseases</td></tr><tr><td>Administrative jobs</td><td>Employees of banks and federations</td><td>Administrative tasks</td></tr><tr><td>Construction rural craftsperson (e.g., mason, electrician, painter)</td><td>Employees performing construction work in rural areas, including jobs such as mason, electrician, painter</td><td>Fixing agricultural machinery, painting, welding, and hammering</td></tr><tr><td>Unspecified rural craftsperson (e.g., cooper, saddler, blacksmith)</td><td>Employees performing hand-crafted work in rural areas, including jobs such as cooper, saddler, blacksmith</td><td>Hammering, welding</td></tr></tbody></table>
**Supplementary Table 3:** Model performance for each activity and each sex

Please refer to the MS Excel file entitled Supplementary Table 3.

**Supplementary Table 4:** SHAP values for each activity and each sex

Please refer to the MS Excel file entitled Supplementary Table 4.