# SIPNet & SAHI: Multiscale Sunspot Extraction for High-Resolution Full Solar Images
## 3 Method
### Prediction Head
#### 3.2.1 SASPP  
Before the fused feature maps are fed separately to the three branches, we proposed a new module called Switchable Atrous Spatial Pyramid Pooling, or SASPP, based on ASPP [38]. SASPP improves ASPP's ability to capture multiscale information and local context by incorporating switchable atrous convolutions and horizontal/vertical mean pooling. Figure 3a shows the structure of ASPP, which fuses the denser feature maps by applying four parallel atrous convolutions with different atrous rates and global context information by global average pooling operation. Atrous convolutions [47] are effective techniques to enlarge the field of view of filters without increasing the number of parameters or the amount of computation, e.g., atrous convolution with atrous rate \(r\) introduces \(r-1\) zeros between successive filter values,  
Figure 3: (a) ASPP Module. (b) SASPP Module. (c) Detailed structure of SAC. In the figure, \"\" stands for a multiplication sign “\(\times\)”. equivalently increasing the kernel size of a \(k\times k\) filter to \(ke=k+(k-1)\)\((r-1)\). ASPP using atrous convolutions with different atrous rates effectively captures multiscale information. However, the authors also point out that local and long-distance information are likely to be irrelevant. So, we analyzed ASPP and then improved it. Figure 3b shows the structure of the improved ASPP, called switchable atrous convolution (SASPP). In SASPP, two switchable atrous convolution (SAC) branches replace three atrous convolutions in ASPP. In addition, the global average pooling sub-branch in ASPP is replaced by two sub-branches, which are horizontal average pooling and vertical average pooling, respectively. Figure 3c shows the structure of the switchable atrous convolution module (SAC, [48]). SAC has three main components: two global context modules that are appended before and after the SAC component. \(Conv(x,\ w,\ r)\) denotes the convolutional operation with weight \(w\) and atrous rate \(r\), taking \(x\) as input. Then, the description of SAC is as follows: \(s(x)\ conv(x,\ w_{1},\ r_{1})+(1\ -\ s(x))\ conv(x,\ w_{2},\ r_{2})\). Here, \(r_{1}\) is a hyperparameter of SAC, \(r_{2}\) is set to \(3\times r_{1},w_{1}\) and \(w_{2}\) are trainable weights, and the switch function \(S\) is implemented as an average pooling layer with a \(5\times 5\) kernel followed by a \(1\times 1\) convolutional layer (see Figure 3c). A locking mechanism is applied by setting one weight as \(w_{1}\) and the other as \(w_{2}\). After several experiments, \(r_{1}\) is set to 3 and 6 in two SAC sub-branches, respectively. This means that the atrous rate can be 3, 9, 6, or 18 depending on the function \(S\). In addition, there are two identical global context modules before and after the main component of SAC. The input features to the module are first compressed by a global average pooling layer; then convolved with a \(1\times 1\) kernel; and, finally, the output is added to the input. The front global context module can make the function \(S\) more stable in its switching predictions. Also, the global pooling sub-branch in ASPP was replaced by two sub-branches: horizontal average pooling (X_Avg_Pool) and vertical average pooling (Y_Avg_Pool). This is because global pooling encodes spatial information globally but squeezes global spatial information into a channel descriptor; thus, it is difficult to preserve positional information. Therefore, the global average pooling in ASPP was improved based on the idea of the Coordinate Attention mechanism [49]. To spatially capture long-range interactions with precise positional information, two spatial extents of the pooling kernels (\(H\); 1) or (\(1\); \(W\)) encode each channel along the horizontal and vertical coordinates, respectively. The features are aggregated along the two spatial directions, yielding a pair of directional feature maps that correspond to long-range interactions along one spatial direction and preserve precise positional information along the other spatial direction.