# New Approach for Brain Tumor Segmentation Based on Gabor Convolution and Attention Mechanism
## 2 Materials and Methods
### The CBAM Module
#### 2.3.2 Spatial Attention Module  
Different from the channel attention, spatial attention focuses on the locations of the effective information in the feature map, and its structure is shown in Figure 5, which mainly focuses on the relationship between different spatial locations in the feature map, and guides the network to focus on more important image regions by learning spatial weights. Specifically, firstly, two new feature maps are generated by downscaling the input feature map \(F^{\prime}\) in spatial dimensions with 3D average pooling and 3D maximum pooling. Their channel numbers are both 1. These two feature maps are spliced together. Secondly, the spliced feature maps are subjected to convolution operation with a 7\({}^{\circ}\)7 convolution kernel and then activated by a sigmoid function to generate a new feature map, and then finally apply it to the original feature map. In summary, the new feature map \(M_{s}(F)\) can be defined with Equation (13):  
\[M_{s}(F)=\sigma\Big{(}f^{\gamma\times 7}([AvgPool(F);MaxPool(F)])\Big{)}=\sigma \Big{(}f^{\gamma\times 7}\Big{(}F^{s}_{avg};F^{s}_{max}\Big{)}\Big{)} \tag{13}\]  
where \(M_{s}(F)\) denotes the output feature map; \(F\) denotes the input feature map; \(AvgPool\) denotes the three-dimensional average pooling operation; \(MaxPool\) denotes the three-dimensional maximum pooling operation; \(F^{s}_{avg}\) and \(F^{s}_{max}\) denote the features obtained with the average pooling and maximum pooling operationsrespectively; \(\sigma\) is the sigmoid activation function. Finally the output can be obtained with \(F^{\prime}=M_{s}(F^{\prime})\otimes F^{\prime}\).  
In convolutional neural networks, the convolution operation is a key step used to extract features from the input data. However, the convolution operation may introduce some redundant information or irrelevant features. The proposed approach adds the Gabor convolution operation to the 3D model, which may introduce redundant information to the model; in order to solve this problem, the CBAM module is added after the convolution to weight the feature map after the convolution operation, which enhances the expressive ability and feature selectivity of the network, and strengthens the network's ability to perceive the boundary information of the brain tumor. A more accurate location of the tumor region can thus be obtained. As a result, the segmentation accuracy can be improved.  
Figure 4: The structure of the attention channel module. The MaxPool layer is shown in dark blue color and the output of the shared MLP network on its output is shown in light blue color; The AvgPool layer is shown in dark orange color and the output of the shared MLP network on its output is shown in light orange color; input feature maps \(F\) and \(M_{c}\) are shown in light and dark green colors respectively.  
Figure 5: The structure of the spatial channel module, where the layer for MaxPool is shown in blue color and the layer for AvgPool is shown in orange color. In addition, the input feature and output feature maps are shown in light and dark green colors respectively.