XGBoost Prediction Model Using Electronic Health Records for Early Detection of Pancreatic Cancer

JCO Clin Cancer Inform 2021 AI 5 Explanations View Original
Original Paper (PDF)

Unable to display PDF. Download it here or view on PMC.

Plain-English Explanations
Pages 1-2
The Problem of Late Diagnosis and the Promise of EHR Signals

Pancreatic ductal adenocarcinoma (PDAC) diagnosed at late stages when metastasis has occurred is associated with median survival measured in months. By contrast, patients diagnosed at Stage I or II before the cancer has spread beyond the pancreas have five-year survival rates exceeding 20%, making early detection one of the highest-impact opportunities in pancreatic cancer care.

Months to years before a formal pancreatic cancer diagnosis, patients often accumulate subtle clinical signals in their health records: new-onset diabetes, unexplained weight loss, elevated bilirubin, or visits for vague abdominal complaints. These signals appear in Electronic Health Records (EHR) but are individually non-specific and are rarely interpreted as cancer warning signs in routine care.

Machine learning models trained to recognize patterns of these pre-diagnostic signals across thousands of patients have the potential to identify high-risk individuals who warrant expedited imaging evaluation. This study built and validated such a model using a large real-world EHR database to predict early-stage pancreatic cancer detection.

TL;DR: Subtle pre-diagnostic clinical signals in EHR data can be detected by machine learning months to years before PDAC diagnosis, enabling earlier intervention.
Pages 2-3
Optum EHR Dataset and Patient Cohort Definition

The study used the Optum de-identified EHR database, a large US claims and clinical dataset containing records from millions of patients across a diverse range of healthcare providers. This large-scale real-world dataset provides the statistical power needed to build reliable models for a relatively rare cancer.

The analytic cohort included 3,322 early-stage pancreatic cancer (ESPC) cases and 25,908 late-stage pancreatic cancer (LSPC) cases, reflecting the clinical reality that most patients present with advanced disease. The large case volume allowed for more robust model training compared to single-institution studies.

Cases were defined using a look-back window of clinical records prior to the cancer diagnosis date, excluding the period immediately before diagnosis when symptoms would be obvious. This ensures the model learns to identify early warning signals rather than obvious diagnostic criteria that would already prompt clinical workup.

TL;DR: The study used the Optum EHR database with over 29,000 pancreatic cancer cases to train a model predicting early-stage disease from pre-diagnostic clinical records.
Pages 3-4
Feature Engineering and XGBoost Model Development

Feature engineering extracted 18,220 candidate features from the EHR, including binary indicators for all diagnosis codes, medication records, procedure codes, and laboratory test categories recorded in the look-back period. This extremely wide feature space captures the full range of clinical encounters that might precede a cancer diagnosis.

The initial feature set was reduced to 582 predictive features using regularization and feature importance selection, eliminating redundant and non-informative variables. The final feature set included diagnosis codes for pancreatic disorders, biliary disease, new-onset diabetes, and demographic features such as age.

XGBoost (Extreme Gradient Boosting) was selected as the primary modeling algorithm. XGBoost builds an ensemble of decision trees sequentially, with each new tree correcting the errors of the previous ensemble. It handles sparse binary feature vectors efficiently and is highly effective for structured EHR data, consistently achieving state-of-the-art performance on clinical prediction tasks.

The model was trained to classify patients as early-stage versus late-stage pancreatic cancer, rather than cancer versus no cancer. This framing leverages the large late-stage case population for training and defines a clinically actionable prediction target: identifying which patients presenting with pancreatic cancer risk factors are most likely to have resectable disease.

TL;DR: XGBoost was trained on 582 features selected from over 18,000 EHR-derived candidates to distinguish early-stage from late-stage pancreatic cancer diagnoses.
Pages 5-6
Model Performance and Key Predictive Features

The final XGBoost model achieved an Area Under the Curve (AUC) of 0.84 for distinguishing early-stage from late-stage pancreatic cancer, indicating strong discriminative ability. At an operating point of 60% sensitivity, the model achieved 90% specificity, meaning that approximately 90% of non-early-stage patients would correctly not be flagged.

At 60% sensitivity and 90% specificity, the model would detect 58% of late-stage patients a median of 24 months before their actual diagnosis date. This two-year early detection window represents a clinically meaningful opportunity to intervene when surgical resection rates are higher.

The most important predictive features identified by XGBoost included prior diagnosis codes for pancreatic disorders, biliary tract disease, and new-onset diabetes. Age was also a strong predictor, consistent with the epidemiology of PDAC as primarily a disease of patients over 65 years old.

TL;DR: The model achieved AUC 0.84 and could detect 58% of late-stage patients a median of 24 months before their actual diagnosis, with pancreatic disorders and biliary disease as top predictors.
Pages 7-9
Clinical Implications and Deployment Considerations

A deployed version of this model could be integrated into primary care EHR systems to automatically flag patients whose longitudinal clinical records match the pre-diagnostic signature of pancreatic cancer. These patients could then be prioritized for cross-sectional abdominal imaging to evaluate for early pancreatic lesions.

One critical consideration is the positive predictive value (PPV) at population scale. Even at 90% specificity, applying this model to millions of patients would generate a substantial number of false positive alerts requiring follow-up imaging. Careful calibration of the alert threshold to target high-risk subgroups (older patients, those with new-onset diabetes) would be needed to make the program cost-effective.

The study demonstrates the potential of large-scale EHR-based machine learning for proactive cancer detection. Future work could combine this EHR-derived risk score with serum biomarkers such as CA 19-9 and emerging liquid biopsy markers to create a multi-modal early detection system with even higher specificity than either approach alone.

TL;DR: Integration into primary care EHR systems could enable proactive flagging of high-risk patients for early pancreatic imaging, though PPV calibration will be essential for cost-effective deployment.
Citation: Open Access, 2021. Available at: PMC8462624.