Source-linked AI summary
ProtoCAM: Interpretable Few-Shot Mask-Guided Prototypical Learning for Breast Lesion Classification in Ultrasound Imaging
Ashkan Ebadi
TL;DR
Limited annotated medical data and the opacity of deep-learning predictions complicate breast ultrasound classification. ProtoCAM combines lesion-mask-guided feature encoding, prototypical few-shot learning, and Grad-CAM explanations. It reports a 0.910 macro F1-score in a 3-way 5-shot setting and notes limitations from single-dataset evaluation and reliance on lesion masks.
Problem
Limited annotated medical imaging data and difficulty interpreting deep-learning decisions constrain breast ultrasound analysis.
Source: §1 · p. 2Method
ProtoCAM combines lesion-mask-guided feature encoding and prototypical metric learning with Grad-CAM interpretability, evaluated using stratified group K-fold validation.
Source: §1 · p. 2, §3.7 · p. 5Results
0.910 macro F1-score in a 3-way 5-shot setting, outperforming conventional CNN classifiers; a same-backbone comparison reports a 37.9% absolute margin.
Source: §5 · p. 9, §4.4 · p. 9Takeaways & Limitations
Grad-CAM visualizations show focus on clinically meaningful lesion regions rather than background artifacts, supporting interpretability within the evaluated setting.
Source: §5 · p. 9Evaluation on BUSI alone may limit generalization across institutions, devices, and patient populations, and mask-guided encoding relies on lesion masks that may require expert annotation.
Source: §6 · p. 9
Abstract
from arXiv · showhide
Breast ultrasound imaging plays an important role in the early detection and diagnosis of breast cancer, particularly for patients with dense breast tissue. However, developing reliable deep learning models for ultrasound analysis is challenging due to limited annotated medical data and the need for interpretable predictions. To address these challenges, this paper proposes ProtoCAM, an explainable few-shot learning framework for breast lesion classification that integrates mask-guided feature encoding, prototypical metric learning, and gradient-based visual explanations. The proposed approach leverages lesion masks to guide feature extraction and constructs class prototypes within an embedding space to enable robust classification under limited training samples. The framework was evaluated on the BUSI dataset using a stratified group k-fold cross-validation protocol to prevent patient-level data leakage. Experimental results demonstrate ProtoCAM's high performance in low-data scenarios. In a 3-way 5-shot setting, the proposed method achieves a macro F1-score of 0.910, representing a substantial improvement over standard supervised CNN models. Among the evaluated backbone networks, ResNet18 achieved the best performance, reaching a macro F1-score of 91.65% under a 15-shot configuration, providing interpretable insights into the classification decisions. These results highlight the potential of explainable few-shot learning frameworks for reliable computer-aided breast cancer diagnosis in data-scarce medical imaging environments.
1 Introduction
Breast ultrasound supports breast cancer assessment, but limited annotated data and deep-learning opacity complicate reliable, interpretable analysis. ProtoCAM combines mask-guided few-shot learning, patient-level validation, and Grad-CAM explanations for lesion classification.
1 Introduction
- Ultrasound is accessible, non-invasive, and useful for distinguishing cystic from solid lesions, but reliable deep learning is constrained by scarce, diverse annotated datasets.Medical imaging data scarcity is linked to privacy restrictions, acquisition costs, and the difficulty of obtaining expert labels.Source: §1 · p. 2
- Deep-learning models are difficult for domain experts to interpret, while explainability supports trust, regulatory requirements, and ethical accountability in medicine.Visual heatmaps can link model predictions to image features that influence a decision.Source: §1 · p. 2
- ProtoCAM integrates mask-guided feature encoding with prototypical metric learning to address limited annotated data in breast ultrasound classification.The framework uses ground-truth lesion masks to guide feature extraction and Grad-CAM visualizations to show lesion-focused predictions.Source: §1 · p. 2
- The study evaluates ProtoCAM on BUSI with stratified group K-fold validation to prevent patient-level data leakage and assesses interpretability using Grad-CAM.The introduction describes the visualizations as focusing on meaningful lesion regions.Source: §1 · p. 2
2 Data
The study uses BUSI, a dataset of 780 breast ultrasound images from 600 female patients, with diagnostic labels and ground-truth annotations.
2 Data
- BUSI contains 780 images collected in 2018 from 600 female patients aged 25 to 75 years.Images have an average resolution of 500 × 500 pixels and are stored in PNG format.Source: §2 · p. 2
- The dataset covers three diagnostic categories: normal, benign, and malignant.Source: §2 · p. 2
- BUSI provides ground-truth annotations for the original images, with more than one annotation in some cases; Table 1 summarizes image counts by category.Source: §2 · p. 2, Table 1 · p. 3
3 Methodology
ProtoCAM uses lesion-aware few-shot learning for breast ultrasound classification, with preprocessing and episodic tasks designed to mimic few-shot inference.
3 Methodology
- The framework combines a prototypical network, lesion-aware feature extraction, episodic meta-learning, and patient-wise cross-validation for limited labelled medical data.Source: §3 · p. 3
3.1 Data Preprocessing
- Images are resized to a fixed square resolution and normalized using dataset-specific statistics; masks are resized with nearest-neighbour interpolation and binarized.Experiments used image sizes from 224 to 320 pixels.Source: §3.1 · p. 3
3.2 Episodic Learning Framework
- Training uses balanced three-way episodes with K-shot support samples and Q query samples per class, matching the few-shot inference setup.The default configuration is 5-shot with 20 query samples per class, with larger support settings also tested.Source: §3.2 · p. 3
3.3 Data Augmentation
The method applies paired image-mask augmentation, extracts backbone features with lesion-aware masked pooling, and classifies query embeddings against support-derived prototypes.
3.3 Data Augmentation
- Paired training augmentations transform each image and its lesion mask identically to preserve spatial alignment; validation uses deterministic preprocessing.Training augmentations include flips, rotations, affine transformations, and image brightness and contrast jitter.Source: §3.3 · p. 3
3.4 Architecture
- The prototypical network classifies samples by computing distances to class prototypes in a learned metric space.Source: §3.4 · p. 3
3.4.1 Backbone Feature Extractor
- The framework evaluates pretrained CNN backbones, using their feature embeddings; ResNet18 is the primary backbone for its balance of representation capacity and computational efficiency.Evaluated architectures include ResNet18, ResNet50, ResNet101, MobileNetV2, DenseNet121, EfficientNetB0, EfficientNetB1, and VGG16.Source: §3.4.1 · pp. 3–4
3.4.2 Mask-Guided Feature Encoding
- Spatial mask gating produces lesion-centric embeddings that emphasize diagnostically relevant tissue and reduce background noise in ultrasound images.Source: §3.4.2 · p. 4
3.4.3 Prototype-Based Classification
- Class prototypes average support-sample embeddings, and query embeddings are compared with them; Euclidean distance performed better than cosine similarity.Figure 1 depicts the mask-guided few-shot pipeline in a five-shot scenario.Source: §3.4.3 · p. 4, Figure 1 · p. 4
3.5 Training Strategy
ProtoCAM is trained episodically, with support and query images encoded, class prototypes computed from support embeddings, and query distances converted into probabilities. Evaluation uses three-fold stratified group cross-validation to preserve class distribution and keep each patient’s images in one fold.
3.5 Training Strategy
- Training episodes encode support and query images, compute prototypes from support embeddings, compare query embeddings with prototypes, and convert distances into class probabilities.Training spans 10 to 80 epochs, depending on the backbone.Source: §3.5 · p. 4
- Adam optimization uses an initial learning rate of 5e−5 and weight decay of 1e−3.A ReduceLROnPlateau scheduler lowers the learning rate by a factor of 0.1 after four consecutive epochs without validation-loss improvement.Source: §3.5 · pp. 4–5
3.6 Cross-Validation Strategy and Evaluation Metrics
- Three-fold stratified group cross-validation keeps each patient’s images within one fold while preserving class distribution across folds.The best model is selected using validation Macro F1-score.Source: §3.6 · p. 5
3.7 Episodic Few-Shot Learning Formulation
ProtoCAM formulates classification as episodic N-way K-shot learning: lesion masks guide embeddings, support samples form class prototypes, and query samples are classified by distance. An episodic query loss updates the model to organize embeddings around their class prototypes.
3.7 Episodic Few-Shot Learning Formulation
- Each episode samples N classes, with K support samples and Q query samples per class; support examples form prototypes and query examples evaluate the model.The support and query sets contain N × K and N × Q examples, respectively.Source: §3.7 · p. 5
- Mask-guided pooling weights feature-map activations by the lesion mask to produce an embedding that emphasizes lesion regions and suppresses background tissue.The resulting embedding is L2-normalized.Source: §3.7 · p. 5
- Class prototypes are means of support embeddings, and query embeddings are classified by Euclidean distance to those prototypes using softmax probabilities.The negative distance is scaled by a learnable temperature parameter.Source: §3.7 · p. 5
- The model minimizes negative log-likelihood over episode query samples, encouraging same-class samples to cluster around their prototypes and separate from other classes.The episodic loss is computed over N × Q query samples.Source: §3.7 · p. 5
- Episodic training updates model parameters by backpropagation after sampling classes, forming prototypes, and computing query probabilities and loss.The procedure uses Adam and is outlined in Algorithm 1.Source: §3.7 · pp. 5–6
3.8 Model Interpretability
ProtoCAM uses Grad-CAM visualizations to assess whether the model focuses on relevant lesion regions. Heatmaps from the backbone’s final convolutional layer are overlaid on ultrasound images.
3.8 Model Interpretability
- Grad-CAM heatmaps are overlaid on ultrasound images to visually assess whether model attention falls on relevant lesion regions.Grad-CAM is applied to the backbone network’s final convolutional layer.Source: §3.8 · p. 6
- The visual explanation uses activations from the backbone’s final convolutional layer.Source: §3.8 · p. 6
- Overlaying heatmaps on the original images provides a visual check of focus on lesion regions.Source: §3.8 · p. 6
3.9 Computational Environment and Implementation Details
Experiments were implemented in Python 3.14 with PyTorch and run on an NVIDIA RTX A6000 workstation with 128 GB RAM. Fixed random seeds and automatic recording of checkpoints, logs, and metrics supported reproducibility and experiment tracking.
3.9 Computational Environment and Implementation Details
- Experiments used Python 3.14 and the PyTorch deep learning framework.Source: §3.9 · p. 6
- Training ran on a workstation equipped with an NVIDIA RTX A6000 GPU and 128 GB RAM.Source: §3.9 · p. 6
- Random seeds were fixed, and checkpoints, training logs, and evaluation metrics were recorded automatically.These practices were used to support reproducibility and experiment tracking.Source: §3.9 · p. 6
4 Experiments and Results
The experiments compare ProtoCAM across backbone and episode configurations, pretraining choices, and conventional CNN baselines, and examine its Grad-CAM visualizations. In the matched 3-way 5-shot comparison, ProtoCAM outperformed its supervised ResNet18 counterpart.
4.1 Comparative Analysis of Backbone Models
- 91.65% macro F1-score (standard deviation 2.38): ResNet18 led the evaluated backbones and also achieved the highest recall and precision.The three metrics were nearly equal, indicating balanced classification behavior across the three classes.Source: §4.1 · pp. 6–7
4.2 Sensitivity Analysis of Episodic Parameters
- 91.65% macro F1-score was best with 15-shot, 25-query; increasing query size from 20 to 25 generally gave modest gains.Across the tested configurations, macro F1-scores ranged approximately from 90.8% to 91.7%; the authors suggest additional support may add near-duplicates or reduce query-based training signal.Source: §4.2 · p. 7, Table 3 · p. 7
4.3 Domain-Specific vs. General-Purpose Pre-training
- 90.96% Macro F1-score at 40 epochs with ImageNet initialization exceeded RadImageNet's 90.79% peak at 80 epochs; RadImageNet fell to 89.93% at 100 epochs.The authors discuss ultrasound speckle and low contrast, and suggest broader feature diversity may benefit few-shot adaptation.Source: §4.3 · p. 8
4.4 Comparative Analysis: ProtoCAM vs. Conventional CNNs
- 0.910 Macro F1-score: ProtoCAM's ResNet18 exceeded its supervised counterpart's 0.531 Macro F1-score by 37.9% in the 3-way 5-shot setting.The comparison was conducted after 40 epochs under the same few-shot constraints.Source: Figure 2 · p. 8, §4.4 · pp. 8–9
4.5 Visual Interpretation of ProtoCAM Predictions
- Grad-CAM maps localized activation within benign lesions and around malignant lesions' irregular margins and internal texture; normal cases showed diffuse, low-intensity activation.The visualizations were generated for the ResNet18 model trained with 15-shot and 25-query settings.Source: §4.5 · p. 9
5 Conclusion
ProtoCAM combines mask-guided feature encoding, prototypical metric learning, and Grad-CAM interpretability, and is evaluated on BUSI with patient-level leakage prevention. It outperforms conventional CNN classifiers in a 3-way 5-shot setting, with ResNet18 performing best among evaluated backbones.
5 Conclusion
- 0.910 macro F1-score in the 3-way 5-shot setting, significantly outperforming conventional CNN classifiers under severe data constraints.Evaluation used the BUSI dataset and Stratified Group K-Fold cross-validation to prevent patient-level data leakage.Source: §5 · p. 9
- ProtoCAM integrates mask-guided feature encoding, prototypical metric learning, and Grad-CAM–based interpretability for breast ultrasound classification.The study evaluated the approach on BUSI using Stratified Group K-Fold cross-validation to prevent patient-level data leakage.Source: §5 · p. 9
- 91.65 percent macro F1-score made ResNet18 the best-performing evaluated backbone; a 15-shot configuration with 25 query samples per class performed best.The authors describe this configuration as balancing prototype stability and training diversity.Source: §5 · p. 9
- Grad-CAM visualizations showed focus on clinically meaningful lesion regions rather than background artifacts.This supports the framework’s interpretability assessment.Source: §5 · p. 9
6 Limitations and Future Work
The evaluation is limited to the BUSI public dataset, and mask-guided feature encoding depends on lesion masks that may require manual expert annotation. Future work will test multiple multi-centre datasets and explore automatic or weakly supervised lesion localization.
6 Limitations and Future Work
- Evaluation on a single public dataset, BUSI, may limit generalizability across institutions, imaging devices, and patient populations.The authors propose evaluation across multiple multi-centre ultrasound datasets to assess robustness and generalization.Source: §6 · p. 9
- Mask-guided feature encoding relies on lesion masks that may be unavailable in clinical settings and typically require expert manual annotation.The authors propose automatic or weakly supervised lesion localization to reduce dependence on manual annotations.Source: §6 · p. 9