# Transformer-Based Explainable Model for Breast Cancer Lesion Segmentation
## 5 Discussion  
Segmenting lesion regions from medical imaging data is of significant importance for the early diagnosis and treatment of breast cancer. However, traditional image segmentation algorithms [11; 20; 21; 22; 23] can only extract low-level features, making them inadequate for diverse datasets and complex segmentation tasks. With advancements in computational power and data availability, CNN-based [14; 24; 25; 26; 27; 28; 29] and transformer-based [6; 16; 30; 31; 32; 33; 34] image segmentation models have gradually replaced traditional methods and are widely used in complex segmentation tasks. CNN-based segmentation models demonstrate strong feature extraction and representation capabilities, but due to the local receptive field of convolutional kernels, they are typically limited to processing local regions and struggle to capture long-range dependencies between pixels in an image. On the other hand, transformer-based models leverage self-attention mechanisms to effectively capture long-range dependencies but often fall short of capturing fine-grained semantic information. Moreover, the lack of interpretability in deep learning algorithms poses challenges for their application in the medical domain. To address these issues, we present an interpretable image segmentation model for the automated segmentation of breast cancer images. To address the issue of blurred boundaries in segmentation results caused by existing models' lack of detailed spatial information capturing local features, we developed a  
Figure 5: Visualizations of TEBLS outputs. The set includes the original input images, ground truth segmentations, TEBLS predictions, Grad-CAM visualizations highlighting model focus, and superimposed images showing the overlay of Grad-CAM heatmaps on the original images. The Grad-CAM visualizations help illustrate which areas of the image TEBLS prioritized during segmentation, providing insight into the model’s decision-making process (TP: true positive; FP: false positive; FN: false negative). densely nested feature fusion model based on transformers. The model uses a locally fully connected structure to capture finer-grained features and performs multi-level feature fusion to extract multi-scale image information. Additionally, a self-attention mechanism was incorporated to capture intra-image interactions, enhancing the model's ability to learn spatial details. These mechanisms improved segmentation accuracy and detail representation and reduced boundary blurriness. To reduce the complexity and high computational cost associated with transformer-based image segmentation models, we developed a lightweight multi-scale feature channel enhancement method. By extending and transforming feature channels, our method promoted effective information flow between channels, enabling the capture of more detailed semantic information related to breast cancer and achieving improved feature representation. The effectiveness of the proposed model was evaluated using the mean AUC and mean DSC metrics for segmentation and classification tasks. Experimental results demonstrated that the model achieved accurate segmentation of breast cancer lesion regions. Moreover, a comparison of the TEBLS model with two other models (Swin-Unet++ and Swin-Unet) in terms of parameter complexity and inference time confirmed that the TEBLS model is a lightweight segmentation model with faster inference speed. Additionally, Grad-CAM was used to enhance the interpretability of the transformer-based model, which can be challenging to understand due to its complex self-attention mechanisms. Figure 2 illustrates how Grad-CAM highlighted areas of focus within the model, helping to identify potential weaknesses, such as instances where the model may not have attended to the correct regions. This addresses the issues related to the data or training process. In Figure 5, TP shows the true positive cases. TEBLS accurately captured the lesion areas, providing clear details in both the image edges and the lesion regions.