Multi-Class Gastric Histopathology Classification Using a Hybrid Swin Transformer–ConvNeXt Model
Abstract Diagnosing gastric cancer still depends, for the most part, on a pathologist looking at stained tissue slides under a microscope. The disease kills roughly 660{,}000 people every year, and although early detection makes a real difference to survival, manual slide reading is slow and two experts examining the same slide do not always agree. In this work we built a system that tries to ease that burden. We trained a hybrid deep learning model on the Gastric Cancer Histopathology Tissue Image Dataset (GCHTID), pairing a Swin Transformer, which is good at picking up the broad structural layout of a tissue patch, with a ConvNeXt network, which captures the fine local textures where early malignant changes tend to hide. Every image first passes through a simple preprocessing chain of median filtering and CLAHE contrast enhancement, a combination we settled on after comparing several denoising and enhancement options. The ensemble sorts each patch into one of eight classes: tumor tissue (TUM) plus seven benign types-adipose, debris, lymphocytes, mucus, smooth muscle, normal mucosa, and stroma. On held-out data it reached 75.35% test accuracy (88.76% training, 76.99% best validation), beating the single-model baselines we tried, including ViT and EfficientNet-B3. To make the model usable outside a notebook, we wrapped it in a Flask REST API and a small web interface where a user can upload a slide image, see the prediction and its confidence, download a PDF report, and look back through past results. The system is a research prototype rather than a clinical tool, but the results suggest that combining transformer and convolutional features is a workable direction for computer-assisted pathology.
Authors
- Rana Fayyaz Ahmad (ORCID: https://orcid.org/0000-0001-8197-8403)
- Muhammad Junaid Asif (ORCID: https://orcid.org/0000-0002-3875-0777)
- Muhammad Ahsan Aziz
- Usman Nazakat
- Uzair Khan
- Muhammad Saad
Institutions
- Quaid-i-Azam University (PK)
- Centre for Artificial Intelligence and Robotics (IN)
- Artificial Intelligence in Medicine (Canada) (CA)
- Pak-Austria Fachhochschule: Institute of Applied Sciences and Technology (PK)
Publication Details
- Journal
- Research Square
- Published
- 2026-11-12
- DOI
- https://doi.org/10.21203/rs.3.rs-11703260/v1
- Primary Topic
- AI in cancer detection
- Type
- preprint
Funders
- National Centre for Physics