Retrospective Study
Copyright ©The Author(s) 2022. Published by Baishideng Publishing Group Inc. All rights reserved.
World J Gastrointest Endosc. May 16, 2022; 14(5): 311-319
Published online May 16, 2022. doi: 10.4253/wjge.v14.i5.311
Recognition of esophagitis in endoscopic images using transfer learning
Elena Caires Silveira, Caio Fellipe Santos Corrêa, Leonardo Madureira Silva, Bruna Almeida Santos, Soraya Mattos Pretti, Fabrício Freire de Melo
Elena Caires Silveira, Caio Fellipe Santos Corrêa, Leonardo Madureira Silva, Bruna Almeida Santos, Soraya Mattos Pretti, Fabrício Freire de Melo, Multidisciplinary Institute of Health, Federal University of Bahia, Vitória da Conquista 45029-094, Bahia, Brazil
Author contributions: Caires Silveira E proceeded the data collection/entry, performed data analysis and data interpretation, developed the proposed predictive model and participated in preparation and review of manuscript; Santos Corrêa CF and Madureira Silva L participated in preparation of manuscript and wrote the literature analysis/search; Mattos Pretti S and Almeida Santos B participated in review of manuscript; Freire de Melo F designed the research and participated in review of manuscript.
Institutional review board statement: For this study, there was no need for an appraisal by an ethics committee, since only publicly available anonymized data were used.
Informed consent statement: The present manuscript used anonymous images to produce its analyzes and results, in a method that obeys the norms of medical bioethics. Thus, there was no direct or even indirect contact between researchers and patients, with no necessity for "Signed Informed Consent Form" to carry out our study.
Conflict-of-interest statement: The authors have no financial relationships to disclose.
Data sharing statement: No additional data are available.
Open-Access: This article is an open-access article that was selected by an in-house editor and fully peer-reviewed by external reviewers. It is distributed in accordance with the Creative Commons Attribution NonCommercial (CC BY-NC 4.0) license, which permits others to distribute, remix, adapt, build upon this work non-commercially, and license their derivative works on different terms, provided the original work is properly cited and the use is non-commercial. See:
Corresponding author: Fabrício Freire de Melo, PhD, Professor, Multidisciplinary Institute of Health, Federal University of Bahia, Hormindo Barros Street, 58, Candeias, Vitória da Conquista 45029-094, Bahia, Brazil.
Received: May 13, 2021
Peer-review started: May 13, 2021
First decision: July 4, 2021
Revised: July 15, 2021
Accepted: April 27, 2022
Article in press: April 27, 2022
Published online: May 16, 2022

Esophagitis is an inflammatory and damaging process of the esophageal mucosa, which is confirmed by endoscopic visualization and may, in extreme cases, result in stenosis, fistulization and esophageal perforation. The use of deep learning (a field of artificial intelligence) techniques can be considered to determine the presence of esophageal lesions compatible with esophagitis.


To develop, using transfer learning, a deep neural network model to recognize the presence of esophagitis in endoscopic images.


Endoscopic images of 1932 patients with a diagnosis of esophagitis and 1663 patients without any pathological diagnosis provenient from the KSAVIR and HyperKSAVIR datasets were splitted in training (80%) and test (20%) and used to develop and evaluate a binary deep learning classifier built using the DenseNet-201 architecture, a densely connected convolutional network, with weights pretrained on the ImageNet image set and fine-tuned during training. The classifier model performance was evaluated in the test set according to accuracy, sensitivity, specificity and area under the receiver operating characteristic curve (AUC).


The model was trained using Adam optimizer with a learning rate of 0.0001 and applying binary cross entropy loss function. In the test set (n = 719), the classifier achieved 93.32% accuracy, 93.18% sensitivity, 93.46% specificity and a 0.96 AUC. Heatmaps for spatial predictive relevance in esophagitis endoscopic images from the test set were also plotted. In face of the obtained results, the use of dense convolutional neural networks with pretrained and fine-tuned weights proves to be a good strategy for predictive modeling for esophagitis recognition in endoscopic images. In addition, adopting the classification approach combined with the subsequent plotting of heat maps associated with the classificatory decision gives greater explainability to the model.


It is opportune to raise new studies involving transfer learning for the analysis of endoscopic images, aiming to improve, validate and disseminate its use for clinical practice.

Keywords: Esophagitis, Endoscopy, Artificial intelligence, Deep learning, Transfer learning

Core Tip: Considering the clinical relevance of esophagitis, we proposed a deep learning model for its diagnosis from endoscopic images of the Z-line, via binary classification of the images according to the presence or absence of esophageal inflammation signs. The excellent accuracy and area under the receiver operating characteristic curve achieved demonstrate the potential of the adopted strategy, consisting of the conjunction of densely connected neural networks and transfer learning. With this, we contribute to the improvement and methodological advancement in the development of automated diagnostic tools for the disease, which reveal great potential in optimizing the management of these patients.