Preparation of endoscopic images. NBI images of neoplastic lesions from patients who underwent endoscopic or surgical resection at Sendai City Medical Center Sendai Open Hospital from April 2017 to December 2019 were used for this single center retrospective study. Characteristics of collected NBI images are summarized in Table 2. A total of 1390 NBI images were sampled from a total of 210 lesions with definite histologic diagnosis 11: 53 low-grade dysplasia (LGD); 120 high grade dysplasia or mucosal carcinoma (HGD); 20 superficially invasive (< 1000 mm) submucosal carcinoma (SMs) and 17 deeply invasive (> 1000 mm) submucosal carcinomas (SMd). Sampled picture number per lesion was 5.5 to 7 samples with an averaged image capturing conditions: no magnification 41.0%; low magnification 37.9%; high magnification 21.1%. The video endoscopes CF-HQ290ZI, PCF-H290ZI, PCF-H290TI and video endoscopy system EVIS LUCERA ELITE CV-290/CLV-290SL (Olympus Medical Systems, Co., Ltd., Tokyo, Japan) were used.
Table 2
Collected NBI images for dataset. NBI, narrow band imaging; HGD, high grade dysplasia; LGD, low grade dysplasia; SMs, superficially invasive submucosal carcinoma; SMd, deeply invasive submucosal carcinoma.
Histology | Number of lesions | Number of still pictures | Averaged picture number per lesion | Magnification (picture counts/ %) |
None | Low | High |
LGD | 53 | 294 | 5.5 | 126/42.9 | 120/40.8 | 48/16.3 |
HGD | 120 | 840 | 7.0 | 345/41.1 | 305/36.3 | 190/22.6 |
SMs | 20 | 138 | 6.9 | 59/42.8 | 46/33.3 | 33/23.9 |
SMd | 17 | 118 | 6.9 | 40/33.9 | 56/47.5 | 22/18.6 |
total | 210 | 1390 | 6.6 | 570/41.0 | 527/37.9 | 293/21.1 |
Preparation of dataset. NBI images (Fig. 1A) were manually partitioned into the lesion (Fig. 1B) and background (Fig. 1C) from which the patch images (128 × 128 pixels) were cropped starting from the left upper corner (white dotted patch), rightwards (white solid patch), then downwards (red solid patch) at every 32-pixel-strides (white and red arrows) over the entire effective region of interest. The patches including blackouts with more than 10% of the effective region were automatically excluded from analysis. Blackouts were defined as regions with the intensity of red component lower than 50. Similarly, the patches with halations exceeding 5% of the effective region were also excluded. Halations were defined as regions with the intensity of green component higher than 250. In this study, the patches were further classified into in-focus patches and out-of-focus ones according to the amount of spatial high frequency area extracted by high pass filter with a cut-off of 6.25% Nyquist frequency. The in-focus patches were classified into 0) background (BG), 1) LGD, 2) HGD, 3) SMs and 4) SMd, and the out-of-focus ones into 5) background (BG-oof) and 6) lesion (L-oof). A total of 59,8801 patches were classified into 7 categories (Table 3). The study did not have any inclusion or exclusion criteria for pictorial quality of the patches by endoscopists. As stated, the patches with excessive blackout or halation were automatically excluded before entry. The study aimed to establish an effective histologic classifier that can be used in any common shooting conditions of NBI.
Table 3
Quantity of clipped patches within each category. BG, background; HGD, high grade dysplasia; LGD, low grade dysplasia; SMs, superficially invasive submucosal carcinoma; SMd, deeply invasive submucosal carcinoma; BG-oof, out-of-focus background; L-oof, out-of-focus lesion.
Category | The number of patches |
BG | 91571 |
LGD | 52184 |
HGD | 158187 |
SMs | 28049 |
SMd | 20882 |
BG-oof | 167081 |
L-oof | 80847 |
Evaluation method. We employed cross-validation to obtain more accurate results with less bias in the machine learning studies. In this study, the dataset is randomly partitioned into three equal sized folds, one fold of which is for validation and the other folds are for training. The proportion of labels was equal in each fold. The training and validation processes were repeated three times using different folds each time. The three validation results could then be averaged to produce a single estimation.
Architecture of the CNN. ResNet50 (a CNN) and Pytorch were utilized 12. ResNet50 without pretraining was imported from Pytorch library (torchvision.models). The original patches with 128 × 128 pixels were converted into images with 224 × 224 pixels. We tuned hyper parameters, which were set by a human, as follows: optimizer, Adam; loss function, cross entropy loss; number of training epochs, 50; batch size, 256; learning rate, 0.00005 via trial and error; and number of the outer layers, 7 classes.
Image-level classification. An exemplification of SMd and the annotation mask without blackout or halation (denoted by X) are depicted in Fig. 2-A and I, respectively. The patches classified into BG, LGD, HGD, SMs, SMd, BG-oof and L-oof, by the trained CNN, are illustrated by white (Fig. 2-B), green (Fig. 2-C), yellow (Fig. 2-D), magenta (Fig. 2-E), red (Fig. 2-F), dark gray (Fig. 2-G) and cyan (Fig. 2-H) open squares, respectively, and the corresponding union masks in Fig. 2-J, K, L, M, N, O and P, respectively. Classification algorithms must be developed by utilizing in-focus patches, without sacrificing pictorial information. Here, the union masks of the patches classified into labels BG, LGD, HGD, SMs and SMd are designated by M0, M1, M2, M3 and M4, respectively. Intersection over union between X and Mi (IoUi) are given by X∩Mi/ X∪Mi (i = 0,1,2,3,4). The lesion was classified into the argmax among IoUi (i = 0,1,2,3,4), with the IoUi values of 0.12, 0.05, 0.21, 0.04 and 0.57, respectively, leading to label 4 or histologic classification SMd.
Ethics approval and consent to participate. This study was approved by the Committee of Medical Ethics of Hirosaki University Graduate School of Medicine (Aomori, Japan; reference no. 2019-1099) and Sendai City Medical Center (Sendai, Japan: reference no. 2019-0029). Informed consent was obtained in the form of opt-out on our website (https:// www. https://www.med.hirosaki-u.ac.jp/hospital/outline/resarch.html), with the approval of the Committee of Medical Ethics of Hirosaki University Graduate School of Medicine. This study was designed and carried out in accordance with the Declaration of Helsinki.
Consent for publication. Informed consent was obtained in the form of opt-out on our website (https://www.med.hirosaki-u.ac.jp/hospital/outline/resarch.html), with the approval of the Committee of Medical Ethics of Hirosaki University Graduate School of Medicine.