AI-Assisted Evaluation of Colon Cleanliness in Capsule Endoscopy Videos
Abstract
1. Introduction
2. Methods
2.1. Methodology
- Image segmentation. We train a TransUNet neural network to segment images using patch labels instead of fully annotated segmentation masks. For this, we implemented a custom loss function, which we call “Patch Loss”.
- Feature extractor. Using the predicted segmentation mask for intestinal content in each image, we extract features to assess the cleanliness level of the video.
- Segment classification. Using the features extracted for each video, we predict the CC-Clear Score by training a Random Forest classifier. The scores provided by three expert physicians serve as the ground truth for training.
2.2. Image Segmentation
2.3. Feature Extractor
2.4. Segment Classification
- Individual Model Training: We trained separate models to replicate the scoring patterns of each physician.
- Consensus Model Training: We trained a single model using the consensus score derived from the three physicians as the ground truth. This consensus score was calculated by averaging the individual scores given by the physicians and rounding the result to the nearest integer.
2.5. Dataset
2.6. Data Splits
- We used 113 videos to train, validate, and test the image segmentation model. From these videos, a total of 8492 patches, each of size 64 × 64 pixels, were randomly extracted. The dataset of 113 patients was divided into three groups, 69 patients for training (5306 patches), 22 patients for validation (1539 patches), and 22 patients for testing (1647 patches), to evaluate the model’s performance.
- The remaining 52 videos were used to train and evaluate the performance of the segment classifier using a leave-one-out strategy.
2.7. Training Configuration
3. Results
3.1. Segmentation Results
3.2. Patch Classification Results
3.3. Segment Classification
3.3.1. Individual Model Training
3.3.2. Consensus Model Training
4. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Ismail, M.S.; Murphy, G.; Semenov, S.; McNamara, D. Comparing Colon Capsule Endoscopy to colonoscopy; a symptomatic patient’s perspective. BMC Gastroenterol. 2022, 22, 31. [Google Scholar] [CrossRef] [PubMed]
- Vuik, F.E.; Nieuwenburg, S.A.; Moen, S.; Spada, C.; Senore, C.; Hassan, C.; Pennazio, M.; Rondonotti, E.; Pecere, S.; Kuipers, E.J.; et al. Colon capsule endoscopy in colorectal cancer screening: A systematic review. Endoscopy 2021, 53, 815–824. [Google Scholar] [CrossRef]
- Song, H.J.; Moon, J.S.; Do, J.H.; Cha, I.H.; Yang, C.H.; Choi, M.G.; Jeen, Y.T.; Kim, H.J. Guidelines for bowel preparation before video capsule endoscopy. Clin. Endosc. 2013, 46, 147–154. [Google Scholar] [CrossRef]
- Xavier, S.; Rosa, B.; Monteiro, S.; Arieira, C.; Magalhães, R.; Gonçalves, T.C.; Carvalho, P.B.; Magalhaes, J.; Moreira, M.; Cotter, J. Bowel preparation for small bowel capsule endoscopy–The later, the better! Dig. Liver Dis. 2019, 51, 1388–1391. [Google Scholar] [CrossRef]
- Koornstra, J.J. Bowel preparation before small bowel capsule endoscopy: What is the optimal approach? Eur. J. Gastroenterol. Hepatol. 2009, 21, 1107–1109. [Google Scholar] [CrossRef]
- Bjoersum-Meyer, T.; Skonieczna-Zydecka, K.; Valdivia, P.C.; Stenfors, I.; Lyutakov, I.; Rondonotti, E.; Pennazio, M.; Marlicz, W.; Baatrup, G.; Koulaouzidis, A.; et al. Efficacy of bowel preparation regimens for colon capsule endoscopy: A systematic review and meta-analysis. Endosc. Int. Open 2021, 9, E1658–E1673. [Google Scholar] [CrossRef]
- Messmann, H.; Bisschops, R.; Antonelli, G.; Libânio, D.; Sinonquel, P.; Abdelrahim, M.; Ahmad, O.F.; Areia, M.; Bergman, J.J.; Bhandari, P.; et al. Expected value of artificial intelligence in gastrointestinal endoscopy: European Society of Gastrointestinal Endoscopy (ESGE) Position Statement. Endoscopy 2022, 54, 1211–1231. [Google Scholar] [CrossRef]
- Laiz, P.; Vitrià, J.; Gilabert, P.; Wenzek, H.; Malagelada, C.; Watson, A.J.; Seguí, S. Anatomical landmarks localization for capsule endoscopy studies. Comput. Med. Imaging Graph. 2023, 108, 102243. [Google Scholar] [CrossRef]
- Leighton, J.A.; Helper, D.J.; Gralnek, I.M.; Dotan, I.; Fernandez-Urien, I.; Lahat, A.; Malik, P.; Mullin, G.E.; Rosa, B. Comparing diagnostic yield of a novel pan-enteric video capsule endoscope with ileocolonoscopy in patients with active Crohn’s disease: A feasibility study. Gastrointest. Endosc. 2017, 85, 196–205.e1. [Google Scholar] [CrossRef]
- Lewis, B.S.; Swain, P. Capsule endoscopy in the evaluation of patients with suspected small intestinal bleeding: Results of a pilot study. Gastrointest. Endosc. 2002, 56, 349–353. [Google Scholar] [CrossRef] [PubMed]
- Gilabert, P.; Vitrià, J.; Laiz, P.; Malagelada, C.; Watson, A.; Wenzek, H.; Segui, S. Artificial intelligence to improve polyp detection and screening time in colon capsule endoscopy. Front. Med. 2022, 9, 1000726. [Google Scholar] [CrossRef]
- Kaalby, L.; Deding, U.; Kobaek-Larsen, M.; Havshoi, A.L.V.; Zimmermann-Nielsen, E.; Thygesen, M.K.; Kroeijer, R.; Bjørsum-Meyer, T.; Baatrup, G. Colon capsule endoscopy in colorectal cancer screening: A randomised controlled trial. BMJ Open Gastroenterol. 2020, 7, e000411. [Google Scholar] [CrossRef]
- Koulaouzidis, A.; Dabos, K.; Philipper, M.; Toth, E.; Keuchel, M. How should we do colon capsule endoscopy reading: A practical guide. Ther. Adv. Gastrointest. Endosc. 2021, 14, 26317745211001983. [Google Scholar] [CrossRef]
- Cortegoso Valdivia, P.; Deding, U.; Bjørsum-Meyer, T.; Baatrup, G.; Fernández-Urién, I.; Dray, X.; Boal-Carvalho, P.; Ellul, P.; Toth, E.; Rondonotti, E.; et al. Inter/Intra-Observer Agreement in Video-Capsule Endoscopy: Are We Getting It All Wrong? A Systematic Review and Meta-Analysis. Diagnostics 2022, 12, 2400. [Google Scholar] [CrossRef]
- Lee, J.Y.; Calderwood, A.H.; Karnes, W.; Requa, J.; Jacobson, B.C.; Wallace, M.B. Artificial intelligence for the assessment of bowel preparation. Gastrointest. Endosc. 2022, 95, 512–518.e1. [Google Scholar] [CrossRef]
- Leenhardt, R.; Souchaud, M.; Houist, G.; Mouel, J.P.L.; Saurin, J.C.; Cholet, F.; Rahmi, G.; Leandri, C.; Histace, A.; Dray, X. A neural network-based algorithm for assessing the cleanliness of small bowel during capsule endoscopy. Endoscopy 2021, 53, 932–936. [Google Scholar] [CrossRef] [PubMed]
- Becq, A.; Histace, A.; Camus, M.; Nion-Larmurier, I.; Ali, E.A.; Pietri, O.; Romain, O.; Chaput, U.; Li, C.; Marteau, P.; et al. Development of a computed cleansing score to assess quality of bowel preparation in colon capsule endoscopy. Endosc. Int. Open 2018, 6, E844–E850. [Google Scholar] [CrossRef]
- Alageeli, M.; Yan, B.; Alshankiti, S.; Al-Zahrani, M.; Bahreini, Z.; Dang, T.T.; Friedland, J.; Gilani, S.; Homenauth, R.; Houle, J.; et al. KODA score: An updated and validated bowel preparation scale for patients undergoing small bowel capsule endoscopy. Endosc. Int. Open 2020, 8, E1011–E1017. [Google Scholar] [CrossRef]
- de Sousa Magalhães, R.; Arieira, C.; Carvalho, P.B.; Rosa, B.; Moreira, M.J.; Cotter, J. Colon Capsule CLEansing Assessment and Report (CC-CLEAR): A new approach for evaluation of the quality of bowel preparation in capsule colonoscopy. Gastrointest. Endosc. 2021, 93, 212–223. [Google Scholar] [CrossRef]
- Silva, V.M.; Capela, T.L.; Freitas, M.; Magalhães, R.S.; Arieira, C.; Xavier, S.; Carvalho, P.B.; Rosa, B.; Moreira, M.J.; Cotter, J. Small Bowel CLEansing Assessment and Report (SB-CLEAR): Standardizing bowel preparation report in capsule endoscopy. J. Gastroenterol. Hepatol. 2022, 38, 747–751. [Google Scholar] [CrossRef]
- Tabone, T.; Koulaouzidis, A.; Ellul, P. Scoring Systems for Clinical Colon Capsule Endoscopy—All You Need to Know. J. Clin. Med. 2021, 10, 2372. [Google Scholar] [CrossRef]
- Chen, J.; Lu, Y.; Yu, Q.; Luo, X.; Adeli, E.; Wang, Y.; Lu, L.; Yuille, A.L.; Zhou, Y. TransUNet: Transformers Make Strong Encoders for Medical Image Segmentation. arXiv 2021, arXiv:2102.04306. [Google Scholar] [CrossRef]
- Shamshad, F.; Khan, S.; Zamir, S.W.; Khan, M.H.; Hayat, M.; Khan, F.S.; Fu, H. Transformers in medical imaging: A survey. Med. Image Anal. 2023, 88, 102802. [Google Scholar] [CrossRef]
- Tay, Y.; Dehghani, M.; Bahri, D.; Metzler, D. Efficient Transformers: A Survey. ACM Comput. Surv. 2022, 55, 1–28. [Google Scholar] [CrossRef]
- Dosovitskiy, A.; Beyer, L.; Kolesnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar] [CrossRef]
- Xiao, H.; Li, L.; Liu, Q.; Zhu, X.; Zhang, Q. Transformers in medical image segmentation: A review. Biomed. Signal Process. Control 2023, 84, 104791. [Google Scholar] [CrossRef]
- Buijs, M.M.; Ramezani, M.H.; Herp, J.; Kroijer, R.; Kobaek-Larsen, M.; Baatrup, G.; Nadimi, E.S. Assessment of bowel cleansing quality in colon capsule endoscopy using machine learning: A pilot study. Endosc. Int. Open 2018, 6, E1044–E1050. [Google Scholar] [CrossRef]
- Noorda, R.; Nevárez, A.; Colomer, A.; Beltrán, V.P.; Naranjo, V. Automatic evaluation of degree of cleanliness in capsule endoscopy based on a novel CNN architecture. Sci. Rep. 2020, 10, 17706. [Google Scholar] [CrossRef]
- Nam, J.H.; Hwang, Y.; Oh, D.J.; Park, J.; Kim, K.B.; Jung, M.K.; Lim, Y.J. Development of a deep learning-based software for calculating cleansing score in small bowel capsule endoscopy. Sci. Rep. 2021, 11, 4417. [Google Scholar] [CrossRef]
- Nam, J.H.; Oh, D.J.; Lee, S.; Song, H.J.; Lim, Y.J. Development and verification of a deep learning algorithm to evaluate small-bowel preparation quality. Diagnostics 2021, 11, 1127. [Google Scholar] [CrossRef]
- Saraiva, M.J.M.; Afonso, J.; Ribeiro, T.; Cardoso, P.; Mendes, F.; Martins, M.; Andrade, A.P.; Cardoso, H.; Saraiva, M.M.; Ferreira, J.; et al. AI-Driven Colon Cleansing Evaluation in Capsule Endoscopy: A Deep Learning Approach. Diagnostics 2023, 13, 3494. [Google Scholar] [CrossRef]
- Ju, J.W.; Jung, H.; Lee, Y.J.; Mun, S.W.; Lee, J.H. Semantic Segmentation Dataset for AI-Based Quantification of Clean Mucosa in Capsule Endoscopy. Medicina 2022, 58, 397. [Google Scholar] [CrossRef] [PubMed]
- Hastie, T.; Tibshirani, R.; Friedman, J. The Elements of Statistical Learning; Springer: New York, NY, USA, 2009. [Google Scholar] [CrossRef]
- MacLeod, C.; Hudson, J.; Brogan, M.; Cotton, S.; Treweek, S.; MacLennan, G.; Watson, A.J. ScotCap–a large observational cohort study. Color. Dis. 2022, 24, 411–421. [Google Scholar] [CrossRef] [PubMed]
Strategy | mIoU |
---|---|
Noorda et al. [28] | 0.43 |
ResNet50 | 0.48 |
ViT-B16 | 0.55 |
TransUNet + Patch Loss (Ours) | 0.73 |
Strategy | Acc. | AUC | Prec. | Rec. | F1 |
---|---|---|---|---|---|
Noorda et al. [28] | 0.89 | 0.82 | 0.92 | 0.67 | 0.78 |
ResNet50 | 0.89 | 0.87 | 0.75 | 0.84 | 0.79 |
ViT-B16 | 0.90 | 0.88 | 0.84 | 0.82 | 0.83 |
TransUNet + Patch Loss (Ours) | 0.97 | 0.96 | 0.93 | 0.93 | 0.93 |
CC-Clear Score | 0 | 1 | 2 | 3 | Mean Score |
---|---|---|---|---|---|
Physician #1 | 4 | 12 | 27 | 9 | 1.79 ± 0.82 |
Physician #2 | 1 | 10 | 23 | 18 | 2.12 ± 0.78 |
Physician #3 | 2 | 10 | 27 | 13 | 1.98 ± 0.78 |
Method | ||
---|---|---|
Logistic Regression | 0.370 | 0.245 |
K-Nearest Neighbors (3 neighbors) | 0.545 | 0.461 |
SVM (linear kernel) | 0.334 | 0.282 |
SVM (rbf kernel) | 0.440 | 0.509 |
SVM (polynomial kernel, degree 2) | 0.451 | 0.543 |
Random Forest | 0.607 | 0.586 |
Physician | Individual Model | Consensus Model | |||||
---|---|---|---|---|---|---|---|
- | - | - | |||||
- | - | - | - | ||||
- | - | - | - | - | |||
avg. | - |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Gilabert, P.; Malagelada, C.; Wenzek, H.; Watson, A.; Robertson, A.R.; Finta, Á.; Vitrià, J.; Seguí, S. AI-Assisted Evaluation of Colon Cleanliness in Capsule Endoscopy Videos. Diagnostics 2025, 15, 2228. https://doi.org/10.3390/diagnostics15172228
Gilabert P, Malagelada C, Wenzek H, Watson A, Robertson AR, Finta Á, Vitrià J, Seguí S. AI-Assisted Evaluation of Colon Cleanliness in Capsule Endoscopy Videos. Diagnostics. 2025; 15(17):2228. https://doi.org/10.3390/diagnostics15172228
Chicago/Turabian StyleGilabert, Pere, Carolina Malagelada, Hagen Wenzek, Angus Watson, Alexander R. Robertson, Ádám Finta, Jordi Vitrià, and Santi Seguí. 2025. "AI-Assisted Evaluation of Colon Cleanliness in Capsule Endoscopy Videos" Diagnostics 15, no. 17: 2228. https://doi.org/10.3390/diagnostics15172228
APA StyleGilabert, P., Malagelada, C., Wenzek, H., Watson, A., Robertson, A. R., Finta, Á., Vitrià, J., & Seguí, S. (2025). AI-Assisted Evaluation of Colon Cleanliness in Capsule Endoscopy Videos. Diagnostics, 15(17), 2228. https://doi.org/10.3390/diagnostics15172228