Magnification-independent breast cancer diagnosis using a GWO-enhanced vision transformer with multi-stage stain normalization

T Taiyaba Fatma P Prabhat Kumar Sahu S Sasanka Choudhury A Aneesh Wunnava

Abstract

Abstract Breast cancer diagnosis from histopathological images remains a critical yet challenging task due to staining variability, magnification differences, and complex tissue morphology. This study presents a comprehensive preprocessing, balancing, and classification framework for the BreakHis dataset, integrating advanced stain normalization, magnification-wise augmentation, and an optimized Vision Transformer architecture. A four-stage normalization pipeline comprising CLAHE, histogram matching, Shades-of-Gray correction, and Macenko stain normalization was developed to standardize color distribution and enhance structural clarity across 7909 images. To address severe class imbalance, a targeted magnification-specific augmentation strategy expanded the dataset to 11,848 images with equal benign and malignant representation. A Vision Transformer (ViT) model was designed for each of the four magnifications (40X, 100X, 200X, 400X), and further optimized using the Grey Wolf Optimizer (GWO) to automatically tune hyperparameters such as transformer depth, attention heads, embedding dimensions, dropout, and learning rate. Experimental results demonstrate high and consistent performance across magnifications, with accuracies of 92.1%, 92.9%, 93.5%, and 94.0%, respectively. Cross-validation reveals minimal variance, confirming model robustness and generalization. The proposed GWO-ViT framework establishes a reliable, magnification-invariant, and computationally efficient solution for automated breast cancer histopathology classification, offering strong potential for clinical integration.

Article Details

Volume / Issue Vol. 16, Issue 1
Published March 04, 2026
ISSN 2045-2322
Publisher Nature Portfolio

Journal Info

Scientific Reports

Nature Portfolio

ISSN: 2045-2322 Open Access Life Sciences

Authors (4)

T

Taiyaba Fatma

P

Prabhat Kumar Sahu

S

Sasanka Choudhury

A

Aneesh Wunnava