## 4 Discussion  
To the best of our knowledge, this is the first AI deep-learning model for the automatic detection of pleomorphic esophageal lesions during CE. This proof-of-concept specific model showed good overall diagnostic performance metrics, across different types of CE devices, which could potentially serve as a noteworthy contribution and the missing step for the implementation of a minimally invasive CE-based panendoscopic evaluation. There are some highlights that must be acknowledged. Firstly, the patient-split design ensures that frames from a specific patient are only attributable to one of either the training/validation or testing group, reducing the risk of similar frames being presented in both, which could lead to the overfitting of the AI model. Secondly, several CE devices were used to train this algorithm, which increases the interoperability of the model, an important aspect for enhancing its technology readiness level and, consequently, its application in real-life clinical practice. Thirdly, it is worth noting that this algorithm was trained using frames from two high-volume CE centers, which may increase the external validity of this results. Fourthly, its capacity to accurately identify different types of lesions during a single procedure enhances its clinical utility, as well. Moreover, through the generation of heatmaps that highlight the region with the higher probability of containing a lesion, we can infer that the model appears to detect patterns as lesions in the way we ideally expect it to. This explainability feature addresses an important current topic, since it not only reduces the cognitive load on exam interpretation by directing attention to specific areas, but also empowers the physician to make the necessary corrections in case of erroneous predictions. The fact that the development of this model was based on a ViT model can also stand as a strength of this paper and should be emphasized. ViT models are a type of DL algorithm that were initially developed in the field of natural language processing, since there is an enhanced capability in recognizing complex relations using self-attention mechanisms [18]. This distinct feature enables models to achieve a greater precision in tasks such as language paraphrasing and translations. More recently, there has been an increasing interest in trying to employ ViT models to enhance visual complicated tasks, with some evidence indicating they perform equally well or at a higher level compared to CNN models [13; 18]. In terms of CE technology, there are a great number of published DL models based on CNN algorithms, but none of them include ViT models. To our knowledge, this model stands as a pioneer. Not only is it the first of its kind in the esophagus, but  
Figure 4: Area under the conventional receiver operating characteristic curve, 2—Area under the precision–recall curve (AUC-PR) of VIT’s performance in detection of pleomorphic esophageal lesions. The proportion of cases in which the DL model was correct is associated with precision and it is on the y-axis. The proportion of frames with true pleomorphic esophageal lesions is associated with recall (which is the same as sensitivity) and it is on the x-axis. A higher precision indicates a lower false positive rate, whereas a higher recall means a lower false negative rate. The higher the precision and recall, the bigger the AUC-PR. it also marks the inaugural application of a ViT method for automatical lesion detection in this specific location, potentially marking a significant double advancement in CE technology. The outcome metrics demonstrate a robust diagnostic performance, indicating a valuable balance between minimizing missed lesions and keeping the proportion of false positives low, which will be an essential consideration for an effective AI-enhanced capsule endoscopy assessment. Nonetheless, some limitations have to be recognized.