BAS-SegNet, a novel boundary-aware segmentation framework that addresses limitations through an enhanced deep learning architecture, shows particular effectiveness under challenging ultrasound conditions where lesion boundaries are ambiguous, offering significant potential for automated clinical diagnosis support.
Early diagnosis of breast and skin cancers significantly reduces mortality rates, yet manual segmentation remains challenging due to subjective interpretation, radiologist fatigue, and irregular lesion boundaries. This study presents BAS-SegNet, a novel boundary-aware segmentation framework that addresses these limitations through an enhanced deep learning architecture. The proposed method integrates three key innovations: (1) an enhanced CNN-based architecture with a switchable feature pyramid interface, a tunable ASPP module, and consistent dropout regularization; (2) an edge-aware preprocessing pipeline using Sobel-based edge magnitude maps stacked as additional channels with geometric augmentations; (3) a boundary-aware hybrid loss combining Binary Cross-Entropy, Dice, and Focal losses with auxiliary edge supervision from morphological gradients. Experimental validation on the BUSI breast ultrasound and ISIC skin lesion datasets demonstrates superior performance, achieving Dice scores of 0.814 and 0.935, respectively, with IoU improvements of 16.3–22.4% for breast cancer and 8.8–11.5% for skin cancer compared with existing methods. The framework shows particular effectiveness under challenging ultrasound conditions where lesion boundaries are ambiguous, offering significant potential for automated clinical diagnosis support.