Using artificial intelligence to predict choledocholithiasis: can machine learning models abate the use of MRCP in patients with biliary dysfunction?

ANZ J Surg. 2024 Mar 25. doi: 10.1111/ans.18950. Online ahead of print.

Abstract

Background: Prompt diagnosis of choledocholithiasis is crucial for reducing disease severity, preventing complications and minimizing length of stay. Magnetic resonance cholangiopancreatography (MRCP) is commonly used to evaluate patients with suspected choledocholithiasis but is expensive and may delay definitive intervention. To optimize patient care and resource utilization, we have developed five machine learning models that predict a patients' risk of choledocholithiasis based on clinical presentation and pre-MRCP investigation results.

Methods: Inpatients admitted to the Royal Hobart Hospital from 2018 to 2023 with a suspicion of choledocholithiasis were included. Exclusion criteria included prior hepatobiliary surgery, known hepatobiliary disease, or incomplete records. Variables related to clinical presentation, laboratory testing, and sonographic or CT imaging were collected. Four machine learning techniques were employed: logistic regression, XGBoost, random forest, and K-nearest neighbours. The three best performing models were combined to create an ensemble model. Model performance was compared against the American Society for Gastrointestinal Endoscopy (ASGE) choledocholithiasis risk stratification guidelines.

Results: Of the 222 patients included, 113 (50.9%) had choledocholithiasis. The most successful models were the random forest (accuracy: 0.79, AUROC: 0.83) and ensemble (accuracy and AUROC: 0.81). Every model outperformed the ASGE guidelines. Key variables influencing the models' predictions included common bile duct diameter, lipase, imaging evidence of cholelithiasis, and liver function tests.

Conclusion: Machine learning models can accurately assess a patient's risk of choledocholithiasis and could assist in identifying patients who could forgo an MRCP and proceed directly to intervention. Ongoing validation on prospective data is necessary to refine their accuracy and clinical utility.

Keywords: artificial intelligence; biliary tract diseases; general surgery; machine learning; prediction.