Boosting Medical Image Classification with Segmentation Foundation Model

Pengfei Gu, Zihan Zhao, Hongxiao Wang, Yaopeng Peng, Yizhe Zhang, Nishchal Sapkota, Chaoli Wang, Danny Z. Chen

Abstract

While foundation models like the Segment Anything Model (SAM) have set new benchmarks in general-purpose image segmentation, their application to medical image classification remains underexplored. This paper presents a novel approach to repurpose SAM for diagnostic tasks through a specialized data augmentation technique called SAMAug-C and a robust dual-branch ensemble framework. By highlighting regions of interest without sacrificing critical textural details, the proposed method achieves state-of-the-art performance across diverse medical imaging datasets, including skin lesions and colorectal cancer pathology.

Introduction

The advent of foundation models has transformed computer vision, with the Segment Anything Model (SAM) leading the way in zero-shot segmentation. However, the transition of these models into the medical domain is often hindered by the unique characteristics of medical imagery, such as low contrast and ambiguous boundaries. Furthermore, while SAM excels at identifying "where" an object is, its utility in determining "what" an object represents—classification—has been limited. This research addresses this gap by leveraging SAM's spatial awareness to enhance the accuracy of medical image classification.

The Limitations of Standard Augmentation

Previous attempts to integrate SAM into classification workflows often relied on standard augmentation techniques (e.g., SAMAug), which were originally designed for segmentation. These methods typically overlay segmentation masks or add them as additional channels. In a classification context, this approach is counterproductive; it often "paints over" or obscures the subtle textures and color variations that are essential for accurate diagnosis. Consequently, standard SAM-based augmentation can actually degrade model performance compared to using raw images alone.

Methodology: SAMAug-C and Dual-Branch Framework

To overcome these hurdles, the authors introduce two primary innovations: SAMAug-C and a dual-branch ensemble architecture.

SAMAug-C

Unlike traditional masking, SAMAug-C (SAM Augmentation for Classification) focuses on highlighting rather than obscuring. The process begins by using SAM to generate a binary mask of the target object (e.g., a lesion or a specific tissue structure). Instead of replacing pixels, the method adds a constant value to the masked region across all RGB channels. This results in a "brightened" region of interest that directs the model's attention to the relevant area while preserving the underlying pixel information and texture.

Dual-Branch Ensemble Framework

Recognizing that SAM's zero-shot performance is not infallible—particularly in challenging medical contexts—the authors developed a dual-branch architecture to ensure robustness.

  1. Raw Branch: Processes the original, unaltered image to ensure the model has access to the full dataset.
  2. Augmented Branch: Processes the SAMAug-C highlighted image to benefit from the spatial guidance provided by the foundation model.

The outputs from both branches (using backbones such as ResNet or SENet) are combined via an Ensemble Module. This module uses a weighted average to produce the final prediction, effectively balancing the "pure" data with the "guided" data. If SAM fails to generate a mask, the augmented branch defaults to the raw image, maintaining system stability.

Experimental Results

The framework was evaluated on three distinct datasets representing different medical challenges:

  • ISIC 2017 (Skin Lesions): For melanoma detection, the ensemble using a SENet154 backbone achieved 86.67% accuracy, significantly higher than the raw baseline (84.45%) and the standard SAMAug approach (82.53%).
  • Vitiligo Dataset: In identifying vitiligo conditions, the model showed a dramatic improvement in AUC, rising from 0.958 to 0.993.
  • ExtCRC (Colorectal Cancer): On high-resolution pathology images, the SE-ResNet50 ensemble reached 83.52% accuracy, compared to the 81.33% baseline.

Discussion and Conclusion

The success of SAMAug-C highlights a "less is more" principle in medical data augmentation. By simplifying the interaction between the segmentation mask and the raw image, the researchers turned a potential performance penalty into a consistent boost. The dual-branch approach further ensures that the system remains reliable even when the foundation model's zero-shot capabilities reach their limits.

While the computational cost of running a dual-branch system and a large foundation model is higher than standard methods, the gains in diagnostic accuracy present a compelling case for its use. Future research may focus on integrating SAM’s internal embeddings directly into classification layers, potentially reducing the reliance on explicit mask generation and further streamlining the diagnostic pipeline.

Summary updated

BibTeX
@inproceedings{gu2024boosting,
  author = {Pengfei Gu and Zihan Zhao and Hongxiao Wang and Yaopeng Peng and Yizhe Zhang and Nishchal Sapkota and Chaoli Wang and Danny Z. Chen},
  title = {{Boosting Medical Image Classification with Segmentation Foundation Model}},
  booktitle = {ISBI},
  year = {2024},
  doi = {10.1109/isbi56570.2024.10635429},
}
Figure