Abstract
We tested whether adding Healthy Eating Index scores from 24-hour dietary recalls improves machine learning screening for prediabetes and diabetes. In cross-sectional National Health and Nutrition Examination Survey data (n = 22,839), adding 11 dietary components to a 7-parameter anthropometric model yielded no measurable improvement in discrimination (ROCAUC 0.797 [95% CI 0.787–0.807] versus 0.797 [0.787–0.808]), suggesting limited utility of dietary quality scores for digital dysglycemia screening.
Main text
The escalating prevalence of undiagnosed prediabetes and type 2 diabetes presents a significant barrier to effective public health intervention1,2. Beyond its role as a precursor to diabetes, prediabetes independently increases the risk of cardiovascular disease and all-cause mortality3, which makes early identification of both conditions urgent. To address the need for accessible, non-invasive risk stratification, we previously developed the Machineborne Early Diabetic Warning And Control System (MEDWACS)4. This machine learning tool utilizes seven easily measurable, non-invasive physical, hemodynamic, and anthropometric parameters, including waist circumference, limb lengths, and blood pressure, to predict the likelihood of prevalent dysglycemia with high discrimination and calibration accuracy. To maximize usability and facilitate home-based self-assessment, MEDWACS was intentionally designed to be parsimonious, excluding complex parameters such as dietary history.
However, poor diet quality is an upstream driver of metabolic dysfunction and a modifiable determinant of type 2 diabetes risk. Self-reported high intakes of fruits, vegetables, and whole grains have been associated with lower risk, whereas high intakes of red and processed meats, and sugar-sweetened beverages have been associated with increased risk5,6. By excluding dietary data, the current model relies on physiological evidence that anthropometric markers act as downstream integrators of long-term nutritional habits4. Waist circumference and body mass index reflect the cumulative balance of energy intake and expenditure over time7, while limb measurements such as leg length are established markers of nutritional status during childhood and adolescence8. It remains an open question whether this exclusion compromises screening accuracy, or if the anthropometric and demographic profile effectively encodes the metabolic history relevant for detection.
In this study, we used 20 years of National Health and Nutrition Examination Survey (NHANES) data to test this assumption. We investigated whether integrating the Healthy Eating Index 2020 (HEI), the federally established metric for quantifying adherence to the Dietary Guidelines for Americans, provides additional predictive utility over the existing anthropometric framework4,9. Specifically, we assessed if aggregated data on diet quality (e.g., sodium, saturated fat, and fruit intake) could enhance the predictive performance of digital screening tools, or if routine anthropometric and clinical measurements render such dietary data unnecessary for the purpose of identifying prevalent disease.
We analyzed data from 22,839 adult participants in the NHANES 1999–2018. The median age was 46.0 years (interquartile range, IQR 31.0–63.0), and 51.0% (n = 11,637) were female. The median body mass index (BMI) was 27.5 kg/m2 (24.0–31.9). The median Total HEI score was 49.6 (41.7–58.5) out of 100. Baseline characteristics, including all 13 HEI component scores, are shown in Table 1. Baseline characteristics stratified by sex are presented in Supplementary Table S1. As expected, males and females differed significantly (p < 0.001) across all anthropometric parameters, systolic blood pressure, the Total HEI score, total energy intake, and outcome prevalence (61.1% in males vs. 47.6% in females). Among the 13 individual HEI components, eight differed significantly at p < 0.001, two more reached significance at p < 0.05 (Seafood/Plant Proteins, p = 0.011; Saturated Fats, p = 0.029), and three were not significantly different between sexes (Sodium, p = 0.32; Added Sugars, p = 0.097; Refined Grains, p = 0.22). The correlation matrix (Supplementary Fig. S1) showed generally low correlations among HEI components, with expected high correlations observed between Total Fruits and Whole Fruits (0.789), and between Saturated Fats and Fatty Acids (0.598). The next highest moderate correlations were observed between Seafood/Plant Proteins and Greens/Beans (0.472), and Dairy and Fatty Acids (−0.469).
Full size tableThe intakes underlying each HEI component score are quantified in Supplementary Table S2. Reported total energy intake was lower in participants with prediabetes or diabetes than in normoglycemic participants (median 1898 versus 1990 kcal/day; p < 0.001), as were absolute added sugars (53.8 versus 65.2 g/day; p < 0.001), whereas whole fruit intake was higher (0.28 versus 0.21 cup equivalents/day; p < 0.001). Absolute differences between outcome groups were small throughout.
The median fasting plasma glucose (FPG) was 99.0 mg/dL (91.0–108.8), and the median glycohemoglobin was 5.4% (5.2–5.8%). In total, 12,385 participants (54.2%) met the criteria for the composite outcome of prevalent prediabetes or diabetes, while 10,454 (45.8%) had normal results for both measures.
To determine if these dietary signals could enhance prediction, we applied the Boruta feature selection algorithm to the 13 HEI components. Boruta confirmed 11 components as statistically relevant, rejecting HEI-Saturated Fats and HEI-Greens and Beans (Supplementary Fig. S2). This selection was sensitive to sample composition. Across 50 reruns using freshly drawn training partitions of identical size, the number of components confirmed ranged from 9 to 13 (median 11), and the exact set of 11 components confirmed in the primary analysis was reproduced in only 3 of 50 reruns (6.0%; Supplementary Fig. S3). HEI-Added Sugars and HEI-Dairy were identified as the strongest dietary predictors, followed by HEI-Sodium and HEI-Whole Fruits. A subsequent learning curve analysis (Supplementary Fig. S4) revealed a flat trajectory, demonstrating that sequentially adding these Boruta-confirmed dietary features to the base anthropometric model yielded no measurable incremental improvement in discrimination. When features were instead selected at random rather than by Boruta importance, drawing three independent subsets at each of eleven subset sizes (33 models in total), cross-validated discrimination remained equally flat, ranging from 0.7947 to 0.7969 across all randomly selected subsets, closely matching the 0.7960 to 0.7974 range of the importance-ordered curve (Supplementary Fig. S5). Consequently, to test the predictive limits of diet quality, we defined a “Base + Boruta-Selected HEI Components” model incorporating all 11 confirmed HEI parameters alongside the base anthropometric parameters.
We compared four neural network models to assess clinical utility (Fig. 1 and Table 2). The Base MEDWACS model (7 parameters) achieved robust discrimination with an area under the receiver operating characteristic curve (ROCAUC) of 0.797 (95% CI 0.787–0.807). Integrating the HEI Total Score yielded no statistically significant improvement (ROCAUC 0.797 [0.787–0.808]; p = 0.243, DeLong’s test). Similarly, the Base + Boruta-Selected HEI Components model provided no statistically significant additional benefit, yielding an identical ROCAUC of 0.797 (0.787–0.808; p = 0.513). By contrast, the HEI Components Only model, which relied exclusively on diet quality without anthropometric data, performed poorly with an ROCAUC of 0.589 (0.577–0.603). Calibration remained strong across all models that included anthropometrics (Fig. 1B). No evidence of miscalibration in any of the four models was found (all p ≥ 0.146 by Spiegelhalter’s z-test and all p ≥ 0.170 by the Hosmer–Lemeshow C statistic; Table 2). However, the HEI Components Only model exhibited a limited calibration range, failing entirely to predict probabilities at the lower and upper extremes. Its predicted probabilities spanned only 0.227 to 0.759, so it satisfied the calibration tests while assigning nearly every participant a risk close to the population prevalence of 54.2%. These performance patterns were consistent during cross-validation (Supplementary Table S3). The details of the hyperparameters’ tuning are available in Supplementary Table S4.
Full size imageA Violin plots displaying the distribution of performance metrics across 1000 bootstrap resamples. The width of the violin represents the density of the results. All box plots within the violins comprise the median line, the box indicates the interquartile range (IQR), whiskers denote the rest of the data distribution, and outliers are denoted by points greater than ±1.5 × IQR. B Calibration curves comparing predicted probabilities (x-axis) against observed probabilities (y-axis). The dotted diagonal line represents perfect calibration. The HEI Components Only model (dark red) shows limited calibration range, failing to predict probabilities at the lower and upper extremes. ROCAUC Area Under the Receiver Operating Characteristic Curve, PRAUC Area Under the Precision-Recall Curve, MEDWACS Machineborne Early Diabetic Warning And Control System, HEI Healthy Eating Index.
Full size tableInterpretability analysis using SHapley Additive exPlanations (SHAP) values (Fig. 2) revealed how individual feature values shift the model’s predicted risk of dysglycemia, highlighting a contrast between feature importance and global model performance10. In the Base + Boruta-Selected HEI Components model (Fig. 2C), HEI-Added Sugars emerged as the highest-ranking dietary predictor. Multiple dietary components, including Added Sugars, Total Fruits, Refined Grains, and Sodium, surpassed body mass index (BMI) in predictive importance. However, the directionality of these self-reported dietary features was counterintuitive: higher HEI-Added Sugars scores (indicating lower sugar intake) were associated with increased predicted risk.
Full size imageSummary plots illustrating the impact of feature values on model predictions for (A) Base MEDWACS (7 parameters), (B) Base + HEI Total Score, (C) Base + Boruta-Selected HEI Components, and (D) HEI Components Only (11 parameters selected by Boruta). Each dot represents a single participant. The color indicates the feature value (red = high, blue = low). The x-axis position indicates the SHAP value; positive values indicate an increased probability of prevalent prediabetes or diabetes, while negative values indicate a decreased probability. MEDWACS Machineborne Early Diabetic Warning And Control System, HEI Healthy Eating Index, BMI Body Mass Index.
This paradoxical pattern was amplified in the HEI Components Only model (Fig. 2D), where anthropometric data were excluded. Without physical measurements to anchor the predictions, HEI-Added Sugars became the single most important predictor overall, driving the risk predictions in a clinically counterintuitive direction. A similar association was observed for HEI-Whole Fruits. This could reflect reporting bias and reverse causality (e.g., individuals actively restricting sugar or eating more fruit following medical advice or weight gain)11. Adjusting for diabetes medication use and physical activity attenuated the association for HEI-Added Sugars and did not reveal any paradoxical association for HEI-Whole Fruits once anthropometric parameters were included (Supplementary Table S5).
We confirmed the stability of our findings across diverse subpopulations (Supplementary Table S6). When evaluating sex-specific performance on the test set, the Base MEDWACS model achieved an ROCAUC of 0.811 (95% CI 0.797–0.825) in females (n = 3522) and 0.765 (0.749–0.781) in males (n = 3329). Incorporating dietary quality scores yielded no statistically significant improvement in discrimination for either females (ROCAUC 0.811 [0.797–0.825]; p = 0.960, DeLong’s test) or males (ROCAUC 0.766 [0.749–0.783]; p = 0.409, DeLong’s test). Stratifying by survey era similarly showed no evidence of effect modification. The null HEI finding held in both the earlier half of the study period (1999–2008; ROCAUC 0.800 [95% CI 0.784–0.815] for Base MEDWACS vs. 0.799 [0.784–0.814] for Base + Boruta-Selected HEI Components; DeLong’s p = 0.481) and the later half (2009–2018; 0.788 [0.773–0.802] vs. 0.788 [0.772–0.802]; p = 0.999), despite dysglycemia prevalence rising from 46.1% to 61.8% between the two periods. Across all other subgroups, performance remained robust when stratified by age, ethnicity, and socioeconomic status. Discrimination and calibration diverged across age strata. Participants aged 65 years and over showed a lower ROCAUC (0.679 [95% CI 0.646–0.711]) but a higher PRAUC (0.872 [0.849–0.894]) and higher calibration (0.841 [0.830–0.852]) than those below 65 years (0.785 [0.774–0.797], 0.762 [0.745–0.779] and 0.811 [0.806–0.816], respectively). This reflects the higher dysglycemia prevalence in this age group (78.1% versus 47.7%) rather than better model performance, because PRAUC and calibration each have a prevalence-dependent baseline that ROCAUC does not share (Supplementary Table S6). Measured against these baselines, the older stratum gained less than the younger one (PRAUC +0.091 versus +0.285; calibration +0.013 versus +0.061), while risk estimates remained accurate on the absolute scale in both strata (Spiegelhalter’s z-test p = 0.985 and p = 0.871). The same prevalence gradient explains the pattern by sex (61.9% dysglycemia in males versus 47.0% in females). The finding was also robust to heterogeneity in dietary recall methodology. Retraining both models exclusively on participants whose HEI was derived from a 2-day average yielded identical discrimination on the corresponding test set (n = 4931; ROCAUC 0.795 [0.783–0.807] for both; DeLong’s p = 0.928), and the null was reproduced separately within the single-day (p = 0.956) and 2-day (p = 0.994) recall strata. The finding was similarly robust to restricting the population to participants with no prior diagnosis of diabetes or prediabetes (NHANES DIQ010; n = 19,929 of 22,839, 87.3%), among whom dysglycemia prevalence remained 48.2%. Retraining both models on this subset reproduced the null result (ROCAUC 0.771 [95% CI 0.760–0.782] for Base + Boruta-Selected HEI Components versus 0.770 [0.758–0.782] for Base MEDWACS; DeLong’s p = 0.512), as did evaluating the original models restricted to the same subset (p = 0.823). Because HEI scores reflect diet quality (density per 1000 kcal), we also tested the inclusion of Total Energy (kcal) to capture absolute caloric load. When forced into the model, the ROCAUC remained unchanged at 0.797 (95% CI 0.787–0.808). Furthermore, SHAP analysis revealed a counterintuitive inverse association, where higher reported caloric intake contributed to a lower predicted probability of dysglycemia (Supplementary Fig. S6). A sensitivity analysis in the 2007–2018 cycles found that physical activity was associated with the outcome (Supplementary Table S7), but adding it to the model did not significantly improve discrimination (ROCAUC 0.790 [95% CI 0.776–0.804] for the Base MEDWACS model versus 0.789 [0.776–0.803] with physical activity added; p = 0.710, DeLong’s test), and the HEI components remained statistically non-contributory in its presence (p = 0.437). With the network architecture held fixed across models, all four models were statistically indistinguishable (ROCAUC 0.785 to 0.789).
In this study, we evaluated the predictive utility of integrating detailed diet quality metrics into a machine learning-based diabetes screening tool. Using a nationally representative dataset spanning 20 years, we found that while specific dietary components are statistically relevant predictors, their addition to the MEDWACS framework yielded no measurable clinical benefit in this cross-sectional screening model. The inclusion of Healthy Eating Index (HEI) scores resulted in no measurable improvement in discrimination performance (ROCAUC 0.797 vs. 0.797). This finding reinforces the robustness of the original 7-parameter anthropometric model and suggests that for the specific purpose of screening for prevalent dysglycemia, these aggregated dietary quality features add little value once anthropometric data are considered.
Our analysis revealed that the addition of aggregated dietary features provided no statistically or clinically significant improvement over the base anthropometric model. This lack of clinical performance gain, despite the biological relevance of diet to diabetes etiology, likely reflects the nature of anthropometrics as downstream integrators of metabolic history. Parameters such as waist circumference, upper leg length, and arm circumference physically encode the cumulative effects of long-term nutritional habits7,12,13. Consequently, the physical phenotype is a robust marker of prevalent disease. Furthermore, this aligns with previous epidemiological analyses demonstrating no substantial or consistent differences in self-reported macronutrient and micronutrient intake between US adults with and without diabetes14. This apparent homogeneity in self-reported dietary patterns suggests that such aggregated data may lack the discriminative variance necessary to effectively classify dysglycemia status in population-scale machine learning models14.
This lack of a robust biological signal is further evidenced by the instability of feature selection. Repeating Boruta selection across 50 freshly drawn training partitions of identical size reproduced the exact primary set of 11 confirmed components in only 6.0% of reruns, and HEI-Total Vegetables, confirmed in the primary analysis, was confirmed in only 38% of reruns (Supplementary Fig. S3). This instability concentrated among components with substantial pairwise correlation (Pearson r = 0.60 between HEI-Fatty Acids and HEI-Saturated Fats, and r = 0.47 between HEI-Greens and Beans and HEI-Seafood and Plant Proteins), consistent with Boruta’s known sensitivity to collinearity, whereby importance is diluted between correlated predictors rather than reflecting a genuine loss of dietary signal. Consistent with this, replacing the importance-based feature ordering with randomly selected feature subsets left the learning curve unchanged (Supplementary Fig. S5).
This interpretation is further supported by our SHAP analysis, which revealed an important distinction between feature importance and discriminative utility. In the Base + Boruta-Selected HEI Components model, HEI-Added Sugars ranked highly in importance, consistent with the model exploiting self-reported dietary patterns as a proxy for behavioral reverse causality, reporting bias, or general predictor instability, rather than as a measure of physiological nutritional benefit. However, this refinement resulted in no measurable AUC improvement. This indicates that while dietary data may help sharpen the calibration of risk, it rarely provides the orthogonal information necessary to reclassify a low-risk individual as high-risk, or vice versa, once the comprehensive anthropometric profile is known. Reverse causation, whereby subclinical dysglycemia prompts early dietary change rather than resulting from it, would align with this pattern: an attenuated dietary signal relative to the comparatively stable anthropometric profile, consistent with the limited utility we observed. However, restricting the population to participants with no prior diagnosis of diabetes or prediabetes, where post-diagnosis dietary change cannot operate, reproduced the same null HEI finding (DeLong’s p = 0.512), suggesting the limited dietary utility reflects weak and unstable predictors more generally rather than reverse causation specifically. To test whether this directionality reflected confounding by physical activity or post-diagnosis dietary change marked by diabetes medication use, we adjusted for each separately (Supplementary Table S5). The HEI-Added Sugars association was small, attenuated after adjustment, and reversed direction in the 2007–2018 subset, consistent with the broader instability of dietary associations documented elsewhere in this study. HEI-Whole Fruits showed no paradoxical association once anthropometric parameters were included at any stage, indicating the paradox was specific to the poorly discriminating HEI Components Only model (Fig. 2D, ROCAUC 0.589).
From a digital health perspective, these results support the design of low-friction screening tools. Dietary assessment via 24-h recalls or food frequency questionnaires is burdensome, time-consuming, and prone to significant reporting bias15,16. Physical activity itself, despite its association with the outcome (Supplementary Table S7), added no measurable discriminative value once the anthropometric profile was known, mirroring the result for diet quality and reinforcing that non-invasive physical measurements already capture much of the relevant risk signal. Furthermore, our subpopulation analyses demonstrated that this null finding held consistently across the evaluated US demographics. Despite substantial baseline differences in body composition and dysglycemia prevalence between males and females, the addition of dietary quality scores provided no statistically significant incremental discriminative gain in either sex (DeLong’s p = 0.960 for females; p = 0.409 for males). The lower ROCAUC in participants aged 65 years and over reflects the compressed range of predicted risk in a stratum where most people already have dysglycemia, not a change in model quality (Supplementary Table S6). Predicted risk remained accurate on the absolute scale across all age and sex strata, which is the property relevant to clinical use of a screening probability. The base non-linear neural network appears to accommodate sex-specific risk thresholds, producing accurate predictions across demographic and socioeconomic variations. These results suggest that non-invasive physical measurements alone can support screening that is simple, objective, and scalable. Such aggregated diet quality assessments may therefore be more valuable in the prevention and management phase than in detection, where they remain important for lifestyle intervention. Although our null finding indicates limited incremental value of diet quality for identifying prevalent dysglycemia in a cross-sectional screening model, it does not contradict the well-established causal role of dietary and lifestyle intervention in preventing incident type 2 diabetes, demonstrated in randomized trials in high-risk populations17,18,19,20,21, alongside the Diabetes Prevention Program (DPP)22. Physical activity showed the same pattern in our data: it was clearly associated with the outcome, consistent with prior evidence23. However, adding it to the model conferred no measurable incremental discriminative value once anthropometric data were known (Supplementary Table S7).
Our study is limited by the cross-sectional design of NHANES, which precludes causal inference24. However, this design is appropriate for our stated purpose: MEDWACS is intended to detect prevalent, currently undiagnosed dysglycemia at a single point in time, not to predict future disease onset, a use case for which cross-sectional data is well suited and consistent with established screening principles25. We also combined prediabetes and diabetes into a single composite outcome, consistent with our aim of identifying individuals requiring clinical attention regardless of diagnostic category26. This composite design does not allow us to determine whether dietary quality contributes differentially to the two conditions, whose clinical and biological drivers may differ. Furthermore, we did not stratify participants by preexisting non-diabetic medical conditions (e.g., cardiovascular disease or clinical obesity), which may independently trigger dietary modifications and exacerbate reverse causality. Future research could link NHANES data with follow-up Medicare or commercial claims data to ascertain the longitudinal onset of chronic diseases, effectively turning NHANES into a cohort study to evaluate causal relationships. Moreover, our physical activity analyses were necessarily restricted to the 2007–2018 cycles, because the NHANES physical activity questionnaire and its reference period changed in 2007, and rely on self-report rather than accelerometry. Antihypertensive medication use did not meaningfully affect model discrimination (ROCAUC 0.699 with medication versus 0.687 without; Supplementary Table S8). The null HEI finding also held for three additional diet quality indices (Alternate Mediterranean Diet [aMED] score, Dietary Approaches to Stop Hypertension [DASH] score, and Planetary Health Diet Index [PHDI] score), none of which meaningfully improved discrimination over the base anthropometric model (Supplementary Table S9). Additionally, the inherent subjectivity of self-reported dietary data remains a limitation. The degree of underreporting of dietary intake or overreporting of physical activity may also differ between participants with and without dysglycemia, which self-reported instruments cannot distinguish from a true behavioral difference. Although participants completed detailed assessments during the mobile examination center visits, these data are still subject to recall bias and misreporting. More objective measures, such as blood-based nutritional biomarkers, might circumvent these biases and offer higher discriminative validity. However, the requirement of venipuncture for such biomarkers conflicts with the premise of accessible, non-invasive digital screening. We also specifically evaluated adherence to recommended dietary guidelines (HEI scores) rather than absolute nutrient intake or granular consumption of individual food items (e.g., sugar-sweetened beverages). In the diet-only model, higher reported whole fruit intake was associated with an increased predicted risk, while total fruit intake was associated with decreased risk. Given the high correlation between these two variables (r = 0.789), this divergence likely illustrates the mathematical instability of highly collinear variables in machine learning models, possibly compounded by behavioral reverse causality. Finally, while we validated the model across diverse US subpopulations, we did not perform external validation on non-US cohorts in this specific dietary analysis. Nonetheless, prioritizing accessible anthropometric measures allows high-risk individuals to be identified quickly, without complex nutritional data collection. Furthermore, our findings suggest that observational studies inferring dietary predictors of dysglycemia should account for comprehensive anthropometric profiles to avoid reporting spurious, confounded associations. MEDWACS remains a parsimonious tool for identifying individuals with undiagnosed dysglycemia.
Methods
Study population
For the derivation dataset, we analyzed data from the National Health and Nutrition Examination Survey (NHANES), spanning 10 cycles (1999–2018)27. NHANES III (1988–1994) was excluded because the Food Patterns Equivalents Database (FPED) and added sugar components required to calculate modern Healthy Eating Index (HEI) scores are not harmonized for survey cycles prior to 1999. A total of 22,839 adult participants aged 18 years or older with complete data on the seven MEDWACS parameters, 13 HEI component scores (and Total HEI Score), fasting plasma glucose, and HbA1c were included in the final analysis. The study flow chart is provided in Supplementary Fig. S7.
Eligibility criteria for participants followed the protocols established in our previous study4. We reported findings in accordance with the Strengthening the Reporting of Observational Studies in Epidemiology (STROBE) statement28. Consistent with the Sex and Gender Equity in Research (SAGER) guidelines, the dataset included both male and female participants29. NHANES categorizes this variable as ‘gender’ with binary options (male/female), which are used throughout this manuscript.
Ethics approval and informed consent
The National Center for Health Statistics (NCHS) Ethics Review Board (formerly the Research Ethics Review Board) approved the NHANES protocols (#98-12 for 1999–2004, #2005-06 for 2005–2010, #2011-17 for 2011–2017, and #2018-01 from October 2017), and all participants provided written informed consent. This secondary analysis of publicly available, de-identified data was conducted in accordance with the Declaration of Helsinki and required no additional ethical approval. No patients or members of the public were involved in the design, conduct, or reporting of this study.
Outcome of interest
The outcome was prevalent prediabetes or diabetes, defined as a composite outcome according to the American Diabetes Association (ADA) guidelines: Fasting Plasma Glucose (FPG) ≥ 100 mg/dL or HbA1c ≥ 5.7% (“glycohemoglobin”; ≥39 mmol/mol)26. This composite outcome was chosen to identify individuals with dysglycemia requiring clinical attention or lifestyle intervention. The detailed reasoning behind the outcome has been described previously4. Details on testing, inclusion, and exclusion criteria are available on the NHANES website (https://www.cdc.gov/nchs/nhanes/index.html).
Candidate predictors
We included the seven non-invasive parameters previously validated in the MEDWACS model4: (1) Age, (2) Waist circumference, (3) Systolic blood pressure, (4) Gender, (5) Upper leg length, (6) Arm circumference, and (7) Body mass index (BMI).
To assess the value of diet quality in predicting prevalent prediabetes or diabetes, we utilized the Healthy Eating Index-2020 (HEI-2020)9, a validated metric developed by the United States Department of Agriculture (USDA) and National Cancer Institute (NCI) to quantify adherence to the Dietary Guidelines for Americans. HEI scoring standards are density-based (calculated per 1000 kcal of energy intake or as a percentage of energy) to decouple diet quality from absolute quantity. HEI-2020 scores were calculated using data from 24-h dietary recalls via the dietaryindex R package. To best approximate usual intake, scores were derived using the average of 2 recall days for survey cycles where available (2003–2018). For earlier cycles where a second recall was not collected (1999–2002), scores were based on the single available 1-day recall. The index comprises 13 component scores reflecting dietary adequacy (e.g., total fruits, whole grains) and moderation (e.g., sodium, saturated fats, where higher scores indicate lower, healthier consumption), which sum to a total score ranging from 0 to 100. Higher scores indicate adherence to dietary recommendations and superior diet quality. Detailed scoring methodology is available via the NCI website (https://epi.grants.cancer.gov/hei/). Both the 13 individual component scores and the Total HEI Score were evaluated as candidate predictors.
Sensitivity analysis on energy intake
Total energy intake (kcal) was initially evaluated as a predictor to capture caloric load. To ensure consistency across survey cycles with varying dietary recall structures, total energy was defined as the reported kilocalories from Day 1 for cycles pre-2003, and the average reported kilocalories across Day 1 and Day 2 for cycles 2003–2018. However, preliminary analysis indicated a strong inverse association (higher caloric intake predicting lower diabetes risk). To isolate the predictive utility of diet quality (density) independent of caloric quantity, and to prevent potential confounding by physical activity or underreporting bias associated with total energy, it was excluded from the final feature set. Because HEI-2020 assigns each component score linearly between a minimum and a maximum intake standard, the intake corresponding to each observed component score was recovered from the score and the participant’s total energy intake, and is reported in Supplementary Table S2 both as the energy-adjusted density in which HEI-2020 scores it and as an absolute daily amount.
Sensitivity analysis on antihypertensive medication use
To evaluate whether antihypertensive medication use confounds the predictive contribution of systolic blood pressure, we linked NHANES questionnaire responses on hypertension diagnosis (BPQ020) and current antihypertensive medication use (BPQ050A) to our study population by participant identifier and survey cycle. Participants were categorized into three mutually exclusive groups: no hypertension diagnosis, diagnosed hypertension without current medication use, and diagnosed hypertension with current medication use. Participants who could not be classified into one of these three groups (n = 1249; 5.5%), most commonly because a hypertension diagnosis was reported but the medication-use question had no recorded answer (n = 1145), were excluded from this sensitivity analysis.
Sensitivity analysis on physical activity
Physical activity was not included among the candidate predictors because the NHANES physical activity questionnaire changed in 2007, from a 30-day recall (1999–2006) to a global module based on a typical week (2007–2018). We therefore tested its effect in a sensitivity analysis restricted to the 2007–2018 cycles (n = 14,046; complete data for 13,944), calculating total physical activity as Metabolic Equivalent of Task (MET)-minutes per week (the sum of vigorous and moderate work activity, walking or bicycling for transportation, and vigorous and moderate recreational activity, using the fixed MET multipliers of 8.0 for vigorous and 4.0 for moderate activity specified in the NHANES questionnaire documentation) and sedentary behavior as self-reported sitting time per day (Supplementary Table S7). Retaining the original training and test partition, we retrained the Base MEDWACS model and the Base + Boruta-Selected HEI Components model with and without physical activity and sedentary behavior, using training settings identical to the primary analysis, and compared discrimination on the held-out test set (n = 4221) using DeLong’s test. Because the four models were tuned independently and did not converge on a common architecture with hyperparameters, we repeated the comparison with the network architecture held fixed.
Sensitivity analysis excluding diagnosed diabetes
To test whether the null HEI finding reflected dietary changes already made by participants previously informed of dysglycemia, we restricted the study population to participants who reported no prior diabetes diagnosis (NHANES DIQ010 = 2), excluding diagnosed diabetes, told-borderline/prediabetes status, and unknown responses (n = 19,929 of 22,839). We retrained the Base MEDWACS and Base + Boruta-Selected HEI Components models on this subset, using settings identical to the primary analysis, and separately evaluated the original models restricted to the same subset.
Sensitivity analysis using additional diet quality indices
To test whether the null finding was specific to HEI, we repeated the primary analysis using three additional diet quality indices: the alternate Mediterranean diet score (aMED), the Dietary Approaches to Stop Hypertension score (DASH), and the Planetary Health Diet Index (PHDI). aMED and DASH were derived from 2-day dietary recalls restricted to cycles 2003–2018, matching HEI’s own 2-day recall coverage; PHDI was derived from 2-day recalls restricted to cycles 2005–2018, reflecting the dietary intake form required for PHDI scoring. For each index, we applied Boruta feature selection to its individual components and compared four models in the same structure as the primary analysis: (1) Base MEDWACS, (2) Base plus the index’s total score, (3) Base plus Boruta-selected components, and (4) the index’s components alone.
Statistical analysis
This study adhered to the TRIPOD+AI (Transparent Reporting of a Multivariable Prediction Model for Individual Prognosis or Diagnosis + artificial intelligence) statement30. Continuous variables were described using medians and interquartile ranges (IQR). Group comparisons were performed using the Mann–Whitney U test, analysis of variance (ANOVA) (or Kruskal–Wallis), or Chi-squared (or Fisher’s exact test) as appropriate. All tests were two-tailed.
To assess model fairness and performance parity across sociodemographic groups, we conducted subgroup analyses stratified by: (1) age (<65 vs. ≥65 years), (2) gender (female vs. male), (3) smoking status (serum cotinine level <14 vs. ≥14 ng/mL), (4) ethnicity (Mexican American, Other Hispanic, Non-Hispanic White, Non-Hispanic Black, Other/Multiracial), (5) BMI (<30 vs. ≥30 kg/m2), (6) Poverty Income Ratio (PIR: <1, 1–2, 2–4, >4), and (7) education level (high school graduate or less vs. some college or above). All statistical analyses were performed using R version 4.3.2.
Machine learning pre-process
The dataset was split into training and testing sets (7:3 ratio) using stratified sampling to ensure identical outcome prevalence in both sets. All predictors were standardized to have a mean of zero and a standard deviation of one. These preprocessing steps were done with the caret R Package. No imputation was performed as the final dataset was complete.
Assessing feature importance and selection
To identify the most predictive dietary features, we performed feature selection on the training set using the Boruta algorithm, a wrapper method using multiple forests or trees and shadow features31. We performed a maximum of 1000 iterations using Random Forest as the base learner32. Boruta compares the importance of real features against randomized shadow features to reject non-informative predictors.
Stability of feature selection
To assess the stability of the Boruta selection, we repeated it 50 times using freshly drawn 70/30 partitions of the full study population, each identical in training-set size to the primary analysis (n = 15,988) and differing only in composition, with maxRuns=100 for computational tractability across repetitions. We further examined sensitivity to the number of Boruta iterations alone (maxRuns from 50 to 1000) and, using the 999 stored iterations of the primary run, the proportion of iterations in which each component’s importance exceeded the maximum shadow feature (Supplementary Fig. S3). To verify the learning curve was not an artifact of adding features in Boruta importance order, we repeated it using randomly selected subsets of the 13 HEI components, drawing three independent subsets at each subset size from one to eleven, with training settings identical to the original learning curve (Supplementary Fig. S5). To evaluate whether collinearity among the HEI components contributed to this instability, we additionally computed pairwise Pearson correlations among the 13 components on the training set.
Learning curve analysis
Using the dietary features identified by Boruta, we performed learning curve analysis to evaluate the incremental predictive value of increasing dietary complexity. Features were added sequentially to the base 7-parameter model in order of importance ranking in the Model Averaged Neural Networks (avNNet)33, the algorithm identified as the top-performing architecture for (pre)diabetes screening in our previous MEDWACS study4. The change in discrimination performance (ROCAUC) on the test set was monitored to assess whether integrating additional dietary variables provided any meaningful improvement over the base model.
Sets of parameters to compare
We developed and compared four distinct models:
-
1)
Base MEDWACS: The 7 anthropometric/demographic parameters only.
-
2)
Base + HEI Total: The 7 parameters plus the single Total HEI Score.
-
3)
Base + Boruta-Selected HEI Components: The 7 parameters plus all individual HEI components confirmed as statistically relevant by Boruta feature selection.
-
4)
HEI Components Only: The HEI component scores identified as significant by Boruta feature selection, without anthropometric parameters (negative control).
Development of machine learning models
We used the avNNet, as in our previous MEDWACS study4. This ensemble method averages predictions from multiple neural networks to reduce variance and overfitting. The training and hyperparameter optimization process was performed with a 3-times repeated tenfold cross-validation. Hyperparameters (number of hidden units, weight decay, bagging) were optimized using a random search strategy within an adaptive resampling framework. This approach iteratively discarded poorly performing hyperparameter configurations based on a generalized least squares (GLS) criterion to improve computational efficiency. The configuration yielding the highest mean area under the receiver operating characteristic curve (ROCAUC) across resamples was selected for the final model.
Model performance assessment
Performance was evaluated on the held-out test set. Discrimination was assessed using the ROCAUC and the area under the precision-recall curve (PRAUC). 1000 bootstraps were used to obtain 95% CIs, and the mean of the estimates was reported. To statistically compare the discrimination performance (ROCAUC) between the Base model and models with dietary features, we utilized the non-parametric DeLong’s test for correlated ROC curves. Calibration was evaluated using calibration curves and the Brier score, and tested using Spiegelhalter’s z-test and the Hosmer–Lemeshow C statistic computed on ten equal-sized groups of predicted risk34,35. Probabilistic predictions were used for all metrics.
Machine learning model interpretation (SHAP)
To interpret the “black box” models, we applied the SHapley Additive exPlanations (SHAP) algorithm10. SHAP values quantify the marginal contribution of each feature to the model’s prediction for an individual instance10. We calculated SHAP values for 2000 randomly sampled participants from the training set to generate summary plots, visualizing the global importance and directionality of feature effects.
Confounder and reverse-causality adjustment for dietary SHAP directionality
To test whether the counterintuitive SHAP directionality for HEI-Added Sugars and HEI-Whole Fruits could reflect confounding or reverse causality, we fit multivariable logistic regression models of the composite outcome on the base MEDWACS parameters and each HEI component, adjusting separately for physical activity, an established independent risk factor for dysglycemia23 that could confound the dietary association, and for diabetes medication use (NHANES DIQ050/DIQ070), a marker of diagnosed and treated status that tests whether the paradoxical direction instead reflects dietary change following diagnosis. Within a given sample, unadjusted and adjusted models were fit on the identical complete-case set, so a change in odds ratio reflects adjustment rather than a change in who is included.
Software and package
Descriptive analyses and machine learning analyses were conducted using R (version 4.3.2, R Foundation for Statistical Computing) and RStudio (version 2026.5.0.218). Packages used for data processing, machine learning development, and visualization were: tidyverse (version 2.0.0), dplyr (version 1.1.4), caret (version 6.0-94), Boruta (version 8.0.0), rsample (version 1.2.1), yardstick (version 1.3.1), pROC (version 1.18.5), parallel (version 4.3.2), doParallel (version 1.0.17), kernelshap (version 0.7.0), shapviz (version 0.9.4), and patchwork (version 1.3.0).
Data availability
The datasets analyzed in the current study were collected by the Centers for Disease Control and Prevention. Our curated dataset is available in the Kaggle repository (https://www.kaggle.com/datasets/nguyenvy/nhanes-19882018)36.
Code availability
The machine learning models, pre-processing pipelines, complete code, and data required to reproduce the figures in this study are available in the public GitHub repository (https://github.com/udaniel/MEDWACS-HEI) under the MIT License.
References
Hu, M. et al. Diabetes prevalence and management patterns in US adults, 2001–2023. Acta Diabetol. 62, 2159–2170 (2025).
Article PubMed PubMed Central Google Scholar
O’Brien, M. J. et al. Screening for prediabetes and diabetes: clinical performance and implications for health equity. Am. J. Prev. Med. 64, 814–823 (2023).
Article PubMed PubMed Central Google Scholar
Huang, Y., Cai, X., Mai, W., Li, M. & Hu, Y. Association between prediabetes and risk of cardiovascular disease and all cause mortality: systematic review and meta-analysis. BMJ 355, i5953 (2016).
Article PubMed PubMed Central Google Scholar
Yoo, D., Maggiore, U. & Jolliet, O. Enhancing prediabetes and diabetes detection through a machine learning-enabled self-assessment approach. J. Clin. Epidemiol. 195, 112266 (2026).
Article PubMed Google Scholar
Neuenschwander, M. et al. Role of diet in type 2 diabetes incidence: umbrella review of meta-analyses of prospective observational studies. BMJ 366, l2368 (2019).
Article PubMed PubMed Central Google Scholar
Banjarnahor, R. L. et al. Umbrella review of systematic reviews and meta-analyses on consumption of different food groups and risk of type 2 diabetes mellitus and metabolic syndrome. J. Nutr. 155, 1285–1297 (2025).
Article CAS PubMed PubMed Central Google Scholar
Després, J.-P. & Lemieux, I. Abdominal obesity and metabolic syndrome. Nature 444, 881–887 (2006).
Article PubMed Google Scholar
Bogin, B. & Varela-Silva, M. I. Leg length, body proportion, and health: a review with a note on beauty. Int. J. Environ. Res. Public Health 7, 1047–1075 (2010).
Article PubMed PubMed Central Google Scholar
Shams-White, M. M. et al. Healthy Eating Index-2020: review and update process to reflect the Dietary Guidelines for Americans, 2020-2025. J. Acad. Nutr. Diet. 123, 1280–1288 (2023).
Article PubMed PubMed Central Google Scholar
Lundberg, S. M. & Lee, S.-I. A unified approach to interpreting model predictions. in Advances in Neural Information Processing Systems, Vol. 30 (Curran Associates, Inc., 2017).
Louie, J. C. Y. & Tan, S.-Y. Free sugars consumption and type 2 diabetes: what are the concerns and how strong is the evidence? Curr. Nutr. Rep. 15, 11 (2026).
Article CAS PubMed PubMed Central Google Scholar
He, B. et al. Upper arm length and knee height are associated with diabetes in the middle-aged and elderly: evidence from the China Health and Retirement Longitudinal Study. Public Health Nutr. 26, 190–198 (2023).
Article PubMed Google Scholar
Habib, S. S. et al. Predictive value of arm circumference (AC) and arm muscle circumference (AMC) with cardiovascular risk in healthy and diabetic males. Eur. Rev. Med. Pharmacol. Sci. 27, 2477–2484 (2023).
McClure, S. T. et al. Dietary intake of adults with and without diabetes: results from NHANES 2013–2016. BMJ Open Diab. Res. Care 8, e001681 (2020).
Wehling, H. & Lusher, J. People with a body mass index ⩾30 under-report their dietary intake: a systematic review. J. Health Psychol. 24, 2042–2059 (2019).
Article PubMed Google Scholar
Thompson, F. E. et al. The National Cancer Institute’s Dietary Assessment primer: a resource for diet research. J. Acad. Nutr. Diet. 115, 1986–1995 (2015).
Article PubMed PubMed Central Google Scholar
Pan, X.-R. et al. Effects of diet and exercise in preventing NIDDM in people with impaired glucose tolerance: The Da Qing IGT and Diabetes Study. Diab. Care 20, 537–544 (1997).
Article CAS Google Scholar
Tuomilehto, J. et al. Prevention of type 2 diabetes mellitus by changes in lifestyle among subjects with impaired glucose tolerance. N. Engl. J. Med. 344, 1343–1350 (2001).
Article CAS PubMed Google Scholar
Lindström, J. et al. Sustained reduction in the incidence of type 2 diabetes by lifestyle intervention: follow-up of the Finnish Diabetes Prevention Study. Lancet 368, 1673–1679 (2006).
Article PubMed Google Scholar
Salas-Salvadó, J. et al. Reduction in the Incidence of Type 2 Diabetes With the Mediterranean Diet: Results of the PREDIMED-Reus nutrition intervention randomized trial. Diab. Care 34, 14–19 (2011).
Article Google Scholar
Salas-Salvadó, J. et al. Prevention of diabetes with Mediterranean diets: a subgroup analysis of a randomized trial. Ann. Intern. Med. 160, 1–10 (2014).
Article PubMed Google Scholar
Knowler, W. C. et al. Reduction in the incidence of type 2 diabetes with lifestyle intervention or metformin. N. Engl. J. Med. 346, 393–403 (2002).
Article CAS PubMed PubMed Central Google Scholar
Laaksonen, D. E. et al. Physical activity in the prevention of type 2 diabetes: the Finnish Diabetes Prevention Study. Diabetes 54, 158–165 (2005).
Article CAS PubMed Google Scholar
Savitz, D. A. & Wellenius, G. A. Can cross-sectional studies contribute to causal inference? It depends. Am. J. Epidemiol. 192, 514–516 (2023).
Article PubMed Google Scholar
Wilson, J. M. G. & Jungner, G. Principles and Practice of Screening for Disease (World Health Organization, 1968).
American Diabetes Association Professional Practice Committee for Diabetes. 2. Diagnosis and classification of diabetes: standards of care in diabetes—2026. Diab. Care 49, S27–S49 (2025).
Centers for Disease Control and Prevention (CDC). National Center for Health Statistics (NCHS). National Health and Nutrition Examination Survey Data. Hyattsville, MD: U.S. Department of Health and Human Services, Centers for Disease Control and Prevention, 1999-2018. https://wwwn.cdc.gov/nchs/nhanes/continuousnhanes/default.aspx.
Elm, E. von et al. Strengthening the reporting of observational studies in epidemiology (STROBE) statement: guidelines for reporting observational studies. BMJ 335, 806–808 (2007).
Article Google Scholar
Heidari, S., Babor, T. F., De Castro, P., Tort, S. & Curno, M. Sex and Gender Equity in Research: rationale for the SAGER guidelines and recommended use. Res. Integr. Peer Rev. 1, 2 (2016).
Article PubMed PubMed Central Google Scholar
Collins, G. S. et al. TRIPOD+AI statement: updated guidance for reporting clinical prediction models that use regression or machine learning methods. BMJ 385, e078378 (2024).
Article PubMed PubMed Central Google Scholar
Kursa, M. B. & Rudnicki, W. R. Feature selection with the Boruta package. J. Stat. Softw. 36, 1–13 (2010).
Article Google Scholar
Breiman, L. Random forests. Mach. Learn. 45, 5–32 (2001).
Article Google Scholar
Ripley, B. D. Pattern Recognition and Neural Networks (Cambridge University Press, Cambridge, 1996). https://doi.org/10.1017/CBO9780511812651.
Spiegelhalter, D. J. Probabilistic prediction in patient management and clinical trials. Stat. Med. 5, 421–433 (1986).
Article CAS PubMed Google Scholar
Hosmer, D. W. & Lemeshow, S. Goodness of fit tests for the multiple logistic regression model. Commun. Stat. Theory and Methods 9, 1043–1069 (1980).
Nguyen, V. K. et al. Harmonized US National Health and Nutrition Examination Survey 1988-2018 for high throughput exposome-health discovery. https://doi.org/10.1101/2023.02.06.23284573 (2023).
Download references
Acknowledgements
The authors thank Umberto Maggiore, MD, PhD (University of Parma), for his contribution to the development of MEDWACS. Dr. Maggiore received no financial support for his participation. D.Y., M.N., and O.J. at Technical University of Denmark were funded by the Novo Nordisk Foundation (grant registration number NNF22OC0075778). V.K.N. was funded by the US National Institute of Environmental Health Sciences (grant numbers NIH R01 ES032470 and NIH R01 ES028802 Diversity Supplements) and the Harvard Data Science Initiative. The funders of this study had no role in the study design, data collection, analysis, or interpretation of the manuscript. A study protocol was not prepared. The study was not registered.
Author information
Authors and Affiliations
Section for Quantitative Sustainability Assessment, Department of Environmental and Resource Engineering, Technical University of Denmark, Kgs. Lyngby, Denmark
Daniel Yoo, Olivier Jolliet & Matilda Nordman
Silent Spring Institute, Newton, MA, USA
Vy Kim Nguyen
Environmental Health Sciences, School of Public Health, University of Michigan, Ann Arbor, MI, USA
Vy Kim Nguyen & Olivier Jolliet
Biomedical Informatics, Harvard Medical School, Boston, MA, USA
Vy Kim Nguyen
Broad Institute of MIT and Harvard, Cambridge, MA, USA
Samuel Zimmerman
National Food Institute, Technical University of Denmark, Kgs. Lyngby, Denmark
Matilda Nordman
- Daniel YooView author publications
Search author on:PubMed Google Scholar
- Vy Kim NguyenView author publications
Search author on:PubMed Google Scholar
- Samuel ZimmermanView author publications
Search author on:PubMed Google Scholar
- Olivier JollietView author publications
Search author on:PubMed Google Scholar
- Matilda NordmanView author publications
Search author on:PubMed Google Scholar
Contributions
D.Y. and M.N. conceptualized the study. D.Y. developed the research methodology, implemented the software, prepared all figures, and wrote the original draft of the manuscript. D.Y. and S.Z. performed the formal machine learning and statistical analyses. V.K.N. and S.Z. conducted data curation. D.Y., O.J. and M.N. performed the validation of the results. O.J. and M.N. provided project supervision and oversight. O.J. acquired the research funding. All authors interpreted the results, reviewed and edited the manuscript, and approved the final version.
Corresponding authors
Correspondence to Daniel Yoo or Matilda Nordman.
Ethics declarations
Competing interests
D.Y., M.N., and O.J. reported receiving grants from the Novo Nordisk Foundation during the conduct of the study. V.K.N. and S.Z. declare no competing financial interests. All authors declare no non-financial competing interests.
Additional information
Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Supplementary information
Supplementary information. (download PDF )
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article’s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article’s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
Reprints and permissions
About this article
Cite this article
Yoo, D., Nguyen, V.K., Zimmerman, S. et al. Limited utility of diet quality scores in anthropometric prediabetes and diabetes screening models. npj Digit. Public Health 1, 51 (2026). https://doi.org/10.1038/s44482-026-00061-3
Download citation
Received: 30 June 2026
Accepted: 30 October 2026
Published: 28 November 2026
Version of record: 28 November 2026
DOI: https://doi.org/10.1038/s44482-026-00061-3
Share this article
Anyone you share the following link with will be able to read this content:
Sorry, a shareable link is not currently available for this article.
Provided by the Springer Nature SharedIt content-sharing initiative

