# New Approach for Brain Tumor Segmentation Based on Gabor Convolution and Attention Mechanism
## 2 Materials and Methods
### The CBAM Module  
CBAM [24] is a model of attention mechanism that can be used to enhance the performance of convolutional neural networks. Specifically, the attention mechanism provides guidance to the network such that it can automatically learn what to pay attention to in a sequence of pictures or text, and its purpose is to enhance the perception of a deep convolutional neural network and the utilization of image features and to improve accuracy. The CBAM starts from two key domains of action, namely, the channel and the space. Two analytical dimensions, spatial attention and channel attention, are introduced. Such a design implements a sequential attention structure from channel to space, where spatial attention allows a neural network to focus more on the pixel regions of the image that are important for classification, thus ignoring irrelevant regions. Meanwhile, channel attention is used to deal with the allocation relationship of the feature map channels. In other words, CBAM makes the neural network more focused on processing the image information by considering both spatial and channel attention, selectively emphasizing important channels and spatial locations in the image, thus improving the network performance. The so-called channel attention mechanism informs the network what to pay attention to, and the spatial  
\begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Descriptions** \\ \hline \(\theta\) & Parallel stripe direction of the filter, value range [0–360\({}^{\circ}\)] \\ \hline \(\phi\) & Offset phase of the filter, value range [ –180–180\({}^{\circ}\)] \\ \hline \(\sigma\) & The standard deviation of the Gaussian function that determines the size of the filter space. This value is related only to the semi-response spatial frequency bandwidth, when \(b=1,\ \sigma=0.56\ \lambda\). \\ \hline \(\gamma\) & The spatial aspect ratio, used to adjust the shape of the Gabor filter in the \(x\) and \(y\) directions. When the value is 1, it is circular; when the value is less than 1, the filter shape is elongated with the direction of the parallel stripes. \\ \hline \(\lambda\) & Spatial frequency-dependent wavelengths associated with sinusoidal components \\ \hline \(b\) & Half-response spatial frequency bandwidth, related to \(\sigma/\lambda\), is a positive real number, generally taken as 1. \\ \hline \hline \end{tabular}
\end{table}
Table 1: Descriptions of all parameters of the filter.  
attention mechanism tells the network where to pay attention to, and its overall network structure diagram is shown in Figure 3.  
Figure 3 shows the overall structure of CBAM; the green module represents a channel attention module and the purple color represents a spatial attention module. The input feature map \(F\) passes through the channel attention module and the spatial attention module in turn. The overall process can be expressed as follows: for the feature map generated by the network, \(F\in R^{C\times H\times W}\), CBAM generates channel attention feature maps separately, \(M_{c}\in R^{C\times 1\times 1}\), and spatial attention feature maps, \(M_{s}\in R^{1\times H\times W}\). It can be described by Equations (9) and (10), where the operator\(\otimes\)denotes element-level multiplication, with a broadcast mechanism for dimensional transformation and matching in between.  
\[F^{\prime}=M_{c}(F)\otimes F \tag{9}\]  
\[F^{\prime}=M_{s}\big{(}F^{\prime}\big{)}\otimes F^{\prime} \tag{10}\]