Histo-MExNet: A Unified Framework for Real-World, Cross-Magnification, and Trustworthy Breast Cancer Histopathology
Authors: Enam Ahmed Taufika, Md Ahasanul Arafatha, Abhijit Kumar Ghoshb, Md. Tanzim Rezab, Md Ashad Alamc
Organizations: European University of Bangladesh, Department of Computer Science and Engineering, Dhaka, Bangladesh · BRAC University, Department of Computer Science and Engineering, Dhaka, Bangladesh · Ochsner Center for Outcomes Research, Ochsner Research, Ochsner Clinic Foundation, New Orleans, LA, 70121, USA
Accurate and reliable histopathological image classification is essential for breast cancer diagnosis. However, many deep learning models remain sensitive to magnification variability and lack interpretability. To address these challenges, we propose Histo-MExNet, a unified framework designed for scaleinvariant and uncertainty-aware classification. The model integrates DenseNet, ConvNeXt, and EfficientNet backbones within a gated multi-expert architecture, incorporates a prototype learning module for example-driven interpretability, and applies physics-informed regularization to enforce morphology preservation and spatial coherence during feature learning. Monte Carlo Dropout is used to quantify predictive uncertainty. On the BreaKHis dataset, Histo-MExNet achieves 96.97% accuracy under multi-magnification training and demonstrates improved generalization to unseen magnification levels compared to single-expert models, while uncertainty estimation helps identify out-of-distribution samples and reduce overconfident errors, supporting a balanced combination of accuracy, robustness, and interpretability for clinical decision support.
Figures & tables
Magnification Level
Benign
Malignant
Total
40 ×
625
1370
1995
100 ×
644
1437
2081
200 ×
623
1390
2013
400 ×
588
1232
1820
Total Images
2480
5429
7909
Total Patients
24
58
82
Table 1: Summary of the BreaKHis dataset, detailing the number of benign and malignant histopathology images across four magnification levels.
Benign Tumors
Malignant Tumors
Adenosis – Non-cancerous proliferation of glandular structures within the breast lobules.
Ductal Carcinoma – Malignant tumor arising from epithelial cells of the milk ducts.
Fibroadenoma – Well-circumscribed benign mass composed of fibrous and glandular tissue.
Lobular Carcinoma – Invasive malignancy originating from the lobules, often with diffuse infiltration.
Phyllodes Tumor – Rare fibroepithelial lesion with variable behavior and potential for recurrence.
Mucinous Carcinoma – Malignancy characterized by abundant extracellular mucin production.
Tubular Adenoma – Benign tumor consisting of tightly packed tubular structures with minimal atypia.
Table 2: Overview of the benign and malignant histopathological subtypes represented in the BreaKHis dataset.
Figure 1: Representative subset of the BreaKHis dataset illustrating all eight tumor subtypes across four magnification levels ( 40× , 100× , 200× , and 400× ). Each column stands for a particular form of tumor, and each row stands for a different level of magnification. This shows how tissue morphology and cellular detail change at different scales.
Figure 2: Overview of the proposed Histo-MExNet framework.Features are extracted using DenseNet201, the most effective backbone, as part with CBAM attention. These features are mapped to a prototype-aligned space and processed by several expert classifiers. The outputs of these classifiers are adaptively fused by a gating network to produce the final prediction.
Table 3: Comparison between baseline CNN architectures evaluated under Type 1 experimental settings, where models are trained and tested on the same magnification level using a random split on each type of magnification.
Figure 3: t-SNE visualization comparing how well the baseline CNNs and the proposed model using the DenseNet201 backbone separate features at a 100× magnification.
Backbone Model
Metric
Type 1: Same-Magnification
Type 2: Cross-Magnification
40X
100X
200X
400X
40X
200X
400X
DenseNet201
Accuracy
98.25%
96.88%
92.80%
88.46%
73.08%
71.93%
51.15%
F1-Score
0.983
0.969
0.927
0.881
0.716
0.690
0.393
ConvNeXt-Tiny
Accuracy
95.74%
97.84%
92.8%
90.66%
78.25 %
73.27%
51.37%
F1-Score
0.956
0.978
0.926
0.906
0.776
0.708
0.397
EfficientNetV2-S ↓
Accuracy
95.99%
92.09%
93.55%
89.84%
67.92%
72.03%
55.22%
Table 4: Performance of the proposed Histo-MExNet framework under Same-Magnification (Type 1) and Cross-Magnification (Type 2) experimental settings.
Figure 4: Comprehensive visual analysis of predictive reliability. Row 1 (a-d): Cross-magnification generalization (trained at 100× , evaluated at 40× ) comparing uncertainty and confidence distributions. Row 2 (e-h): Multi-magnification evaluation comparing variance and predictive confidence (U vs C) correlations for models trained and evaluated on data across all magnification levels.
Backbone Model
Accuracy
W-Precision
W-Recall
W-F1 Score
DenseNet201 ⋆
96.97%
0.9703
0.9697
0.9698
ConvNeXt-Tiny
93.49%
0.9352
0.9349
0.9347
EfficientNetV2-S
93.93%
0.9395
0.9393
0.939
Table 5: Performance metrics of the proposed Histo-MExNet framework under the Type 3 experimental setup, which combines all magnification levels for training and tests on a stratified split.
Figure 5: Confusion matrix for the DenseNet201 backbone under Type 3 experimental condition, trained on mixed data from all magnifications and assessed on a stratified test split.
Histological Subtype
40X
100X
200X
400X
mean
max
mean
max
mean
max
mean
max
Benign
Adenosis
1.44
4.6
0.96
3
1.68
4
1.16
4.8
Fibroadenoma
.94
2.4
0.86
3.4
.96
2.8
2.66
5.6
Phyllodes Tumor
0.9
3
1.12
3.6
1.2
4.6
0.58
1.2
Tubular Adenoma
1.26
3.2
1.78
3.28
0.98
3.2
1.68
5.8
Table 6: Quantitative Analysis of Occlusion Sensitivity Features by Class and Magnifications
Figure 6: Occlusion sensitivity study in Ductal Carcinoma. The rows indicate magnification levels of 40× , 100× , 200× , and 400× . Columns display the input picture, occlusion sensitivity map, and overlay. The red zones emphasize the individual tissue properties that have the most influence on the model’s categorization choice, with confidence ratings for each scale.
Method
40X
100X
200X
400X
All-Mag
ES-CNN [ 50 ] ↓
83.46%
79.62%
82.13%
78.3%
79.01%
HF+DNN [ 51 ]
90.87%
89.57%
91.58%
88.67%
-
CSDCNN [ 52 ]
89.4%
90.8%
88.6%
87.6%
-
Histo-MExNet ⋆
98.25%
96.88%
92.8%
88.46%
96.97%
Table 7: Comparative analysis of classification accuracy (%) between existing state-of-the-art methods and the proposed Histo-MExNet across four individual magnifications ( 40×,100×,200×,400× ) and the combined all-magnification setting.
Variant
Accuracy (%)
W-Precision
W-Recall
W-F1
Histo-MExNet
96.97
0.9703
0.9697
0.9698
A1
93.05
0.9303
0.9305
0.9296
A2
90.49
0.9051
0.9049
0.9048
A3
91.81
0.9175
0.9181
0.9176
A4
92.62
0.9259
0.9262
0.9259
Table 8: Ablation study of Histo-MExNet evaluating the impact of key components on classification performance. The table reports Accuracy, Weighted Precision, Weighted Recall, and Weighted F1-Score for the full model and variants with specific components removed, including ensemble learning (A1), hybrid loss (A2), attention module (A3), and prototype module (A4). This analysis highlights the individual contribution of each module to the overall model effectiveness.
Breast cancer is one of the most common types of cancer among women around the world. Rapid detection and early treatment can hinder its progress to more complex stages and can impede its spread to other parts of the body. Histopathological image classification is the most common task in cancer detection due to its robustness in analyzing cellular data. Breast histopathology classification requires handling both multi-scale tissue morphology and clinically relevant generalization beyond the source domain. This paper presents MagViT, an interpretable multi-magnification transformer framework with scale-gated fusion and patient-level model selection. The model uses four BreakHis magnifications (40X, 100X, 200X, 400X) and extracts per-scale representations with a ViT backbone, and combines them via a learnable gate that masks missing scales. Patient-level five-fold cross-validation with a fixed seed has been run and compared with three architectural branches. The most accurate branch is then selected as the final model due to the strongest patient-level accuracy while retaining the simplest fusion pathway. On BreakHis, our architecture achieves a mean image accuracy of 0.9191, a mean patient accuracy of 0.9643, and a mean macro-F1 of 0.9042. External transfer experiments provide preliminary evidence of cross-dataset generalization under controlled adaptation settings on BUSI (image accuracy 0.8306, macro-F1 0.7480, patient accuracy 0.8291) and IDC (image accuracy 0.8577, macro-F1 0.8191, patient accuracy 0.8372). Grad-CAM visualization indicates that the model focuses on diagnostically significant and meaningful regions across magnifications. Relative to prior ViT-centered BreakHis work, this study emphasizes patient-level selection and cross-dataset robustness under a reproducible protocol.
Nabil Ashab, Soumit Kumar Kundu, Saif Mahmud Parvez +3
Department of Computer Science and Engineering, Dhaka International University, Dhaka, Bangladesh · Department of Microbiology, TMSS Medical College, Bogura, Bangladesh
Magnification shift is a major obstacle to robust histopathology classification, because models trained on one imaging scale often generalize poorly to another. Here, we evaluated this problem on the BreaKHis dataset using a strict patient-disjoint leave-one-magnification-out protocol, comparing supervised baseline, baseline augmented with DCGAN-generated patches, and a gradient-reversal domain-general model designed to preserve discriminative information while suppressing magnification-specific variation. Across held-out magnifications, the domain-general model achieved the strongest overall discrimination and its clearest gain was observed when 200X was held out. By contrast, GAN augmentation produced inconsistent effects, improving some folds but degrading others, particularly at 400X. The domain-general model also yielded the lowest Brier score at 0.063 vs 0.089 at baseline. Sparse embedding analysis further revealed that domain-general training reduced average signature size more than three-fold (306 versus 1,074 dimensions) while preserving equivalent predictive performance (AUC: 0.967 vs 0.965; F1: 0.930 vs 0.931). It also increased cross-fold signature reproducibility from near-zero Jaccard overlap in the baseline to 0.99 between the 100X and 200X folds. These findings show that calibrated, compact, and transferable representations can be learned without added architectural complexity, with clear implications for the reliable deployment of computational pathology models across heterogeneous acquisition settings.
Histopathology remains the gold standard for cancer diagnosis because it provides detailed cellular-level assessment of tissue morphology. However, manual histopathological examination is time-consuming, labour-intensive, and subject to inter-observer variability, creating a demand for reliable computer-assisted diagnostic tools. Recent advances in deep learning, particularly transformer-based architectures, have shown strong potential for modelling complex spatial dependencies in medical images. In this work, we propose DeepHistoViT, a transformer-based framework for automated classification of histopathological images. The model employs a customized Vision Transformer architecture with an integrated attention mechanism designed to capture fine-grained cellular structures while improving interpretability through attention-based localization of diagnostically relevant regions. The framework is evaluated on three publicly available histopathology datasets covering lung cancer, colon cancer, and acute lymphoblastic leukaemia. Experimental results demonstrate state-of-the-art performance across all datasets, with classification accuracy, precision, recall, F1-score, and ROC-AUC reaching 100 percent on the lung and colon cancer datasets, and 99.85 percent, 99.84 percent, 99.86 percent, 99.85 percent, and 99.99 percent respectively on the acute lymphoblastic leukaemia dataset. All performance metrics are reported with 95 percent confidence intervals. These results highlight the effectiveness of transformer-based architectures for histopathological image analysis and demonstrate the potential of DeepHistoViT as an interpretable computer-assisted diagnostic tool to support pathologists in clinical decision-making.
Ravi Mosalpuri, Mohammed Abdelsamea, Ahmed Karam Eldaly