# Transformer-Based Explainable Model for Breast Cancer Lesion Segmentation
## 3 Methodology
### Lightweight Channel Enhancement Method Based on Multi-Scale Features  
To reduce the complexity of the model and achieve multi-channel feature fusion, we propose a lightweight channel enhancement method based on multi-scale features. The image feature maps obtained by the TEBLS model at different levels are denoted as \(F_{0},F_{1},F_{2},F_{3}\). These features are concatenated along the channel dimension to obtain a mixed feature map with a channel size of 4\(C\). After a linear transformation, the number of channels is reduced to \(C\). To reduce the dimensionality of the channels for subsequent transformations, we use a \(1\times 1\) convolution layer, a batch normalization layer, and a ReLU activation function to transform the channels from \(C\) to \(R\). Moreover, a max. pooling layer is applied to reduce the size of the feature map while extracting the most prominent features. To further reduce the complexity and number of parameters, we use grouped convolutions to split the channels into three groups, applying convolution operations to each group separately. Furthermore, in order to capture more detailed features, we perform channel transformations on the features of each group through three stages: stage 2, stage 3, and stage 4. The number of channels increases from \(R\) to 240 in stage 2, to 480 in stage 3, and to 960 in stage 4. During this process, the image size progressively decreases: in stage 2, the image size is \(4\times 4\); in stage 3, the image size becomes \(2\times 2\); and in stage 4, the image size is reduced to \(1\times 1\). A global average pooling operation is applied to obtain a channel feature representation of the dimension 960. Subsequently, global pooling is applied to the entire feature map. After the global pooling layer, the feature map of the size \(H\times W\times R\) is reduced to \(1\times 1\times R\). To ensure that the output channel number matches the input channel number, we use a linear layer to transform the output channels back to \(C\). Finally, a softmax layer outputs the weights of the channel feature representations. To effectively fuse the rich semantic information contained in the original input features and compensate for any potentially ignored semantic information during the channel transformation process, we element-wise multiply the obtained feature weights with the original input feature map. Through these operations, the resolution of the feature map is restored to the input resolution \(W\times H\). These features are then linearly projected to obtain pixel-level classification prediction results. The specific calculation formula for channel transformation is as follows: First, the number of channels \(C\) is transformed using the first \(1\times 1\) convolution layer to reduce the number of parameters. Then, a grouped convolution is applied to the obtained features, dividing them into groups. After grouping, a channel transformation operation is performed on the features to enhance the information modeling between the channels. \begin{table}
\begin{tabular}{l c c} \hline \hline  & **Image Size** & **Number of Channels** \\ \hline \(B^{0,0}\) & 56 & C \\ \(B^{1,0}\) & 28 & 2 C \\ \(B^{0,1}\) & 56 & C \\ \(B^{2,0}\) & 14 & 4 C \\ \(B^{1,1}\) & 28 & 2 C \\ Bottleneck layer & 7 & 8 C \\ \(B^{0,2}\) & 56 & C \\ \(B^{2,1}\) & 14 & 4 C \\ \(B^{1,2}\) & 28 & 2 C \\ \(B^{0,3}\) & 56 & C \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The output dimensions of the swin block unit, detailing image sizes and corresponding channel numbers across different layers. This transformation allows for the efficient extraction and modeling of features across different channel groups, leading to improved feature representation while minimizing computational complexity. The computation process formula is as follows. \[X=Fc(G(Fcf(Fgc(Fc2r(C,Wc),Wg)),Wr)) \tag{3}\]  
where we have the following:  
* \(Fcf()\) represents the channel transformation operation.