Machine Learning Finds Mixed Dietary Signals in Older Adults’ Predicted

A machine-learning study that researchers could interpret found that diet was linked to predictions of existing, self-reported non-melanoma skin cancer in adults aged 60 and older. The study used data from two National Health and Nutrition Examination Survey (NHANES) periods. The results showed mixed patterns: some dietary factors were linked to higher predicted risk, while others were linked to lower predicted risk. The final model combined information about age, other personal characteristics, lifestyle and diet, including individual flavonoids, caffeine, zinc and niacin. Age was the strongest predictor, but the effects linked to different dietary compounds varied. These results show patterns found by a model, not proof that eating, avoiding or taking supplements containing any nutrient causes or prevents skin cancer.
The researchers studied data from the 2007–2010 and 2017–2018 NHANES survey periods, which included 29,940 participants in total. They chose these periods because they contained both the cancer questionnaire information needed to identify the outcome and detailed dietary records. They excluded people younger than 60, people without information about non-melanoma skin cancer and people with missing diet or other relevant information. The final study group contained 3,729 older adults. Of these, 3,607 reported that they had not had non-melanoma skin cancer, while 122 reported that they had received this diagnosis. The researchers identified cases using a question in the Medical Conditions questionnaire. Medical tests of tissue were not used to confirm the diagnoses. The questionnaire also did not provide enough information to tell whether the cancers were basal cell carcinoma, squamous cell carcinoma or another type based on tissue features.
The two groups differed in several ways, including age, social and economic circumstances, health-related measurements and diet. People who reported non-melanoma skin cancer were older on average than those who did not: 73.57 years compared with 69.45 years. Among people in the skin-cancer group, 94.3% were non-Hispanic White, compared with 48.6% in the control group. The skin-cancer group also had higher proportions of people who had studied beyond high school, had a poverty income ratio above 3 and currently drank alcohol. Their average Oxidative Balance Score was higher, while their average Dietary Inflammatory Index was lower. They also reported higher average intakes of vitamin E, zinc, calcium, magnesium, total anthocyanidins and several individual flavonoids. These differences do not mean the nutrients caused the cancer. People may change what they eat after a cancer diagnosis, and this survey study cannot show which came first.
Diet was measured using two interviews in which participants recalled everything they had eaten and drunk during the previous 24 hours. The interviews took place three to 10 days apart, and researchers calculated average daily intake from both. The dietary factors studied included carbohydrates, protein, fat and other major nutrients; vitamins and minerals; caffeine; groups of flavonoids; and four combined scores: the Composite Dietary Antioxidant Index, Oxidative Balance Score, Healthy Eating Index-2015 and Dietary Inflammatory Index. The researchers filled in missing values using missForest, a computer method that uses repeated random-forest calculations and can work with different types of data. They first compared logistic regression, least absolute shrinkage and selection operator (LASSO) and random forest to help choose useful features. They then ranked the predictors using random-forest importance and removed variables that were too strongly related to each other, with absolute pairwise Pearson correlation values above 0.70. Six related variables were removed: total flavonols, copper, total flavonoids, vitamin B12, vitamin B6 and thiamin. This left 24 features that were relatively independent of one another. Because there were far fewer cancer cases than controls, the researchers used synthetic minority oversampling (SMOTE) to create additional synthetic examples of cases in the training data. They did not use oversampling, undersampling or any other resampling method on the separate test data.
The researchers tested 12 computer models using the untouched test data: logistic regression, support vector machine, random forest, XGBoost, LightGBM, multilayer perceptron, kernel nearest neighbors, Gaussian naïve Bayes, extra trees, adaptive boosting, gradient-boosting decision tree and linear discriminant analysis. They measured how well the models separated cases from controls using the area under the receiver operating characteristic curve (AUC), along with 95% confidence intervals, accuracy, precision, sensitivity, specificity, balanced accuracy, the Matthews correlation coefficient, F1 score, calibration and decision-curve analysis. Linear discriminant analysis and logistic regression tied for the highest AUC, at 0.742. Their 95% confidence intervals were 0.666–0.815 and 0.668–0.815, respectively. The researchers chose linear discriminant analysis for the final model, which was designed to help screen for possible cases, because its sensitivity was 0.730, balanced accuracy was 0.703 and Matthews correlation coefficient was 0.153. Its accuracy was 0.677, precision was 0.071 and specificity was 0.676.
The results showed why a model's overall accuracy can be misleading. Extra trees and random forest had accuracy above 0.93, but their sensitivity was only 0.081 and 0.135, respectively. This means they detected very few of the non-melanoma skin cancer cases in the test data. Their high accuracy mainly came from the much larger number of people without the reported cancer. Linear discriminant analysis identified 73% of cases and correctly classified 67.6% of controls, giving a better balance between finding cases and producing false alarms. However, its precision was still low at 0.071, which fits the low proportion of cases in the study group. Calibration curves suggested that the model's predicted probabilities generally matched the observed outcomes. Decision-curve analysis also suggested that it offered greater net benefit than the other models across a wide range of probability thresholds. Still, its ability to distinguish cases from controls was moderate, and its precision was very low. Its predictions should therefore not be treated as proof of a diagnosis.
The researchers used SHapley Additive Explanations (SHAP) to show how each feature affected the predictions made by linear discriminant analysis. Age had the greatest influence, with a mean absolute SHAP value of 0.71. Older age increased predicted risk, and this effect became stronger at around age 70. The most important dietary factors were luteolin, with a value of 0.49; total flavones, 0.44; caffeine, 0.36; zinc, 0.32; and niacin, 0.29. In the model, higher values for luteolin, caffeine and zinc generally pushed predicted risk upward. Higher values for total flavones, quercetin and kaempferol generally pushed it downward. Niacin mostly contributed in the direction of lower predicted risk, although the detailed analysis also suggested that nutrients might interact. One possible pattern was an inverse relationship involving selenium and niacin. In one example of a person given a high predicted risk of 0.998, caffeine had the strongest upward contribution, with a SHAP value of +4.66, followed by alcohol at +4.19. Kaempferol, at −1.50, and niacin, at −1.06, made the strongest contributions in the opposite direction.
The unexpected patterns may reflect the complex relationships between diet, aging and years of sun exposure, rather than harmful effects of foods rich in antioxidants. Zinc helps antioxidant enzymes work and supports the immune system. However, the researchers noted that too much zinc may disrupt the balance of substances involved in oxidation and reduction by competing with copper for absorption in the intestine. People in the non-melanoma skin cancer group reported an average zinc intake of 11.29 milligrams per day, compared with 9.99 milligrams per day among controls. Caffeine was also linked to higher predicted risk in the model, even though some earlier observational studies reported different patterns. Laboratory experiments have found that luteolin can reduce inflammation and show effects linked to slower aging. However, the amounts used in laboratory studies may be much higher than the amounts people get from food, and the body limits how much luteolin enters the bloodstream and reaches tissues. By contrast, the model's links between quercetin and kaempferol and lower predicted risk are consistent with laboratory studies of skin cells and tissues that examine UV-related signals, inflammation and cancer development. These biological explanations suggest ideas for further research, but they do not prove that normal amounts of these nutrients in food protect people against skin cancer.
The study also shows why overall accuracy can be misleading when a medical prediction model deals with an outcome that is much less common than its absence. Only 122 of the 3,729 participants were cases. A model that labels nearly everyone as a control can therefore achieve high accuracy while missing most cases. For this reason, the researchers also focused on sensitivity, AUC, balanced accuracy and the Matthews correlation coefficient, as well as calibration and potential clinical usefulness. SHAP explanations make it easier to understand how the selected model works, but they do not turn associations into evidence of cause and effect. A feature may influence a prediction because it reflects another factor that was not measured, such as income, outdoor work, sun exposure or changes in behavior after diagnosis, rather than because the feature itself causes disease. The fact that caffeine and individual flavonoids appeared as signals linked to higher predicted risk does not establish that these foods or nutrients have harmful effects, nor does it overturn earlier research. It identifies patterns that need to be tested in studies that follow people over time.
Several limitations affect how the findings should be understood. Because the study measured information from a single general period rather than following people over time, it cannot establish cause and effect. It may also be affected by reverse causation, such as people changing their diets after a skin-cancer diagnosis. Self-reported cancer status may include mistakes in memory or reporting and cannot confirm a clinical diagnosis or identify the cancer subtype. The survey periods may not reflect current eating habits, supplement use, sun-protection practices or skin-cancer screening. Most importantly, the data did not include key details about UV exposure, such as lifetime sun exposure, exposure at work or during leisure activities, sunscreen use and related behaviors. The researchers measured age, race, socioeconomic position, smoking, alcohol use, body mass index and other characteristics, but these could not fully make up for the missing UV information. Larger studies that follow people over time and include more diverse populations, detailed UV exposure, genetic information and biological markers would be needed to find out whether these dietary patterns continue to appear and whether they have a causal or clinical role. For now, this analysis is best understood as a description of subtle patterns in observational data, not as dietary advice for preventing skin cancer.
Subject of Research: Using interpretable machine learning to study dietary antioxidant patterns and self-reported non-melanoma skin cancer in older adults
Article Title: From Nutritional Epidemiology to Clinical Prediction: Interpretable Machine Learning Reveals Subtle Associations Between Dietary Antioxidant Profiles and Non‐Melanoma Skin Cancer in Older Adults
Article References: Yu, B. H., Kang, J. Y., & Kim, K. E. (2026). From Nutritional Epidemiology to Clinical Prediction: Interpretable Machine Learning Reveals Subtle Associations Between Dietary Antioxidant Profiles and Non‐Melanoma Skin Cancer in Older Adults. Food Science & Nutrition, 14(10), Article e72458. https://doi.org/10.1002/fsn3.72458
Image Credits: AI Generated
DOI: 10.1002/fsn3.72458
Keywords: NHANES, non-melanoma skin cancer, machine learning, dietary antioxidants, older adults, flavonoids, SHAP analysis, nutritional epidemiology, risk prediction, nutrition, epidemiology, clinical research
