Welcome to Journal of Graphics

Journal of Graphics ›› 2026, Vol. 47 ›› Issue (2): 322-331.DOI: 10.11996/JG.j.2095-302X.2026020322

• Image Processing and Computer Vision • Previous Articles     Next Articles

SAM-based mask generation and segmentation for dermatological images

CHEN Mengqi1, ZHAO Junli1(), DENG Xiaodan2   

  1. 1 College of Computer Science and Technology, Qingdao University, Qingdao Shandong 266071, China
    2 School of Automation, Qingdao University, Qingdao Shandong 266071, China
  • Received:2025-10-22 Accepted:2026-01-12 Online:2026-04-30 Published:2026-05-20
  • Contact: ZHAO Junli
  • Supported by:
    Shandong Provincial Natural Science Foundation General Project(ZR2024MF087);National Natural Science Foundation of China General Project(62172247);Shandong Provincial Natural Science Foundation(ZR2024QF184)

Abstract:

As a malignant tumor with a relatively high incidence rate, the timely detection of skin cancer carries substantial clinical significance. Accurate identification and segmentation of skin lesions serve as critical prerequisites for computer-aided diagnosis. Despite the remarkable performance of deep learning techniques in medical image segmentation, existing models commonly encounter challenges such as insufficient segmentation accuracy at lesion edges and constraints on the scale and diversity of training data. To address these issues, a boundary-enhanced model system named BESA-Diff was proposed. The system employed the boundary-enhanced diffusion model DermoSegDiff as its core segmentation architecture and optimized the model training workflow. The core technical contributions of this research were twofold: First, a framework for the automatic generation of pathological skin images and masks was constructed based on diffusion models. Second, an innovative mask refinement pipeline was designed by innovatively integrating the Segment Anything Model (SAM) with the edge refinement module of DermoSegDiff, and a high-quality synthetic medical image dataset was established. Experimental evaluations on the ISIC2018 standard dataset, PH2 dataset, HAM10000 dataset, and the synthetic dataset demonstrated that the proposed model significantly outperformed baseline models in key segmentation metrics, including the Dice Similarity Coefficient (Dice) and Intersection over Union (IoU). Ablation experiments confirmed that the introduction of SAM for mask refinement was the pivotal factor driving performance improvement. This module effectively enhanced the segmentation of lesion edges, particularly in regions with blurred boundaries or low contrast. The findings of this study validated that integrating the data generation capability of diffusion models with the boundary optimization capability of general segmentation models can effectively improve the accuracy and robustness of skin lesion segmentation. This work provided a high-performance solution for auxiliary diagnosis of skin cancer and highlighted the immense potential of synthetic data technology in overcoming the data bottleneck in medical artificial intelligence.

Key words: skin cancer, data enhancement, diffusion model, edge segmentation, image segmentation

CLC Number: