Boosting Ultrasound Image Classification via Attribute-Guided Dual-Branch Framework


Abstract

Ultrasound image classification is essential for computer-aided diagnosis. However, current methods often neglect clinical priors, leading to poor generalization in challenging scenarios and a lack of interpretability that limits clinical adoption. To address these issues, we aim to develop a medical-prior module that can be seamlessly integrated into existing pipelines to enhance both diagnostic performance and interpretability. In this paper, we propose an attribute-guided dual-branch framework for ultrasound classification that introduces domain-agnostic medical attribute priors, improving generalization while offering interpretable evidence. Specifically, a baseline branch follows conventional architectures and predicts image categories via a fully connected classifier. An attribute-guided branch injects domain-agnostic attributes as priors and produces human-interpretable decision cues. Finally, an adaptive decision module fuses the two branches in a data-dependent manner to yield the final prediction. Experiments across diverse ultrasound classification tasks demonstrate that our approach can be integrated into multiple backbones and state-of-the-art methods with low overhead, consistently improving accuracy and interpretability. Code is available at: https://github.com/zhaobo253-crypto/AttrGuide.

1 Introduction↩︎

Ultrasound imaging is widely used in routine clinical practice because it is non-invasive, real-time, portable, and cost-effective[1], [2]. It supports screening, follow-up, and point-of-care assessment across fetal, breast, and other organ systems[1][5]. However, ultrasound images often suffer from speckle noise, low contrast, operator dependence, and large appearance variations across devices and acquisition settings, motivating extensive deep learning-based analysis[6], [7]. These factors make reliable interpretation difficult even for experienced clinicians and raise concerns about model generalization under distribution shift[8]. Therefore, accurate ultrasound image classification is important for computer-aided diagnosis, including fetal standard-plane recognition and breast lesion assessment[1], [2], [9].

Existing ultrasound classification methods mainly follow two paradigms. Conventional representation learning methods use transfer learning or self-supervised pretraining to extract discriminative features[3][5], [8], [10][13]. Although effective on benchmark datasets, these “black-box” models may overfit superficial textures rather than clinically meaningful attributes such as echo patterns, boundary cues, and internal structures. This can lead to misclassifications on hard cases (Fig. 1) and limits clinical trust because the prediction is difficult to verify. Interpretable and attribute-guided models, including Concept Bottleneck Models and Vision-Language Models, introduce semantic concepts to align model reasoning with clinical cognition[14][22]. Yet their dependence on dense annotations, task-specific concept labels, or complex prompt-tuning[23][25] limits lightweight adaptation and increases computational cost. Thus, improving both performance and interpretability without heavy annotation burdens remains challenging.

Motivated by this, we aim to develop a plug-and-play module for existing architectures[9] that improves diagnostic accuracy and transparency while preserving their original training pipelines. Two issues are central: how to transform domain-agnostic medical priors into a structured representation that can guide feature learning, and how to adaptively combine global semantic predictions with attribute-based cues across diverse clinical cases. A practical solution should provide interpretable evidence without requiring dense attribute annotation for every image.

Figure 1: Motivation. Traditional classifiers fail on hard samples; AttrGuide adds an attribute-guided branch for semantic self-correction with negligible overhead.

In this paper, we propose AttrGuide, an attribute-guided dual-branch framework that can be integrated into existing classifiers with negligible overhead. The original architecture serves as the baseline branch, while a parallel attribute-guided branch injects clinical priors to bridge visual features and medical knowledge. It constructs a lightweight semantic pathway from predefined medical attributes and reuses the backbone features for attribute matching. An adaptive fusion module then combines baseline logits with prior-informed attribute cues in a data-dependent manner, enabling low-cost self-correction and improving both generalization and interpretability. Since the branch reuses backbone features and performs decision-level fusion, the framework requires only minimal structural modification.

To summarize, the main contributions of this paper are:

  • Plug-and-play framework: We propose an attribute-guided dual-branch framework that can be seamlessly integrated into existing models to enhance both robustness and interpretability.

  • Clinical-prior injection: We design a dedicated attribute-guided branch that injects domain-agnostic medical priors to provide human-interpretable diagnostic evidence.

  • Adaptive decision fusion: We introduce an adaptive fusion module that dynamically reconciles global and attribute-based decisions to yield superior classification performance.

Extensive experiments show that AttrGuide can be integrated into various SOTA backbones, consistently improving performance and interpretability with negligible computational overhead.

2 Method↩︎

We consider a labeled ultrasound dataset \(\mathcal{D}=\{(x_i,y_i)\}_{i=1}^N\), where \(x_i\) is an image and \(y_i \in \{1,\dots,C\}\) is the class label. We collect English attribute words \(\mathcal{A}=\{a_k\}_{k=1}^{K}\) and build a fixed class–attribute matrix \(M\in\{0,1\}^{C\times K}\), where \(M_{c,k}=1\) if class \(c\) is expected to exhibit attribute \(k\). Our goal is to learn a mapping \(f_\theta: x \mapsto z_{\text{fus}} \in \mathbb{R}^C\), where \(\theta\) denotes all learnable parameters and \(z_{\text{fus}}\) are fused logits that integrate a conventional baseline branch with an attribute-guided branch before softmax. The overall architecture (Figure 2) treats any existing encoder+FC classifier as the baseline branch producing logits \(z_{\text{cls}}\), reuses its encoder features to drive an additional attribute-guided branch that produces attribute-based class logits \(z_{\text{attr}}\) via \(M\), and finally combines \(z_{\text{cls}}\) and \(z_{\text{attr}}\) through a lightweight fusion block at the decision level.

Figure 2: Overview of AttrGuide. Our plug-in module can be seamlessly integrated into existing ultrasound classifiers by reusing their encoder feature maps: a baseline branch follows the original encoder–classifier design, while an attribute-guided branch matches the same features with CLIP-derived attribute prototypes, aggregates them into attribute scores, maps them to class scores via a fixed class–attribute matrix, and is jointly optimized with the baseline prediction through classification and attribute-based regularization losses.

2.1 Building the Medical Attribute Semantic Space↩︎

We first construct an attribute semantic space on the text side. Let the pre-trained CLIP text encoder be \(T(\cdot)\)[26]. For each attribute word \(a_k\), we build an ultrasound-specific prompt and encode it as \(e_k = T(\texttt{prompt}(a_k)) \in \mathbb{R}^{d}\), stacking all attribute embeddings into \(E = [e_1;\dots;e_K] \in \mathbb{R}^{K\times d}\).

The matrix \(E\) is precomputed and frozen. On the image side, the backbone \(B(\cdot)\) outputs local features \(v_i\) (ViT tokens or ResNet patches), which together with \(\{e_k\}\) are projected into a shared space and \(\ell_2\)-normalized as \(\tilde{v}_i=\mathrm{norm}(W_v v_i)\) and \(\tilde{e}_k=\mathrm{norm}(W_a e_k)\).

In this common space, we measure the correlation between each patch and each attribute via cosine similarity and aggregate patches to obtain per-attribute logits: \[s_{k,i} = \cos(\tilde{v}_i,\tilde{e}_k),\quad w_{k,i} = \mathrm{softmax}_i(\gamma\cdot s_{k,i}),\quad \ell_k = \sum_{i=1}^{N} w_{k,i}\, s_{k,i}. \label{eq:attr-logits}\tag{1}\] where \(\gamma\) is a scaling factor and \(\ell=[\ell_1,\dots,\ell_K]\) is the attribute prediction vector. Given the class–attribute matrix \(M\), we derive for each class \(y\) a binary target vector \(m_y\in\{0,1\}^{K}\) that encodes which attributes are expected to be present, and supervise attribute prediction with: \[\mathcal{L}_{\text{attr-pred}}=\mathrm{BCEWithLogits}(\ell, m_{y}). \label{eq:attr-loss}\tag{2}\] Beyond this attribute-prediction loss, we introduce a regularization term that further pulls the predicted attribute activations towards the same target vector \(m_y\) using both an element-wise penalty and a directional constraint in the semantic space: \[\mathcal{L}_{\text{reg}} = \mathrm{MSE}(\sigma(\ell), m_y) + \bigl(1-\cos(\sigma(\ell), m_y)\bigr). \label{eq:reg-loss}\tag{3}\]

2.2 Dual-Branch Adaptive Fusion Module↩︎

Baseline classification branch. The global feature \(g\) from the frozen or fine-tuned backbone is passed through the existing classifier head to obtain logits \(z_{\text{cls}}=W_{\text{cls}} g\), which coincide with the baseline prediction (cls_logits).

Attribute-guided branch. The attribute logits \(\ell\) are passed through a sigmoid to obtain scores \(p=\sigma(\ell)\in[0,1]^K\), which we interpret as attribute activations for the current image. These activations are then aggregated into the class space using the fixed matrix \(M\). For class \(c\), we compute a weighted average over its attribute set: \[s_c=\frac{\sum_{k} M_{c,k}\, p_k\cdot p_k}{\sum_{k} M_{c,k}\, p_k+\epsilon}, \label{eq:class-score}\tag{4}\]

where \(s=[s_1,\dots,s_C]\) are class scores that are subsequently scaled to logits, yielding the attribute-guided output \(z_{\text{attr}}\).

Adaptive fusion (low-cost self-correction). To combine the two decisions, we use a learnable fusion weight \(\alpha\) and temperature \(\tau\) that rescale and interpolate the two logits. The final fused logits are \[z_{\text{fus}}=\alpha\cdot (z_{\text{cls}}/\tau) + (1-\alpha)\cdot (z_{\text{attr}}/\tau). \label{eq:fusion}\tag{5}\]

During training, we always use the fused output \(z_{\text{fus}}\) as the sole classification head, computing the cross-entropy loss only on \(z_{\text{fus}}\); the attribute prediction and regularization terms act as auxiliary supervision to shape the shared representation and fusion weights, as validated by the ablations in Table 3.

2.3 Joint Optimization Objective and Training Strategy↩︎

The training objective combines a cross-entropy loss on the fused logits, an attribute prediction loss, and a regularization term that aligns attribute predictions with the class–attribute matrix: \[\mathcal{L}= \lambda_{\text{fus}}\,\mathcal{L}_{\text{fus}} + \lambda_{\text{reg}}\,\mathcal{L}_{\text{reg}} + \lambda_{\text{attr-pred}}\,\mathcal{L}_{\text{attr-pred}}. \label{eq:overall-loss}\tag{6}\]

where \(\mathcal{L}_{\text{fus}}\) is the cross-entropy loss between the fused logits \(z_{\text{fus}}\) and the true class label, \(\mathcal{L}_{\text{attr-pred}}\) is the BCEWithLogits loss on attribute logits \(\ell\) against the binary target vector \(m_y\), and \(\mathcal{L}_{\text{reg}}\) is the regularization term in Eq. 3 that combines an MSE penalty and a cosine-similarity term between the predicted attribute activations (after sigmoid) and the same target vector \(m_y\) derived from \(M\). Using both terms encourages the model to match each attribute probability numerically while also aligning the overall attribute direction in the semantic space. All modules—including the backbone, attribute branch and fusion weight—are optimized jointly using a single optimizer, while the primary supervision for classification is always applied to \(z_{\text{fus}}\).

3 Experiments↩︎

3.1 Datasets and Setup↩︎

Datasets. We consider both public and private ultrasound datasets. The breast cancer three-class task is based on BUSI[2] (normal/benign/malignant), while the fetal plane 7-class task uses an internal multi-center dataset of standard views (abdomen, brain, femur, etc.).

Models and Training. We adopt ImageNet-pretrained ResNet50, ViT-B and Vim-s-16 (BU-Mamba[27]) backbones and simply attach our attribute-guided branch and fusion head, denoting the resulting model as AttrGuide. All models are trained with Adam under the same hyper-parameters (learning rate \(1\times10^{-4}\), batch size 32), and the attribute tables are designed by ultrasound experts from public guidelines for BUSI and the fetal views.

3.2 Results and Analysis↩︎

We first evaluate AttrGuide as a plug-in to an existing SOTA framework. On BUSI, we attach our module to the BU-Mamba Vim-s-16 encoder[27] and compare it with ViT and VMamba baselines to verify that it works across diverse backbones without re-designing the architecture. We further test whether the same module remains effective in a multi-task setting where BUSI classification is trained jointly with segmentation or auxiliary tasks [28]. Table ¿tbl:tab:busi95encoders? reports BUSI test accuracy, including BU-Mamba with and without AttrGuide, and the accompanying multi-task plot shows how attribute guidance influences ACC and Macro F1.

4pt

Table 1: Overall performance on BUSI and fetal 7-class tasks. Acc (%) and Macro F1 (%) for Baseline and +Attribute Guidance (\(\uparrow\) denotes absolute improvement over Baseline).
Dataset Backbone Acc Acc Macro F1 Macro F1
Baseline +Attr Baseline +Attr
BUSI (3-class) ViT-B 81.1 85.4\(\uparrow\)4.3 79.86 82.76\(\uparrow\)2.90
ResNet50 81.5 83.3\(\uparrow\)1.8 81.04 82.35\(\uparrow\)1.31
Fetal (7-class, private) ViT-B 92.8 94.9\(\uparrow\)2.1 90.69 94.25\(\uparrow\)3.56
ResNet50 92.2 92.6\(\uparrow\)0.4 90.22 91.51\(\uparrow\)1.29

4pt

Table 2: Training cost on BUSI. Time is minutes per fold and Params are in millions. For each backbone, \(\Delta\) denotes the absolute increase of +Attr over Baseline (\(\uparrow\)).
Backbone Setting Time \(\Delta\) Params \(\Delta\)
(min) (min) (M) (M)
ViT-B Baseline 11.02 85.8
+Attr 11.18 \(\uparrow\)0.16 86.4 \(\uparrow\)0.6
ResNet50 Baseline 10.35 23.5
+Attr 11.20 \(\uparrow\)0.85 24.8 \(\uparrow\)1.3
Mamba Baseline 73.98 25.4
+Attr 75.91 \(\uparrow\)1.93 25.9 \(\uparrow\)0.5

4pt

Generality. AttrGuide consistently improves performance across datasets and backbones, and remains effective when plugged into a strong baseline (BU-Mamba), improving BUSI test accuracy from 87.86% to 88.72% (Tables ¿tbl:tab:busi95encoders? and 1).

Low cost. The plug-in attribute-guided branch adds only marginal training-time and parameter overhead on BUSI (Table 2), while delivering consistent gains across backbones (Table 1).

Table 3: Ablation on the private fetal 7-class task (ViT-B). \(\Delta\) denotes absolute improvement over Cls-only.
Cls branch Attr branch Learnable fusion Test Acc (%) \(\Delta\)
89.1
Avg 90.3 \(\uparrow\)1.2
92.6 \(\uparrow\)3.5
94.9 \(\uparrow\)5.8

6pt

Figure 3: Interpretability via attribute prediction. (a) Pred-attr accuracy: fetal 87.56%, BUSI 83.29%. (b)–(c) Example cases.

Interpretability. Figure 3 shows that the attribute-guided branch predicts clinically meaningful attributes with high accuracy (87.56% fetal, 83.29% BUSI), providing human-interpretable cues for verification.

Ablation. Table 3 verifies that learnable fusion is crucial: the full model achieves the best accuracy (+5.8 over Cls-only) and outperforms naive averaging, showing that both branches are needed.

4 Conclusion↩︎

In this paper, we introduce an attribute-guided dual-branch framework to enhance ultrasound classification by bridging visual features with clinical priors. We demonstrate that our approach consistently boosts the performance of SOTA backbones—for instance, improving BU-Mamba’s accuracy on the BUSI dataset from 87.86% to 88.72%—while remaining highly efficient with less than 5% additional training time. From the results, we mainly conclude that: (1) the injection of domain-agnostic attributes provides essential evidence that bolsters both model robustness and clinical interpretability; and (2) the adaptive fusion module is critical for synergistically integrating global and attribute-based semantics. In the future, we intend to extend this low-cost, plug-and-play enhancement to a broader range of medical imaging tasks.

References↩︎

[1]
Burgos-Artizzu, X.P., Coronado-Gutiérrez, D., Valenzuela-Alcaraz, B., et al.: Evaluation of deep convolutional neural networks for automatic classification of common maternal fetal ultrasound planes. Scientific Reports10, 10200 (2020).
[2]
Al-Dhabyani, W., et al.: Dataset of breast ultrasound images. Data in Brief28, 104863 (2020).
[3]
Zheng, X., et al.: XFMamba: Cross-Fusion Mamba for Multi-View Medical Image Classification. arXiv:2503.02619 (2025).
[4]
Feng, Z., Fu, J., Zou, X., Ye, H., Wu, H., Zhou, J., Wang, Y.: Hybrid-View Attention Network for Clinically Significant Prostate Cancer Classification in Transrectal Ultrasound. arXiv:2507.03421 (2025).
[5]
Lin, Z., et al.: UniUSNet: A Promptable Framework for Universal Ultrasound Disease Prediction and Tissue Segmentation. arXiv:2406.01154 (2024).
[6]
Litjens, G., et al.: A survey on deep learning in medical image analysis. Medical Image Analysis42, 60–88 (2017).
[7]
Tajbakhsh, N., et al.: Convolutional Neural Networks for Medical Image Analysis: Full Training or Fine Tuning? IEEE Transactions on Medical Imaging35(5), 1299–1312 (2016).
[8]
Zech, J.R., et al.: Variable generalization performance of a deep learning model to detect pneumonia in chest radiographs: a cross-sectional study. PLoS Medicine15(11), e1002683 (2018).
[9]
Chen, Y., Zhao, S., Chen, B., Gustaf, M.: Clinically guided adaptive contrast adjustment for fetal plane classification: a modular plug-and-play solution. Frontiers in Physiology16, 1689936 (2025).
[10]
Azizi, S., et al.: Big self-supervised models advance medical image classification. In: Proceedings of ICCV, pp. 3478–3488 (2021).
[11]
Chen, T., et al.: A simple framework for contrastive learning of visual representations. In: Proceedings of ICML, pp. 1597–1607 (2020).
[12]
He, K., et al.: Momentum contrast for unsupervised visual representation learning. In: Proceedings of CVPR, pp. 9729–9738 (2020).
[13]
You, K., Lee, S., Jo, K., Park, E., Kooi, T., Nam, H.: Intra-class contrastive learning improves computer aided diagnosis of breast cancer in mammography. In: Medical Image Computing and Computer Assisted Intervention – MICCAI 2022, pp. 331–340 (2022).
[14]
Lampert, C.H., Nickisch, H., Harmeling, S.: Attribute-based classification for zero-shot visual object categorization. IEEE Trans. Pattern Anal. Mach. Intell.36(3), 453–465 (2014).
[15]
Lei, Y., Li, Z., Shen, Y., Zhang, J., Shan, H.: CLIP-Lung: Textual knowledge-guided lung nodule malignancy prediction. In: Medical Image Computing and Computer Assisted Intervention – MICCAI 2023, pp. 403–412 (2023).
[16]
Ghosh, S., Poynton, C.B., Visweswaran, S., Batmanghelich, K.: Mammo-CLIP: A Vision Language Foundation Model to Enhance Data Efficiency and Robustness in Mammography. In: Proceedings of MICCAI(2024); arXiv:2405.12255.
[17]
Gao, Y., Gu, D., Zhou, M., Metaxas, D.: Aligning Human Knowledge with Visual Concepts Towards Explainable Medical Image Classification. arXiv:2406.05596 (2024).
[18]
Fang, X., Lin, Y., Zhang, D., Cheng, K.-T., Chen, H.: Aligning Medical Images with General Knowledge from Large Language Models. arXiv:2409.00341 (2024).
[19]
Koh, P.W., Nguyen, T., Tang, Y.S., Mussmann, S., Pierson, E., Kim, B., Liang, P.: Concept Bottleneck Models. arXiv:2007.04612 (2020).
[20]
Oikarinen, T., Das, S., Nguyen, L.M., Weng, T.-W.: Label-Free Concept Bottleneck Models. arXiv:2304.06129 (2023).
[21]
Yuksekgonul, M., Wang, M., Zou, J.: Post-hoc Concept Bottleneck Models. arXiv:2205.15480 (2023).
[22]
Chen, S., Wang, W., Xia, B., et al.: TransZero: Attribute-Guided Transformer for Zero-Shot Learning. arXiv:2112.01683 (2021).
[23]
Shakeri, F., et al.: Few-shot Adaptation of Medical Vision-Language Models. In: Proceedings of MICCAI(2024).
[24]
Huang, Y., Cheng, P., Tam, R., Tang, X.: Fine-grained Prompt Tuning: A Parameter and Memory Efficient Transfer Learning Method for High-resolution Medical Image Classification. In: Proceedings of MICCAI(2024).
[25]
Hussein, N., Shamshad, F., Naseer, M., Nandakumar, K.: PromptSmooth: Certifying Robustness of Medical Vision-Language Models via Prompt Learning. In: Proceedings of MICCAI(2024).
[26]
Radford, A., et al.: Learning transferable visual models from natural language supervision. arXiv:2103.00020 (2021).
[27]
Nasiri-Sarvi, A., Hosseini, M.S., Rivaz, H.: Vision Mamba for Classification of Breast Ultrasound Images. arXiv:2407.03552 (2024). (MICCAI 2024 Deep-Breath Workshop).
[28]
Aumente-Maestro, C., Díez, J., Remeseiro, B.: A multi-task framework for breast cancer segmentation and classification in ultrasound imaging. Computer Methods and Programs in Biomedicine260, 108540 (2025).