Opportunistic screening of type 2 diabetes with deep metric learning using electronic health records
Deep learning models leveraging electronic health records (EHR) for opportunistic screening of type 2 diabetes (T2D) can improve current practices by identifying individuals who may need further glycemic testing. Accurate onset prediction and subtyping are crucial for targeted interventions, but existing methods treat the tasks separately, thus limiting clinical utility. In this paper, we introduce a novel deep metric learning (DML) model that unifies both tasks by learning a latent space based on sample similarity. In onset prediction, the DML model predicts the onset of T2D 7 years later with an AUC of 0.754, outperforming logistic regression (AUC 0.706), clinical risk factors (AUC 0.693), and glycemic measures (AUC 0.632). For subtyping, we identify three subtypes with varying prevalences of obesity-related, cardiovascular, and mental health conditions. Additionally, the subtype with fewer comorbidities shows earlier metformin initiation and a greater reduction in HbA1c. We validated these findings using data from 300 U.S. hospitals in the All of Us program (T2D, n = 7567) and the Massachusetts General Brigham Biobank (T2D, n = 3298), demonstrating the transferability of our model and subtypes across cohorts.
Authors
- Aaron J. Deutsch (ORCID: https://orcid.org/0000-0001-6750-5335)
- Alisa K. Manning (ORCID: https://orcid.org/0000-0003-0247-902X)
- Sarah Hsu (ORCID: https://orcid.org/0000-0001-9823-9711)
- Łukasz Szczerbiński (ORCID: https://orcid.org/0000-0002-6201-0605)
- Miriam S. Udler (ORCID: https://orcid.org/0000-0003-3824-9162)
- Walter Gerych (ORCID: https://orcid.org/0000-0002-1194-1493)
- Xuhai Xu (ORCID: https://orcid.org/0000-0001-5930-3899)
- Marzyeh Ghassemi (ORCID: https://orcid.org/0000-0001-6349-7251)
- Jiacheng Zhu (ORCID: https://orcid.org/0000-0001-6990-5228)
- Thomas Hartvigsen (ORCID: https://orcid.org/0000-0002-5288-2792)
- Qixuan Jin (ORCID: https://orcid.org/0009-0008-2861-5927)
- Josep Mercader (ORCID: https://orcid.org/0000-0002-5293-2809)
- Ravi Mandla (ORCID: https://orcid.org/0000-0002-0782-0138)
- Haoran Zhang (ORCID: https://orcid.org/0000-0003-1027-9976)
- Kai Wang (ORCID: https://orcid.org/0000-0003-4124-2025)
Institutions
- Worcester Polytechnic Institute (US)
- Broad Institute (US)
- Georgia Institute of Technology (US)
- Harvard University (US)
- Medical University of Białystok (PL)
- University of California, San Francisco (US)
- Massachusetts General Hospital (US)
- Center for Genomic Science (IT)
- University of Virginia (US)
- Massachusetts Institute of Technology (US)
- University of San Francisco (US)
- Columbia University (US)
Publication Details
- Journal
- Scientific Reports
- Published
- 2025-11-25
- DOI
- https://doi.org/10.1038/s41598-025-25759-x
- Primary Topic
- Machine Learning in Healthcare
- Type
- article
- Field-Weighted Citation Impact
- 0.00
Funders
- National Science Foundation
- Gordon and Betty Moore Foundation
- National Institutes of Health