Previously submitted to: Interactive Journal of Medical Research (no longer under consideration since Feb 26, 2026)
Date Submitted: Feb 22, 2026
Open Peer Review Period: Feb 26, 2026 - Feb 26, 2026
(closed for review but you can still tweet)
NOTE: This is an unreviewed Preprint
Warning: This is a unreviewed preprint (What is a preprint?). Readers are warned that the document has not been peer-reviewed by expert/patient reviewers or an academic editor, may contain misleading claims, and is likely to undergo changes before final publication, if accepted, or may have been rejected/withdrawn (a note "no longer under consideration" will appear above).
Peer review me: Readers with interest and expertise are encouraged to sign up as peer-reviewer, if the paper is within an open peer-review period (in this case, a "Peer Review Me" button to sign up as reviewer is displayed above). All preprints currently open for review are listed here. Outside of the formal open peer-review period we encourage you to tweet about the preprint.
Citation: Please cite this preprint only for review purposes or for grant applications and CVs (if you are the author).
Final version: If our system detects a final peer-reviewed "version of record" (VoR) published in any journal, a link to that VoR will appear below. Readers are then encourage to cite the VoR instead of this preprint.
Settings: If you are the author, you can login and change the preprint display settings, but the preprint URL/DOI is supposed to be stable and citable, so it should not be removed once posted.
Submit: To post your own preprint, simply submit to any JMIR journal, and choose the appropriate settings to expose your submitted version as preprint.
Warning: This is an author submission that is not peer-reviewed or edited. Preprints - unless they show as "accepted" - should not be relied on to guide clinical practice or health-related behavior and should not be reported in news media as established information.
Machine Learning–Based Risk Stratification for Incident Cancer in Patients With Type 2 Diabetes: An Electronic Health Record Cohort Study
ABSTRACT
Background:
Type 2 diabetes mellitus (T2DM) is a major global health concern, affecting over 537 million adults worldwide in 2021, with projections reaching 783 million by 2045. Cancer represents a significant comorbidity in T2DM patients, accounting for an increasing proportion of hospital admissions and mortality. The complex interplay between T2DM and cancer involves shared risk factors including obesity, physical inactivity, chronic inflammation, and metabolic dysregulation. Early identification of cancer risk in T2DM patients could enable targeted preventive interventions and improve clinical outcomes.
Objective:
This study aimed to develop and validate machine learning models for predicting breast cancer and lung cancer risk in patients with type 2 diabetes using routinely collected clinical and biochemical parameters from electronic health records.
Methods:
This retrospective cohort study analyzed electronic health record data from the National Taiwan University Hospital Integrated Medical Database (NTUH-iMD), which stores patient-level information continuously from NTUH and its affiliated branches serving citizens throughout Taiwan. The study included 68,000 adult T2DM patients (≥20 years) from March 2007 to December 2019. Patients were identified using ICD-10 diagnostic codes for T2DM (E11) and cancer (C33-C34 for lung cancer, C50 for breast cancer). We collected demographic data and biochemical parameters including lipid profiles, inflammatory markers, renal function tests, liver enzymes, and glycemic control indicators. Three machine learning algorithms were implemented: eXtreme Gradient Boosting (XGBoost), Light Gradient Boosting Machine (LightGBM), and Random Forest. Data preprocessing included regression-based imputation for missing values, Min-Max normalization, and k-fold cross-validation. Model performance was evaluated using accuracy, sensitivity, specificity, and area under the receiver operating characteristic curve (AUC-ROC). Binary logistic regression analysis identified significant risk factors with odds ratios and 95% confidence intervals. This study was approved by the Research Ethics Committee of National Taiwan University Hospital (IRB No. 202110098RINA).
Results:
Among 68,000 T2DM patients, 1,714 developed breast cancer and 1,970 developed lung cancer during the study period. Student's t-tests revealed significant differences (p<0.05) in multiple biochemical markers between cancer and non-cancer groups. For breast cancer prediction, body mass index (BMI), globulin (Glo), triglycerides (TG), high-sensitivity C-reactive protein (hsCRP), low-density lipoprotein (LDL), and alkaline phosphatase (ALP) emerged as significant risk factors. Specifically, BMI ≥35 kg/m² showed the highest risk (OR=1.651), followed by Glo >3.5 g/dL (OR=5.131), and TG >150 mg/dL (OR=1.352). For lung cancer prediction, significant factors included BMI, albumin (Alb), globulin (Glo), blood urea nitrogen (BUN), total cholesterol (T-CHO), hsCRP, platelet count (PLT), hemoglobin A1c (HbA1c), and fasting glucose (GLUAC). Notably, hsCRP >1 mg/dL demonstrated the strongest association (OR=2.044), while high platelet count >378×10³/µL showed an OR of 1.323. The machine learning models demonstrated robust predictive performance across both cancer types, with the best-performing model achieving an AUC-ROC of 0.786 in internal validation and 0.764 in external validation for lung cancer prediction.
Conclusions:
This study successfully developed machine learning-based prediction models for breast cancer and lung cancer risk in T2DM patients using routinely available clinical data from electronic health records. The identification of specific biochemical markers as significant predictors provides clinically actionable insights for early cancer detection and prevention strategies in this high-risk population. The models demonstrated good discriminative ability and could be integrated into clinical decision support systems to facilitate timely interventions. Future research should focus on external validation in diverse populations, prospective validation studies, and integration with additional data modalities including genetic and lifestyle factors to further enhance prediction accuracy and clinical utility. Clinical Trial: no
Citation
Request queued. Please wait while the file is being generated. It may take some time.
Copyright
© The authors. All rights reserved. This is a privileged document currently under peer-review/community review (or an accepted/rejected manuscript). Authors have provided JMIR Publications with an exclusive license to publish this preprint on it's website for review and ahead-of-print citation purposes only. While the final peer-reviewed paper may be licensed under a cc-by license on publication, at this stage authors and publisher expressively prohibit redistribution of this draft paper other than for review purposes.