Skip to Content
Applied SciencesApplied Sciences
  • Article
  • Open Access

30 July 2025

18 Pages

DCS-ST for Classification of Breast Cancer Histopathology Images with Limited Annotations

and
1
School of Digital Arts, Jiangxi Arts & Ceramics Technology Institute, Jindezhen 333001, China
2
Department of IT Engineering, Mokwon University, Daejeon 35349, Republic of Korea
*
Author to whom correspondence should be addressed.

Abstract

Accurate classification of breast cancer histopathology images is critical for early diagnosis and treatment planning. Yet, conventional deep learning models face significant challenges under limited annotation scenarios due to their reliance on large-scale labeled datasets. To address this, we propose Dynamic Cross-Scale Swin Transformer (DCS-ST), a robust and efficient framework tailored for histopathology image classification with scarce annotations. Specifically, DCS-ST integrates a dynamic window predictor and a cross-scale attention module to enhance multi-scale feature representation and interaction while employing a semi-supervised learning strategy based on pseudo-labeling and denoising to exploit unlabeled data effectively. This design enables the model to adaptively attend to diverse tissue structures and pathological patterns while maintaining classification stability. Extensive experiments on three public datasets—BreakHis, Mini-DDSM, and ICIAR2018—demonstrate that DCS-ST consistently outperforms existing state-of-the-art methods across various magnifications and classification tasks, achieving superior quantitative results and reliable visual classification. Furthermore, empirical evaluations validate its strong generalization capability and practical potential for real-world weakly-supervised medical image analysis.

1. Introduction

Histopathology images of breast cancer are often captured under weakly labeled conditions. These present significant analytical challenges impairing downstream vision tasks such as automated classification, lesion detection, and clinical diagnostic assistance [1,2]. As one of the most prevalent and life-threatening cancers worldwide, breast cancer demands early and accurate diagnosis to improve patient outcomes, with histopathology images serving as the gold standard due to their rich cellular and tissue detail. However, annotating these images relies heavily on pathologists’ expertise and time, resulting in a critical scarcity of labeled data. This data insufficiency hampers the robustness of conventional deep learning models, which typically require vast annotated datasets for effective training [3,4].
In recent years, Transformer-based models like the Swin Transformer [5] have shown remarkable success in high-resolution image tasks, leveraging their hierarchical structure and shifted window mechanism to efficiently capture local and global features, making them highly suitable for analyzing complex histopathology images. Yet, in scenarios with limited labeled data, optimizing these models to handle diverse tissue structures and pathological patterns remains a formidable challenge. Traditional approaches often depend on hand-crafted feature extraction rules, which struggle to adapt to the complexity and variability of histopathology images [6,7].
To address this, we propose the Dynamic Cross-Scale Swin Transformer (DCS-ST) cite b25, a robust approach tailored for classifying breast cancer histopathology images under weakly labeled conditions. Building on the Swin Transformer architecture, DCS-ST leverages a small set of labeled data alongside a larger pool of unlabeled data, employing a semi-supervised learning strategy with pseudo-labeling to generate high-confidence labels for training. Our method introduces two novel components: a Dynamic Window Predictor and a Cross-Scale Attention Module. The Dynamic Window Predictor uses a convolutional layer to predict window sizes for each image region adaptively, enabling the model to adjust its attention mechanism based on content dynamically. The Cross-Scale Attention Module integrates multi-scale features via a multi-head attention mechanism, significantly enhancing the model’s ability to discern intricate patterns, such as normal, benign, in situ carcinoma, and invasive carcinoma, across varying spatial resolutions. Compared to the standard Swin Transformer, DCS-ST exhibits superior feature representation and classification stability when labeled data is scarce.
We evaluate DCS-ST on multiple benchmark datasets, including BreakHis [8], Mini-DDSM [9], and  ICIAR2018 BACH Challenge [10], covering two-class, three-class, and four-class breast cancer classification tasks. For the ICIAR2018 dataset, which includes four classes (normal, benign, in situ carcinoma, and invasive carcinoma), we simulate real-world weakly labeled scenarios by partitioning the dataset into 80% for training (with only 5% labeled and 95% unlabeled) and 20% for testing, using stratified sampling to ensure class balance. Experimental results demonstrate that DCS-ST consistently outperforms existing methods across key metrics, including AUC-ROC [11], balanced accuracy [12], F1 score [13], and Cohen’s Kappa [14], delivering high-quality classification outcomes even with minimal labeled data, while avoiding overfitting issues common in supervised methods and instability seen in unsupervised ones.
Our contributions are summarized as follows:
  • We propose the Dynamic Cross-Scale Swin Transformer (DCS-ST), which leverages dynamic window prediction, cross-scale attention, and semi-supervised learning for robust histopathology image classification under limited annotations.
  • We design innovative Dynamic Window Predictor and Cross-Scale Attention Modules to enhance the model’s ability to capture complex tissue features across scales.
  • Extensive experiments on the BreakHis, Mini-DDSM datasets, and ICIAR2018 BACH Challenge validate the method’s superior performance across various classification tasks and magnifications.

2. Related Works

2.1. Semi-Supervised Learning for Image Classification

Semi-supervised learning (SSL) has become a vital approach for image classification, particularly in scenarios with limited labeled data, such as medical imaging, where high-quality annotations are costly and time-intensive to acquire. SSL leverages a small labeled dataset alongside a larger pool of unlabeled data to improve model performance. Traditional SSL methods include self-training [15,16], which generates pseudo-labels for unlabeled data using the model’s predictions and incorporates them into training, co-training [17], which uses complementary views or models to refine pseudo-labels, and graph-based approaches, which propagate labels through similarity graphs between samples.
With the rise of deep learning, SSL methods have evolved significantly. FixMatch [18,19] combines pseudo-labeling with consistency regularization, enforcing consistent predictions across augmented versions of unlabeled data, achieving strong performance in image classification. MixMatch [20] integrates data augmentation and MixUp to enhance model generalization by blending labeled and unlabeled samples. Unsupervised Data Augmentation (UDA) [21] further emphasizes augmentation invariance, using diverse transformations to improve robustness in SSL settings.
SSL has been increasingly applied to address data scarcity in medical image classification. For breast cancer histopathology image classification, Abdulrazzaq et al.  [22] proposed an SSL framework that leverages unlabeled data to enhance model robustness, achieving improved performance on datasets with limited annotations. Pani et al. [23] combined SSL with transfer learning, applying it to medical image classification tasks with constrained labeled data, demonstrating its effectiveness in handling diverse medical imaging modalities. These works highlight the potential of SSL in medical imaging. Still, they often rely on generic architectures, leaving room for specialized models tailored to histopathology images, as addressed in our work with the Dynamic Cross-Scale Swin Transformer (DCS-ST), which integrates pseudo-labeling and semi-supervised learning to tackle limited annotations in breast cancer classification.
Recently, GAN-based data augmentation methods have been widely adopted to mitigate data scarcity and class imbalance in biomedical imaging, including modalities such as fMRI and mammography [24]. Among these, Salazar et al. [25] proposed GANSO, which integrates Generative Adversarial Networks (GANs) with Markov Random Fields (MRFs) to produce spatially coherent synthetic samples even under extremely small dataset conditions. Similarly, Dimitrakopoulos et al. [26] introduced ISING-GAN, a GAN-based augmentation approach incorporating an Ising model prior to impose spatial constraints during training, improving the realism of both images and annotations. Jo and Kim [27] further proposed OBGAN, which focuses on generating minority class samples near the decision boundary, enhancing model robustness in imbalanced learning scenarios. These advanced oversampling strategies are closely aligned with the challenges addressed in this work and could serve as promising directions to complement our current semi-supervised learning framework.

2.2. Transformers in Medical Image Analysis

Transformer models, originally developed for natural language processing, have been adapted for computer vision with significant success. The Vision Transformer (ViT) [28] pioneered this transition by segmenting images into patches and treating them as sequences, achieving competitive performance on benchmark datasets like ImageNet. However, ViT’s global self-attention mechanism can be computationally intensive for high-resolution images, such as those in medical imaging.
The Swin Transformer [5], a hierarchical Transformer with a shifted window mechanism, addresses this limitation by efficiently capturing local and global features, which makes it well suited for high-resolution medical images. In medical image analysis, the Swin Transformer has been applied to tasks such as segmentation. Cao et al. [29] achieve state-of-the-art results by leveraging their hierarchical structure to model spatial relationships in medical images.
For breast cancer histopathology image classification, Transformer-based models are gaining increasing attention. Recent works such as RDTNet [30], a residual deformable attention-based Transformer network, and the discrete wavelet-enhanced Transformer model proposed by Yan et al. [31], have demonstrated promising performance. Furthermore, Abimouloud et al. [32] introduced a token vision transformer that accelerates and improves the classification of histopathology images. However, these methods often assume access to large labeled datasets, which is not feasible in many real-world medical scenarios.
Our work builds on the Swin Transformer by introducing dynamic window prediction and cross-scale attention, specifically designed to handle limited annotations in breast cancer histopathology image classification across datasets such as BreakHis, ICIAR2018 BACH Challenge and Mini-DDSM.

2.3. Dynamic Window and Cross-Scale Attention Mechanisms

Dynamic window and cross-scale attention mechanisms are emerging techniques in computer vision, aimed at improving the capture of multi-scale features. Dynamic window mechanisms enable models to adjust window sizes based on input content adaptively, providing flexibility in focusing on regions of interest at varying scales. Cross-scale attention mechanisms enhance feature representation by facilitating interactions between features at different scales, improving the model’s ability to handle complex patterns.
In general image classification, Yang et al. [33] proposed a Dynamic Window Attention Network that dynamically adjusts window sizes to improve classification accuracy, demonstrating its effectiveness in capturing context-aware features. Chen et al. [34] developed a cross-scale attention module to enhance information exchange between feature maps at different scales, boosting representational power for tasks like object recognition.
In medical image analysis, these mechanisms are still being explored but show significant potential. Shen et al. [35] applied dynamic window mechanisms to medical image segmentation, achieving improved precision by adaptively adjusting window sizes to focus on relevant anatomical structures. Zhao et al. [36] proposed a cross-scale attention network for medical image classification and segmentation, demonstrating its ability to integrate multi-scale features for better performance. While these methods highlight the benefits of dynamic and cross-scale attention, their application to breast cancer histopathology image classification under limited annotations remains underexplored. Our Dynamic Cross-Scale Swin Transformer (DCS-ST) addresses this gap by combining a Dynamic Window Predictor and a Cross-Scale Attention Module, enabling robust feature extraction and classification of histopathology images with minimal labeled data.

3. Method

3.1. Overview of the Method

To tackle the challenge of classifying breast cancer histopathology images with limited annotated data, we introduce the Dynamic Cross-Scale Swin Transformer (DCS-ST). This novel architecture enhances the Swin Transformer framework. DCS-ST incorporates three key innovations: a dynamic window predictor, a cross-scale attention module, and a semi-supervised learning strategy. These components work synergistically to enable robust feature extraction and classification, effectively capturing local and global image features despite scarce annotations. The dynamic window predictor adapts the model’s focus to varying feature scales, the cross-scale attention module integrates multi-scale information for richer representations, and the semi-supervised strategy leverages abundant unlabeled data to improve generalization. This pipeline, illustrated in Figure 1, addresses the critical need for accurate classification in data-constrained medical imaging scenarios.
Figure 1. Flowchart of the Dynamic Cross-Scale Swin Transformer (DCS-ST) pipeline for breast cancer histopathology image classification with limited annotations. Input images are split into 5% labeled and 95% unlabeled data, processed via a Dynamic Window Predictor and pseudo-labeling strategy, followed by backbone feature extraction and classification. This pipeline effectively leverages both labeled and unlabeled data for robust performance.

3.2. Dynamic Window Predictor

The dynamic window predictor enhances the Swin Transformer’s flexibility by dynamically adjusting attention window sizes based on the spatial content of the input image. Unlike the fixed window sizes in traditional Swin Transformers, this module enables the model to focus adaptively across different scales—a critical capability for histopathology images, where features range from small cellular structures to larger tissue patterns.
The predictor employs a lightweight convolutional layer to estimate window scales:
scales = softmax ( Conv 1 × 1 ( x ) ) ,
where x ∈ R B × C × H × W is the input image, Conv 1 × 1 is a 1 × 1 convolution with output channels equal to the number of candidate scales, and softmax ensures the predictions form a valid distribution. The output scales ∈ R B × S × H × W guides downstream modules in adapting attention spans.

3.3. Cross-Scale Attention Module

The cross-scale attention module enhances the model’s representational power by combining features from different transformer stages through a multi-head attention mechanism. This integration captures dependencies across various resolutions, enabling the model to identify subtle histopathological patterns.
Given features from the current stage current_features ∈ R B × C × H × W and a previous stage prev_features ∈ R B × C × H × W , they are reshaped and fused as follows:
current_flat = reshape ( current_features , [ H · W , B , C ] ) , prev_flat = reshape ( prev_features , [ H · W , B , C ] ) ,
attended = MultiheadAttention ( current_flat , prev_flat , prev_flat ) ,
output = reshape ( attended , [ B , C , H , W ] ) .
      This operation allows information exchange between layers and enhances multi-scale representation fusion.

3.4. Semi-Supervised Learning Strategy

To address the limited availability of labeled data, we employ a semi-supervised learning (SSL) approach that leverages both labeled (5%) and unlabeled (95%) samples. A forward diffusion process introduces Gaussian noise into unlabeled samples:
q ( x 1 : T ∣ x 0 ) = ∏ t = 1 T q ( x t ∣ x t − 1 ) , q ( x t ∣ x t − 1 ) = N ( x t ; 1 − β t x t − 1 , β t I ) ,
where β t is a noise schedule and x 0 is the original image.
During training, the model predicts clean data from noisy samples via a learned reverse process p θ ( x 0 ∣ x t ) . In addition, pseudo-labels are generated for unlabeled samples if the model’s confidence exceeds a threshold τ . These are incorporated into the loss:
L total = L sup + λ · L pseudo ,
where λ balances contributions from labeled and pseudo-labeled data.
To determine an optimal confidence threshold, we performed tuning on the BreakHis dataset under 5% labeled settings. Table 1 shows that τ = 0.9 provides the best trade-off between pseudo-label quantity and quality in AUC-ROC and F1 score. Hence, we fix τ = 0.9 throughout all experiments.
Table 1. Validation performance under different pseudo-labeling thresholds τ (5% labeled data) on BreakHis dataset at 40×, 100×, 200×, and 400× magnifications. The best result for each magnification is highlighted in bold.

3.5. Model Architecture

The DCS-ST architecture integrates the Swin Transformer backbone with the proposed enhancements, forming a cohesive pipeline (see Figure 1):
  • Swin Transformer Backbone: A pre-trained Swin-Base model extracts hierarchical features from the input image.
  • Dynamic Window Predictor: Adjusts attention window sizes dynamically, guiding the backbone’s attention mechanism.
  • Cross-Scale Attention Module: Fuses multi-scale features across transformer stages for enhanced representation.
  • Classifier: A linear layer maps the backbone’s 1024-dimensional feature vector to four class logits, corresponding to breast cancer histopathology categories.
The input image is processed sequentially: the dynamic window predictor informs the backbone, the cross-scale attention module refines features, and the classifier delivers the final prediction, leveraging both labeled and pseudo-labeled data.

3.6. Training and Evaluation

The model is trained using the cross-entropy loss:
L = − 1 N ∑ i = 1 N ∑ c = 1 C y i , c log ( p i , c ) ,
where N is the batch size, C = 4 is the number of classes, y i , c is the ground-truth label, and  p i , c is the predicted probability. For semi-supervised training, a weighted loss incorporates pseudo-labels, as detailed in Algorithm 1.
Algorithm 1  Enhanced Swin Transformer with semi-supervised learning
Require: 
Labeled dataset D labeled = { ( x i , y i ) } i = 1 N l , Unlabeled dataset D unlabeled = { x u j } j = 1 N u , Test dataset D test , Epochs E, Threshold τ = 0.9
 1:
Initialize Enhanced Swin Transformer parameters θ , optimizer, and scheduler
 2:
for epoch e = 1 , … , E  do
 3:
if  e < 2  then                                 ▹ Initial training on labeled data only
 4:
Train model on D labeled , update parameters θ
 5:
else                                              ▹ Semi-supervised learning phase
 6:
Initialize PseudoLabels ← ∅
 7:
Initialize PseudoImages ← ∅
 8:
Generate pseudo-labels:
 9:
for all  x u ∈ D unlabeled  do
10:
Predict class and confidence for x u
11:
if confidence > τ  then
12:
Add ( x u , y ^ u ) to PseudoLabels
13:
end if
14:
end for
15:
Training: Train model on D labeled
16:
if PseudoLabels not empty then
17:
Train model on pseudo-labeled data using weighted loss
18:
end if
19:
end if
20:
Update learning rate scheduler
21:
end for
22:
Testing: Compute predictions on D test and evaluate metrics
23:
return Classification metrics and trained model

4. Experiment

4.1. Experimental Settings

4.1.1. Implementation Details

Our implementation is built on PyTorch 2.0.1 and Python 3.10, with training conducted on two NVIDIA T4 GPUs (Kaggle T4×2 setup), each with 16GB of video memory. To handle the small and imbalanced medical imaging datasets, we empirically set the initial learning rate to 0.0001 to mitigate the risk of gradient explosion and ensure stable convergence. The batch size was fixed at 16 due to memory constraints, enabling frequent parameter updates without exhausting GPU resources. We trained the model for 50 epochs, balancing training effectiveness with computational efficiency.
In addition, to enhance data diversity and improve model generalization under limited annotations, we applied several data augmentation techniques during preprocessing. These included random horizontal flipping, vertical flipping, and random rotations within ±30°. All images were resized to 224 × 224 pixels and normalized before being converted to tensors.
To ensure robust evaluation, we performed four independent runs and reported the average results to mitigate randomness and increase the reliability of our findings.

4.1.2. Dataset

Our network is trained and evaluated on three main datasets: BreakHis [8], containing 7909 breast cancer histopathology images (2429 benign and 5429 malignant) at 40×, 100×, 200×, and 400× magnifications, each 700 × 460 pixels; Mini-DDSM [9], a reduced version of DDSM with approximately 2000 annotated mammography images detailing lesion locations and diagnoses; and BACH from ICIAR2018 [10], with 400 HE-stained images in four categories (Normal, Benign, In-situ carcinoma, Invasive carcinoma), each 2048 × 1536 pixels. Figure 2, Figure 3 and Figure 4 depict sample images from the BreakHis, Mini-DDSM, and ICIAR2018 datasets. Table 2, Table 3 and Table 4 also present statistical data for these datasets, including sample sizes and class distributions.
Figure 2. Images of breast cancer histopathology from the BreakHis dataset at four magnifications.
Figure 3. Images of breast cancer histopathology from the Mini-DDSM dataset.
Figure 4. Images of breast cancer histopathology from the ICIAR2018 dataset.
Table 2. BreakHis dataset: class distribution and a priori probabilities across magnification factors.
Table 3. Mini-DDSM dataset: class distribution and a priori probabilities.
Table 4. ICIAR2018 dataset: class distribution and a priori probabilities.

4.1.3. Metrics

To comprehensively evaluate our model’s performance, we adopt a diverse set of complementary metrics as shown in Table 5. Our evaluation framework includes AUC-ROC [11], which quantifies the model’s discriminative ability across classification thresholds; balanced accuracy [12], which equalizes the importance of each class regardless of prevalence; F1 score [13], the harmonic mean of precision and recall that proves particularly valuable for imbalanced datasets like BreakHis; and Cohen’s Kappa [14], which assesses agreement between predicted and actual classifications while accounting for chance agreement. This multifaceted approach ensures robust performance assessment, especially critical in medical image analysis, where classification errors carry significant consequences. The combined use of these metrics addresses various aspects of model performance, from general classification accuracy to class-imbalance robustness—providing a holistic view that a single metric alone cannot capture. Moreover, this comprehensive evaluation strategy facilitates fair comparison with existing methodologies in the literature while offering deeper insights into our model’s strengths and limitations.
Table 5. Performance of network models on BreakHis dataset (two-class classification).

4.2. Comparison with Existing Methods

4.2.1. Comparison Methods

We evaluate our proposed DCS-ST model against state-of-the-art methods, including SimCLR [37], BYOL [38], ViT [28], CoAtNet [39], DenTnet [40], MedViT [41], EfficientNetV2 [42], SWIN-UNETR [43], and MLFF [44], on the BreakHis(two-class), Mini-DDSM(three-class), and ICIAR2018(four-class) datasets. All models are assessed under identical conditions using metrics such as AUC-ROC, Balanced Accuracy, F1 Score, and Cohen’s Kappa, with results reported as mean ± standard deviation in Table 5 and Table 6.
Table 6. Performance of network models on Mini-DDSM dataset (three-class classification) and ICIAR2018 dataset (four-class classification).

4.2.2. Performance Analysis

We first comprehensively compared the proposed DCS-ST model with multiple state-of-the-art methods on the BreakHis, Mini-DDSM, and ICIAR2018 datasets. As shown in Table 5 and Table 6, DCS-ST consistently achieves superior quantitative performance in all tasks and magnifications. Specifically, on the BreakHis dataset at 40× magnification, DCS-ST obtains an AUC-ROC of 0.9187, outperforming CoAtNet by 0.0064 (=0.9187 − 0.9123) and ViT by 0.0822 (=0.9187 − 0.8365). In terms of Balanced Accuracy, DCS-ST achieves 0.8664, surpassing SWIN-UNETR by 0.0435, and reaches an F1 score of 0.9004, which is 0.0713 higher than MLFF.
In the Mini-DDSM dataset, DCS-ST achieves an AUC-ROC of 0.8334, exceeding Swin-UNETR by 0.0009 and MLFF by 0.0072. Furthermore, in the ICIAR2018 dataset, DCS-ST achieves an AUC-ROC of 0.8781, outperforming ViT by 0.1057 (= 0.8881 − 0.7724) and EfficientNetV2 by 0.3272. In addition, DCS-ST achieves the highest Balanced Accuracy (0.7771) and F1 score (0.6712) among all compared methods, confirming its superior generalization and robustness across magnifications and complex classification tasks under limited annotation scenarios.
In addition to ROC-based metrics, we further analyzed the Precision-Recall (PR) curve performance to evaluate model behavior under imbalanced settings, where ROC curves may be overly optimistic in low false positive rate scenarios. As shown in Figure 5, DCS-ST consistently maintains superior PR-AUC values across different magnification levels on the BreakHis dataset. Specifically, the PR-AUC trends align closely with the AUC-ROC results, peaking at 200× magnification and slightly decreasing at 400×. This confirms the model’s reliable precision-recall tradeoff under various class imbalance conditions, further validating the robustness of our semi-supervised framework.
Figure 5. Magnification-Wise ROC and PR-AUC Trends of DCS-ST on BreakHis.

4.3. Ablation Study

To investigate the effectiveness of the proposed dynamic window prediction and cross-scale attention mechanisms, we conduct ablation experiments on the BreakHis, Mini-DDSM, and ICIAR2018 datasets following the implementation settings described in Sec. IV-A. As shown in Table 7 and Table 8, the proposed DCS-ST consistently outperforms the baseline Swin-Transformer across all magnifications and classification tasks.
Table 7. Ablation experiment: performance comparison of Swin-Transformer and DCS-ST on BreakHis dataset based on different magnifications (two-class classification).
Table 8. Ablation Experiment: Performance Comparison of Swin-Transformer and DCS-ST Based on Mini-DDSM Dataset (Three-Class Classification) and ICIAR2018 Dataset (Four-Class Classification).
In the BreakHis data set, DCS-ST achieves an AUC-ROC of 0.9528 at 200× magnification, improving upon Swin-Transformer by 0.0098 (=0.9528 − 0.9430). Balanced Accuracy and F1 Score also increase by 0.0149 and 0.0026, respectively. Similar improvements are observed at other magnifications. In the Mini-DDSM dataset, DCS-ST improves the AUC-ROC, the balanced precision, and the F1 score by 0.0514, 0.0542, and 0.0695, respectively, compared to the baseline. Furthermore, on the ICIAR2018 dataset, DCS-ST achieves an AUC-ROC of 0.8781,surpassing Swin-Transformer by 0.0502, with Balanced Accuracy and F1 Score increasing by 0.0396 and 0.0632, respectively.
The confusion matrices in Figure 6 and Figure 7 further illustrate these improvements. At 200× magnification on the BreakHis dataset, the number of correctly classified benign images by DCS-ST increases from 1411 to 1466, while malignant classifications also increase from 1411 to 1466, substantially reducing misclassification rates. These results demonstrate that the proposed dynamic window predictor and the cross-scale attention module effectively enhance feature extraction and classification robustness under limited annotation scenarios.
Figure 6. Comparison of the Confusion Matrices of the BreakHis Dataset.
Figure 7. Comparison of the confusion matrices of the Mini-DDSM dataset (three-class classification) and ICIAR2018 dataset (four-class classification).
Moreover, to assess the statistical reliability of these performance gains, we conducted significance tests between DCS-ST and baseline models on the BreakHis dataset, with p-values for Balanced Accuracy and F1-Score summarized in Table 9. The results confirm that the improvements achieved by DCS-ST are statistically significant. In addition, we evaluated the empirical computational complexity of DCS-ST in comparison to other competing models, as detailed in Table 10. This analysis includes training time per epoch, peak GPU memory usage, and relative computational overhead, demonstrating that DCS-ST maintains acceptable computational efficiency while achieving superior performance.
Table 9. Statistical significance test between DCS-ST and baseline models on the BreakHis dataset (average over 4 magnifications, 5 simulated runs).
Table 10. Empirical Computational Complexity of Models on the BreakHis Dataset (Evaluated on NVIDIA T4 ×2 GPUs).

4.4. Learning Curve Analysis

To further investigate the impact of annotated data scarcity on model performance, we conducted a learning curve analysis using varying proportions of labeled data, as illustrated in Figure 8 and Figure 9. Following the suggestion in [45], we estimated classification performance bounds by progressively increasing the percentage of labeled samples from 5% to 20%. The results consistently demonstrate that the AUC-ROC and Macro F1 scores improve with the increase of annotated data, eventually approaching convergence as the labeled data ratio reaches 20%.
Figure 8. Learning Curves of DcS-ST on BreakHis Dataset.
Figure 9. Learning Curves of DCS-ST on Mini-DDSM Dataset and ICIAR2018 Dataset.
This empirical observation is also in line with theoretical studies on learning curve modeling, which describe classifier performance as a function of training data size using inverse power-law relationships [46,47,48]. Specifically, performance improvements typically follow a diminishing-returns trend such as s ( n ) = a n b + c , or error reduction ϵ ( n ) ∝ n − α , where n is the number of labeled samples. These models have been widely used in microarray classification, cancer drug response prediction, and sample size estimation tasks. Our results conform to these theories, confirming that annotation scarcity remains a major limiting factor, while demonstrating the robustness of the proposed DCS-ST method under limited supervision conditions.

4.5. Limitations

Despite the superior classification performance achieved by DCS-ST, several limitations remain. First, the model relies on a pre-trained Swin-Transformer backbone and a computationally intensive cross-scale attention module, posing challenges for deployment on resource-constrained devices. Additionally, the proposed semi-supervised learning strategy depends heavily on a large amount of high-quality unlabeled data. When such data is scarce or when pseudo-label confidence scores fail to meet the predefined threshold (τ = 0.9), performance degradation may occur. Notably, on the BreakHis dataset at higher magnifications (e.g., 400×), the Balanced Accuracy exhibits noticeable fluctuations (0.8263 ± 0.0461), indicating room for improvement in handling diverse image distributions.
Moreover, DCS-ST has yet to be evaluated on ultra-large-scale datasets (e.g., whole slide images) and cross-domain transfer learning tasks. Its robustness against adversarial perturbations also remains unverified. Future work will focus on model compression, enhancing domain generalization, and improving adversarial robustness further to increase the practical value of DCS-ST for clinical applications.

5. Conclusions

This paper proposes a novel Dynamic Cross-Scale Swin Transformer (DCS-ST) for breast cancer histopathology image classification under limited annotation conditions. By integrating a dynamic window predictor, a cross-scale attention mechanism, and a semi-supervised learning strategy, DCS-ST significantly enhances multi-scale feature modeling and classification performance. Extensive experiments on BreakHis, Mini-DDSM, and ICIAR2018 datasets demonstrate that DCS-ST consistently outperforms state-of-the-art methods in terms of AUC-ROC, Balanced Accuracy, F1 Score, and Cohen’s Kappa, with particularly strong robustness and generalization capability under high magnification and complex multi-class settings.
Comprehensive comparative and ablation studies further confirm the effectiveness of the proposed modules in improving classification outcomes. The presented framework offers a reliable and scalable solution for intelligent histopathology image analysis with limited annotations. Future work will focus on model lightweighting, cross-domain transferability, and multi-modal integration to enhance the clinical applicability of DCS-ST.

Author Contributions

Conceptualization, S.L.; methodology, S.L.; software, S.L.; validation, S.L. and B.M.; formal analysis, S.L.; investigation, S.L.; resources, S.L.; data curation, S.L.; writing—original draft preparation, S.L.; writing—review and editing, B.M.; visualization, S.L.; supervision, B.M.; project administration, S.L. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Institutional Review Board Statement

Not applicable.

Data Availability Statement

The datasets used in this study are publicly available from the original sources cited in the manuscript. Preprocessed data and code can be made available from the corresponding author upon reasonable request.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. Krithiga, R.; Geetha, P. Breast cancer detection, segmentation and classification on histopathology images analysis: A systematic review. Arch. Comput. Methods Eng. 2021, 28, 2607–2619. [Google Scholar] [CrossRef] [Scilit]
  2. Kaur, A.; Singh, Y.; Neeru, N.; Kaur, L.; Singh, A. A survey on deep learning approaches to medical images and a systematic look up into real-time object detection. Arch. Comput. Methods Eng. 2022, 29, 2071–2111. [Google Scholar] [CrossRef] [Scilit]
  3. Jiang, H.; Yin, Y.; Zhang, J.; Deng, W.; Li, C. Deep learning for liver cancer histopathology image analysis: A comprehensive survey. Eng. Appl. Artif. Intell. 2024, 133, 108436. [Google Scholar] [CrossRef] [Scilit]
  4. Alzubaidi, L.; Bai, J.; Al-Sabaawi, A.; Santamaría, J.; Albahri, A.S. A survey on deep learning tools dealing with data scarcity: Definitions, challenges, solutions, tips, and applications. J. Big Data 2023, 10, 46. [Google Scholar] [CrossRef] [Scilit]
  5. Liu, Z.; Lin, Y.; Cao, Y.; Hu, H.; Wei, Y.; Zhang, Z.; Lin, S.; Guo, B. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 17–21 October 2021; pp. 10012–10022. [Google Scholar]
  6. Xu, H.; Xu, Q.; Cong, F.; Kang, J.; Han, C.; Liu, Z.; Madabhushi, A.; Lu, C. Vision transformers for computational histopathology. IEEE Rev. Biomed. Eng. 2023, 17, 63–79. [Google Scholar] [CrossRef] [Scilit]
  7. Abdullakutty, F.; Akbari, Y.; Al-Maadeed, S.; Bouridane, A.; Talaat, I.M.; Hamoudi, R. Histopathology in focus: A review on explainable multi-modal approaches for breast cancer diagnosis. Front. Med. 2024, 11, 1450103. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  8. Spanhol, F.A.; Oliveira, L.S.; Petitjean, C.; Heutte, L. A dataset for breast cancer histopathological image classification. IEEE Trans. Biomed. Eng. 2015, 63, 1455–1462. [Google Scholar] [CrossRef] [Scilit]
  9. Lekamlage, C.D.; Afzal, F.; Westerberg, E.; Cheddad, A. Mini-DDSM: Mammography-based automatic age estimation. In Proceedings of the 3rd International Conference on Digital Medicine and Image Processing, Kyoto, Japan, 6–9 November 2020; pp. 1–6. [Google Scholar]
  10. Aresta, G.; Araújo, T.; Kwok, S.; Chennamsetty, S.S.; Safwan, M.; Alex, V.; Marami, B.; Prastawa, M.; Chan, M.; Donovan, M.; et al. BACH: Grand challenge on breast cancer histology images. Med. Image Anal. 2019, 56, 122–139. [Google Scholar] [CrossRef] [Scilit]
  11. Carrington, A.M.; Manuel, D.G.; Fieguth, P.W.; Ramsay, T.; Osmani, V.; Wernly, B.; Bennett, C.; Hawken, S.; Magwood, O.; Sheikh, Y.; et al. Deep ROC analysis and AUC as balanced average accuracy, for improved classifier selection, audit and explanation. IEEE Trans. Pattern Anal. Mach. Intell. 2022, 45, 329–341. [Google Scholar] [CrossRef] [Scilit]
  12. Chicco, D.; Tötsch, N.; Jurman, G. The Matthews correlation coefficient (MCC) is more reliable than balanced accuracy, bookmaker informedness, and markedness in two-class confusion matrix evaluation. BioData Min. 2021, 14, 1–22. [Google Scholar] [CrossRef] [Scilit]
  13. Parekh, D.H.; Dahiya, V. Predicting breast cancer using machine learning classifiers and enhancing the output by combining the predictions to generate optimal F1-score. Biomed. Biotechnol. Res. J. 2021, 5, 331–334. [Google Scholar] [CrossRef] [Scilit]
  14. Wetstein, S.C.; de Jong, V.M.; Stathonikos, N.; Opdam, M.; Dackus, G.M.; Pluim, J.P.; van Diest, P.J.; Veta, M. Deep learning-based breast cancer grading and survival analysis on whole-slide histopathology images. Sci. Rep. 2022, 12, 15102. [Google Scholar] [CrossRef] [Scilit]
  15. Zhang, L.; Yang, L.; Ma, T.; Shen, F.; Cai, Y.; Zhou, C. A self-training semi-supervised machine learning method for predictive mapping of soil classes with limited sample data. Geoderma 2021, 384, 114809. [Google Scholar] [CrossRef] [Scilit]
  16. Nassar, I.; Herath, S.; Abbasnejad, E.; Buntine, W.; Haffari, G. All labels are not created equal: Enhancing semi-supervision via label grouping and co-training. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Nashville, TN, USA, 20–25 June 2021; pp. 7241–7250. [Google Scholar]
  17. Rong, S.; Tu, B.; Wang, Z.; Li, J. Boundary-enhanced co-training for weakly supervised semantic segmentation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Vancouver, BC, Canada, 17–24 June 2023; pp. 19574–19584. [Google Scholar]
  18. Sohn, K.; Berthelot, D.; Carlini, N.; Zhang, Z.; Zhang, H.; Raffel, C. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. Adv. Neural Inf. Process. Syst. 2020, 33, 596–608. [Google Scholar]
  19. Ihler, S.; Kuhnke, F.; Kuhlgatz, T.; Seel, T. Distribution-aware multi-label FixMatch for semi-supervised learning on CheXpert. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 16–22 June 2024; pp. 2295–2304. [Google Scholar]
  20. Peng, X.; Peng, T.; Yang, C.; Ye, C.; Chen, Z.; Yang, C. Adversarial domain adaptation network with MixMatch for incipient fault diagnosis of PMSM under multiple working conditions. Knowl.-Based Syst. 2024, 284, 111331. [Google Scholar] [CrossRef] [Scilit]
  21. Pham, D.H.; Nguyen, A.D.; Nguyen, H.N. GAN-based data augmentation and pseudo-label refinement with holistic features for unsupervised domain adaptation person re-identification. Knowl.-Based Syst. 2024, 288, 111471. [Google Scholar] [CrossRef] [Scilit]
  22. Abdulrazzaq, M.M.; Ramaha, N.T.A.; Hameed, A.A.; Salman, M.; Yon, D.K.; Fitriyani, N.L.; Syafrudin, M.; Lee, S.W. Consequential advancements of self-supervised learning (SSL) in deep learning contexts. Mathematics 2024, 12, 758. [Google Scholar] [CrossRef] [Scilit]
  23. Pani, K.; Chawla, I. A hybrid approach for multi modal brain tumor segmentation using two phase transfer learning, SSL and a hybrid 3DUNET. Comput. Electr. Eng. 2024, 118, 109418. [Google Scholar] [CrossRef] [Scilit]
  24. Frid-Adar, M.; Diamant, I.; Klang, E.; Amitai, M.; Goldberger, J.; Greenspan, H. GAN-based synthetic medical image augmentation for increased CNN performance in liver lesion classification. Neurocomputing 2018, 321, 321–331. [Google Scholar] [CrossRef] [Scilit]
  25. Salazar, A.; Vergara, L.; Safont, G. Generative Adversarial Networks and Markov Random Fields for oversampling very small training sets. Expert Syst. Appl. 2021, 163, 113819. [Google Scholar] [CrossRef] [Scilit]
  26. Dimitrakopoulos, P.; Sfikas, G.; Nikou, C. ISING-GAN: Annotated Data Augmentation with a Spatially Constrained Generative Adversarial Network. In Proceedings of the IEEE International Symposium on Biomedical Imaging (ISBI), Iowa City, IA, USA, 3–7 April 2020; pp. 1052–1055. [Google Scholar]
  27. Jo, W.; Kim, D. OBGAN: Minority oversampling near borderline with generative adversarial networks. Expert Syst. Appl. 2022, 197, 116694. [Google Scholar] [CrossRef] [Scilit]
  28. Dosovitskiy, A. An image is worth 16x16 words: Transformers for image recognition at scale. arXiv 2020, arXiv:2010.11929. [Google Scholar]
  29. Cao, H.; Wang, Y.; Chen, J.; Jiang, D.; Zhang, X.; Tian, Q.; Wang, M. Swin-unet: Unet-like pure transformer for medical image segmentation. In Proceedings of the European Conference on Computer Vision; Springer Nature: Cham, Switzerland, 2022; pp. 205–218. [Google Scholar]
  30. Nayak, D.R. RDTNet: A residual deformable attention based transformer network for breast cancer classification. Expert Syst. Appl. 2024, 249, 123569. [Google Scholar] [CrossRef] [Scilit]
  31. Yan, Y.; Lu, R.; Sun, J.; Zhang, J.; Zhang, Q. Breast Cancer Histopathology Image Classification Using Transformer with Discrete Wavelet Transform. Med. Eng. Phys. 2025, 138, 104317. [Google Scholar] [CrossRef] [Scilit]
  32. Abimouloud, M.L.; Bensid, K.; Elleuch, M.; Ammar, M.B.; Kherallah, M. Advancing Breast Cancer Diagnosis: Token Vision Transformers for Faster and Accurate Classification of Histopathology Images. Vis. Comput. Ind. Biomed. Art 2025, 8, 1. [Google Scholar] [CrossRef] [Scilit]
  33. Yang, B.; Li, J.; Wong, D.F.; Chao, L.S.; Wang, X.; Tu, Z. Context-aware self-attention networks. In Proceedings of the AAAI Conference on Artificial Intelligence, Honolulu, HI, USA, 27 January–1 February 2019; Volume 33, pp. 387–394. [Google Scholar]
  34. Chen, P.H.; Hsieh, J.W.; Hsieh, Y.K.; Chang, C.W.; Huang, D.Y. Cross-scale overlapping patch-based attention network for road crack detection. IEEE Trans. Intell. Transp. Syst. 2025; early access. [CrossRef] [Scilit]
  35. Shen, T.; Li, H.; Huang, X. Active volume models for medical image segmentation. IEEE Trans. Med. Imaging 2010, 30, 774–791. [Google Scholar] [CrossRef] [PubMed]
  36. Zhao, Q.; Wu, D.; Tian, J. PCASNet: Polarized cross-scale attention self-attention network for lightweight ultrasound medical image segmentation. In Proceedings of the 2024 International Conference on Image Processing, Computer Vision and Machine Learning (ICICML), Shenzhen, China, 22–24 November 2024; IEEE: New York, NY, USA, 2024; pp. 326–330. [Google Scholar]
  37. Chen, T.; Kornblith, S.; Norouzi, M.; Hinton, G. A simple framework for contrastive learning of visual representations. Proc. Int. Conf. Mach. Learn. 2020, 119, 1597–1607. [Google Scholar]
  38. Feng, H.; Jia, Y.; Xu, R.; Prasad, M.; Anaissi, A.; Braytee, A. Integration of self-supervised BYOL in semi-supervised medical image recognition. In Proceedings of the International Conference on Computational Science; Springer Nature: Cham, Switzerland, 2024; pp. 163–170. [Google Scholar]
  39. Dai, Z.; Liu, H.; Le, Q.V.; Tan, M. CoAtNet: Marrying convolution and attention for all data sizes. Adv. Neural Inf. Process. Syst. 2022, 34, 3965–3977. [Google Scholar]
  40. Kim, J.; Lee, H.S.; Song, I.S.; Jung, K.H. DeNTNet: Deep neural transfer network for the detection of periodontal bone loss using panoramic dental radiographs. Sci. Rep. 2019, 9, 17615. [Google Scholar] [CrossRef] [Scilit]
  41. Manzari, O.N.; Ahmadabadi, H.; Kashiani, H.; Shokouhi, S.B.; Ayatollahi, A. MedViT: A robust vision transformer for generalized medical image classification. Comput. Biol. Med. 2023, 157, 106791. [Google Scholar] [CrossRef] [Scilit]
  42. Tan, M.; Le, Q. Efficientnetv2: Smaller models and faster training. In Proceedings of the International Conference on Machine Learning, Shenzhen, China, 26 February–1 March 2021; pp. 10096–10106. [Google Scholar]
  43. Hatamizadeh, A.; Nath, V.; Tang, Y.; Yang, D.; Roth, H.R.; Xu, D. Swin UNETR: Swin transformers for semantic segmentation of brain tumors in MRI images. In Proceedings of the International MICCAI Brainlesion Workshop; Springer: Berlin/Heidelberg, Germany, 2021; pp. 272–284. [Google Scholar]
  44. Ding, W.L.; Zhu, X.J.; Zheng, K.; Liu, J.L.; You, Q.H. A multi-level feature-fusion-based approach to breast histopathological image classification. Biomed. Phys. Eng. Express 2022, 8, 055002. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  45. Xie, Q.; Luong, M.T.; Hovy, E.; Le, Q.V. Understanding and Improving Interpolation in Semi-Supervised Learning via the Power Law. Pattern Recognit. 2022, 122, 108299. [Google Scholar]
  46. Hoiem, D.; Gupta, T.; Li, Z.; Shlapentokh-Rothman, M. Learning Curves for Analysis of Deep Networks. In Proceedings of the International Conference on Machine Learning (ICML), Virtual Event, 18–24 July 2021; pp. 4287–4296. [Google Scholar]
  47. Mohr, F.; van Rijn, J.N. Fast and Informative Model Selection Using Learning Curve Cross-Validation. IEEE Trans. Pattern Anal. Mach. Intell. 2023, 45, 9669–9680. [Google Scholar] [CrossRef] [Scilit] [PubMed]
  48. Li, X.; Wei, C.; Sohn, K.; Zhang, D.; Ren, M.; Yang, C.; Luong, M.T.; Hovy, E.; Le, Q.V. Learning from Few Examples with Uncertainty Propagation and Data Amplification. In Proceedings of the International Conference on Learning Representations (ICLR), Virtual Event, 3–7 May 2021. [Google Scholar]
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Article Metrics

Citations

Article Access Statistics

Multiple requests from the same IP address are counted as one view.