Manuscript Offprint
arXiv:2610.37026Interpretable Deep Learning Models for Breast Cancer Diagnosis Using Medical Imaging
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Sami Alnawali
Information Systems Department
College of Computer Science and Information Technology
King Faisal University, Alahsaa, Saudi Arabia
Abdul Hadi
Department of Robotics & Artificial Intelligence
Shaheed Zulfikar Ali Bhutto Institute
of Science and Technology
Islamabad, Pakistan
Akhtar Jamil
Department of Computer Science
National University of Computer and Emerging Sciences
Islamabad, Pakistan
Muhammad Atif Saeed
Department of Artificial Intelligence & Data Science
National University of Computer and Emerging Sciences
Islamabad, Pakistan
Azka Atiq
Department of Artificial Intelligence & Data Science
National University of Computer and Emerging Sciences
Islamabad, Pakistan
Ahmad Din
Department of Artificial Intelligence & Data Science
National University of Computer and Emerging Sciences
Islamabad, Pakistan
ABSTRACT
Breast cancer continues to be a leading cause of mortality among women globally, highlighting the necessity for precise and comprehensible diagnostic tools. Although deep learning demonstrates significant potential, several current methodologies emphasize accuracy at the expense of interpretability, hence limiting their clinical applicability. To tackle this issue, we established a thorough framework that assesses ten advanced transfer learning models ResNet50, VGG19, InceptionV3, DenseNet121, Xception, MobileNetV2, EfficientNetV2S, EfficientNet-B7, Vision Transformer, and Swin Transformer, using the BreakHis dataset for automated breast cancer classification. All models underwent pretraining on ImageNet and were subsequently fine-tuned using bespoke classification heads, strengthened by comprehensive preprocessing and data augmentation methods including rotation, flipping, zooming, normalization, and contrast enhancement to increase generalization. To improve transparency, explainable AI (XAI) techniques such as Grad-CAM, LIME, SHAP, and LRP were utilized to display distinguishing histological features, emphasizing nuclei-rich and glandular areas aligned with clinical significance. Experimental results indicated that DenseNet121 attained superior performance, achieving a test accuracy of 99.4% and an AUC-ROC of 0.9997 across various magnifications, whilst EfficientNet also exhibited robust performance with an accuracy of 98.5% and continuously low false positive rates. Transformer-based models as Swin Transformer and ViT demonstrated strong generalization in intricate scenarios, while the lightweight MobileNetV2 provided competitive performance for implementation in resource-constrained settings. This study demonstrates the efficacy of integrating advanced transfer learning with explainable artificial intelligence to provide clinically relevant and interpretable frameworks for breast cancer detection. Future work will extend this framework to include multi-modal datasets, detailed tumor subtyping, and more advanced explainable artificial intelligence techniques to augment diagnostic reliability and facilitate clinical adoption.
Keywords Breast cancer · Histopathology · BreakHis · Transfer learning · Vision transformers · Explainable AI
Corresponding author.
These authors contributed equally to this work.
1 Introduction
Breast cancer is among the most common and lethal malignancies impacting women globally. The World Health Organization reports over 2.3 million new cases and over 680,000 deaths per year, establishing it as a primary cause of cancer-related mortality in women[1]. Timely and precise identification of breast cancer is crucial for enhancing treatment efficacy, survival probabilities, and the overall quality of life for patients[2]. Traditional diagnostic methods, including mammography, histological examination, and ultrasound imaging, while useful, are prone to inter-observer variability, necessitate professional interpretation, and may overlook small abnormalities in the early stages[3]. These constraints have catalyzed the integration of artificial intelligence (AI) and deep learning (DL) methodologies in medical imaging to aid radiologists in achieving precise and prompt diagnosis[4], [5].
Deep learning, especially convolutional neural networks (CNNs), has demonstrated exceptional efficacy in visual recognition tasks, encompassing medical image classification, segmentation, and detection[6]. Numerous research have utilized CNN architectures, including VGG, ResNet, Inception, and DenseNet, for breast cancer classification, with remarkable accuracy[1]. Nonetheless, these models frequently necessitate substantial quantities of annotated training data and considerable computational resources, posing challenges in the medical field where labeled data is limited and costly to obtain[7]. Furthermore, deep learning models are often criticized for their opacity and lack of interpretability, presenting a substantial obstacle to clinical implementation[8]. Comprehending the rationale behind a model's decision-making process is essential in healthcare applications, as erroneous predictions can lead to severe repercussions[9].
To mitigate data scarcity and enhance model generalisability, transfer learning has emerged as an effective technique that facilitates the utilization of pretrained models on extensive datasets (e.g., ImageNet) for domain-specific applications such as breast cancer classification[10], [11]. Transfer learning decreases computational demands and training duration while improving performance on limited, specialized medical datasets. The use of Explainable Artificial Intelligence (XAI) techniques, including Grad-CAM, LIME, SHAP, and XRAI, has created new opportunities for visualizing model behavior, enhancing clinician trust, and streamlining regulatory approval[7], [12].
This paper presents a comprehensive and interpretable deep learning framework that integrates various transfer learning models with explainable artificial intelligence methodologies for robust breast cancer classification[8]. We assess ten cutting-edge models, ResNet50, VGG19, InceptionV3, DenseNet121, Xception, MobileNetV2, EfficientNetV2S, EfficientNet-B7, Vision Transformer (ViT), and Swin Transformer, across four prevalent breast cancer datasets[13]. To improve model performance and generalisation, we employ customised data augmentation methods, normalisation, and patch-based image preprocessing[4]. Additionally, we incorporate various XAI techniques to deliver both local and global interpretability, assisting physicians in comprehending the reasoning behind the model's predictions[3].
The subsequent sections of this work are structured as follows: Section 1 delineates the pertinent literature and recent progress in deep learning for breast cancer diagnosis. Section 2 delineates the datasets employed, encompassing their structure, clinical context, and preparation procedures. Section 3 delineates the methodology, encompassing model architectures, transfer learning procedures, data augmentation techniques, and explainability methods. Section 4 delineates the experimental configuration and assessment criteria. Section 5 examines the outcomes derived from various models and datasets. Section 6 ultimately summarises the paper by presenting insights, limitations, and prospective future directions.
Silva-Aravena et al. [2023][14] introduced a hybrid machine learning and explainable artificial intelligence system for the early prevention of breast cancer, utilizing risk factor analysis on an Indonesian dataset of 400 persons (200 cases and 200 controls). The system utilized an XGBoost ensemble, compared with logistic regression, SVMs, and random forests, following the CRISP-ML(Q) framework to guarantee transparency and quality[7]. Preprocessing encompassed feature encoding and stratified division of lifestyle and reproductive variables, resulting in 85% accuracy. SHAP explanations identified high-fat diet, absence of breastfeeding, and familial predisposition as significant risk factors; but, the study's limited, self-reported dataset constrains generalisability.
Nasir et al. [2025][15] performed a comparative deep learning analysis on the Breast Cancer Wisconsin Diagnostic Dataset (569 cases, 33 tumor characteristics), assessing CNNs, RNNs, MLPs, and hybrid models (CNN+LSTM, CNN+MLP), in addition to pretrained VGG16, ResNet, and EfficientNet[4]. Preprocessing encompassed normalization, feature correlation analysis, and stratified partitioning, while data insufficiency was mitigated through augmentation (rotation, flipping, contrast adjustment), SMOTE, and GAN-based synthesis. Grad-CAM and SHAP were utilized for interpretability, with CNN+LSTM attaining the highest accuracy (98.2%), illustrating the efficacy of integrating spatial and sequential feature learning. Nonetheless, the study was constrained by the size of the dataset, the lack of image inputs, and diminished generalizability to clinical imaging[7].
Patho-Net [16] introduced a GRU-augmented U-Net segmentation framework for breast cancer histopathology, utilizing the BreakHis dataset of 2,048 pictures at magnification. The pipeline utilized Reinhard color normalization with automated reference selection, EANLM noise reduction, and I-GLCM-based feature extraction, culminating in GRU-based classification[3]. It attained an accuracy of 98.9%, precision and recall of 98.6%, and specificity of 99%, with Grad-CAM and XRAI augmenting interpretability. Notwithstanding its robust performance, the model was confined to binary classification and depended on a resource-intensive preprocessing procedure, hence limiting cross-domain generalization.
Kabir et al. [2025] [17] introduced a deep learning framework for the classification of breast cancer utilizing the BUSI ultrasound dataset, which comprises 780 pictures categorized as benign, malignant, and normal. Four pretrained CNNs—EfficientNetV2S, EfficientNetV2M, InceptionResNetV2, and XceptionNet[1] were fine-tuned utilizing scaling, flipping, rotation, zooming, and stratified splitting techniques. To enhance interpretability, Faster Score-CAM and LIME were utilized, emphasizing critical diagnostic areas. EfficientNetV2S attained superior performance (91.02% accuracy, precision 0.92, recall 0.91, F1-score 0.91); however, dataset size, class imbalance, and absence of external validation limited generalizability[18].
Talukder [2025] [19] proposed an improved DenseNet169 model for breast cancer histopathology, validated on the BreakHis (40×−400×), BACH, and BHI datasets. Preprocessing encompassed resizing (256×256), sharpening, normalization, and label encoding, along with augmentation by ±20° rotation, shifting, and flipping. Class Activation Mapping (CAM) and saliency maps were utilized for interpretability. The model attained 99.5% accuracy on BreakHis 40×, 98.8% on 100×, 97.3% on 200×, 96.9% on 400×, 94.8% on BACH, and 88% on BHI; nonetheless, difficulties remained in categorizing benign cases at elevated magnifications, highlighting the necessity for clinical validation.
Sharmi et al. [2025] [20] proposed an explainable framework for breast cancer diagnosis utilizing thermal images from the DMR dataset, comprising 2,010 samples. The pipeline integrated Attention U-Net for segmentation, K-Means clustering for region extraction, and EfficientNet-B7 for classification, incorporating preprocessing processes such as resizing (224×224), masking, and array conversion[5]. LIME was utilized for interpretability based on superpixels. The model attained a training accuracy of 96.5%, a validation accuracy of 91.7%, a recall of 91.9%, a specificity of 91.4%, a precision of 89.9%, and an F1-score of 90.9%. However, its generalizability was constrained by class imbalance, demographic bias, and insufficient cross-validation[12].
An ensemble-based transfer learning method[21] for breast cancer diagnosis utilizing ultrasound imagery was presented in IEEE Access [2024]. The research employed a dataset including 780 photos classified into benign, malignant, and normal categories, obtained from UCI and Kaggle. The authors employed an ensemble stacking technique to improve classification, integrating pretrained CNNs (InceptionV3, VGG16, VGG19) with machine learning classifiers, including MLPs and SVMs[8]. Preprocessing encompassed resizing, cropping, normalization, and data supplementation to enhance image quality and model resilience. The optimal ensemble model, utilizing InceptionV3 with stacking, attained an accuracy of 85.77% and an AUC of 0.947, underscoring its diagnostic efficacy[22]. Nonetheless, the approach failed to incorporate explainable AI (XAI) methodologies such as Grad-CAM or SHAP, which are essential for clinical transparency, and its scalability to extensive, heterogeneous ultrasound datasets has yet to be investigated[9].
3 Research Gap
Although substantial advancements have been made in deep learning for breast cancer classification, current research frequently prioritizes accuracy over interpretability, so limiting medical applicability. The integration of XAI approaches (e.g., Grad-CAM, LIME, SHAP) is superficial and inconsistent among architectures, while dependence on a singular dataset limits generalizability. Histopathology datasets, like BreakHis and BACH, exhibit class imbalance, while mammography datasets such as CBIS-DDSM and INbreast are inadequately employed for cross-model comparisons. Moreover, there is a paucity of benchmarks involving both CNNs and transformer-based models (ResNet, EfficientNet, MobileNet, Xception, ViT, Swin Transformer), and the synergistic impact of augmentation and preprocessing on interpretability remains little examined. This study fills these gaps by doing a thorough assessment of transfer learning models utilizing several XAI methodologies to establish a transparent, precise, and clinically dependable diagnostic framework.
4 Proposed Methodology
4.1 Dataset
In this paper, we will use the BreakHis (Breast Cancer Histopathological Image Classification) dataset which is one of the most popular benchmarks of 7,909 images of 82 patients with 40, 100, 200, and 400 magnifications of both benign and malignant tumor cells. In order to guarantee methodological rigor and prevent data leakage, a patient-level strict splitting strategy was utilized, and pictures of a patient were only used in training (70%), validation (20%), or testing (10%) sets, which ensured that no overlap occurred between splits and simulated clinical conditions in real-life. The data has an inherent imbalance of classes and this was overcome by using weighted sampling methodology in training. All the images were subjected to a standardized processing procedure that included resizing (224x224 or 299x299 based on the needs of the model), ImageNet normalization, and augmentation as rotation, flipping, zooming, and contrast adjustment to enhance generalization. Also, evaluations of the magnification specifics were performed to measure the robustness of various magnifications of images. In spite of these measures, there can still be intra-patient and inter-magnification similarities in the dataset, thus, can bring subtle correlations, this is a limitation that is noted in order to make the results transparently reported and carefully interpreted.
4.2 Data Augmentation
This study utilizes customized data augmentation techniques to enhance generalization and reduce overfitting in deep learning models for breast cancer classification, addressing the lack of labeled medical images and class imbalance[23]. Augmentations have been proposed to maintain diagnostic integrity while improving robustness: rotation ( ) to establish rotational invariance, horizontal/vertical flipping to enhance spatial diversity[3], shearing to replicate distortions from scanning or tissue preparation, zooming ( ) to represent scale variations across magnifications[23], and contrast adjustment to accommodate discrepancies in staining and lighting conditions[24]. Bilinear interpolation was employed during scaling and translating to maintain smooth transitions and reduce aliasing problems[12]. These augmentations collectively mimic real-world variability, allowing models to learn invariant, clinically significant characteristics that enhance classification performance across various imaging settings.
4.3 Transfer Learning
Transfer learning has become a potent approach in medical image analysis, especially in contexts with scarce labelled data. Transfer learning utilises deep neural networks pretrained on extensive datasets like ImageNet to generate robust, generalisable characteristics that may be refined for specific applications, such as breast cancer prediction. This work utilised many advanced pretrained models, including ResNet, VGG, DenseNet, EfficientNet, Xception, MobileNet, and vision transformer architectures, to evaluate their efficacy in breast cancer detection and classification. The models were modified by substituting their final classification layers and fine-tuning specific layers on target datasets to enhance performance for the particular diagnostic task.
4.3.1 DenseNet121
This study utilized DenseNet-121, a densely connected convolutional neural network pre-trained on ImageNet, as the foundation for classifying breast cancer histopathology images. The architecture utilizes extensive connectivity, allowing each layer to receive inputs from all prior levels, thus enhancing gradient flow, optimizing parameter efficiency, and alleviating vanishing gradient problems. The backbone consists of four dense blocks (6, 12, 24, and 16 layers, growth rate = 32) interspersed with transition layers utilizing convolutions and average pooling, culminating in global average pooling[25], [26]. A bespoke classifier head was incorporated, comprising a fully connected layer (1024→512) with ReLU activation, dropout (p=0.5) for regularization, and a concluding dense layer (512→2) generating logits for binary classification (benign versus malignant)[2]. Input photos were downsized to , normalized, then augmented by random rotations, shifts, scaling, and flips to improve generality. The model underwent fine-tuning utilizing Label Smoothing Cross-Entropy loss ( ), optimized via AdamW (weight decay = 0.01) with differential learning rates, and trained employing Cosine Annealing Warm Restarts[25], [26]. Supplementary regularization encompassed RandAugment and gradual layer unfreezing. Training was conducted with a batch size of 32 over 50 epochs, incorporating early stopping (patience = 15, monitored on validation F1-score).
4.3.2 EfficientNet
This study utilized EfficientNet, a scalable convolutional neural network created by Google AI, owing to its exceptional balance between accuracy and computational efficiency in medical image classification[10], [27]. The model uses the compound scaling method, which uniformly adjusts network depth, width, and input resolution, and is constructed using MBConv (Mobile Inverted Residual Bottleneck) blocks integrated with squeeze-and-excitation (SE) modules for channel-wise recalibration. We specifically fine-tuned EfficientNet-B0 and its larger variants (EfficientNetV2S and EfficientNet-B7), which were pretrained on ImageNet, by substituting the classifier head with a bespoke binary classification architecture[28]. The backbone generated 1280 feature maps, which underwent global average pooling, succeeded by dropout (p = 0.5), a fully connected layer (1280 → 512, ReLU), an additional dropout, and a concluding linear layer (512 → 2) to yield logits for benign and malignant classifications. The training utilized Cross Entropy Loss with label smoothing and softmax activation during inference. To mitigate overfitting and enhance resilience, input photos were downsized (224×224 or 380×380), normalized, and subjected to augmentation by random flipping, zooming, shifting, and rotation with Keras' ImageDataGenerator[28]. The model underwent training with a progressive unfreezing of the pretrained backbone and varying learning rates, resulting in roughly 4 million trainable parameters post fine-tuning.
4.3.3 ConvNeXt
Using the BreakHis dataset, we optimized ConvNeXt, a state-of-the-art CNN architecture that draws inspiration from ResNet and Vision Transformers, for the purpose of breast cancer histological picture categorization. ConvNeXt maintains CNN inductive biases, such as locality and translation equivariance, while integrating transformer-inspired design elements, including extensive kernel depthwise convolutions, inverted bottlenecks, Layer Normalization, GELU activation, stochastic depth, AdamW optimization, and cosine learning rate scheduling[29], [30]. We employed the ConvNeXt-Tiny/Base variation pretrained on ImageNet-21k and substituted the classification head with a bespoke architecture using LayerNorm, GELU activation, dropout (p=0.5), and fully connected layers (768 → 512 → 2) for the binary classification of benign and malignant instances. Input photos were reduced to 224×224 pixels, normalized with ImageNet statistics, and augmented by RandAugment (n=2, m=10), random cropping, color jittering, flipping, and rotation, while test-time augmentation (TTA) was utilized for enhanced inference robustness[30]. Training utilized label-smoothing cross-entropy (smoothing=0.1), the AdamW optimizer (weight decay=0.01), cosine annealing for learning rate scheduling, and mixed-precision training, alongside a gradual unfreezing of backbone layers to modify pretrained features[31]. The model comprised around 28.6 million trainable parameters.
4.3.4 ResNet
This study utilized the fine-tuning of a ResNet-50 backbone, pretrained on ImageNet, for the classification of breast cancer utilizing the BreaKHis dataset. The input photos were downsized to RGB, normalized using ImageNet statistics, and augmented by flipping, rotation, zooming, and RandAugment[32]. The backbone (about 23.5 million parameters) was initially fixed and subsequently unfixed with varying learning rates, while the custom classifier head (approximately 1.05 million parameters) comprised fully connected layers of with ReLU activation and a dropout rate of 0.5[33]. The training employed CrossEntropyLoss with label smoothing, the Adam optimizer, and cosine annealing with warm restarts, while the assessment metrics comprised accuracy, precision, recall, specificity, F1-score, and AUC-ROC[32]. To improve interpretability, Grad-CAM, LIME, SHAP, and LRP were combined for visualizing decision boundaries.
4.3.5 InceptionV3
The study used InceptionV3, a deep convolutional neural network architecture designed for effective multi-scale feature extraction, as a transfer learning model for breast cancer classification[34]. InceptionV3 enhances the original GoogLeNet by integrating factorized convolutions, auxiliary classifiers, asymmetric filters (1×7 and 7×1), and batch normalization, hence facilitating computational efficiency and superior generalization. The model employs Inception modules that concurrently process various convolution filters (1×1, 3×3, 5×5), effectively capturing both local and global representations[1]. In our approach, the pretrained backbone was initialized using ImageNet weights, and the final classification head was substituted with a dense block (2048→512→2) with ReLU activation and dropout (p=0.5), in addition to a modified auxiliary classifier. Histopathology photos were downsized to 299×299, normalized using ImageNet statistics, and augmented with RandAugment, including cropping, flipping, rotating, zooming, and color jittering[34]. Training utilized the AdamW optimizer, label smoothing cross-entropy, cosine annealing warm restarts, mixed precision, and a gradual unfreezing of backbone layers for stable fine-tuning[1].
4.3.6 VGG19
This research used VGG-19, pretrained on ImageNet, as a transfer learning model for the classification of breast cancer. The backbone, consisting of 16 convolutional and 5 pooling layers (about 20 million parameters), was initially frozen and subsequently fine-tuned using differential learning rates and a gradual unfreezing approach[35]. The initial head was substituted with a bespoke classifier (102.8M parameters) comprising Linear (25088→4096→4096→512→2) layers, ReLU activations, and several dropout layers (p=0.5) for regularization purposes. The input photos were downsized to 224×224, normalized, and augmented using RandAugment, along with cropping, flipping, rotation, and color jittering[10]. The training employed Label Smoothing Cross-Entropy (smoothing=0.1), the AdamW optimizer, cosine annealing warm restarts, AMP mixed-precision, and early halting, resulting in about 122.8 million trainable parameters optimized for histopathology picture classification[35].
4.3.7 MobileNetV2
This research utilized MobileNetV2, a lightweight convolutional neural network optimized for processing efficiency by depthwise separable convolutions and inverted residual bottlenecks with linear projections[31]. The model accepts RGB inputs, commencing with a convolution (32 filters, stride 2), succeeded by a series of 17 bottleneck layers incorporating expansion through convolutions, depthwise filtering, and projection layers. Each block integrates ReLU6 activations and residual shortcuts when the input and output dimensions are congruent[1]. The backbone generates 1280 feature maps, which are subsequently processed by a global average pooling layer and a bespoke classifier head (Linear 1280→512, ReLU, Dropout 0.5, Linear 512→2) for binary classification. MobileNetV2, with around 3.5 million parameters, attains a balance between precision and low complexity, rendering it appropriate for medical imaging applications where efficiency and scalability are paramount[36], [24].
4.3.8 Vision Transformer (ViT)
This study utilized a Vision Transformer (ViT-B/16) pretrained on ImageNet-21k and subsequently fine-tuned for breast cancer categorization[37]. Input images (3×224×224) were segmented into 16×16 non-overlapping patches, resulting in 196 tokens embedded in 768-dimensional vectors, together with an additional learnable class token and positional embeddings[38]. The sequence underwent processing through 12 transformer encoder blocks, each consisting of multi-head self-attention (12 heads), MLP layers (hidden=3072, GELU), LayerNorm, residual connections, and dropout (p=0.1). The ultimate representation underwent LayerNorm, followed by a bespoke classifier head incorporating LayerNorm, Linear (768→512), GELU, Dropout, and Linear (512→2) for binary classification[39]. The architecture comprised over 86 million parameters, with around 400,000 derived from the custom head, facilitating efficient fine-tuning on histopathological pictures while maintaining the ViT's robust feature extraction and contextual modeling abilities[36], [40].
4.3.9 Swin Transformer (Shifted Window Transformer)
This research used the Swin Transformer Tiny, a hierarchical vision transformer pretrained on ImageNet-1K, for the classification of breast cancer images[41], [40]. Input images (3×224×224) were divided into 4×4 patches and transformed into 768-dimensional tokens, which underwent four steps of shifted window-based multi-head self-attention (W-MSA, SW-MSA), residual connections, LayerNorm, and MLPs with GELU activations. Patch merging systematically diminished resolution while augmenting channel depth (768→1536→3072)[41]. The backbone output, a 3072-dimensional feature vector, was consolidated using global average pooling and forwarded to a bespoke classifier head consisting of Linear (768→512), ReLU, Dropout (0.5), Linear (512→256), ReLU, Dropout (0.5), and Linear (256→2) for the prediction of benign versus malignant outcomes[29]. The architecture had approximately 28.3 million parameters, with around 0.5 million being trainable during the initial fine-tuning phase, integrating transformer-based global context modeling with computational efficiency appropriate for high-resolution medical imaging[29].
4.3.10 Xception
The study utilized Xception (Extreme Inception), a deep convolutional neural network pretrained on ImageNet, modified for binary breast cancer classification[16]. Xception substitutes conventional convolutions with depthwise separable convolutions integrated with residual connections, facilitating efficient feature extraction. The network processes RGB inputs via an entering flow of convolutional and separable convolutional layers (32–728 channels), succeeded by a middle flow including 8 repeating blocks (728 channels), and concluding with an exit flow that expands to 2048 channels[42]. The backbone output undergoes global average pooling, dropout (p=0.5), and a concluding linear layer (2048→2) for the classification of benign and malignant cases. The training utilized the AdamW optimizer, cosine annealing warm restarts, and label-smoothed cross-entropy loss, rendering the model both computationally efficient and highly expressive for histopathology picture processing[31].
4.4 Explainable Artificial Intelligence (XAI)
The black-box aspect of deep learning models presents major obstacles to their clinical adoption, where trust and transparency are of the utmost importance, notwithstanding their impressive accuracy in breast cancer detection. Explainable Artificial Intelligence (XAI) methodologies seek to mitigate this constraint by offering human-comprehensible insights into model predictions[43]. This study utilised XAI technologies, including Grad-CAM, LIME, SHAP, and XRAI, to visualise and elucidate the decision-making processes of diverse deep learning models. These tools not only improve model transparency but also aid doctors in verifying the regions or features most significant in diagnosis results.
4.4.1 Grad-CAM (Gradient-weighted Class Activation Mapping)
Grad-CAM (Gradient-weighted Class Activation Mapping) was utilized to improve the interpretability of deep learning models by producing class-discriminative heatmaps that emphasize the picture regions most significant for classification[37, 44]. It calculates the gradients of the projected class score relative to the feature maps of the final convolutional layer, use global average pooling to obtain channel weights, and generates a ReLU-activated weighted sum to create the final heatmap. The heatmap is subsequently overlaid on the original image, clearly highlighting areas essential for decision-making[28, 31]. This study employed Grad-CAM across various architectures (ResNet50, DenseNet121, Xception, EfficientNetV2, Swin Transformer) to assess the models' attention to aberrant tissue patterns. Its post hoc nature, necessitating no architectural alterations, renders it especially appropriate for medical imaging applications where trust and transparency are important[29].
4.4.2 LIME (Local Interpretable Model-Agnostic Explanations)
The study used LIME (Local Interpretable Model-Agnostic Explanations) to produce localized, case-specific elucidations of breast cancer classification models. In contrast to gradient-based approaches, LIME is model-agnostic, approximating intricate predictions with a straightforward interpretable surrogate by perturbing inputs into superpixels and analyzing output fluctuations[9]. Each image underwent masking or modification, and a local linear model was applied to assess the significance of various image segments. LIME was utilized on models such as ResNet50, EfficientNet, DenseNet121, and Swin Transformer, emphasizing the areas most critical for benign or malignant predictions. This offered clear, instance-specific interpretability, augmenting Grad-CAM by elucidating local decision limits that global saliency maps would neglect, thus enhancing clinical confidence in AI-assisted breast cancer diagnosis[45].
4.4.3 SHAP (SHapley Additive Explanations)
SHAP was used to measure feature significance through principles of cooperative game theory, assigning the contribution of each input region to the model's output. By estimating Shapley values, SHAP equitably allocates prediction influence among picture superpixels or patches[46]. This work employed SHAP on models such as ResNet50, EfficientNet, DenseNet121, and Swin Transformer, generating heatmaps that emphasized areas influencing malignant or benign predictions. In contrast to gradient-based techniques, SHAP delivers globally consistent and theoretically robust explanations, furnishing doctors with insights into the influence of each input feature on decision outcomes[24].
4.4.4 Integrated Gradients (IG)
Integrated Gradients were used to attribute model predictions by calculating the path integral of gradients between a baseline (e.g., a black images) and the input image. This method offers a systematic methodology for allocating contribution scores to each pixel by averaging gradients along the interpolation trajectory[46]. This study employed IG on CNN and transformer-based architectures to elucidate subtle tissue patterns affecting benign-malignant classification. Its efficacy is rooted in generating smoother and more accurate attributions than raw gradients, rendering it particularly suitable for medical imaging, where detailed interpretability is essential[43].
4.4.5 Layer-wise Relevance Propagation (LRP)
LRP was utilized as a backpropagation-based explanation technique, redistributing the prediction score backwards through the network to identify the input areas that were most responsible for the decision[47]. Using relevance conservation concepts, LRP assigns pixel-level contributions that aggregate to the model's output, producing comprehensive and intuitive visual representations. LRP was incorporated into CNNs (ResNet, DenseNet, Xception) for the analysis of breast cancer images, emphasizing significant histological features. LRP's ability to deliver detailed pixel attributions improves clinical confidence by guaranteeing that diagnostic predictions correspond with medically relevant structures.
5 Experimental Details
6 Results and Discussion
6.1 Datasets
The BreakHis dataset is a collection of histopathological pictures created by the P&D Lab in Brazil, comprising 7,909 microscopic images of breast tissue samples from 82 patients, classified as benign or malignant. Images are obtained at four magnification levels: 40X, 100X, 200X, and 400X, utilising an Olympus BX-50 microscope. The dataset has eight subtypes: four benign (adenosis, fibroadenoma, phyllodes tumour, tubular adenoma) and four malignant (ductal carcinoma, lobular carcinoma, mucinous carcinoma, papillary carcinoma). The dataset exhibits imbalance and significant intra-class variability, rendering it appropriate for training and assessing deep learning models in fine-grained classification tasks. Each image is in RGB format and possesses a resolution of pixels.
6.2 Experimental Results
Table 1: Performance of DenseNet-121 on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 89.2 | 90.7 | 95.5 | 93.0 | 70.3 | 0.936 |
| Test (All Mag.) | 99.4 | 99.9 | 99.5 | 99.6 | 99.2 | 0.999 |
| Test (40×) | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 1.000 |
| Test (100×) | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 1.000 |
| Test (200×) | 100.0 | 100.0 | 100.0 | 100.0 | 100.0 | 1.000 |
| Test (400×) | 97.5 | 99.4 | 97.7 | 98.5 | 96.4 | 0.998 |
DenseNet-121 performed well on the BreakHis dataset, showing the ability to generalize across magnifications. On the validation set, it achieved 89.24% accuracy, 90.72% precision, 95.46% recall, 70.31% specificity, an F1-score of 93.03%, and an AUC-ROC of 0.9362, indicating high sensitivity but some misclassification of benign cases(Table 1 & Figure 1). On the test set (at all magnifications), the model achieved near-perfect results with 99.41% accuracy, 99.86% precision, 99.45% recall, 99.17% specificity, 99.65% F1-score, and 0.9997 AUC-ROC, indicating strong generalization and balanced performance across both malignant and benign classes (Figure 2 & 3). The model reliably extracted discriminative histopathological characteristics at individual magnification settings (40X, 100X, and 200X) with 100% accuracy across all measures (Figure 4). These findings show the effectiveness of DenseNet-121's densely connected architecture in reducing vanishing gradients, encouraging feature reuse, and providing highly reliable breast cancer classification performance on histopathology pictures.

Figure 1: Performance metrics comparison of DenseNet121 on the BreakHis dataset across validation and test sets at different magnifications (40X, 100X, 200X, 400X).

(a) 40X

(b) 100X
(c) 200X
(d) 400X
Figure 2: Confusion matrices of the DenseNet-121 model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC

(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 3: Validation and test performance of the DenseNet-121 model on the BreakHis dataset across all magnifications.

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 4: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the DenseNet-121 model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 2: Performance of EfficientNet on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 93.1 | 96.1 | 94.3 | 95.2 | 89.7 | 0.979 |
| Test (All Mag.) | 86.2 | 83.6 | 86.0 | 84.8 | 86.3 | 0.940 |
| Test (40×) | 85.9 | 87.8 | 80.4 | 83.9 | 90.6 | 0.946 |
| Test (100×) | 86.3 | 86.4 | 84.3 | 85.4 | 88.1 | 0.941 |
| Test (200×) | 85.5 | 83.2 | 83.2 | 83.2 | 87.3 | 0.959 |
| Test (400×) | 84.3 | 78.7 | 86.7 | 82.5 | 82.4 | 0.915 |
On the BreakHis dataset, EfficientNet performed well though with a little bit of variation. With a recall of 94.31%, a specificity of 89.74%, an F1-score of 95.18%, and an area under the curve (AUC-ROC) of 0.979 on the validation set (at all magnifications), it demonstrated strong generalizability and a balanced sensitivity-specificity trade-off (Table 2). Nevertheless, a decline in performance to 86.16% accuracy, 83.6% precision, 85.99% recall, 86.29% specificity, 84.78% F1-score, and 0.9397 AUC-ROC was seen on the test set (at all magnifications), indicating difficulties with generalization (Figure 5). 40X (85.9% accuracy, 94.64% AUC), 100X (86.27% accuracy, 94.13% AUC), 200X (85.52% accuracy, 95.87% AUC), and 400X (84.28% accuracy, 91.5% AUC) were all results that were consistent but below validation (Figure 6 & 7). These results demonstrate that EfficientNet is efficient and has good feature extraction capabilities, but they also show that it is sensitive to variance in magnification and that test performance is slightly lower than validation (Figure 8). This suggests that there may be overfitting in this dataset and that more optimization is needed.
Model Performance Metrics Comparison

Specificity Comparison
AUC-ROC Comparison
Figure 5: Model performance metrics on the BreakHis dataset across validation and test sets at different magnifications.

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 6: Confusion matrices of the EfficientNet model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC

(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 7: Validation and test performance of the EfficientNet model on the BreakHis dataset across all magnifications.

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 8: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the EfficientNet model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 3: Performance of ConvNeXt on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 80.9 | 80.6 | 91.1 | 85.6 | 64.2 | 0.881 |
| Test (All Mag.) | 77.1 | 85.1 | 89.1 | 87.0 | 2.4 | 0.653 |
| Test (40×) | 76.1 | 83.6 | 89.5 | 86.4 | 0.0 | 0.450 |
| Test (100×) | 79.1 | 84.7 | 92.1 | 88.3 | 2.7 | 0.708 |
| Test (200×) | 79.7 | 88.3 | 88.8 | 88.6 | 8.7 | 0.823 |
| Test (400×) | 76.4 | 85.2 | 88.0 | 86.6 | 3.5 | 0.780 |
ConvNeXt showed moderate efficacy on the BreakHis dataset, with the validation set achieving 80.92% accuracy, 80.62% precision, 91.14% recall, 64.23% specificity, 85.56% F1-score, and 0.8806 AUC-ROC, indicating strong sensitivity but a diminished capacity to accurately detect benign instances (Table 3). In the test set (across all magnifications), the results exhibited a fall to 77.14% accuracy, 85.12% precision, 89.06% recall, 2.42% specificity, 87.04% F1-score, and 0.6533 AUC-ROC, indicating a pronounced bias towards malignant categorization owing to the exceedingly low specificity (Figure 9, 10 & 11)). ConvNeXt showed consistently high recall ( .88%) across various magnifications but had inadequate specificity, especially at 40X (0%) and only slight enhancements at 100X (2.7%), 200X (8.7%), and 400X (3.45%), despite F1-scores ranging from 86% to 88% (Figure 12). The results indicate that although ConvNeXt effectively detects malignant samples owing to its hierarchical convolutional-transformer hybrid architecture, its failure to balance false positives undermines its diagnostic reliability in breast cancer classification.
Model Performance Metrics Comparison

Figure 9: Performance metrics of the ConvNeXt model across validation and test sets at multiple magnifications.

(a) 40X
(b) (b) 100X
(c) (c) 200X
(d) (d) 400X
Figure 10: Confusion matrices of the ConvNeXt model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC
(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 11: Validation and test performance of the ConvNeXt model on the BreakHis dataset across all magnifications.

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 12: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the ConvNeXt model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 4: Performance of InceptionV3 on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 94.3 | 96.2 | 95.9 | 96.1 | 89.9 | 0.980 |
| Test (All Mag.) | 84.6 | 79.5 | 88.4 | 83.7 | 81.5 | 0.933 |
| Test (40×) | 87.2 | 86.0 | 86.0 | 86.0 | 88.2 | 0.937 |
| Test (100×) | 81.2 | 77.0 | 85.9 | 81.3 | 76.9 | 0.924 |
| Test (200×) | 85.1 | 80.4 | 86.3 | 83.3 | 84.1 | 0.938 |
| Test (400×) | 86.9 | 78.3 | 95.9 | 86.2 | 80.2 | 0.943 |
Inception V3 showed strong results on the BreakHis validation set, achieving 94.29% accuracy, 96.22% precision, 95.91% recall, 89.96% specificity, 96.06% F1-score, and 0.9803 AUC-ROC, indicating exceptional generalization and a well-balanced sensitivity–specificity ratio (Table 4). Nonetheless, performance on the test set (across all magnifications) diminished to 84.56% accuracy, 79.49% precision, 88.36% recall, 81.47% specificity, 83.69% F1-score, and 0.933 AUC-ROC, suggesting a propensity to misclassify benign instances (Figure 13, 14 & 15). The model attained accuracies of 87.18% at 40X magnification (AUC 0.9366), 81.18% at 100X (AUC 0.9243), and 85.07% at 200X (AUC 0.9383), with recall continuously surpassing precision, indicating effective detection of malignant cases but a higher incidence of false positives (Figure 16). These results underscore Inception V3's efficacy in extracting multi-scale histopathological features, while simultaneously revealing its vulnerability to magnification-related variability and diminished specificity on previously unreported test data.
Model Performance Metrics Comparison

Specificity Comparison
AUC-ROC Comparison
Figure 13: Performance of the Inception model shows high validation accuracy (94.5%, AUC = 0.98) and stable test results (81–87% accuracy, AUC = 0.93–0.95), with recall generally exceeding precision across magnifications.

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 14: Confusion matrices of the Inception model across 40X, 100X, 200X, and 400X magnifications

(a) Validation ROC

(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 15: Validation and test performance of the Inception model on the BreakHis dataset across all magnifications.

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 16: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the Inception model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 5: Performance of MobileNetV2 on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 91.8 | 95.9 | 92.7 | 94.3 | 89.5 | 0.975 |
| Test (All Mag.) | 84.7 | 83.5 | 81.9 | 82.7 | 86.9 | 0.933 |
| Test (40×) | 81.6 | 84.0 | 73.8 | 78.6 | 88.2 | 0.923 |
| Test (100×) | 84.7 | 82.0 | 86.8 | 84.3 | 82.8 | 0.928 |
| Test (200×) | 86.4 | 85.0 | 83.2 | 84.0 | 88.9 | 0.956 |
| Test (400×) | 84.3 | 81.6 | 81.6 | 81.6 | 86.3 | 0.927 |
MobileNetV2 showed strong efficacy on the BreakHis validation set, attaining 91.84% accuracy, 95.93% precision, 92.70% recall, 89.53% specificity, 94.29% F1-score, and 0.9746 AUC-ROC, so affirming effective generalization during training (Table 5). In the test set (across all magnifications), the findings diminished to 84.66% accuracy, 83.54% precision, 81.95% recall, 86.87% specificity, 82.73% F1-score, and 0.9332 AUC-ROC, indicating a marginal reduction in sensitivity while maintaining balanced specificity (Figure 17, 18 & 19). At several magnifications, performance exhibited variability: 40X (81.62% accuracy, 73.83% recall, AUC 0.9229) shown diminished sensitivity, whereas 100X (84.71%, AUC 0.9284), 200X (86.43%, AUC 0.9558), and 400X (84.28%, AUC 0.9271) yielded more consistent outcomes, with recall and specificity ranging from 82% to 89% (Figure 20). The results demonstrate that MobileNetV2, utilizing lightweight depthwise separable convolutions, achieves competitive accuracy and efficiency; however, its diminished capacity relative to deeper architectures leads to decreased recall and heightened magnification sensitivity in test data.
Model Performance Metrics Comparison

Specificity Comparison
AUC-ROC Comparison
Figure 17: MobileNet performance across validation and test sets at multiple magnifications

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 18: Confusion matrices of the MobileNetV2 model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC

(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 19: Validation and test performance of the MobileNetV2 model

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 20: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the MobileNetV2 model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 6: Performance of ResNet50 on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 93.2 | 96.2 | 94.4 | 95.3 | 90.2 | 0.978 |
| Test (All Mag.) | 83.6 | 79.1 | 86.2 | 82.5 | 81.5 | 0.919 |
| Test (40×) | 87.2 | 87.4 | 84.1 | 85.7 | 89.8 | 0.914 |
| Test (100×) | 82.4 | 80.6 | 82.6 | 81.6 | 82.1 | 0.925 |
| Test (200×) | 83.3 | 76.4 | 88.4 | 81.9 | 79.4 | 0.928 |
| Test (400×) | 80.8 | 73.3 | 86.7 | 79.4 | 76.3 | 0.907 |
ResNet50 achieved excellent generalization on the BreakHis validation set, achieving 93.24% accuracy, 96.24% precision, 94.39% recall, 90.17% specificity, 95.30% F1-score, and 0.9784 AUC-ROC, indicating an adequate sensitivity-specificity balance during training (Table 6). In the test set (across all magnifications), performance decreased to 83.60% accuracy, 79.08% precision, 86.22% recall, 81.47% specificity, 82.50% F1-score, and 0.9185 AUC-ROC, signifying diminished precision and an increase in false positives (Figure 21, 22 & 23). At various magnifications, the model exhibited optimal performance at 40X, achieving 87.18% accuracy, 87.38% precision, 84.11% recall, 89.76% specificity, and an AUC of 0.9135. In contrast, the results at 100X yielded 82.35% accuracy with a 92.51 AUC, and at 200X, 83.26% accuracy with a 92.82 AUC, demonstrating commendable recall but diminished precision (Figure 24). Performance was suboptimal at 400X (80.79% accuracy, 73.28% precision, 86.73% recall, AUC 0.9065), indicating difficulties in collecting intricate elements at elevated magnification. ResNet50 exhibited dependable malignant diagnosis with excellent recall; however, diminished precision and variability across magnifications underscore its sensitivity to scale variations in histopathological pictures.
Model Performance Metrics Comparison

Specificity Comparison
AUC-ROC Comparison
Figure 21: Performance metrics of ResNet across validation and test sets at multiple magnifications.

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 22: Confusion matrices of the ResNet model across 40X, 100X, 200X, and 400X magnifications

(a) Validation ROC

(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 23: Validation and test performance of the ResNet model on the BreakHis dataset across all magnifications.

(a) ROC 40X

(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X

(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 24: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h).
Table 7: Performance of Swin Transformer Tiny on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Test (All Mag.) | 79.5 | 73.6 | 84.6 | 78.7 | 75.3 | 0.860 |
| Test (40×) | 85.0 | 81.6 | 86.9 | 84.2 | 83.5 | 0.929 |
| Test (100×) | 79.2 | 74.6 | 85.1 | 79.5 | 73.9 | 0.874 |
| Test (200×) | 77.8 | 69.8 | 85.3 | 76.8 | 72.2 | 0.834 |
| Test (400×) | 77.7 | 70.1 | 83.7 | 76.3 | 73.3 | 0.821 |
The Swin Transformer Tiny attained an accuracy of 79.45%, precision of 73.55%, recall of 84.56%, specificity of 75.29%, F1-score of 78.67%, and an AUC-ROC of 0.8595 across all magnifications on BreakHis, indicating robust malignancy identification but moderate precision and specificity (Table 7). Performance peaked at 40X magnification, achieving 85.04% accuracy, 81.58% precision, 86.92% recall, 83.46% specificity, an F1 score of 84.16%, and an AUC of 0.9285. In contrast, findings at 100X yielded 79.22% accuracy and an AUC of 87.36, while 200X produced 77.83% accuracy and an AUC of 83.38, both demonstrating commendable recall (>85%) but diminished precision (<75%) (Figure 25, 26 & 27). At 400X magnification, accuracy decreased to 77.73%, with precision at 70.09%, recall at 83.67%, specificity at 73.28%, and an AUC-ROC of 0.8212, suggesting challenges in discerning fine-grained patterns at elevated magnification levels. The Swin Transformer exhibited strong recall and stable F1-scores across many scales; however, its significantly lower accuracy and specificity indicate a propensity for false positives, despite its efficacy in detecting cancerous regions.
Swin Transformer Tiny Model Performance Metrics Comparison

Specificity Comparison
AUC-ROC Comparison
Figure 25: Performance metrics of the Swin Transformer Tiny across different magnifications

Figure 26: Training curves of Swin Transformer Tiny

(a) (a) 40X

(b) (b) 100X

(c) (c) 200X

(d) (d) 400X
Figure 27: Confusion matrices of the Swin Transformer Tiny model across 40X, 100X, 200X, and 400X magnifications

Figure 28: Performance metrics of the VGG19 model across validation and test sets at multiple magnifications.
Table 8: Performance of VGG19 on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 93.1 | 95.9 | 94.6 | 95.2 | 89.3 | 0.975 |
| Test (All Mag.) | 81.3 | 76.5 | 84.1 | 80.1 | 79.0 | 0.905 |
| Test (40×) | 80.3 | 75.6 | 84.1 | 79.6 | 77.2 | 0.899 |
| Test (100×) | 78.8 | 74.5 | 84.3 | 79.1 | 73.9 | 0.914 |
| Test (200×) | 84.2 | 76.8 | 90.5 | 83.1 | 79.4 | 0.938 |
| Test (400×) | 80.4 | 74.8 | 81.6 | 78.1 | 79.4 | 0.892 |
VGG19 had outstanding results on the validation set, achieving 93.12% accuracy, 95.93% precision, 94.55% recall, 89.32% specificity, 95.23% F1-score, and 0.975 AUC-ROC, so proving its strong generalization throughout training (Table 8). Test performance declined to 81.26% accuracy, 76.46% precision, 84.09% recall, 78.96% specificity, 80.09% F1-score, and 0.9053 AUC-ROC, signifying diminished precision and an increase in false positives (Figure 28, 29 & 30). At certain magnifications, the results were consistent: 40X (80.34% accuracy, AUC 0.8987), 100X (78.82%, AUC 0.9138), 200X (84.16%, recall 90.53%, AUC 0.9378), and 400X (80.35%, AUC 0.892). The model exhibited strong recall at various magnifications ( .84%), achieving the optimal balance at 200X; however, precision was comparatively lower (74–77%), indicating a predisposition towards malignant predictions (Figure 31). VGG19 exhibited significant sensitivity and dependable detection of malignant cases; nevertheless, diminished accuracy and unpredictability in magnification underscore the limitations of its deeper, sequential CNN design in comparison to contemporary alternatives.

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 29: Confusion matrices of the VGG19 model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC
(b) Validation Confusion Matrix
(c) Test ROC
(d) Test Confusion Matrix
Figure 30: Validation and test performance of the VGG19 model on the BreakHis dataset across all magnifications.

(a) ROC 40X
(b) ROC 100X
(c) ROC 200X
(d) ROC 400X

(e) PR 40X
(f) PR 100X
(g) PR 200X
(h) PR 400X
Figure 31: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the VGG19 model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
The Vision Transformer (ViT) showed an accuracy of 86.47%, precision of 90.89%, recall of 90.46%, specificity of 75.85%, F1-score of 90.68%, and an AUC-ROC of 0.8918 on the validation set, showing robust sensitivity and balanced performance throughout training (Table 9). In the test set (across all magnifications), performance decreased to 77.64% accuracy, 71.14% precision, 84.32% recall, 72.20% specificity, 77.17% F1-score, and 0.8578 AUC-ROC,
Table 9: Performance of Vision Transformer (ViT) on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 86.5 | 90.9 | 90.5 | 90.7 | 75.9 | 0.892 |
| Test (All Mag.) | 77.6 | 71.1 | 84.3 | 77.2 | 72.2 | 0.858 |
| Test (40×) | 79.1 | 71.0 | 91.6 | 80.0 | 68.5 | 0.856 |
| Test (100×) | 72.6 | 68.4 | 78.5 | 73.1 | 67.2 | 0.789 |
| Test (200×) | 81.0 | 73.9 | 86.3 | 79.6 | 77.0 | 0.893 |
| Test (400×) | 79.0 | 71.9 | 83.7 | 77.4 | 75.6 | 0.862 |
signifying diminished precision and an elevated false-positive rate (Figure 32, 33 & 34). At particular magnifications, ViT exhibited optimal performance at 200X, achieving 81.0% accuracy, 73.87% precision, 86.32% recall, 76.98% specificity, 79.61% F1-score, and an AUC of 0.8928. In contrast, both 40X and 400X attained approximately 79% accuracy with recall exceeding 83%, while performance was least effective at 100X, yielding 72.55% accuracy and an AUC of 0.7885 (Figure 35). The results underscore ViT’s proficiency in recall across various magnifications, affirming its capacity to identify malignant patients; nevertheless, diminished precision and magnification-dependent variability indicate difficulties in discerning intricate histological patterns relative to deeper CNN-based models.

Figure 32: ViT model performance across validation and test sets at multiple magnifications. Validation achieved strong results (Accuracy = 0.86, Precision = 0.91, Recall = 0.90, F1 = 0.91, AUC-ROC = 0.89).

(a) 40X
(b) 100X
(c) 200X
(d) 400X
Figure 33: Confusion matrices of the Vision Transformer (ViT) model across 40X, 100X, 200X, and 400X magnifications on the BreakHis dataset.

(a) Validation ROC
(b) Validation Confusion Matrix

(c) Test ROC

(d) Test Confusion Matrix
Figure 34: Validation and test performance of the Vision Transformer (ViT) model on the BreakHis dataset across all magnifications.

(a) ROC 40X
(b) ROC 100X

(c) ROC 200X

(d) ROC 400X

(e) PR 40X
(f) PR 100X

(g) PR 200X

(h) PR 400X
Figure 35: Receiver Operating Characteristic (ROC) curves (a–d) and Precision–Recall (PR) curves (e–h) for the Vision Transformer (ViT) model evaluated on the BreakHis dataset across 40X, 100X, 200X, and 400X magnifications.
Table 10: Performance of Xception on the BreakHis dataset
| Dataset | Accuracy (%) | Precision (%) | Recall (%) | F1-score (%) | Specificity (%) | AUC |
|---|---|---|---|---|---|---|
| Validation (All Mag.) | 94.5 | 95.7 | 96.9 | 96.3 | 88.3 | 0.985 |
| Test (All Mag.) | 85.8 | 80.0 | 91.2 | 85.2 | 81.5 | 0.939 |
| Test (40×) | 87.2 | 82.9 | 90.7 | 86.6 | 84.3 | 0.945 |
| Test (100×) | 84.3 | 80.9 | 87.6 | 84.1 | 81.3 | 0.935 |
| Test (200×) | 87.3 | 80.2 | 93.7 | 86.4 | 82.5 | 0.961 |
| Test (400×) | 83.8 | 74.0 | 95.9 | 83.6 | 74.8 | 0.928 |
The Xception model showed remarkable performance on the validation set, achieving 94.52% accuracy, 95.65% precision, 96.87% recall, 88.25% specificity, 96.25% F1-score, and 0.9849 AUC-ROC, showing a robust sensitivity-specificity balance during training (Table 10). In the test set (across all magnifications), performance dropped to 85.84% accuracy, 80.0% precision, 91.21% recall, 81.47% specificity, 85.24% F1-score, and 0.9392 AUC-ROC, indicating elevated recall but diminished precision attributable to false positives. Results were comparable across magnifications: 40X (87.18% accuracy, 86.61% F1, AUC 0.9452), 100X (84.31% accuracy, 84.13% F1, AUC 0.9352), 200X (87.33% accuracy, 86.41% F1, AUC 0.9609), and 400X (83.84% accuracy, 83.56% F1, AUC 0.9278) (Figure 36). Recall was consistently elevated (≥.87%, culminating at 93.68% at 200X and 95.92% at 400X), affirming Xception’s efficacy in detecting malignant cases; nonetheless, its diminished precision throughout test sets underscores a trade-off between sensitivity and false-positive rates.
Model Performance Metrics Comparison

Figure 36: Performance metrics comparison of the Xception model across validation and test sets at multiple magnifications (40X, 100X, 200X, 400X).
Model Performance Comparison (Test - All Magnifications)

Model Performance Trends (Test - All Magnifications)
Model
Figure 37: Comparison of ten deep learning models on the test set (all magnifications) across accuracy, precision, recall, specificity, F1, and AUC-ROC.

Figure 38: Top-5 performing models across evaluation metrics on the test set (all magnifications).
Among all models, DenseNet-121 showed outstanding results, attaining near-perfect generalization on the BreakHis test set with an accuracy of 99.41%, precision of 99.86%, recall of 99.45%, specificity of 99.17%, F1-score of 99.65%, and an AUC-ROC of 0.9997, while achieving 100% performance at 40X, 100X, and 200X magnifications. Other CNN-based models achieved competitive performance: Xception showed impressive performance with an accuracy of 85.84%, a recall of 91.21%, and an AUC-ROC of 0.9392, showing superior sensitivity across magnifications (recall 0.90% at 200X and 400X) (Figure 37). Inception V3 and ResNet50 demonstrated comparable performance (accuracy 84–86%, AUC 0.92–0.94) with uniform recall across magnifications, albeit with marginally reduced precision, suggesting a propensity for false positives. EfficientNet and MobileNetV2 preserved efficiency while yielding consistent outcomes (accuracy approximately 84–86%, AUC approximately 0.93–0.95), albeit with some variability in recall contingent upon magnification (Figure 38). VGG19, despite exhibiting robust validation performance (93.12% accuracy, 0.975 AUC), demonstrated inferior generalization on test sets (about 81% accuracy, AUC around 0.91), highlighting the constraints of its antiquated sequential design. Conversely, transformer-based models like the Vision Transformer (ViT) and Swin Transformer Tiny exhibited inferior performance relative to CNNs, achieving test accuracies of approximately 77–79% and lower AUC values (0.85–0.89). Nevertheless, they demonstrated relatively high recall (>83%) across various magnifications, indicating potential in malignant case detection, albeit with diminished precision and specificity. ConvNeXt showed the lowest performance overall, achieving a test accuracy of 77.14% and an exceedingly low specificity of 2.42%, despite a high recall rate of 89%, which suggests a significant bias towards malignant diagnoses.
The results show that DenseNet-121 had the most robust and generalizable performance, whilst Xception, Inception V3, and EfficientNet achieved a commendable balance between accuracy and sensitivity. Transformer-based models showed potential for high recall but encountered difficulties with precision and generalization in histopathology data. These findings underscore the advantages of densely connected CNNs in breast cancer histopathology image classification, while emphasizing the necessity for additional improvement of vision transformers to address domain-specific heterogeneity.
7 Explainability
The DenseNet121 model achieved outstanding performance on the BreakHis dataset (test accuracy: 0.994, F1 score: 0.997, AUC-ROC: 1.0), with prediction confidence consistently above 0.98. To interpret its decisions, multiple XAI techniques were employed. Grad-CAM revealed progressive localization of discriminative regions, with deeper layers focusing on nuclei and glandular structures. Integrated Gradients consistently highlighted nuclei-dense areas and boundaries across different baselines, ensuring attribution robustness (Figure 39). LIME identified superpixel-level regions supporting benign predictions, while LRP decomposed evidence into positive contributions from epithelial and nuclei structures and negative relevance in background areas. Saliency maps further confirmed fine-grained sensitivity to relevant tissue features. Collectively, these results demonstrate that DenseNet121 not only achieves state-of-the-art performance but also grounds its predictions in clinically meaningful histopathological patterns.
DenseNet121 Grad-CAM Analysis - Predicted: Benign (0.988)

(a) Grad-CAM
DenseNet121 Architecture
F1 Score: 0.994
F1 Score: 0.997
Confidence: 0.988
DenseNet121 Architecture
F1 Score: 0.994
F1 Score: 0.997
Confidence: 0.988

Model Performance:
Test Accuracy: 0.858
Precision: 0.800
Predicted: Malignant
Confidence: 0.956
(b) Integrated Gradients
LIME Analysis - Predicted: Benign (0.988)

Model Performance:
Test Accuracy: 0.994
F1 Score: 0.997
Predicted: Benign
Confidence: 0.988
(c) LIME
LRP Analysis - Predicted: Benign (0.988)

Model Performance:
Test Accuracy: 0.994
F1 Score: 0.997
Predicted: Benign
Confidence: 0.988
(d) LRP
Figure 39: Explainable AI (XAI) visualizations of DenseNet121 predictions on the BreakHis dataset using (a) Grad-CAM, (b) Integrated Gradients, (c) LIME, and (d) Layer-wise Relevance Propagation (LRP).
The EfficientNet model, trained on the BreakHis dataset, attained a test accuracy of 0.862, recall of 0.860, precision of 0.836, F1-score of 0.848, and AUC-ROC of 0.940, with benign predictions exhibiting high confidence levels (0.956–0.969) (Figure 40). Grad-CAM representations at layers 2, 4, 6, and 8 demonstrated an increasingly finer concentration on nuclei-rich and glandular structures, whereas Integrated Gradients consistently highlighted epithelial boundaries and clustered nuclei across various baselines. LIME validated localized decision boundaries via superpixel-level attributions, while Saliency Maps emphasized pixel-level gradients indicative of tissue shape. The XAI approaches collectively demonstrate that EfficientNet, while slightly less accurate than DenseNet121, relies on clinically significant histopathological traits, hence ensuring interpretability and robust performance.

(a) Grad-CAM

(b) Integrated Gradients
LINE Analysis - Predicted: Benign (0.969)

(c) LIME

(d) Saliency Map
Figure 40: XAI visualizations of EfficientNet predictions on the BreakHis dataset using (a) Grad-CAM, (b) Integrated Gradients, (c) LIME, and (d) Saliency Maps.
The InceptionV3 model, trained on the BreakHis dataset, attained a test accuracy of 0.846, recall of 0.884, precision of 0.795, and an F1-score of 0.837, with malignant predictions exhibiting confidence levels ranging from 0.775 to 0.851. Grad-CAM indicated a transition from textural patterns in first layers to nuclei-dense areas in deeper modules (Mixed5d–Mixed7c), whereas Integrated Gradients consistently underscored clustered nuclei and cell boundaries across various baselines (Figure 41). LIME detected superpixel regions associated with malignant forms compared to suppressed backgrounds, while LRP further analysed positive attributions to nuclear clusters and epithelial anomalies, removing irrelevant tissue. These XAI approaches collectively demonstrate that InceptionV3 bases its malignant predictions on clinically significant histological characteristics, hence ensuring interpretability while maintaining robust performance.

(a) Grad-CAM

(b) Integrated Gradients
LIME Analysis - Predicted Malignant (0.775)

(c) LIME

(d) LRP
Figure 41: XAI visualizations of InceptionV3 predictions on the BreakHis dataset using (a) Grad-CAM, (b) Integrated Gradients, (c) LIME, and (d) Layer-wise Relevance Propagation (LRP).
The MobileNetV2 model, trained on the BreakHis dataset, attained a test accuracy of 0.847, precision of 0.835, recall of 0.819, and an F1-score of 0.827, with benign predictions exhibiting high confidence levels (0.952–0.953). Grad-CAM demonstrated a gradual localization of features from textures to regions packed with nuclei, whereas Integrated Gradients validated consistent attributions to nuclear boundaries across various baselines (Figure 42). LIME emphasized superpixel-level positive (green) and negative (red) areas, while LRP dissected predictions into clinically pertinent positive nuclear attributions and background exclusions. The XAI techniques collectively validated MobileNetV2's dependence on diagnostically relevant histopathological features, ensuring interpretability while maintaining competitive performance.

MobileNetV2 Grad-CAM Analysis - Predicted: Benign (0.953)
Grad-CAM: Early Features
MobileNetV2 Performance
Test Accuracy 0.847
F1 Score 0.827
Predicted: Benign
Confidence 0.953
(a) Grad-CAM
LINE Analysis - Predicted: Benign (0.953)


Mask Only
Model Performance
Test Accuracy 0.847
F1 Score 0.827
Predicted: Benign
Confidence 0.953
(c) LIME

Integrated Gradients Analysis - Predicted: Benign (0.953)

K Baseline White

Model Performance
Test Accuracy 0.847
F1 Score 0.827
Predicted: Benign
Confidence 0.953
(b) Integrated Gradients

LIP-like Analysis - Predicted: Benign (0.953)
(d) LRP
Figure 42: XAI visualizations of MobileNetV2 predictions on the BreakHis dataset using (a) Grad-CAM, (b) Integrated Gradients, (c) LIME, and (d) LRP.
7.1 Statistical Significance, Robustness, and Generalization Analysis
The overall performance ranks derived from the classification experiments are well supported by the statistical validation results. Among all evaluated architectures, DenseNet121 consistently emerged as the best-performing model, achieving an average test accuracy of (95% CI: 98.6-99.7%), an AUC-ROC of 0.999 (95% CI: 0.9963-1.0000), precision of , recall of , F1-score of , Cohen's of 0.986, and an MCC of 0.984. The high agreement coefficients show the high level of consistency between predicted labels and true labels, and is the reason why DenseNet121 achieved the lowest Friedman rank (1.00) and statistically outperformed all other models (). Furthermore, it is magnifications sensitive under across all the magnifications of , , and levels, showing excellent robustness and generalization capability in different tissue magnifications.
Table 11: Comprehensive statistical performance summary of all models on the BreakHis test set.
| Model | Arch. | Acc. (%) | Prec. (%) | Recall (%) | Spec. (%) | F1 (%) | AUC | κ | MCC | F-Rank |
|---|---|---|---|---|---|---|---|---|---|---|
| DenseNet121 | CNN | 99.4 [98.6, 99.7] | 99.9 | 99.5 | 99.2 | 99.6 | 0.999 [0.9963, 1.0000] | 0.986 | 0.984 | 1.00 |
| EfficientNet | CNN | 86.2 [83.6, 88.4] | 83.6 | 86.0 | 86.3 | 84.8 | 0.940 [0.9192, 0.9608] | 0.685 | 0.700 | 3.62 |
| Xception | CNN | 85.8 [83.2, 88.1] | 80.0 | 91.2 | 81.5 | 85.2 | 0.939 [0.9180, 0.9600] | 0.676 | 0.689 | 3.50 |
| InceptionV3 | CNN | 84.6 [81.9, 86.9] | 79.5 | 88.4 | 81.5 | 83.7 | 0.933 [0.9111, 0.9549] | 0.648 | 0.665 | 4.00 |
| MobileNetV2 | CNN | 84.7 [82.0, 87.0] | 83.5 | 81.9 | 86.9 | 82.7 | 0.933 [0.9111, 0.9549] | 0.651 | 0.673 | 4.12 |
| ResNet50 | CNN | 83.6 [80.9, 86.0] | 79.1 | 86.2 | 81.5 | 82.5 | 0.919 [0.8950, 0.9430] | 0.625 | 0.645 | 5.25 |
| VGG19 | CNN | 81.3 [78.4, 83.9] | 76.5 | 84.1 | 79.0 | 80.1 | 0.905 [0.8792, 0.9308] | 0.573 | 0.599 | 7.50 |
| Swin Transformer | ViT/Swin | 79.5 [76.5, 82.2] | 73.6 | 84.6 | 75.3 | 78.7 | 0.860 [0.8293, 0.8907] | 0.532 | 0.564 | 8.00 |
| ViT | ViT/Swin | 77.6 [74.6, 80.4] | 71.1 | 84.3 | 72.2 | 77.2 | 0.858 [0.8271, 0.8889] | 0.488 | 0.530 | 8.75 |
| ConvNeXt | CNN | 77.1 [74.0, 79.9] | 85.1 | 89.1 | 2.4 | 87.0 | 0.653 [0.6110, 0.6950] | 0.477 | -0.180 | 9.25 |
EfficientNet, Xception, InceptionV3 and MobileNetV2 were the second tier of models, with an accuracy of to and AUC ranging between 0.933 and 0.940. They were not far off their statistical measures from their predictive performance. The best agreement metrics with DenseNet ( and MCC = 0.700) and the lowest magnification variability ( ), EfficientNet earned the top ranking (Friedman rank = 3.62), with high performance at all magnifications. Likewise, Xception achieved a high sensitivity (91.2%) and an MCC of 0.689, meaning that it had a high recall value and good predictive consistency. The moderate agreement between both models (InceptionV3 and MobileNetV2, ) and similar AUC values (0.933) helps to justify the models' statistically similar performance when compared pairwise.
The statistical results also account for the relatively poor performance of ResNet50 and VGG19. Both models had satisfactory accuracy (83.6% and 81.3%) and relatively low agreement coefficient (0.625 and 0.573), and moderate MCC values (0.645 and 0.599), which showed less reliable classification boundaries and less robustness in variable magnification levels. Because larger magnification sensitivities, and on image magnification were suggested with their larger effects of dependence on image scale variations, they had lower Friedman rankings.

Figure 43: Statistical comparison of the 10 models tested in the patient-stratified BreakHis test set, with test accuracy and AUC-ROC and their 95% confidence intervals quantifying predictive uncertainty and comparative performance.
The transformer based architectures (Swin Transformer and Vision Transformer (ViT)) had relatively poor accuracy with 79.5% and 77.6%, respectively, and AUC values less than 0.86. There is moderate agreement between these results and their moderate agreement statistics ( and 0.488) and lower MCC scores (0.564 and 0.530). In addition, both architectures had the largest magnification sensitivities ( and ), and very poor Friedman rankings (8.00 and 8.75) which signify that they were not stable and showed the least robust results for different image resolutions. The Mann–Whitney U test also found that CNN architectures were significantly more accurate (p = 0.0032) and more accurate for the AUC (p = 0.0047) than the transformers, indicating the advantage of convolutional inductive biases for relatively small histopathological datasets like BreakHis.

Figure 44: Friedman and Nemenyi non-parametric analyses comparing the ten architectures across four magnification levels that display statistically significant differences and average performance ranking of the evaluated models.
Lastly, ConvNeXt was the worst-performing architecture in terms of accuracy (77.1%), AUC (0.653) and MCC (-0.180) although it had a decent F1 score (87.0%). The negative MCC value and low value of (0.477) suggest poor discriminator capability and prediction bias to the majority class. This is also supported by its low Friedman ranking (9.25) and the high dispersion in the AUC values at different magnifications. The combined results of these statistical analyses provide further validation and corroboration of the experimental results: Conventional classification metrics validate the performance hierarchy as well as rigorous significance testing, agreement measures, confidence intervals and robustness analyses, which significantly adds to the credibility and reproducibility of the results reported.
(A) Per-Magnification Test Accuracy

(B) Magnification Sensitivity (lower=more stable)
(C) Per-Magnification AUC-ROC
(D) Accuracy-Stability Trade-off
Figure 45: Magnification sensitivity analysis showing the robustness and stability of the model performance at different histopathological magnifications (40×, 100×, 200× and 400×) using the accuracy, AUC-ROC and deviation from accuracy metrics.
8 Limitations
Although different transfer learning architectures were comprehensively benchmarked on BreakHis and various explainable AI techniques were used, there are still limitations. Firstly, the study was based on a single histopathological data set and a binary classification scenario to limit the generalizability of the result to other imaging modalities, multi-class classification of subtypes, tumour grading, and staging for clinical scenarios. All statistical measures were conducted in ways that ensure the superiority of DenseNet121, and these tests and the perfect scores at several magnifications in itself should be treated with a grain of salt due to near-perfect performance (99.4% accuracy, AUC-ROC of 0.999, and MCC = 0.984). Histopathological datasets, like BreakHis, may have nuances within and between magnifications that can create implicit correlations and result in inflated performance metrics. Moreover, the difference between the positive validation and test performance, as well as the very high agreement scores indicate that some degree of learning of the validation set may exist, in spite of the statistically significant improvement in performance. Furthermore, the XAI methods used are mostly qualitative and do not measure explanation faithfulness and clinical utility, quantitatively. Lastly, the complexity of the memory and computational hardware of large transformer-based architectures limited the exploration of a wide range of hyperparameters and external experiments. However, additional testing on independent multi-institutional data and quantitative assessment of interpretability would be required before confidently implementing for clinical use.
9 Conclusion & Future Work
In this work, we benchmarked 10 state-of-the-art transfer learning architectures in order to classify breast cancer on the BreakHis dataset: CNN-based models (ResNet50, DenseNet121, EfficientNetV2, MobileNetV2, VGG19, Xception, ConvNeXt and InceptionV3) and transformer-based models (Vision Transformer and Swin Transformer). Both experimental and statistical analyses showed that DenseNet121 yielded the highest accuracy (99.41%), AUC-ROC (0.9997), Cohen's (0.986), and MCC (0.984) and was statistically significantly better than all models compared (p < 0.001). It was also shown to be robust in terms of magnification in tests at all the image resolutions and was found to be only slightly sensitive to variations in magnification ( ). Moreover, Grad-CAM and LIME provided clinically relevant visual explanations for DenseNet121, EfficientNet and Swin Transformer, consistently identifying nuclei-dense and glandular regions that are crucial for diagnostic decisions. Together, these results highlight the potential of combining the strengths of transfer learning architectures with explainable AI approaches to achieve reliable clinical decision-making support systems for breast cancer diagnosis that are accurate, transparent, and clinically relevant.
However, the results are to be viewed with some caution as the study is based upon one histopathological dataset and binary classification. The proposed framework will be validated with independent multi-institutional and multi-modal data sets in future, extended to subtyping and grading tasks, explored on the hybrid CNN-Transformer architectures, and validated quantitatively and clinically to increase the generalization capabilities, reliability, and clinical utility.
Author contributions statement
Author 1 analyzed the results and reviewed the manuscript draft. Authors 2 and 4 contributed to the overall methodology, original draft preparation, and data analysis. Author 3 conducted the experiments and generated the results. Authors 5 and 6 were responsible for project administration, results evaluation. All authors reviewed, edited, and approved the final version of the manuscript.
Data Availability
The datasets analysed during the current study are publicly available. This study utilised the BreakHis (Breast Cancer Histopathological Image Classification) dataset, which is accessible through the public repository at: https://web.inf.ufpr.br/vri/databases/breast-cancer-histopathological-database-breakhis/
No new datasets were generated during this study. All processed data supporting the findings of this research are available from the corresponding author upon reasonable request.
Ethics Statement
This study used the publicly available BreakHis dataset consisting of de-identified histopathological images. No direct human participation, patient recruitment, or intervention was conducted by the authors. The dataset was originally collected following relevant clinical and ethical guidelines, and all images are anonymised. Therefore, additional ethical approval and informed consent were not required for this secondary analysis.
Acknowledgments
This work was supported by the Deanship of Scientific Research, Vice Presidency for Graduate Studies and Scientific Research, King Faisal University, Saudi Arabia [Grant No.XXXXXX].
References
[1] Marwa M Emam, Essam H Houssein, Nagwan Abdel Samee, Manal Abdullah Alohali, and Mosa E Hosney. Breast cancer diagnosis using optimized deep convolutional neural network based on transfer learning technique and improved coati optimization algorithm. Expert Systems with Applications, 255:124581, 2024.
[2] Weimin Wang, Yufeng Li, Xu Yan, Mingxuan Xiao, and Min Gao. Breast cancer image classification method based on deep transfer learning. In Proceedings of the International Conference on Image Processing, Machine Learning and Pattern Recognition, pages 190–197, 2024.
[3] Jacinta Potsangbam and Salam Shuleenda Devi. Classification of breast cancer histopathological images using transfer learning with densenet121. Procedia Computer Science, 235:1990–1997, 2024.
[4] Madhusudan G Lanjewar, Kamini G Panchbhai, and Lalchand B Patle. Fusion of transfer learning models with lstm for detection of breast cancer using ultrasound images. Computers in Biology and Medicine, 169:107914, 2024.
[5] Tharunya Arravalli, Krishnaraj Chadaga, H Muralikrishna, Niranjana Sampathila, D Cenitta, Rajagopala Chadaga, and KS Swathi. Detection of breast cancer using machine learning and explainable artificial intelligence. Scientific Reports, 15(1):26931, 2025.
[6] Md Romzan Alom, Fahmid Al Farid, Muhammad Aminur Rahaman, Anichur Rahman, Tanoy Debnath, Abu Saleh Musa Miah, and Sarina Mansor. An explainable ai-driven deep neural network for accurate breast cancer detection from histopathological and ultrasound images. Scientific Reports, 15(1):17531, 2025.
[7] Neha Rani, Deepak Kumar Gupta, and Samayveer Singh. Multi-class classification of breast cancer abnormality using transfer learning. Multimedia Tools and Applications, 83(30):75085–75100, 2024.
[8] SR Sannasi Chakravarthy, N Bharanidharan, V Vinoth Kumar, TR Mahesh, Mohammed S Alqahtani, and Suresh Guluwadi. Deep transfer learning with fuzzy ensemble approach for the early detection of breast cancer. BMC Medical Imaging, 24(1):82, 2024.
[9] Ritesh Maurya, Nageshwar Nath Pandey, Malay Kishore Dutta, and Mohan Karnati. Fccs-net: Breast cancer classification using multi-level fully convolutional-channel and spatial attention-based transfer learning approach. Biomedical Signal Processing and Control, 94:106258, 2024.
[10] Melwin D Souza, G Ananth Prabhu, Varuna Kumara, and KM Chaithra. Earlynet: a novel transfer learning approach with vgg11 and efficientnet for early-stage breast cancer detection. International Journal of System Assurance Engineering and Management, 15(8):4018–4031, 2024.
[11] Mohammad Mobin Mirimoghaddam, Jafar Majidpour, Fakhereh Pashaei, Hossein Arabalibeik, Esmaeil Samizadeh, Nema Mohmadian Roshan, and Tarik A Rashid. Her2gan: Overcome the scarcity of her2 breast cancer dataset based on transfer learning and gan model. Clinical Breast Cancer, 24(1):53–64, 2024.
[12] Belgacem Bouallegue, Yasser M Abd El-Latif, Hosam El-Sofany, and Islam ATF Taj-Eddin. An enhanced approach for predicting breast cancer using different deep learning algorithms and explainable ai techniques in an iot environment. International Journal of Intelligent Systems, 2025(1):8884481, 2025.
[13] Dhayanithi Jaganathan, Sathiyabhama Balasubramaniam, Vidhushavarshini Sureshkumar, and Seshathiri Dhanasekaran. Revolutionizing breast cancer diagnosis: a concatenated precision through transfer learning in histopathological data analysis. Diagnostics, 14(4):422, 2024.
[14] Fabián Silva-Aravena, Hugo Núñez Delafuente, Jimmy H Gutiérrez-Bahamondes, and Jenny Morales. A hybrid algorithm of ml and xai to prevent breast cancer: A strategy to support decision making. Cancers, 15(9):2443, 2023.
[15] Faizan Nasir, Shanur Rahman, Nazim Nasir, FAIZAN NASIR, SHANUR RAHMAN, and NAZIM NASIR. Breast cancer detection using convolutional neural networks: A deep learning-based approach. Cureus, 17(5), 2025.
[16] Kalappanaickenpatty Suriaprakasam Manojee and Athiappan Rajiv Kannan. Patho-net: enhancing breast cancer classification using deep learning and explainable artificial intelligence. American Journal of Cancer Research, 15(2):754, 2025.
[17] Md Zobayer Ibna Kabir. Breast cancer classification using pre-trained cnns with explainable ai for enhanced decision support. In 2025 International Conference on Electrical, Computer and Communication Engineering (ECCE), pages 1–6. IEEE, 2025.
[18] Vinayak Gupta and Richa Sharma. Enhancing breast cancer prediction with xai-enabled boosting algorithms. In 2024 15th International Conference on Computing Communication and Networking Technologies (ICCCNT), pages 1–5. IEEE, 2024.
[19] Md Alamin Talukder. An improved xai-based densenet model for breast cancer detection using reconstruction and fine-tuning. Results in Engineering, 26:104802, 2025.
[20] Jamalur Ridha, Khairun Saddami, Muhammad Riswan, Roslidar Roslidar, et al. An explainable artificial intelligence framework for breast cancer detection. Indonesian Journal of Electronics, Electromedical Engineering, and Medical Informatics, 7(2):298–311, 2025.
[21] Kuncham Sreenivasa Rao, Panduranga Vital Terlapu, D Jayaram, Kalidindi Kishore Raju, G Kiran Kumar, Rambabu Pemula, M Venu Gopalachari, and S Rakesh. Intelligent ultrasound imaging for enhanced breast cancer diagnosis: Ensemble transfer learning strategies. IEEE Access, 12:22243–22263, 2024.
[22] Raafat M Munshi, Lucia Cascone, Nazik Alturki, Oumaima Saidani, Amal Alshardan, and Muhammad Umer. A novel approach for breast cancer detection using optimized ensemble learning framework and xai. Image and Vision Computing, 142:104910, 2024.
[23] Salma Fayaz, Syed Zubair Ahmad Shah, Nusrat Mohi ud din, Naillah Gul, and Assif Assad. Advancements in data augmentation and transfer learning: A comprehensive survey to address data scarcity challenges. Recent advances in computer science and communications (Formerly: Recent patents on computer science), 17(8):14–35, 2024.
[24] Sara Sumaiyya, G Shyamala, NR Latha, and GB Pallavi. Breast cancer detection with mobilenetv2 and explainable ai. In 2024 4th International Conference on Sustainable Expert Systems (ICSES), pages 1237–1243. IEEE, 2024.
[25] Gurusiddayya Hiremath, Jose Alex Mathew, and Naveen Kumar Boraiah. Hybrid statistical and texture features with densenet 121 for breast cancer classification. International Journal of Intelligent Engineering & Systems, 16(2), 2023.
[26] Raj Kumar Pattanaik, Satyasis Mishra, Mohammed Siddique, Tiruveedula Gopikrishna, and Sunita Satapathy. Breast cancer classification from mammogram images using extreme learning machine-based densenet121 model. Journal of Sensors, 2022(1):2731364, 2022.
[27] Sakinat Oluwabukonla Folorunso, Joseph Bamidele Awotunde, Y Pandu Rangaiah, and Roseline Oluwaseun Ogundokun. Efficientnets transfer learning strategies for histopathological breast cancer image analysis. International Journal of Modeling, Simulation, and Scientific Computing, 15(02):2441009, 2024.
[28] Majid Behzadpour, Bengie L Ortiz, Ebrahim Azizi, and Kai Wu. Breast tumor classification using efficientnet deep learning model. arXiv preprint arXiv:2411.17870, 2024.
[29] Ojonugwa Oluwafemi Ejiga Peter, Daniel Emakporuena, Bamidele Dayo Tunde, Maryam Abdulkarim, and Abdullahi Bn Umar. Transformer-based explainable deep learning for breast cancer detection in mammography: The mammoformer framework. arxiv.org, 2025.
[30] Shakil Khan, Hamdadur Rahman, Md Ismail Hossain Siddiqui, Zishad Hossain Limon, Mahbub Alam Khan, Rezaul Haque, Md Redwan Ahmed, Ahmed Wasif Reza, and Shamim Hasnat Ripon. Ensemble-based explainable approach for rare medicinal plant recognition and conservation. In 2025 10th International Conference on Information and Network Technologies (ICINT), pages 88–93. IEEE, 2025.
[31] Awika Ariyametkul, Sudarshan Tamang, and May Phu Paing. Explainable ai (xai) for breast cancer diagnosis. In 2024 16th Biomedical Engineering International Conference (BMEiCON), pages 1–5. IEEE, 2024.
[32] R Reenadevi, T Sathiya, and B Sathiyabhama. Breast cancer histopathological image classification using augmentation based on optimized deep resnet-152 structure. Annals of the Romanian Society for Cell Biology, 25(6):5866–5874, 2021.
[33] Syed Usama Khalid Bukhari, Asmara Syed, Syed Safwan Khalid, and Syed Sajid Hussain Shah. The histological diagnosis of breast cancer by employing scale invariant resnet 18 with spatial supervised technique. medRxiv, pages 2021–09, 2021. DOI:10.1145/3492323.3495596.
[34] Wasyihun Sema Admass, Yirga Yayeh Munaye, and Ayodeji Olalekan Salau. Integration of feature enhancement technique in google inception network for breast cancer detection and classification. Journal of Big Data, 11(1):78, 2024.
[35] S Kanimozhi and S Priyadarsini. Breast cancer histopathological image classification using cnn and vgg-19. In 2024 Third International Conference on Intelligent Techniques in Control, Optimization and Signal Processing (INCOS), pages 1–6. IEEE, 2024.
[36] Md Humaion Kabir Mehedi, Moumita Khandaker, Shaneen Ara, Md Ashraful Alam, MF Mridha, and Zeyar Aung. A lightweight deep learning method to identify different types of cervical cancer. Scientific Reports, 14(1):29446, 2024.
[37] Marwa Naas, Hiba Mzoughi, Ines Njeh, and Mohamed BenSlima. An explainable ai for breast cancer classification using vision transformer (vit). Biomedical Signal Processing and Control, 108:108011, 2025.
[38] Aymen M Al-Hejri, Archana Harsing Sable, Riyadh M Al-Tam, Mugahed A Al-Antari, Sultan S Alshamrani, Kaled M Alshmrany, and Wedad Alatebi. A hybrid explainable federated-based vision transformer framework for breast cancer prediction via risk factors. Scientific Reports, 15(1):1–23, 2025.
[39] Hossam Magdy Balaha, Khadiga M Ali, Dibson Gondim, Mohammed Ghazal, and Ayman El-Baz. Harnessing vision transformers for precise and explainable breast cancer diagnosis. In International Conference on Pattern Recognition, pages 191–206. Springer, 2025.
[40] Gelan Ayana and Se-woon Choe. Vision transformers-based transfer learning for breast mass classification from multiple diagnostic modalities. Journal of Electrical Engineering & Technology, 19(5):3391–3410, 2024.
[41] Md Redwan Ahmed, Hamdadur Rahman, Zishad Hossain Limon, Md Ismail Hossain Siddiqui, Mahbub Alam Khan, Al Shahriar Uddin Khondakar Pranta, Rezaul Haque, SM Masfequier Rahman Swapno, Young-Im Cho, and Mohamed S Abdallah. Hierarchical swin transformer ensemble with explainable ai for robust and decentralized breast cancer diagnosis. Bioengineering, 12(6):651, 2025.
[42] Farhan Farabi, Farhan Hossen, Farhan Monsur, Mir Araf Hossain, and Md Mohibul Hasan. Explainable breast cancer detection from Histopathology images using transfer learning and XAI. PhD thesis, Brac University, 2023.
[43] Tamilarasi Kathirvel Murugan, Pritikaa Karthikeyan, and Pavithra Sekar. Efficient breast cancer detection using neural networks and explainable artificial intelligence. Neural Computing and Applications, 37(5):3759–3776, 2025.
[44] Kaushik Raghavan, Sivaselvan B, and Kamakoti v. Attention guided grad-cam: an improved explainable artificial intelligence model for infrared breast cancer detection. Multimedia Tools and Applications, 83(19):57551–57578, 2024.
[45] Adyasha Sahu, Pradeep Kumar Das, and Sukadev Meher. An efficient deep learning scheme to detect breast cancer using mammogram and ultrasound breast images. Biomedical Signal Processing and Control, 87:105377, 2024.
[46] Ahmed Alhussen, Mohd Anul Haq, Arfat Ahmad Khan, Rakesh Kumar Mahendran, and Seifedine Kadry. Xairacapsnet: Relevance aware capsule network-based breast cancer detection using mammography images via explainability o-net roi segmentation. Expert Systems with Applications, 261:125461, 2025.
[47] Sharia Arfin Tanim, Gazi Mohammad Imdadul Alam, Tahmid Enam Shrestha, Maruful Islam, Fariha Jahan, and Kamruddin Nur. Breast cancer diagnosis with xai-integrated deep learning approach. In 2024 International Conference on Innovation and Intelligence for Informatics, Computing, and Technologies (3ICT), pages 659–665. IEEE, 2024.