苏州大学附属第一医院 消化内科，江苏 苏州 215000
Department of Gastroenterology, the First Affiliated Hospital of Soochow University, Suzhou, Jiangsu 215000, China
目的 建立内镜下内痔诊断及危险分级的深度学习模型，探讨人工智能辅助内镜下内痔诊疗的可行性。方法 收集该院内镜中心的肛齿状线上倒镜图片，分为内痔组和正常组（A任务）；根据LDRf分级标准，将内痔组进一步分为Rf0组、Rf1组和Rf2组（B任务）。选取基于卷积神经网络（CNN）框架的Xception、ResNet和EfficientNet，以及基于Transformer框架的ViT和ConvMixer等5个神经网络，建立针对A、B两项计算机视觉任务的深度学习模型。模型评价指标包括准确率、召回率、精确度、F1值和读片时间。将深度学习模型的读片表现与两位不同年资内镜医生进行比较。结果 5种深度学习模型在A与B任务测试集中皆展现出较好的准确性。其中，最优模型为ConvMixer，准确性最高（0.961和0.911），其次为EfficientNet（0.956和0.901），均优于高年资内镜医生（0.952和0.881）和低年资内镜医生（0.913和0.832）。同时，所有深度学习模型在验证集中读片用时均 < 10 s，速度快于内镜医生（均 > 300 s）。此外，笔者采用梯度加权分类激活映射（Grad-CAM）方法突出图像中对模型判断较重要的区域。结论 建立的内痔诊断及危险分级的深度学习模型，其表现优于内镜医生。基于深度学习的计算机视觉模型可辅助内镜医师进行内痔诊断和分级，展现出潜在的临床应用前景。
Objective To develop deep learning models for the diagnosis and risk stratification of internal hemorrhoids in endoscopy.Methods Endoscopic images in upper anus dentate line were collected, which were divided into normal group and internal hemorrhoids group (Task A). Based on the LDRf standard, internal hemorrhoids group was further classified into Rf0, Rf1 and Rf2 (Task B). Five deep learning models, included: Xception, ResNet, EfficientNet (based on CNNs architecture) and ViT, ConvMixer (Transformer architecture), were chosen to be trained on the two computer vision tasks. The models were evaluated by accuracy, recall, precision, F1 and prediction time. Their performances were compared with two endoscopists.Results The five models showed good performance in the validation dataset of the two tasks. The best was the ConvMixer model (accuracy 0.961 in Task A and 0.911 in Task B), followed by the EfficientNet model (0.956 and 0.901), which were both higher than the endoscopists (senior 0.952 and 0.881; junior 0.913 and 0.832). Meanwhile, in terms of prediction time in the validation dataset, all models (<10 s) cost significantly less time than the endoscopists ( > 300 s). Furthermore, the Grad-CAM promoted model’s visualization and explanation.Conclusion This study trained deep learning models to diagnose and stratify internal hemorrhoids in endoscopy, whose performance was better than endoscopists. Computer vision models, based on deep learning, could assist endoscopists to diagnose and stratify internal hemorrhoids, which show promise in future clinical practice.