Enhancing BMI Predictions: A Machine Learning Approach (Preprint)
Authors: Peregrin Alvarez Jose M 
Published: January 2024

BACKGROUND

This paper investigates the predictive capabilities of the Body Mass Index (BMI) formula over thousands of individuals and explores the potential enhancements achievable through integrating additional parameters using machine learning (ML) models. After exploring a wide variety of modern ML models (K-Nearest Neighbors, Neural Networks, Decision Trees, Support Vector Classification, Logistic Regression, and Ridge Classifiers. Ensemble models: voting Classifier, Random Forest, and Gradient Boosting), most models demonstrated a high precision capability, and, interestingly, some models were able to either equalize or even perform better than the reference model. Our results suggest that incorporating into the conventional BMI formula variables, such as age or gender, may lead to more accurate and personalized BMI measurements, helping health practitioners to provide more realistic weight management and health assessments, as well as early diagnoses, treatments, and enhanced healthcare.

OBJECTIVE

The Body Mass Index (BMI), a widely used metric for assessing an individual's body weight relative to their height, serves as a valuable tool in health assessments [1]. However, recent studies have questioned its accuracy, prompting an exploration into alternative approaches. For example, due to the variety of body types, muscle distribution, bone mass, etc, BMI is not appropriate as the only indication for diagnosis, which could lead to misclassification [2]. However, weight control is a key factor in the prevention of non-communicable diseases. Recent studies have shown the utility of Machine Learning (ML) in clinical settings. For example, a recent ML approach predicted weight changes over the years, which could be helpful for weight management approaches [3]. Thus, it will be interesting to evaluate the efficacy of the traditional BMI formula and investigate the potential improvements offered by modern ML classification models by incorporating additional parameters other than the traditional height and weight. For example, as a person ages, body fat mass naturally increases, and muscle mass declines. Numerous studies have shown that a higher BMI of 23.0–29.9 in older adults can be protective against early death and disease [4]. Other studies have indicated that the risk for heart disease and diabetes increases in women with a waist measurement greater than 35 inches (88.9 cm) and more than 40 inches (101.6 cm) in the case of men [5]. Furthermore, the BMI may not accurately reflect the health of certain racial and ethnic populations. For example, numerous studies have shown that people of Asian-Pacific descent have an increased risk of chronic disease at lower BMI cut-off points, which leads to specific BMI guidelines with alternative BMI cut-off points for this population [6].
This paper aims to investigate the potential of using modern ML classification models, by evaluating age, gender, and/or ethnicity as potential additional parameters to be considered in traditional BMI calculations. We employed a highly reliable and publicly available comprehensive and transparent dataset from the National Health and Nutrition Examination Survey (NHANES) [7]. NHANES is a program of studies designed to assess the health and nutritional status of adults and children in the United States, a subprogram of the Centers for Disease Control and Prevention (CDC) [7]. Survey data is intended to be used in epidemiological studies and health sciences research, which help develop sound public health policy, direct and design health programs and services, and expand the health knowledge for the Nation. These data were fundamental to conducting our comprehensive analysis aiming to provide potential new alternative measurements to the traditional BMI calculations.

METHODS

We downloaded data from 5663 individuals data obtained from surveys combining interviews and physical examinations from NHANES (years 1999 to 2022). Since 1999, the survey has examined about 5,000 people in 15 different counties across the country each year. Each participant makes an important contribution to the study, representing approximately 65,000 others in the country like them. The dataset comprises weight, height, age, gender, ethnicity, and BMI variables. Data Privacy was a priority for the NHANES dataset. Participation was confidential and bound by law, following strict privacy standards to protect every NHANES participant. Federal law, good statistical practice, and ethical obligations to the American people required that any personal information collected by this survey be treated with the utmost concern for the privacy of those who provide it.
Initially, we utilized Python language (version 3.11.3) within the JupyterLab environment [8], a highly extensible feature-rich notebook, part of the Jupyter project, to compute the standard BMI formula and compare different ML predictions against real BMI classification values (Underweight, BMI below 18.5; Normal, BMI 18.5 – 24.9; Overweight, BMI 25.0 – 29.9, and Obese BMI 30.0 and above). Subsequently, ML classification models were employed to discern whether incorporating additional parameters such as age, gender, and ethnicity could enhance predictive accuracy. ML models: K-Nearest Neighbors [9], Neural Networks [10], Decision Trees [11], Support Vector Classification [12], Logistic Regression [13], and Ridge Classifiers [14]. ML ensemble models: voting Classifier [15], Random Forest [16], and Gradient Boosting [17].
For statistical analyses, we computed two kinds of measurements: 1) MAE (Mean Absolute Error), the average absolute difference between the predicted and actual values); MSE (Mean Squared Error), the average of the squared differences between predicted and actual values; RMSE (Root Mean Squared Error), the square root of the MSE; and R-squared, the proportion of the variance in the dependent variable that is predictable from the independent variable(s). Lower MAE and MSE values indicate better predictive performance. RMSE is the square root of MSE, providing a measure of the spread of errors (Lower RMSE values are desirable). R-squared (R2 = 1 – (RSS/TSS), where RSS represents the sum of squares of residuals, and TSS represents the total sum of squares) measures the proportion of the variance in the dependent variable (Real BMI class) that is predictable from the independent variable (model predictions). R-squared values close to 1 indicate a good fit, but negative values suggest that the model is not suitable for prediction, i.e. the model's predicted values perform worse than using the average as a predicted value. 2) Accuracy, specifically calculated for each model as a measure of how well the model predicts the correct BMI class labels; Precision, the proportion of true-positive predictions among all positive predictions; Recall, the proportion of true-positive predictions among all actual positive instances; and F1-score, the harmonic mean of precision and recall.
Selection procedure: Step 1: we pre-selected those ML models that showed equal or lowest MAE, MSE, and RMSE values, compared to the reference models (considering height and weight parameters only). Step 2: we pre-selected those models showing equal or highest R-squared, Accuracy, Precision, Recall, and F1-score values, compared to the reference models. Finally, we selected as best models those with the best statistics in both steps 1 and 2.

RESULTS

Our findings indicate that the traditional BMI formula, based solely on weight and height, exhibits reasonable predictive power. However, some ML models trained on datasets enriched with age or gender information were able to outperform the model trained with the standard BMI parameters, height, and weight. Specifically, all models demonstrated a high precision, while models such as Decision Tree, Support Vector, and Ridge Classifiers, and ensembles such as Random Forest, Gradient Boosting, and Voting Classifier, can either equalize or even outperform the reference model (only trained with height and weight parameters) (Fig. 1, Tables 1 and 2). The results show that, in comparison to the traditional BMI parameters, training the datasets with additional age or gender parameters (HWA or HWG) can improve ML model prediction capabilities.

Figure 1. Accuracy, precision, recall, and F1-score of ML models.
Accuracy vs ML model's graphic. Abbreviations: HW: height and weight; HWG: height, weight, and gender; HWA: height, weight, and age; HWE: height, weight, and ethnicity; and HWAGE: height, weight, age, gender, and ethnicity.

Table 1. Accuracy, precision, recall, and F1-score of ML models table.
Detailed statistical table for Fig. 1. Abbreviations: HW: height and weight; HWG: height, weight, and gender; HWA: height, weight, and age; HWE: height, weight, and ethnicity; and HWAGE: height, weight, age, gender, and ethnicity. Acc.:Accuracy; Pr.: precision; and F1: F1-score. Bold characters indicate the highest column values about the Accuracy, Precision, Recall, and F1-score. Red characters indicate zero values. Red background models indicate ML models outperforming the reference-trained HW model. Light gray cells stand for the predicted values of the reference dataset (HW); Sky blue cells indicate the same values as the reference dataset; and red cells indicate improved prediction values compared to the reference. Blue borders stand for best predictors (additional BMI parameters, other than height and weight, and ML models), combining information from Tables 1 and 2 (see methods).

Table 2. MAE, MSE, RMSE, and R-squared.
Abbreviations: Same as Figure 1, and MAE, Mean Absolute Error; MSE, Mean Squared Error; RMSE, Root Mean Squared Error; Rs, R-squared. Bold characters indicate the lowest column values about MAE, MSE, and RMSE calculations, and the highest column values about the R-square. Red characters indicate negative values (see methods). Red background models indicate ML models outperforming the reference-trained HW model. Light gray cells stand for the predicted values of the reference dataset (HW); Sky blue cells indicate the same values as the reference dataset; and red cells indicate improved prediction values compared to the reference. Blue borders stand for best predictors (additional BMI parameters, other than height and weight, and ML models), combining information from Tables 1 and 2 (see methods).

Specifically, using HWA (height, weight, and age) and HWG (height, weight, and gender) data with Decision Tree, Support Vector, and Ridge Classifiers as well as Random Forest, Gradient Boosting, and Voting Classifier's ensemble models can either equalize or perform even better than the same models using only height and weight parameters (Fig.1, Tables 1 and 2). However, R-squared values are negative in the case of the Ridge Classifier applied to the HWA dataset, suggesting that the model might not be suitable for prediction (see methods). In summary, these results suggest that the predictive capability of the traditional BMI formula could significantly be enhanced by incorporating age or gender parameters.

CONCLUSIONS

Discussion
BMI is a standard health assessment tool in most healthcare facilities. Although, for decades, the BMI has been widely used as a standard measurement for health based on body size, it has been criticized for its oversimplification of the real meaning of being healthy. Many researchers have claimed that BMI is outdated and inaccurate, and, perhaps, it should not be used in medical and fitness settings. For example, in epidemiological studies, the BMI based on self-reported height and weight (self-reported BMI) is subjected to measurement error [18]. Other studies have suggested adjusting the Normal BMI values to avoid false positive/ negative assignments [19]. It is expected that medical professionals would take the BMI result and consider patients as unique individuals. However, some health professionals use only BMI to measure a person's health status before providing medical recommendations. This can lead to weight bias and poor quality healthcare [20, 21]. Moreover, serious medical issues might go unnoticed or incorrectly seen as weight-related problems [20]. Other studies have shown that the higher a person's BMI is, the less likely the person will attend regular health checkups due to fear of being judged, distrust of the healthcare professional, or a previous negative experience. This can lead to late diagnoses, treatment, and care [22]. However, because of the ease and efficiency of gathering height and weight information, it remains important to assess the extent of error present in self-reported BMI measures and to explore possible adjustment factors.
It is important to consider the potential limitations of this study. For example, regarding ethnicity data, some populations such as Asian-Pacific might be not included or be underrepresented in the NHANES dataset, which is reported to be formed by Mexican American, non-Hispanic White, non-Hispanic Black, Other Hispanic, and Multi-Racial ethnicities. This could explain why using ethnicity as an additional parameter for BMI class prediction did not show any significant improvement compared to the use of age or gender. Furthermore, R-squared values are negative in the case of the Ridge Classifier applied to the HWA dataset (see results), suggesting some potential limitations of the model or the nature of the age data may be due to underrepresentation of some age categories. Moreover, there is a possibility of other potential biases been introduced during the process of survey-data compilation.

Conclusions
Our results suggest that while the conventional BMI formula is widely used as a reliable metric, its predictive capabilities could significantly be enhanced by incorporating additional parameters such as age or gender. ML models, such as Decision Trees, Support Vector, and Ridge Classifiers, and ensembles, such as Random Forest, Gradient Boosting, and Voting Classifier, emerged as promising alternatives, showcasing the potential for a more nuanced and accurate approach to BMI measurement. These findings open avenues for further research into refining BMI calculations, to better reflect individual characteristics and health refinements. In summary, this study provides valuable insights into the predictive capabilities of ML models for classifying BMI values. Our results underscore the potential for improved BMI measurements by adapting traditional formulas with additional parameters, such as age or gender. Future research in this domain could contribute to developing more personalized and accurate health assessment tools. The BMI only considers weight and height as a measure of health status, rather than the person. Our results suggest that considering height, weight, age or gender, and potentially other factors that may affect an individual weight and health status, such as a more comprehensive ethnicity and age dataset, could complement traditional BMI calculations and provide more consistent health statements. For example, health practitioners could train and test their historical patient data with the above ML models and additional BMI parameters (age or gender, or both independently), and, either serve as a validation of the results, if there is no difference with the traditional BMI results, or, in case of discrepancy, study in more detail the potential causes behind the differences between the traditional BMI formula versus ML prediction. Furthermore, additional data, such as body composition [23], medical history [24], and demographic and socioeconomic information [25], could help health practitioners, researchers, and scientists to provide more realistic weight management and health assessments, as well as early diagnoses, treatments, better healthcare, as well as new opportunities for R&D and scientific discovery. We will take into account all the points described above in future analysis.