Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2025 Jul 16:16:1549306.
doi: 10.3389/fphys.2025.1549306. eCollection 2025.

Prediction of obesity levels based on physical activity and eating habits with a machine learning model integrated with explainable artificial intelligence

Affiliations

Prediction of obesity levels based on physical activity and eating habits with a machine learning model integrated with explainable artificial intelligence

Yasin Görmez et al. Front Physiol. .

Abstract

Objectives: This study aims to build a machine learning (ML) prediction model integrated with explainable artificial intelligence (XAI) to categorize obesity levels from physical activity and dietary patterns. The inclusion of XAI methodologies facilitates a comprehensive understanding of the risk factors influencing the model predictions and thus increases transparency in the identification of obesity risk factors.

Methods: Six ML models were used: Bernoulli Naive Bayes, CatBoost, Decision Tree, Extra Trees Classifier, Histogram-based Gradient Boosting and Support Vector Machine. For each model, hyperparameters were tuned by random search methodology and model effectiveness was evaluated by repeated holdout testing. SHAP (SHapley Additive Annotations) and LIME (Local Interpretable Model Independent Annotations) interpretability methods were used to generate local and global feature importance measures.

Results: The CatBoost model exhibited the highest overall performance and achieved superior results in accuracy, precision, F1 score and AUC metrics. Nonetheless, other models such as Decision Tree and Histogram-based Gradient Boosting also yielded strong and competitive results. The results also highlighted age, weight, height and specific food patterns as key predictors of obesity. In terms of interpretability, LIME showed superior in fidelity, whereas SHAP showed improved sparsity and consistency across models, facilitating a comprehensive understanding of trait importance.

Conclusion: This research demonstrates that ML algorithms, when integrated with XAI technologies, can accurately predict obesity levels and explain important contributing risk factors. The use of SHAP and LIME increases model transparency, facilitating the identification of specific lifestyle patterns linked to obesity risk. These findings help to formulate more precise intervention techniques guided by a reliable and understandable predictive framework.

Keywords: explainable artificial intelligence; feature importance; machine learning; obesity prediction; physical activity and diet.

PubMed Disclaimer

Conflict of interest statement

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Figures

FIGURE 1
FIGURE 1
Flow diagram of analysis stages in this study.
FIGURE 2
FIGURE 2
Local Explanation of Each Method’s Best Holdout Model using SHAP.
FIGURE 3
FIGURE 3
Local Explanation of Each Method’s Best Holdout Model using LIME.

References

    1. Adadi A., Berrada M. (2018). Peeking inside the black-box: a survey on explainable artificial intelligence (XAI). IEEE access 6, 52138–52160. 10.1109/access.2018.2870052 - DOI
    1. Adebibe M., Coppack S. W. (2022). “Obesity-Associated comorbidities: health consequences,” in Obesity, bariatric and metabolic surgery: a comprehensive guide (Springer; ), 1–16.
    1. Afolabi H. A., Zakaria Z., Salleh S. M., Ch’ng E. S., Nafi S. N. M., Aziz AABA, et al. (2023). “Obesity: a prerequisite for major chronic illnesses,” in Obesity-recent insights and therapeutic options (IntechOpen; ). 10.5772/intechopen.111935 - DOI
    1. Akbulut S., Yagin F. H., Cicek I. B., Koc C., Colak C., Yilmaz S. (2023). Prediction of perforated and nonperforated acute appendicitis using machine learning-based explainable artificial intelligence. Diagnostics 13 (6), 1173. 10.3390/diagnostics13061173 - DOI - PMC - PubMed
    1. Al-Hazzaa H. M., Abahussain N. A., Al-Sobayel H. I., Qahwaji D. M., Musaiger A. O. (2012). Lifestyle factors associated with overweight and obesity among Saudi adolescents. BMC public health 12, 354–411. 10.1186/1471-2458-12-354 - DOI - PMC - PubMed

LinkOut - more resources