Pancreatic cancer is almost always detected too late because it causes few symptoms until advanced stages. By the time of diagnosis, the cancer has often spread and survival chances are poor. The need for early detection tools is urgent.
Most patients who develop pancreatic cancer have a history of other health conditions — including diabetes, pancreatitis, and digestive problems — in the years before diagnosis. These patterns of illness create a 'disease trajectory' that might signal elevated risk.
A team from Denmark and the US asked: can an AI system learn to recognize these trajectories from millions of patients' medical records and identify who is likely to develop pancreatic cancer up to three years in advance?
The researchers applied AI to clinical data from the Danish National Patient Registry (8.1 million patients, 1977-2018) and the US Veterans Affairs healthcare system (3 million patients, 1999-2020), providing data on over 24,000 pancreatic cancer cases.
Each patient's complete sequence of diagnosis codes over their lifetime was treated as a time-ordered 'disease trajectory'. Several AI architectures were tested including multi-layer perceptrons, recurrent neural networks (GRUs), and Transformer models.
Models were trained to predict cancer occurrence within 12 or 36 months, with performance measured by AUROC and relative risk (RR) at various screening thresholds.
For 3-year cancer prediction, the Transformer model achieved an AUROC of 0.879 on the Danish test set. Patients in the highest-risk category had a 104-times higher likelihood of developing pancreatic cancer than the average patient.
Time-sequential models (Transformer and GRU) substantially outperformed a simple multi-layer perceptron (AUROC 0.843-0.847). The timing and sequence of diagnoses matters as much as which diagnoses occurred.
When the Danish-trained model was applied cross-nationally to US-VA data without adaptation, performance dropped (AUROC 0.710) but remained meaningful. After retraining on US data, performance recovered.
The AI learned that certain diagnoses appearing years before cancer are strong early warning signals: type 2 diabetes, acute pancreatitis, unspecified pancreatic disease, and obesity — consistent with known biological risk factors.
Diagnoses appearing 0-6 months before cancer detection — unspecified jaundice, diseases of the biliary tract, weight loss, abdominal pain — were the strongest immediate predictors, likely reflecting early cancer symptoms.
The model revealed a temporal pattern: long-range risk factors (diabetes, pancreatitis) dominate predictions years out, while symptom-like signals dominate months before diagnosis — an insight important for screening program design.
The authors modeled how this AI could work in a real surveillance program. If the top 1% of highest-risk patients over age 50 were selected for pancreatic cancer screening with MRI or EUS, the model would capture a substantial fraction of cases while keeping the screened population manageable.
In Denmark this would translate to roughly 400,000 people — a large but potentially feasible surveillance cohort given the 104-fold enrichment of cancer risk in this group.
The study demonstrates that routinely collected health records, available in many countries' national health systems, contain enough signal to power meaningful cancer risk prediction without requiring additional biomarker tests or imaging.
This study represents one of the largest and most rigorous AI-based cancer risk prediction studies to date. Its use of national health registry data from two countries gives results unusual generalizability.
The key advance is showing that sequential, time-aware AI models extract far more predictive value from medical records than models that simply look at which diagnoses a patient has without considering when or in what order they occurred.
The authors call for prospective implementation studies to test whether this AI-guided surveillance approach actually reduces pancreatic cancer mortality — the ultimate clinical test of the model's value.