AI-Powered Endoscopic Image Classification: CNN-Based Gastric Cancer and Ulcer Detection


doi:10.9718/JBER.2020.41.2.101

Introduction

Gastric cancer remains one of the most lethal malignancies worldwide, ranking among the top causes of cancer-related mortality. Despite advances in screening, early detection of gastric cancer is still challenging, particularly due to the morphological similarities between benign gastric ulcers and early gastric cancers. This diagnostic ambiguity often leads to misclassification, delayed treatment, and poorer clinical outcomes.

Traditional gastroscopy, though regarded as the gold standard, has limitations. Outcomes depend heavily on the skill, fatigue level, and interpretive ability of the endoscopist. In fact, studies reveal that up to 11.3% of upper gastrointestinal cancers may be missed during endoscopy. Given these limitations, the application of Artificial Intelligence (AI) and specifically Convolutional Neural Networks (CNNs), offers a transformative approach in Computer-Aided Diagnosis (CAD).

This column delves into a recent research study by Park et al. (2020), which developed a CNN-based automated classification system for gastroscopic images of gastric cancer and gastric ulcers. Leveraging ResNet-50, the authors demonstrated how AI can outperform conventional diagnostic practices and assist gastroenterologists in real-time classification.


Background: Gastric Cancer and Ulcer Diagnostic Challenges

Gastric ulcers are divided into benign and malignant types. Malignant ulcers are essentially classified as gastric cancer, whereas benign ulcers remain non-progressive. However, their endoscopic appearances are strikingly similar, particularly in the early stages. Distinguishing between the two entities is crucial but difficult.

Why Misclassification Matters

  • Benign gastric ulcer misdiagnosed as cancer → unnecessary surgical intervention.

  • Early gastric cancer misdiagnosed as a benign ulcer → delayed treatment, progression to advanced cancer.

Early gastric cancers, particularly superficial and depressed types, often mimic benign ulcers. This diagnostic overlap is why AI-enhanced image classification models are vital for modern gastroenterology.


Methodology of the CNN-Based Model

Data Collection

The research team collected 3,015 gastroscopic images from patients at Gachon University Gil Hospital. The dataset included:

  • Normal images: 1,076

  • Gastric ulcer: 970

  • Gastric cancer: 969

The dataset was split into training and test sets (80:20 ratio).

Figure 1. Examples of gastroscopy images.
(A) Normal mucosa, (B) Gastric ulcer, (C) Gastric cancer.
.


Image Preprocessing

  • Gastroscopic images are rectangular, so resizing and black padding were applied to create square images.

  • Data augmentation was crucial given the limited dataset:

    • Random rotations (±5°)

    • Scaling (±5%)

    • Cropping (1–5%)

    • Mirroring

This increased dataset robustness and reduced overfitting.

Table 1. Dataset distribution after augmentation.

  • 5× augmentation → ~4,300–3,880 images per category

  • 15× augmentation → ~12,900–11,640 images per category


CNN Architecture: ResNet-50

The team employed ResNet-50, a deep CNN architecture with residual blocks that mitigate vanishing gradients and allow for deeper, more effective training.

Fig. 2 highlights the convolutional layers and skip connections characteristic of residual networks.

Transfer learning was used with ImageNet pre-trained weights, allowing faster convergence and higher accuracy.


Results

The CNN achieved impressive results in classification tasks:

Accuracy and AUC values:

  • Normal vs. Ulcer: up to 95.11%, AUC 0.99

  • Normal vs. Cancer: up to 98.28%, AUC 0.99

  • Ulcer vs. Cancer: max 89.30%, AUC 0.95

Fig. 3 demonstrates high diagnostic performance, especially in differentiating normal tissue from lesions



Class Activation Maps (CAM)

To interpret CNN decisions, the team employed CAM visualization, showing where the model focused attention:

  • Red regions indicate high model weight.

  • Correctly classified ulcer/cancer lesions corresponded with actual pathology sites.

  • Misclassified images showed overlap, highlighting the morphological similarity problem.

Figure 4. Test images with corresponding CAM heatmaps.
(A–C) Test gastroscopy images (D–F) CAM overlays indicating lesion detection.

Figure 5. Misclassified cases:

  • (A)(B) Ulcers misclassified as cancer.

  • (C)(D) Cancers misclassified as ulcers.


Discussion

Key Findings

  • High accuracy for normal vs lesion classification (95–98%).

  • Ulcer vs cancer classification remained challenging (≤89%).

  • Data augmentation improved model robustness, though excessive augmentation (15×) sometimes decreased performance due to visual distortion.

  • CAM confirmed that CNNs detect clinically relevant lesion areas, aligning with human diagnostic reasoning.

Clinical Implications

  • Decision support: AI reduces inter-observer variability and fatigue-related errors.

  • Screening aid: AI-assisted endoscopy enhances early detection of gastric cancer.

  • Workflow optimization: Automated classification reduces workload, allowing pathologists to focus on complex cases.

Limitations

  • Small dataset (3,015 images).

  • Need for more diverse ulcer and depressed-type cancer images.

  • Current models are offline; real-time implementation requires model optimization for speed.


Future Directions

  1. Dataset Expansion: Focus on morphologically ambiguous lesions.

  2. Advanced Preprocessing: Noise reduction, histogram equalization, and sharpening to enhance lesion visibility.

  3. Hyperparameter Optimization: Grid search and random search for the best CNN configurations.

  4. Real-time AI Endoscopy: Lightweight CNN architectures for 60 FPS video classification in live endoscopy.

  5. Clinical Integration: AI as a second reader, reducing diagnostic misses in population screening programs.


Conclusion

The integration of CNN-based deep learning into endoscopic practice represents a paradigm shift in gastroenterology. This study demonstrated that AI can achieve diagnostic accuracy rivaling or surpassing human experts in detecting gastric ulcers and cancers. While challenges remain in differentiating ulcerative lesions from early cancers, continuous improvements in dataset size, preprocessing, and network design will further enhance reliability.

The future of gastroscopy is AI-assisted real-time classification, ensuring earlier detection, improved patient outcomes, and optimized clinical workflow.


Quiz

1. Which factor contributes most to the difficulty of distinguishing a gastric ulcer from early gastric cancer in endoscopy?

  1. Lesion color differences

  2. Similar morphology in early stages

  3. Ulcer bleeding patterns

  4. Location in the gastric fundus

2. What was the highest accuracy achieved in the CNN-based model for classification?

  1. Normal vs. Ulcer – 95.11%

  2. Normal vs. Cancer – 98.28%

  3. Ulcer vs. Cancer – 87.89%

  4. Ulcer vs. Cancer – 99.00%

Answer & Explanation

1. Answer: 2. Similar morphology in early stages. Explanation: Early gastric cancer, particularly flat and depressed types, closely resembles benign gastric ulcers, making differentiation challenging.

2. Answer: 2. Normal vs. Cancer – 98.28%. Explanation: The CNN achieved the best accuracy in distinguishing normal tissue from gastric cancer, highlighting its value in screening.


References

[1] S. J. Yoon, “Screening between benign and malignant gastric ulcers,” Korean J. Gastrointest. Endosc., vol. 35, pp. 29–33, 2007.
[2] K. N. Sim, “Endoscopic findings of early gastric cancer,” Korean J. Gastrointest. Endosc., vol. 34, pp. 254–257, 2007.
[3] H. A. Park et al., “The Korean guideline for gastric cancer screening,” J. Korean Med. Assoc., vol. 58, no. 5, pp. 373–384, 2015.
[4] J. S. Ryu, “Cases of misdiagnosis and countermeasures,” Korean J. Gastrointest. Endosc., vol. 37, pp. 24–26, 2008.
[5] T. Hirasawa et al., “Application of artificial intelligence using a convolutional neural network for detecting gastric cancer in endoscopic images,” Gastric Cancer, vol. 21, no. 4, pp. 653–660, 2018.
[6] X. Zhang et al., “Gastric precancerous diseases classification using CNN with a concise model,” PLoS One, vol. 12, no. 9, pp. 1–10, 2017.
[7] H. Sharma et al., “Deep convolutional neural networks for automatic classification of gastric carcinoma using whole slide images in digital histopathology,” Comput. Med. Imaging Graph., vol. 61, pp. 2–13, 2017.
[8] S. Menon and N. Trudgill, “How commonly is upper gastrointestinal cancer missed at endoscopy? A meta-analysis,” Endoscopy, vol. 2, no. 2, pp. 46–50, 2014.

댓글

이 블로그의 인기 게시물

수면 건강 혁신: 기능성 직물 전도성 전극을 활용한 심전도 측정 기술의 최신 연구와 발전 방향

최첨단 진단 기술: 악성 포도막 흑색종 전이의 F-18 FDG PET/CT 조기 발견과 생존율 향상 전략

[유방암 영상의학] DCIS 업스테이징 예측을 위한 맘모그래피 기반 Radiomics: 최신 연구로 본 임상적 적용 가능성