Abstract
Ultrasound imaging suffers from significant domain shift due to hardware variability, often causing diagnostic models to fail when deployed across different devices. Traditional Unpaired Image Translation (UIT) methods frequently lead to semantic misalignment, where diagnostic features are distorted during style transfer. We present UI-Styler, a framework that performs class-aware style transfer in a "frozen black-box" setting, where internal model parameters are inaccessible. UI-Styler utilizes a dual-level stylization strategy: domain-level pattern matching for texture transfer and category-level class-aware prompting to preserve diagnostic semantics. Evaluated on four breast ultrasound datasets across 12 cross-device tasks, UI-Styler demonstrates state-of-the-art performance in classification and segmentation, effectively bridging the domain gap while maintaining diagnostic integrity.
Introduction
In medical ultrasound, the visual characteristics of images are highly dependent on the specific acquisition hardware. A deep learning model optimized for a high-end stationary scanner may perform poorly on a portable handheld device due to "domain shift." While Unpaired Image Translation (UIT) is a common solution to harmonize these styles, it often suffers from semantic misalignment—where the style transfer process inadvertently alters critical diagnostic features (e.g., changing the texture of a benign lesion such that it appears malignant to the AI).
Furthermore, real-world clinical deployment often involves "black-box" models provided via restricted APIs, where neither gradients nor internal feature maps are available. UI-Styler addresses these challenges by learning to navigate the decision boundaries of a frozen black-box model using only its final predictions (pseudo-labels).
Methodology
UI-Styler employs a dual-level stylization architecture to achieve both visual and semantic alignment:
- Domain-level Stylization: Utilizing a Vision Transformer (ViT) with cross-attention, the model identifies and extracts texture patterns from the target domain. These patterns are then "injected" into the source image features, ensuring the global "look" matches the target device while preserving anatomical structure.
- Category-level Stylization (Class-Aware Prompting): To maintain diagnostic consistency without internal model access, UI-Styler learns a set of "template prompts" based on the black-box model's pseudo-labels. These prompts serve as prototypes for specific diagnostic categories (e.g., benign vs. malignant).
- Directional Guidance: A novel direction loss encourages stylized features to align with the learned class prompts. This effectively "steers" the translation process toward the correct side of the black-box model's decision boundary, preventing the semantic drift common in typical UIT methods.
Experimental Results
The framework was validated using four public breast ultrasound datasets (BUSBRA, BUSI, UCLM, UDIAT) across 12 cross-device transfer tasks.
- Quantitative Performance: UI-Styler consistently outperformed existing UIT methods like TransColor and S2WAT. Notably, in the UCLM to BUSI task, it achieved a +5.00% improvement in classification accuracy over the best baseline. It also recorded the lowest Kernel Inception Distance (KID), indicating superior statistical similarity to real target-domain images.
- Qualitative Integrity: Grad-CAM analysis revealed that diagnostic models focused more accurately on tumor regions when processing UI-Styler-translated images compared to baselines, which often produced fragmented or noisy attention maps. This suggests that the diagnostic "signal" is better preserved during the style transfer process.
Conclusion
UI-Styler provides a robust solution for cross-device ultrasound diagnosis in restricted, black-box environments. By integrating class-aware prompts into the style transfer pipeline, it successfully mitigates semantic misalignment and improves the reliability of AI-assisted diagnosis. Future work will explore scaling the framework to multi-source domains and other medical imaging modalities such as MRI and CT scans.
Summary updated