# New Approach for Brain Tumor Segmentation Based on Gabor Convolution and Attention Mechanism
## 2 Materials and Methods
### Gabor Filters  
As early as 1946, [PERSON] [19] proposed a one-dimensional Gabor function in his published paper. In 1980, [PERSON] [20] proposed a two-dimensional form of the Gabor function. The design of this filter is inspired by the Gabor wavelet in biology, which is based on the working principle of the human visual system and simulates the response properties of simple cells in the visual cortex. The results of researchers such as [PERSON] [21] and [PERSON] [22] showed that biological cells have different perceptions of stimuli of different frequencies during visual processing, and their response patterns can be described by a two-dimensional Gabor filter. This filter presents excellent selectivity in the frequency domain and is able to capture features of different frequencies in the image. Gabor convolution is a technique that integrates the interpretability of Gabor filters with the powerful learning capabilities of convolutional neural networks (CNNs) [23]. The Gabor filter is a linear filter mainly used for image edge detection. Its design is inspired by the visual response of simple cells, and it can effectively mimic the properties of the human visual system and can perform feature extraction from different scales and directions. As a result, Gabor filters excel in capturing image texture features. In addition to texture features, the Gabor filter can also recognize useful features in the sample image and is sensitive to changes in image brightness, contrast, etc., thus giving the model greater robustness. The Gabor function consists of a Gaussian function and a cosine function, whose expression is in complex form and consists of a real part and an imaginary part, which are orthogonal to each other. Among them, the filtering of the real part can be used to smooth the image, while the filtering of the imaginary part is used for edge detection. Therefore, based on their excellent performance, Gabor filters are widely used in many fields such as texture analysis, image classification, and action recognition. The 3D Gabor filter can be described by Equations (1)-(3), where \(x^{\prime}\), \(y^{\prime}\), and \(z^{\prime}\) are coordinates adjusted relative to the center position in space, calculated with Equations (4)-(6), where \(\theta\), \(\varphi\), \(\gamma\), \(\lambda\) are the parameters of the filter, and the specific explanation of each parameter is shown in Table 1. The relationship between \(b\) and \(\sigma/\lambda\) is given by Equations (7) and (8). \[G(x,y,z;\theta,\phi,\sigma,\gamma,\lambda)=G_{re}(x,y,z;\theta,\phi,\sigma, \gamma,\lambda)+jG_{im}(x,y,z;\theta,\phi,\sigma,\gamma,\lambda) \tag{1}\]  
\[G_{re}(x,y,z;\theta,\phi,\sigma,\gamma,\lambda)=\exp\Biggl{(}-\frac{{x^{\prime 2 }+\gamma^{2}{y^{\prime}}^{2}+\gamma^{2}{z^{\prime}}^{2}}}{2\sigma^{2}}\Biggr{)} \cos\Biggl{(}2\pi\frac{x^{\prime}}{\lambda}+\phi\Biggr{)} \tag{2}\]  
\[G_{im}(x,y,z;\theta,\phi,\sigma,\gamma,\lambda)=\exp\Biggl{(}-\frac{{x^{\prime 2 }+\gamma^{2}{y^{\prime}}^{2}+\gamma^{2}{z^{\prime}}^{2}}}{2\sigma^{2}}\[PERSON]{)} \sin\Biggl{(}2\pi\frac{x^{\prime}}{\lambda}+\phi\Biggr{)} \tag{3}\]  
\[x^{\prime}=xcos(\theta)+ysin(\theta)+z\phi \tag{4}\]  
\[y^{\prime}=-xsin(\theta)+ycos(\theta) \tag{5}\]  
\[z^{\prime}=zcos(\theta)-y\phi \tag{6}\]\[b=\log_{2}\frac{\frac{\sigma}{\lambda}\pi+\sqrt{\frac{\frac{\eta \eta 2}{2}}{2}}}{\frac{\sigma}{\lambda}\pi-\sqrt{\frac{\eta 2}{2}}} \tag{7}\] \[\frac{\sigma}{\lambda}=\frac{1}{\pi}\sqrt{\frac{\eta 2}{2}}\frac{2^{b}+1}{2^{b}-1} \tag{8}\]  
The filtering performance of a Gabor filter is mainly determined by the size of the convolution kernel. Different convolution kernel sizes may have different effects on the Gabor filter. If the edge length of the convolution kernel is larger than the wavelength, it has no effect on the result of filtering. If the edge length of the convolution kernel is smaller than the wavelength, then the entire waveform is not fully included in the convolution calculation, resulting in poor filtering of the waveform edges.