Abstract
Objectives. The diversifying modalities of treatment for gastric cancer raise urgent demands for the rapid and precise diagnosis of metastases in regional lymph nodes, thereby significantly impact the workload of pathologists. Meanwhile, the recent advent of whole-slide scanners and deep-learning techniques have enabled the computer-assisted analysis of histopathological images, which could help to alleviate this impact. Thus, we developed a deep learning-based diagnostic algorithm to detect lymph node metastases of gastric adenocarcinoma and evaluated its performance. Methods. We randomly selected 20 patients with gastric adenocarcinoma who underwent surgery as definitive treatment and were found to be node metastasis-positive. HEMATOXYLIN-eosin (HE) stained glass slides, including a total of 51 metastasis-positive nodes, were retrieved from the specimens of these cases. Other slides with 776 metastasis-negative nodes were also retrieved from other twenty cases with the same disease that were diagnosed as metastasis-negative by the final pathological examinations. All glass slides were digitized using a whole-slide scanner. A deep-learning algorithm to detect metastases was developed using the data in which metastasis-positive parts of the images were annotated by a well-trained pathologist, and its performance in detecting metastases was evaluated. Results. Cross-validation analysis indicated an area of 0.9994 under the receiver operating characteristic curve. Free-response receiver operating characteristic curve (FROC) analysis indicated a sensitivity of 1.00 with three false positives. Further evaluation using an independent dataset also showed similar level of accuracies. Conclusion. This deep learning-based diagnosis-aid system is a promising tool that can assist pathologists involved in gastric cancer care and reduce their workload.
Keywords
Introduction
The incidence of cancer and mortality are rapidly growing worldwide, and gastric cancer ranks sixth in incidence and second in mortality. 1 Various treatment modalities have been developed for this malignant disease, and the metastatic status of regional lymph nodes has been demonstrated to be one of the most important prognostic factors and criteria for selecting appropriate treatment options. 2
Furthermore, sentinel lymph node navigation, which was originally developed for the management of malignant skin melanoma and breast cancer,3,4 has been proposed for gastric cancer surgeries,5,6 and an increasing number of favorable results have been obtained. 7 This technique demands quick intraoperative diagnosis for the presence of metastases in lymph node specimens, including micrometastases (0.2-2 mm in size).
The aforementioned advance in gastric cancer care significantly increases the stress of the pathologists in charge of such diagnostic practices. 8 Meanwhile, the recent advent of whole-slide scanners, which allows quick digitization of glass slides to histopathological images, makes it possible to process medical images through computer-based analyses. In particular, the machine learning algorithm 9 has been introduced as a remarkable innovation in the field of clinical image analysis, and have been used successfully to develop a diagnostic aid system for detecting specific lesions in endoscopic or angiographic images.10,11 Some deep learning algorithms have been demonstrated to have high performance in detecting breast cancer metastases in lymph nodes, 12 and improve accuracy and efficiency in digital pathology workflows. 13 Similar approaches have achieved practical level to detect cancer region on biopsy samples of gastric adenocarcinoma.14,15 However, none of these studies has applied those algorithms to detect metastases in regional lymph nodes of the same disease. Based on these previous studies, we used the same technique to detect gastric cancer metastases in regional lymph nodes and evaluate the performance of the system in this study.
Consequently, ResNet-152, 16 pre-trained on ImageNet, 17 in which only the fully connected layers were fine-tuned for detecting the gastric cancer metastases in lymph nodes, demonstrated comparable performance to that of expert pathologists and other studies for breast cancers. This approach can be potentially extended to other domains of cancer and reduce the physical and mental load of the pathologists in charge of cancer care practices.
Material and Methods
Patients
After obtaining approval from the research ethics committee of our university, we examined our database between 2008 and 2017, and randomly selected 20 cases with gastric tubular adenocarcinoma that underwent surgery for definitive treatment and were found to be lymph node metastasis-positive. The hematoxylin-eosin (HE) stained regional lymph node slides of these cases were retrieved and confirmed by an expert pathologist again. Through the examination, we found a case with only one isolated tumor cell lesion (metastatic foci of less than 0.2 mm) but no micro- (between 0.2 and 2 mm) or macro-metastases (larger than 2 mm). The case with isolated tumor cell lesion was excluded from the targets of this analysis because the clinical significance of isolated tumor cell in gastric cancer remains controversial 18 and most of the comparable research for breast cancers have excluded isolated tumor cell lesions for the evaluation of their performances. Meanwhile, another case was detected that exhibited no metastatic lesions in the regional lymph node slides; however, a metastatic lesion was observed in an lymph node adjacent to the gastric wall within the main lesion slide. Cancerous invasion reached the capsule of the lymph node and it made difficult to clearly annotate the complete area of the node. Consequently, the image data of these two cases were excluded (Figure 1). Slides from 20 cases with 776 metastasis-negative lymph nodes confirmed by the same expert pathologist were also retrieved.

Diagram of this study.
Immunohistochemical Analysis
All surgically dissected lymph nodes were fixed in 20% or 10% buffered formalin. We performed immunohistochemical analysis on all samples using the anti-cytokeratin antibody (CAM5.2, BD biosciences, CA, USA) to confirm node status. PT-link (Dako, CA, USA) was used for the pretreatment, and the subsequent reactions were conducted using Autostainer Link 48 (Dako, CA, USA).
Image Dataset
All HE- and immunohistochemically stained lymph node images were acquired by NanoZoomer S60 (Hamamatsu photonics, Hamamatsu, Japan) with a 40x objective lens (specimen-level pixel size; 0.226μm × 0.226μm).
Data Labeling
All annotations in this study were performed by a well-trained specialist for pathology (JM). First, all HE-stained lymph nodes presented in the whole-slide images were annotated by outlining the margins. Then, the metastatic regions in each lymph node were also outlined with different annotations. All annotated regions were divided into 224-pixel × 224-pixel square patches as datasets for the analyses.
Computer Algorithm
We adopted a convolutional neural network (CNN) as the algorithm to detect metastatic lesions. ResNet-152 16 pre-trained with ImageNet 17 was used as the base network model of the CNN. We only fine-tuned the parameters of the fully connected layers at the end of ResNet-152.
The network was implemented with Chainer 19 (Preferred Networks, Inc., Tokyo, Japan) on a workstation equipped with NVIDIA Tesla K80 GPUs (NVIDIA corporation, California, U.S.A). To optimize the parameters, we used stochastic gradient descent (SGD) with a learning rate and momentum of 0.001 and 0.9, respectively. The number of epochs and minibatch size for network training were set to 100 and 32, respectively. For the experiment, down-sampled images imitated at 20x magnification included in the .npdi files (output media of NanoZoomer) were used. In accordance with default ResNet-152, patches with 224 × 224 pixels (∼100 μm) were input into the network. In the training phase, 1000 patches were randomly picked from each whole-slide image. Image data labeled as “positive” were obtained from only metastatic area of the positive nodes, and data labeled as “negative” were obtained from the entire lymph node area of the whole-slide image with metastasis-negative patients.
Task and Evaluation
We conducted cross-validation tests to evaluate the effectiveness of our network developed for lymph node metastasis detection. The dataset that included 51 metastasis-positive nodes and 776 metastasis-negative nodes was divided into five groups. We built the network model by arbitrarily selecting four out of five groups and verified the performance using the remaining group.
In addition, we prepared another independent dataset to test the generalizability of our established network. Only 7 cases with lymph node metastasis-positive and 5 cases with node metastasis-negative were available in the patients who underwent definitive surgery for tubular adenocarcinoma in our hospital between 2018 and 2021. Total of 12 metastasis-positive nodes were identified in the node metastasis-positive cases and so were identified 100 nodes in metastasis-negative cases. All of these lymph node images were subjected to test the performances of the network.
Results
As indicated in Figure 1, a total of 51 lymph nodes were identified as metastasis-positive among the samples from 18 lymph node metastasis-positive cases. Thirty-four of these lymph nodes were revealed to have macrometases, while the remaining only had micrometastases. Consequently, a total of 145 metastatic lesions (1-30 per node, average 2.8, median 1) were identified by the immunohistochemical analysis. Seven hundred and seventy-six lymph nodes were revealed among the samples from the node metastasis-negative cases, and all of these lymph nodes were confirmed by the immunohistochemical analysis.
The probability of metastases was estimated for each patch of the test group, and patches with probabilities of more than 0.5 were highlighted with green square as metastases. These squares aggregated roughly within the metastatic regions, and one of the representative outputs of inference is indicated in Figure 2. The general performance of the established algorithm for detecting metastases at the node level was evaluated by the area under the receiver operating characteristic curve (AUC). Five validations indicated an AUC between 0.9974 and 1.000, and the total AUC was found to be 0.9994 (95% CI, 0.999-1.000), as shown in Figure 3. However, two of the nodes exhibited a scattered high-probability area within the metastasis-negative regions, as indicated in Figure 4. Thus, the accuracy of inference was evaluated using the free-response receiver operating characteristic curve (FROC). The FROC of each validation is shown in Figure 5. The total FROC indicated that the sensitivity was 0.844 with 1 false positive and 0.914 with 2 false positives. If approximately three false positive estimates are allowed per node, all (100%) metastasis-positive nodes could be detected.

Representative example of inferences on a metastatic lymph node specimen. Lymph node areas and metastatic regions are delineated with red and black lines, respectively. Green squares correspond to image patches that were estimated to have a high probability of metastasis.

Receiver operating characteristic curve analyses to assess the inference performance per node level results of each round of cross-validation (fold 1 to 5) and the combined result (total ROC) are indicated.

Example of a close-up image of a false-positive case. No malignant cells were observed in this region.

Free-response receiver operating characteristic curve analysis to assess the accuracy of inference results of each round of cross-validation (fold 1 to 5) and the combined result (total FROC) are indicated.
Further evaluation using an independent dataset indicated AUC of 0.9914 (95% CI, 0.9557-1.0000) for ROC analysis (Figure 6A) and three false positive per node with 100% detection of metastasis-positive node for FROC analysis (Figure 6B).

Receiver operating characteristic curve analyses (A) and free-response receiver operating characteristic curve analysis (B) to assess the inference performance per node level using additional independent data set.
Discussion
Demands for the rapid and accurate pathological diagnosis of gastric cancer metastases in lymph nodes are increasing as the quality of life of patients after surgery has garnered significant attention. Standardized levels of lymph adenectomy in gastric cancer surgery have been well defined 20 and the guideline recommends intraoperative sampling and pathological examination of the regional lymph nodes to determine the level of treatment. 2 In addition, the introduction of sentinel lymph node navigation procedures to the management of gastric cancer5,6 poses additional workload. Furthermore, difficulties in detecting the metastases of poorly differentiated gastric carcinoma and controversies regarding the biological activities of isolated tumor cell lesions in regional lymph nodes bring up additional stress to the pathologists.
Meanwhile, whole-slide scanners have been developed to acquire images from glass slides with high speed and high resolution. The digitization of histopathological data not only saves the storage space for glass slides, but also facilitates fast access to the stored data and provides a telemedicine opportunity for consultations and automated diagnosis of histopathology. Similarity in pathologist experience on using whole-slide imaging and conventional glass slide-based approach to make diagnosis21,22 has promoted the research on computer-based pathological diagnosis with artificial intelligence. In particular, the advent of the deep learning algorithm 9 has introduced a new concept in the analyses of clinical images. These trends have accelerated the detection and classification of the disease of interest at the lesion or whole-slide image level in the field of pathology.
Several groups have attempted to diagnose the metastatic foci in the lymph nodes of whole-slide images. However, most of these studies focused on breast cancer metastases. Litjens et al applied CNNs to analyze the whole-slide images of sentinel lymph nodes, and an AUC of 0.88–0.90 was achieved for the slide level detection of metastases. 23 The CAMELYON16 competition 12 provided training and test datasets of whole-slide images of sentinel lymph nodes from breast cancer patients and allowed the development of automated solutions for lymph node metastasis detection. The top-performing algorithm achieved an AUC of 0.994 for the whole-slide image classification task. Although the performance needs to be validated in a large scale of clinical trial, it was significantly better than that of the performance of pathologists with time constraints. Unfortunately, the same algorithms cannot be directly applied for the detection of gastric cancer because of the difference in morphologic features of the two cancers. In these contexts, the current study on detection of the lymph node metastasis of gastric cancer demonstrated comparable performance on node-level detection for metastases with those previously reported on breast cancer. To the best of our knowledge, this is the first study that describes the use of deep learning techniques for detecting lymph node metastases for gastric cancer.
Gastric cancer exhibits a variety of histological morphologies. 24 In our study, only patients with tubular adenocarcinoma were enrolled. Tubular adenocarcinoma is the main subtype of the differentiated type of gastric cancer, and generally forms a characteristic duct-like configuration in the metastatic foci, which can be easily identified. In contrast, undifferentiated subtypes tend to sparsely infiltrate the lymphatic tissues. In addition, it is difficult to discriminate them from normal tissues. The specific histologic subtypes of gastric adenocarcinoma selected for the current study could have contributed to the high metastasis detection performance in the proposed model. It would be interesting to examine its performance on other histologic subtypes of the tumor in future studies
A significant number of false positives were obtained in our outputs, and this is one of the common issues encountered in various similar studies. Litjens et al indicated a sensitivity of 0.90 and 0.93 for one and two false positives, respectively. 23 The top-performing algorithm in CAMELYON16 indicated a sensitivity of approximately 0.8 for two false positives 12 ; thus, our model achieved comparable performance. In our experiment, the number of metastasis-negative node images was more than ten times larger than that of metastasis-positive node slides; therefore, the dataset contained negative patches with the same rate, which could have contributed to the reduction of false positives. Sampling the negatives preferentially is also known as a standard method for reducing false positives.
Litjens, et al described in their report that the distinction between the histiocyte-rich regions and metastases is a well-established difficulty. 23 In our model, the false positives were apparently indicated around the histiocytes and small vessels, as shown in Figure 4. Pham et al addressed this issue in the detection of lung cancer lymph node metastases and proposed a two-step deep learning algorithm approach, 25 with the first step to eliminate the frequently misclassified noncancerous regions, such as lymphoid follicles, and the second to detect cancer cells. Errors were reportedly reduced by 36.4% compared with the single step model. A similar approach would be an alternative for reducing the false positives.
In our study, we investigated approaches for updating all the weights of ResNet-152 16 for our new task, as well as a method wherein the fully connected layers of ResNet-152, 16 pre-trained on ImageNet, 17 were fine-tuned while freezing all previous layers. As a result, the latter approach demonstrated better performance. ImageNet is a classification dataset containing more than 1 million natural images organized into 1000 classes, which are very dissimilar to digital pathology images though. It has been used to pre-train CNN models and then transfer the learned knowledge to facilitate training on the target tasks of digital pathology, and sometimes showed to boost performance the models. Our result was consistent with these reports and it can contribute to the reduction of development cost as well as to improve the diagnostic accuracy of the system.
This study has several limitations. We did not include color normalization steps for HE staining. The color appearances of HE-stained tissues vary across ages, institutions, and scanners. This is an essential step for developing a system for practical use. In addition, our model was developed using data from patients with tubular adenocarcinoma only. Other subtypes of gastric cancer should also be included in future studies. Furthermore, this was a retrospective study, and both the training and test data were sampled from the same cohort. The usefulness of this model should be evaluated in a prospective manner in future work.
Conclusion
Our first trial to test the performance of a deep-learning model to detect gastric cancer metastases in lymph nodes with defined conditions indicated comparable outcomes to those previously reported for breast cancer. The proposed model needs to be further refined to develop a system for practical use.
Footnotes
Acknowledgments
We particularly thank Kiyotaka Onodera and other technical staff members at Chiba University Hospital's Department of Pathology for their technical assistance.
Author Contributions
Jun Matsushima: Methodology, Data Curation, Writing—Original Draft. Tamotsu Sato: Methodology, Software, Visualization. Takashi Ohnishi: Formal analysis, Software. Yuichiro Yoshimura: Data Curation. Hiroyuki Mizutani: Project administration. Shinichiro Koto: Supervision. Jun-ichiro Ikeda: Resources, Writing—review & editing. Masayuki Kano: Investigation. Hisahiro Matsubara: Resources, Supervision. Hideki Hayashi: Conceptualization, Writing—review & editing.
Declaration of Conflicting Interests
The author(s) declared the following potential conflicts of interest with respect to the research, authorship, and/or publication of this article: J. Matsushima and H. Hayashi received funding from Toshiba Digital Solutions Corporation. T. Sato, H. Mizutani, and S. Koto are employees of Toshiba Digital Solutions Corporation. The other authors declare that they have no conflicts of interest to disclose. There are no other relationships or activities that could appear to have influenced the submitted work. The corresponding author had full access to all the data in the study and had final responsibility for the decision to submit for publication.
Ethical Approval
The study was approved by the research ethics committee of the Graduate School of Medicine, Chiba University (No. 2855 and No. 4122)
Funding
The author(s) disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This work was supported by the Chiba University (Strategic Priority Research Promotion Program “Multimodal Medical Engineering”), and Japan Society for the Promotion of Science (Grant-in-Aid for Scientific Research (19H01172, and 20K09027)).
Informed Consent
Not applicable, because this article does not contain any studies with human or animal subjects
Trial Registration
The present research is a retrospective study.
