# Liver Tumor Computed Tomography Image Segmentation Based on an Improved U-Net Model
## 4 Improved U-Net for Liver Tumor Segmentation
### Attention Module  
There exists a special information processing mechanism in the human brain known as a visual attention mechanism. When humans view a photograph, their eyes quickly scan the entire image, selecting the areas they want to focus on. The attention intensity is then enhanced in those selected regions, highlighting the important information of the objects they wish to pay attention to and filtering out the irrelevant details. Machine vision also operates with a similar attention mechanism, aiming to extract the most important and useful information from massive amounts of data. Building models based on attention mechanisms is crucial in deep neural networks as it allows for the self-regulation of attention and perception of the external world.  
Since the introduction of the squeeze-and-excitation network (SENet) [28] and its channel attention (CA) mechanism, subsequent attention mechanisms such as the concurrent spatial and channel squeeze and excitation (scSE) ([PERSON] et al., 2018) and the convolutional block attention module (CBAM) ([PERSON] et al., 2018) have been proposed, incorporating spatial attention mechanisms. The attention module used in this study first captures the importance of each channel through channel attention, and then adaptively adjusts the output through element-wise multiplication with the input features. This approach recalibrates the importance of feature maps, suppressing relatively irrelevant locations, and has a positive effect on fine-grained image segmentation. The calculation formula for the attention module in this paper is as follows:  
Figure 2: Overall model and key components of this study. (**a**) Overall structure; (**b**) attention module; (**c**) multi-scale convolution module (MSCM).  
\[\widetilde{X}=(((XW_{1})*\text{Relu}(\text{F}_{\text{g}}(X)W_{2}))W_{3})\otimes X \tag{5}\]  
where \(X\in R^{HW\times C}\) represents the input feature map, \(C\) represents the number of channels, and \(H\) and \(W\) represent the height and width of the feature map, respectively. \(W_{1},W_{2}\in R^{C\times\frac{C}{7}}\) denotes the convolutional matrix, and r represents the compression ratio for feature compression, which was set to two in this study. \(\text{F}_{\text{g}}(X)\in R^{1\times C}\) represents the global average pooling operation. \(W_{3}\in R^{\frac{C}{7}\times C}\) represents the convolutional matrix used to restore the channel dimension to its original size, \(C\). Relu represents the activation function that converts negative values to 0, enabling the neurons to have sparse activation. The symbol \(*\) represents the shape expansion, making the two parameters on the right side match the shape of the left parameter and then performing element-wise multiplication. The \(\otimes\) operator represents the element-wise multiplication of matrices. In summary, this module controls the flow of information across different levels in the pipeline. It performs feature transformation, suppressing irrelevant features and allowing only useful information to pass through the network layers. This enables each level to focus on complementary details with other levels, enhancing the overall performance of the network. Through this module, we can delve deeper into the effective information in medical images, improve the network's expressiveness, and reduce interference from background noise. This allows us to focus on the deep-level features of the desired lesion and accurately classify it.