Artificial intelligence-assisted biliary stent length selection for common bile duct strictures in endoscopic retrograde cholangiopancreatography: Model development and validation

Hepatobiliary Pancreat Dis Int. 2026 Feb;25(1):76-82. doi: 10.1016/j.hbpd.2025.11.004. Epub 2025 Nov 12.

Abstract

Background: Biliary stent placement during endoscopic retrograde cholangiopancreatography (ERCP) is important for drainage in common bile duct (CBD) strictures, while the stent length is associated with many stent-related complications. We aimed to develop an artificial intelligence (AI) model for stent length selection during ERCP.

Methods: Images of the patients who underwent ERCP and were diagnosed with CBD strictures were collected. Training involved identifying and delineating the duodenoscope, CBD and guidewire, calculating the pixel distance of the target guidewire and determining the required biliary stent length based on the diameter of the duodenoscope. The performance of the model, accuracy for length calculation and the assistance for endoscopists were validated using the testing set.

Results: A total of 794 images from 431 patients were included and data augmentation was conducted. The mean intersection over union (mIoU) for duodenoscope, CBD and guidewire were 90.46%, 84.79% and 84.64%, respectively. The accuracy in identifying the strictures was 97.58% (121/124). The accuracy for stent length calculation achieved 85.95% (104/121) with an error margin of ± 1 cm. The mean absolute error (MAE) and mean relative error (MRE) of the AI model was 0.81 cm and 0.13, respectively. The AI model could reduce approximately 202 mGycm2 of the radiation exposure for each patient. It significantly improved both MAE and MRE for less experienced endoscopists (P = 0.01 and P = 0.02, respectively).

Conclusions: The AI model could accurately identify duodenoscope, CBD and guidewire, enabling accurate strictures identification and stent length selection.

Keywords: Artificial intelligence; Common bile duct stricture; Endoscopic retrograde cholangiopancreatography; Stent placement.

Publication types

  • Validation Study

MeSH terms

  • Aged
  • Aged, 80 and over
  • Artificial Intelligence*
  • Cholangiopancreatography, Endoscopic Retrograde* / adverse effects
  • Cholangiopancreatography, Endoscopic Retrograde* / instrumentation
  • Cholestasis* / diagnostic imaging
  • Cholestasis* / surgery
  • Cholestasis* / therapy
  • Common Bile Duct* / diagnostic imaging
  • Common Bile Duct* / surgery
  • Constriction, Pathologic
  • Duodenoscopes
  • Female
  • Humans
  • Male
  • Middle Aged
  • Predictive Value of Tests
  • Reproducibility of Results
  • Retrospective Studies
  • Stents*