## 3 Method
### Network Architecture  
The structure of the proposed GMANet is shown in Figure 3a and the framework is based on the VGG16 [27] architecture. Through comparative experiments, we found that the performance of VGG16 is similar to that of other backbones, such as resnet50. Considering the simplification of the model, VGG16 was used as the backbone. The gradient image extracted by the local maximum gradient method was introduced into the CNN as an attention map, and Figure 3b shows the specific structure of the convolution block with MA, namely the GMA block. The input of the GMA block is a 3-D input feature map \(I_{i}\) and its corresponding 2-D spatial attention map \(M_{i}\), where i represents the i-th convolution block. Firstly, the operation of convolution and batch normalization is performed on input \(I_{i}\) to obtain \(I_{i}^{\prime}\); secondly, the operation of average pooling (the pooling parameter is same as the convolution on \(I_{i}\)) is performed on input \(M_{i}\) to obtain \(M_{i}^{\prime}\); thirdly, the features of \(I_{i}^{\prime}\) are adjusted by attention map \(M_{i}^{\prime}\) through element-wise multiplication, obtaining adjusted feature map \(I_{i}^{\prime\prime}\). Finally, \(I_{i}^{\prime}\) and \(I_{i}^{\prime}\) are added together and the operation of Leaky Relu is performed on the addition result, obtaining feature map \(\hat{I}_{i}\). \(\hat{I}_{i}\) and \(M_{i}^{\prime}\) are the input of the next GMA block. The MA mechanism does not change the network structure or increase the training parameters, but it enhances the feature values in high-gradient regions. The calculation process can be summarized as:  
\[\hat{I}_{i}=lrelu\big{(}(1+M_{i}^{\prime})\cdot BN(Conv(I_{i}))\big{)} \tag{7}\]  
Figure 2: The calculation process of local maximum gradient method. (**a**) is a fecal microscopic image with fungal spores. (**b**) is a local enlargement image of a fungal spore in (**a**). (**c**) is a \(8\times 8\) image patch, which is defined as block \(\varphi\). (**d**,**e**) is the feature image of (**a**,**b**) calculated by local maximum gradient method with \(s_{h}\) and \(s_{v}\) equal to 1. (**f**) is the feature map of (**b**) calculated by Tenengrad method. (**d**–**f**) are visual images after normalizing image pixel value to 0–255. Figure 3: (**a**) The structure of the proposed GMANet. (**b**) The structure of the GMA block. (**c**) The structure of the pooling block. (**d**) The structure of the feature aggregation module. The specific structure of the pooling block is shown in Figure 3c. When the feature matrix performs the max pooling operation, the corresponding spatial attention map performs the same operation. The feature aggregation module is shown in Figure 3d. Two low-level feature maps named Deconv3 and Deconv4 are obtained by feature aggregation, and the size of them are 128 \(\times\) 192 \(\times\) 512 and 64 \(\times\) 96 \(\times\) 512. Most deep-learning-based IQA methods use a small patch as network input, and connect fully connected layers at the end of the feature extraction layer to predict the score of the current patch. These patch-based IQA methods only consider the local information while ignoring the global information. Furthermore, the local quality of a small image patch is not equal to the real score of the whole image. In order to solve the above problem, a large image patch with a fixed size of 512 \(\times\) 768 \(\times\) 3 was used. At the end of the feature extraction layer (Layer5, size: 32 \(\times\) 48 \(\times\) 512), every feature vector with a size of 1 \(\times\) 1 \(\times\) 512 is regarded as an independent patch sample feature. After connecting them with two convolutional layers, the predicted score map is obtained with a size of 32 \(\times\) 48 \(\times\) 1. The final prediction score, Output1, is calculated by the improved global average pooling, which computes the average of non-zero values in the predicted score map.