Oncoformer was trained on millions of health records and chest X-rays to detect signals across cancer risk, stage, treatment response, and recurrence.

Research: Advances in cancer detection and treatment using longitudinal, routine clinical data. Image credit: Lightspring / Shutterstock
In a recent study published in the journal cellresearchers developed Oncoformer, an artificial intelligence (AI)-based transformer model to accelerate cancer detection and management using longitudinal electronic health records (EHRs) and chest X-rays.
Developed using data from 2.81 million individuals with 11.9 million clinical visits and evaluated in independent cohorts, this framework can classify pre-existing cancers, distinguish between individuals who receive a cancer diagnosis up to one year later, predict the tumor stage assigned at diagnosis, predict the observed response to treatment, and stratify risk of recurrence-free survival (RFS) for 10 cancer types. If validated in large prospective randomized controlled trials in diverse populations, this model could support risk-adapted cancer monitoring and improve personalized cancer treatment.
Many cancers are diagnosed only after they are advanced, missing the window when treatment is most effective. As the disease progresses and spreads to other organs, the prognosis worsens and survival rates decrease. Treatment selection is also often based on experience, with limited individualized risk assessment and monitoring. Organ-specific imaging tests are expensive, can involve radiation exposure, and cannot provide an overall cancer risk assessment. On the other hand, blood tests for emerging multiple cancers remain expensive and have variable sensitivity for early-stage disease. Existing AI frameworks often address a single clinical task or rely on specialized data that is not routinely available. New methods are needed to provide a more comprehensive assessment of total care using readily accessible data.
About research
In this study, researchers introduced Oncoformer, a multimodal AI framework for cancer detection that uses routinely available longitudinal EHR data, including vital signs and laboratory values, and opportunistically collected chest radiographs.
The team developed the model using COMPASS-Main. The model included 2,810,742 individuals and 11,934,576 clinical visitors. Across COMPASS-Main and COMPASS-Replication, the curated dataset includes approximately 3.67 million individuals and 17.75 million healthcare workers, including 347,940 cancer patients across clinical stages I-IV and more than 3.32 million non-cancer control patients.
Non-cancer controls included people with comorbidities and known cancer risk factors. The researchers validated their findings using the COMPASS-Replication cohort (862,247 participants) and conducted a between-group analysis using data from the UK Biobank (UKB), a resource that includes 502,665 participants. From this resource, they identified 44,275 participants with cancer and constructed a matched case-control cohort.
Oncoformer learns a holistic picture of an individual’s health by reconstructing masked clinical information while reducing the impact of missing data and differences between cohorts. This model captures potential signals related to cancer evolution by analyzing longitudinal clinical data. Using this learned patient profile, Oncoformer classifies current cancer status, predicts future cancer diagnoses up to one year in advance, infers the stage assigned at diagnosis from prediagnostic data, predicts post-treatment tumor or biomarker trajectory across six cancer treatment settings, and stratifies patients by RFS across 10 cancer types. For the 1-year prediction task, the model excluded all clinical data recorded in the 90 days immediately preceding diagnosis.
To determine Oncoformer’s performance, researchers calculated the area under the receiver operating characteristic curve (AUROC) for cancer diagnosis, future prediction, and stage estimation. AUROC measures how well the model discriminates between groups, with values closer to 1 indicating better discrimination. They assessed the trajectory of treatment response using R² values, which measure how well predictions match observed outcomes, and RFS, defined as time to recurrence or death from any cause, using hazard ratios, Kaplan-Meier analysis, and Harrell’s concordance index. We then compared the model’s performance to baseline models suitable for the task, such as XGBoost and DINO v2. They also used Cox regression and UMAP, a technique that visualizes how similar patient profiles are grouped together. Additionally, we performed pathway analysis using genomic profiling data and validated model predictions using postoperative pathological findings.
result
The model showed strong discrimination for cancer diagnosis, prediction up to one year before diagnosis, and stage inference. The average AUROC values for pan-cancer diagnosis, cancer onset prediction up to 1 year before clinical diagnosis, and tumor stage estimation were 0.956, 0.869, and 0.90 or higher, respectively. The model also predicted treatment response trajectories with R2 values ranging from 0.573 to 0.721 and significantly stratified patients into groups with different RFS risks across 10 cancer types.
Predicted tumor stage scores were correlated with mutation burden in established genomic pathways associated with cancer progression. Albumin levels and neutrophil percentage are most important for pan-cancer diagnosis, while alkaline phosphatase (ALP) and lactate dehydrogenase (LDH) are most influential in tumor staging. Consistent with established cancer biology, various biomarkers also contributed to predicting treatment response. This model identified mean platelet volume (MPV) and indirect bilirubin as important factors associated with response to epidermal growth factor receptor (EGFR) inhibitors.
Oncoformer placed biologically related cancers close to each other in a computational patient map. Breast, ovarian, and cervical cancers were concentrated in nearby areas of the map, and Cox regression analysis confirmed that clusters of cancers of the female reproductive system were associated with higher risk of future breast and ovarian cancer. These findings suggest that the model captured biologically relevant patterns associated with future cancer risk.
Oncoformer also outperformed XGBoost and DINO v2 in estimating cancer risk. In a prospective colorectal cancer screening study of 3,025 asymptomatic high-risk individuals selected from 38,059 consenting health screening participants, the model identified 54 of 60 cancer cases with a sensitivity of 90%, specificity of 86.8%, and AUROC of 0.927, supporting further evaluation of its clinical relevance. On the UKB dataset, the researchers evaluated both a direct application without additional UKB training and an adapted version using UKB training partitions. The adapted version consistently improved the baseline model’s predictions across cancer types, particularly for lung and pancreatic cancers. Oncoformer also achieved the highest Harrell concordance (C-index) value, which measures how well predicted risk rankings match patient outcomes across all cancer types, compared to Cox proportional hazards, random survival forest, and DeepHit survival models.
Research limitations
However, most analyzes were retrospective, predictions of treatment response were derived from observational data, and unmeasured differences influencing treatment assignment could not be excluded. The COMPASS population was over 99% Asian, whereas UKB participants were predominantly white European, subject to volunteer selection bias. Therefore, performance in unselected average-risk screening populations remains unclear, and missing data and differences in laboratory practice may impact outcomes in other health systems.
conclusion
This finding highlights the development of transformer models that can assess cancer progression by integrating EHR, laboratory tests, and chest X-rays. Taken together, these results suggest that routinely collected clinical data may contain signals relevant to multiple stages of cancer detection, treatment, and tracking. Looking forward, large prospective trials across multiple cancer types and diverse clinical settings will be required before clinical deployment. Radiogenomic analysis and experimental biological validation may help elucidate the molecular mechanisms associated with potential predictive signals. Such efforts have the potential to accelerate the clinical application of these models, which may ultimately improve risk stratification, facilitate early diagnosis, and guide treatment decisions.
AI model trained from routine electronic health record data of 3.7 million people predicts cancer one year before clinical onset, with similar improvements in detection, staging, treatment response, and prognosis accuracy https://t.co/ORrpJ2vIcR pic.twitter.com/ymJWRAYOSw
— Eric Topol (@EricTopol) July 27, 2026

