Artificial intelligence/United Kingdom, Brazil, Israel, United States
An ECG spotted future diabetes five years early, with code on GitHub
An AI-ECG model flagged future type 2 diabetes years ahead of diagnosis, validated in UK Biobank and a Brazilian cohort.
An Imperial College-led team trained a model on 1,163,401 ECGs from 189,537 people at a Boston centre and validated it in UK Biobank and the Brazilian ELSA-Brasil cohort. Discrimination for prevalent type 2 diabetes was 0.706 to 0.733, and the top risk quartile reached 5% cumulative incidence 5.4 years earlier than the bottom.
What happened
A team centred on the National Heart and Lung Institute at Imperial College London, with Imperial College Healthcare NHS Trust and the MRC Laboratory of Medical Sciences, published in European Heart Journal – Digital Health a convolutional model that reads a standard ECG and estimates diabetes risk. They call it AIRE-DM.
Training used 1,163,401 ECGs from 189,537 individuals at Beth Israel Deaconess Medical Center in Boston.
External validation used UK Biobank (65,606 people) and ELSA-Brasil (13,739 people), which puts the test data on two further continents.
Discrimination for prevalent type 2 diabetes was 0.724, 0.733 and 0.706 across the three cohorts. The most striking finding was temporal: the highest risk quartile reached 5% cumulative incidence 5.4 years earlier in Boston and 4.8 years earlier in Brazil than the lowest quartile, after adjusting for glycated haemoglobin, age and sex.
The test
The clinical argument rests on cost. A large share of type 2 diabetes is undiagnosed, carrying cardiometabolic risk the whole time, and the screening test is a blood draw that someone has to order. ECGs are recorded in enormous volume for unrelated reasons. A risk flag that rides along on an existing ECG is nearly free.
The validation design is the paper’s strength. Three cohorts, one for training and two independent, spanning a US hospital system, a UK volunteer cohort and a Brazilian population study. Those three populations differ substantially in ancestry, body habitus and diabetes prevalence, which is a genuine test of transportability.
The benchmark chosen was glycated haemoglobin, which is the right comparator because it is what the model would have to add value over.
The numbers
| Measure | Boston (BIDMC) | UK Biobank | ELSA-Brasil |
|---|---|---|---|
| Participants | 189,537 | 65,606 | 13,739 |
| ECGs (training) | 1,163,401 | external | external |
| AUC, prevalent type 2 diabetes | 0.724 | 0.733 | 0.706 |
| Hazard ratio, highest vs lowest risk | 4.75 | 7.52 | 3.96 |
| Years earlier to 5% cumulative incidence | 5.4 | – | 4.8 |
| vs HbA1c in normoglycaemic patients | superior | – | non-inferior |
| Code availability | architecture and survival loss functions on GitHub | ||
The result
Two different claims live in that table and they should be separated.
The discrimination figures, 0.706 to 0.733, are moderate. As a standalone diagnostic they would be unimpressive. They are remarkably consistent across three very different cohorts, which is the more interesting property: a model that holds 0.72 everywhere is more useful than one that scores 0.85 in one place and 0.60 in another.
The temporal claim is the eye-catching one. A separation of 5.4 years to a 5% incidence threshold between top and bottom risk quartiles is a large lead time. But it is a comparison between the extremes of a four-way split, which is the most favourable framing available and says little about an individual whose score lands in the middle.
The hazard ratios, 4.75, 7.52 and 3.96, vary by a factor of nearly two across cohorts, which is a reminder that the risk gradient is not the same everywhere even when the ranking ability is.
How this compares to what came before
Among the AI models in this batch, this one has the largest training set by two orders of magnitude and the most geographically diverse validation.
It also lands in the same performance band as several others that had far less data: the bowel preparation machine learning models reached 0.71 to 0.74, and the pooled neck MRI meta-analysis reached 0.72 sensitivity. A million ECGs did not buy a higher ceiling than 2,652 prospectively collected patients did on a different problem.
That is consistent with the pattern across this batch’s AI cluster. The results cluster not by data volume or method but by whether the thing being predicted is actually encoded in the input. Acute heart failure is visible on a chest CT, and that model reached 0.95. Future diabetes is faintly implied by an ECG, and this model reached 0.72.
What it means
The deployable version of this is a flag, not a test. If a health system already records ECGs at scale, adding a risk score costs compute and nothing else, and a flag that identifies people worth a blood test years early could plausibly shift diagnosis forward.
The thing that would make it real is not better discrimination. It is a pathway: who receives the flag, what they are asked to do, and whether anyone follows up. Prediction models of this kind routinely fail at that step, and nothing in this paper tests it.
The claim worth being careful with is the comparison against glycated haemoglobin. It was superior in one cohort and non-inferior in another, among normoglycaemic patients specifically. That is a real finding and it is not the same as beating the blood test.
Business ideas from this paper
Opportunistic risk scoring over existing ECG archives, sold on cases identified rather than on model performance. The marginal cost is near zero and the asset already exists in every hospital.
Follow-up pathway design and measurement, which is the actual gap. A product that closes the loop from flag to blood test to diagnosis is worth more than a better model.
Cohort-specific recalibration services, given hazard ratios ranging from 3.96 to 7.52 across the three cohorts here.
What could be wrong with it
Discrimination is moderate. Areas under the curve of 0.706 to 0.733 leave substantial overlap between people who will and will not develop diabetes.
The 5.4-year lead time compares the top and bottom quartiles, which is the widest possible contrast and overstates what an individual learns from their score.
All three cohorts are retrospective. No one was screened on the basis of this model.
UK Biobank volunteers are healthier, wealthier and less ethnically diverse than the UK population, and the populations where undiagnosed diabetes is most concentrated are the least well represented in it.
The data are gated: UK Biobank by application, the Boston dataset restricted on ethical grounds, and the Brazilian cohort by request to a steering committee. The model code is public, which is what earns the open-data point here, and it means the architecture can be inspected even though the data cannot be re-analysed.
How sure can you be?
Confident that the model discriminates moderately and consistently across three cohorts on two continents, which is a stronger form of evidence than a single high number.
Confident that there is a real risk gradient, given hazard ratios between 3.96 and 7.52.
Confident that the model code can be inspected, because it is deposited at two public repositories.
Less confident about the practical value of the 5.4-year lead time, which is a between-quartile contrast rather than an individual prediction.
Less confident about the comparison with glycated haemoglobin, which held in one cohort and was only non-inferior in another, in a specific subgroup.
Not confident about any screening benefit, because no prospective pathway was tested.
Our rubric places this at the lower end of the range for this batch: peer-reviewed, many institutions across three countries, retrospective development and external validation, with the model code deposited publicly and the data gated.
Do this today
If you hold a large ECG archive, the cheapest experiment available is to score it and see how many flagged patients already have undiagnosed diabetes on existing records.
If you are evaluating a risk model, ask for discrimination in every validation cohort separately. Consistency across populations is worth more than a single high figure.
If someone quotes the 5.4-year figure, ask what it compares. Top quartile against bottom quartile is a different statement from what any individual patient would learn.
Source: Artificial intelligence-enhanced electrocardiography for the prediction of future type 2 diabetes mellitus: a model-development and multicentre validation study, European Heart Journal - Digital Health, 2026-07-22. PMID 42668860 · doi.org ().
Just Out Tech explains new research in plain language. This article was drafted with AI assistance and checked by a human against the original source.
- Trained on 1,163,401 ECGs from 189,537 individuals at Beth Israel Deaconess Medical Center.
- Externally validated in UK Biobank (n = 65,606) and ELSA-Brasil (n = 13,739).
- Area under the curve for prevalent type 2 diabetes: 0.724 Boston, 0.733 UK Biobank, 0.706 Brazil.
- Top risk quartile reached 5% cumulative incidence 5.4 years earlier (Boston) and 4.8 years earlier (Brazil) than the bottom quartile.
Retrospective development and external validation across three cohorts on two continents, benchmarked against a blood test; no prospective screening deployment.
Questions people ask
Why would an ECG know about diabetes?
Diabetes affects the heart long before it is diagnosed, through autonomic changes and early structural remodelling. The claim is that these leave traces in the waveform that a model can detect.
Is 0.72 good enough for screening?
It is moderate. As a standalone test it would be weak. As a free flag on an ECG already being recorded, a moderate signal can still be worth acting on.
Did it beat the blood test?
In normoglycaemic patients it was superior to glycated haemoglobin for predicting incident diabetes in the Boston cohort and non-inferior in Brazil. That is a narrower claim than beating HbA1c generally.
Can the model be checked?
The data are gated behind applications, but the code for the architecture and the survival loss functions is on GitHub, which is what earns this paper its open-data credit.