# ResGDANet: An Efficient Residual Group Attention Neural Network for Medical Image Classification
## 3 Methodology  
### Dual-Channel Attention Fusion Module  
Through learning from data, attention mechanisms can weight multi-dimensional features according to their importance, enhancing critical features while suppressing interference. [PERSON] et al. [33] proposed embedding positional information into channel attention, using one-dimensional global average pooling in the horizontal and vertical directions to compress information, reducing positional information loss from 2D pooling. Nevertheless, this technique employs average pooling exclusively to derive global region data, potentially overlooking locally salient features in lesion areas, such as small lesions, edge details, or texture features [34]. In medical image analysis, since many pathological regions share visual characteristics with normal tissues, it is essential to preserve fine local features to support subsequent tasks such as lesion classification, localization, and diagnosis. To address this challenge, we designed the Dual-Channel Attention Fusion (DCAF) module, introducing a dual-branch structure combining global average pooling and max pooling to enhance the capture of significant local features in medical images, as shown in Figure 3. Besides maintaining the original global average pooling branch, we incorporated a max pooling branch to capture prominent local features. By fusing feature information from both branches, the model can simultaneously utilize global contextual information and local salient features, thereby further improving the accuracy and robustness of classification tasks. Figure 3: Dual-Channel Attention Fusion module structure diagram. It consists of several components: the Channel Attention Module, the Coordinate Attention Module, and the Gated Fusion Unit. For input feature map \(X\in\mathbb{R}^{B\times C\times H\times W}\), where \(B\) is the batch size, \(C\) is the number of channels, and \(H\) and \(W\) are the height and width of the feature map, the spatial information is first aggregated through global average pooling and global max pooling:  
\[F_{avg}(X)=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}X(i,j) \tag{1}\]  
\[F_{max}(X)=\underset{i,j}{max}X(i,j) \tag{2}\]  
\(F_{avg}(X)\) and \(F_{max}(X)\) represent the global average pooling and global max pooling results, respectively, with dimensions \(B\times C\times 1\times 1\). The outputs of these two branches generate channel attention maps through a shared-weight multilayer perceptron (MLP):  
\[M_{ca}(X)=\sigma\big{(}W_{2}\delta\big{(}W_{1}\big{(}F_{avg}(X)\big{)}\big{)}+ W_{2}\delta(W_{1}(F_{max}(X)))\big{)} \tag{3}\]  
where \(M_{ca}(X)\) is the channel attention map, \(W_{1}\in\mathbb{R}^{C/r\times C}\) and \(W_{2}\in\mathbb{R}^{C/r\times C}\) are the weight matrices of MLP, \(\delta\) is the ReLU activation function, and \(\sigma\) is the Sigmoid activation function. The reduction ratio, denoted as \(r\), signifies that the number of channels in the input feature map is first reduced to \(C/r\) via a \(1\times 1\) convolution and subsequently restored to the original channel count. The other branch is coordinate attention, which first calculates global information for each position in spatial directions through global average pooling operations on the feature map's spatial dimensions. Specifically, for input feature map \(X\) with dimensions \((B,C,H,W)\), global average pooling is performed in the horizontal and vertical directions to obtain feature maps \(x_{h}\) and \(x_{w}\) in Equation (4):  
\[ \begin{split} x_{h}&=\frac{1}{W}\sum\limits_{0\leq i \leq W}x(h,i)\\ x_{w}&=\frac{1}{H}\sum\limits_{0\leq j\leq H}x(j,w) \end{split}  \tag{4}\]  
This operation maintains global information on the feature map along horizontal and vertical directions, enabling the network to comprehend object distribution in both horizontal and vertical orientations.