Background and aims: An irregular z-line is characterized by a squamocolumnar junction (SCJ) that extends proximally above the gastroesophageal junction (GEJ) by < 1 centimeter (cm), while Barrett's esophagus (BE) is defined as a columnar lined esophagus (CLE) that extends proximally by ≥1 cm with the presence of specialized intestinal metaplasia (IM) on biopsy. Measurement of CLE is most accurate for lengths ≥1 cm, and as such, guidelines do not recommend biopsy of an irregular z-line when seen on endoscopy. However, a CLE is often estimated by visual inspection rather than direct measurement, making this characterization imprecise. In this study, we present methodology to standardize the characterization of the SCJ, hypothesizing that the shape of the z-line can be used as a surrogate classifier. We present a computer-generated algorithm capable of automated segmentation and shape complexity quantification of the z-line.
Methods: 849 images of the z-line were selected and manually segmented. We used the nnUNet framework to train a model to segment the z-line. An additional dataset of 58 videos containing the z-line were obtained from the Mayo Clinic Endoscopy video library. A high-quality image containing the z-line was selected from each video. Ten gastroenterologists (5 esophageal experts) rated each of the 58 video/image pairs containing the z-line as "regular" or "irregular," including their degree of confidence. Fleiss kappa statistics was used to determine interobserver variability. The "ground truth" classification was determined by the esophageal expert majority vote. A wavelet decomposition model was then used to determine the threshold of irregularity based on the ground truth. Heat maps were generated for each z-line to determine localized areas of complexity.
Results: Fair agreement, with a Fleiss' kappa of 0.39, was observed between the 10 endoscopists when rating the z-line as "regular" vs "irregular" using this dataset. Moderate agreement was observed between the 5 esophageal experts with a Fleiss' kappa statistic of 0.42, and fair agreement was observed between the 5 non-esophageal experts with a Fleiss' kappa statistic of 0.31. The wavelet energy coefficient optimal threshold to classify an SCJ as irregular was determined to be 1.53×10ˆ7 with an accuracy of 78%.
Conclusion: Our computer-generated model was capable of auto-segmentation and classification of the z-line. We established a threshold of complexity using wavelet energy coefficient to standardize the classification of the SCJ.
Copyright © 2025 American Society for Gastrointestinal Endoscopy. Published by Elsevier Inc. All rights reserved.