P170 Automated measurement of colonoscopy withdrawal time using convolutional neural networks. (19th June 2022) - Kader, Rawen; Carvalho, Thomas de; Oh, Ga Young; Brandao, Patrick; Toth, Daniel; Vega, Roser; Seward, Edward; Mountney, Peter; Stoyanov, Danail; Lovat, Laurence B
Abstract : Introduction: Withdrawal time (WT) is the time from reaching the caecum to exiting the anal canal minus time spent during phases of cleaning and intervention. Deducting these phases from the WT is not feasible in clinical practice as it requires manual measurement in real-time. This results in inaccuracies in the current measurement of endoscopists WT. Recent years has demonstrated the ability of artificial intelligence (AI) to detect caecal landmarks, however, its potential to detect phases of withdrawal is unexplored. Our aim was to develop convolutional neural networks (CNN) to detect phases of cleaning and intervention during colonoscopy withdrawal. Methodology: Lower gastrointestinal endoscopy videos were prospectively collected at a single centre. Individual frames after the appendicular orifice or ileocaecal valve were first detected were annotated. The first frame an instrument was visualised during polypectomy up until the end of inspecting post-resection margins and biopsies was labelled as 'intervention'. Frames during suctioning of colonic content or washing were labelled as 'cleaning'. The remaining frames contributed to the procedural WT ('withdrawal' frames). The annotations were referenced as the gold standard. Two ResNet-101 CNNs pre-trained on ImageNet were developed to detect the phases of cleaning and intervention. Results: 87 endoscopy videos and 1, 288, 319 frames during withdrawal were annotated. This consisted of 437, 359 withdrawal, 232, 384 cleaning and 618, 576 interventional frames. The procedures were split into training (70%), validation (10%) and testing ( 20%) with no overlap of patients. Evaluated against a test-set of 17 videos, which totalled 306 minutes of withdrawal (including cleaning and interventional phases), the CNNs identified the interventional frames with 92.4% sensitivity and 95.8% specificity. For cleaning, the sensitivity was 83.0% and specificity 89.5%. Across the 17 videos, the ground truth mean WT was 8 minutes and 51 seconds. The absolute mean error of the AI predicted WT was 39 seconds per procedure. The AI system correctly categorised a procedure as less than or more than 6 minutes in 16 of the 17 procedures (94%). One procedure of more than 6 minutes was incorrectly categorised as under 6 minutes. Conclusions: This pilot study demonstrated the feasibility of CNNs to differentiate the phases of withdrawal and to automate the measurement of WT.