# AI detection of H. pylori in gastric biopsy patches: perfect scores with important limits

> Several networks made no errors on a small test set of selected gastric biopsy patches. The Egyptian study reports retrospective patch classification, not clinical diagnostic validation, and has no external validation.

Type: Article · Topic: Digital pathology
Published: 2026-11-16T14:45:20+00:00
Updated: 2026-11-16T14:45:20+00:00
Canonical URL: https://www.pathologistsbrief.com/article/h-pylori-ai-patch-detection
Publisher: Pathologist’s Brief
Source: https://doi.org/10.3390/microorganisms14102207
Author: Editor
Reviewer: Pathologist’s Brief editorial team
Review date: 2026-11-16

## Why automate the search for H. pylori?

Small, unevenly distributed bacilli and obscuring mucus can make H. pylori detection on gastric biopsies time-consuming. The authors also describe variation between observers and limited access to specialist gastrointestinal pathologists as reasons to investigate automated support.

Hasona et al., in [Microorganisms, October 2026](https://doi.org/10.3390/microorganisms14102207), report a retrospective study by researchers in Egypt. Its central question was how different pretrained networks classify selected positive and negative tissue patches.

## How the patches were selected

The dataset comprised 100 whole-slide images from gastric biopsies in 50 patients at a single hospital. Material was stained with haematoxylin-eosin and Giemsa. The researchers generated 432 non-overlapping patches of 1024 × 1024 pixels, resized to 512 × 512 pixels for modelling.

Positive patches came exclusively from regions where a pathologist had located visible bacilli on positive slides. Negative patches came from negative slides across the tissue area. All patches underwent label review. Thus, a positive slide label was not automatically assigned to every patch from that slide.

Patients were separated before patch extraction, with 30 allocated to training, 10 to validation and 10 to testing. Patches from a given patient stayed within the same subset. There were 300 training patches, 66 validation patches and 66 test patches, with equal positive and negative patch counts in each subset. Stain representation was preserved, and augmentation was used only during training.

## What the comparison found

The study compared eight pretrained architectures, including convolutional networks and a vision transformer. Bayesian hyperparameter search selected training configurations. Pretrained feature-extraction layers were frozen, while the added classification head was trained.

Several convolutional networks achieved 100% test accuracy without misclassifications. The leading pair also achieved 100% sensitivity and specificity, with 33 true-positive and 33 true-negative patches and no errors. The authors give a 95% confidence interval of [94.6%, 100%] for perfect test accuracy, noting that the lower bound remains 94.6% despite the error-free result.

The vision transformer achieved 96.97% accuracy (95% CI [89.5%, 99.6%]). Another convolutional network achieved 74.24% accuracy, showing that the shared experimental protocol did not produce uniformly high performance.

Training efficiency differed within the leading pair: 10 min 12 s versus 23 min 40 s, described by the authors as 2.3 times faster. These are training times, rather than measurements of routine diagnostic turnaround.

## Why the perfect scores need caution

The authors explicitly describe the findings as retrospective patch-level classification, not clinical diagnostic validation. Positive patches were selected from confirmed bacteria-containing regions. This test therefore does not establish the ability to find sparse organisms across an unselected biopsy slide.

Patient-level separation reduces leakage between subsets, but all material came from the same hospital. There was no external validation, and the reported metrics reflect a single training run per architecture at its selected configuration. The authors recommend repeated training and larger multicentre validation.

Earlier literature cited in the paper reported an accuracy drop from 97% to 78% during external validation under unfamiliar staining and imaging conditions. That is a finding from earlier work, not an external test of the networks in this study.

## What reporting pathologists can take from it

The study shows that selected gastric tissue patches can be classified accurately under these experimental conditions, and that a computationally lighter network can match more demanding alternatives. It does not establish readiness for diagnosis or reliable detection in the difficult, scant-organism cases that motivate automation.

The authors call for independent multicentre datasets with varied staining, imaging and populations, followed by prospective clinical evaluation before clinical use. No external funding was received, and no conflicts of interest were declared.

## Frequently asked questions

### Could patches from the same patient appear in training and testing?
No, patches from each patient were kept within a single subset. Patients were assigned before patch extraction, reducing leakage from shared tissue appearances, staining and imaging features. This safeguard strengthens the internal comparison, although it cannot substitute for testing material collected independently at other centres.

### Did every patch from a positive slide count as positive?
No, positive patches were extracted only from regions containing visually identifiable bacilli. A pathologist located those regions and the labels were reviewed after extraction. This targeted selection avoids assigning infection to organism-free tissue, but it also limits what the experiment demonstrates about searching an entire biopsy.

### Does faster training mean faster diagnostic reporting?
No, the reported time comparison concerns model training rather than diagnostic turnaround. The leading pair reached the same error-free patch result with different training durations. The study did not validate a routine reporting workflow, and the authors require external testing and prospective clinical evaluation before clinical use.
