## 3 IBSA_Net Model Construction and Module Composition
### Introduce Inverted Bottleneck Structure to Improve Network Accuracy
Adding Shuffle Attention Module to Improve the Spatial Localization Accuracy of the Network for Sick Regions  
For traditional convolutional networks, the spatial localization ability of the network is poor, i.e., the network cannot locate the leaf disease region well and learn the disease features during the recognition process. Shuffle Attention is one of the attention mechanisms, the core idea of which is to focus on the picture's critical information [32]. The following Figure 5 shows the structure schematic of the Shuffle Attention module:  
The Shuffle Attention (from now on referred to as SA) module takes the given input \(X\in R^{C\times H\times W}\), where \(C\), \(H\), and \(W\) denote the number of input channels, feature map height and width, respectively. SA divides the channels into g groups in the channel direction, i.e., \(X=[X_{1},X_{2},\cdots,X_{g}]\), and for each \(X_{i}\in R^{C/g\times H\times W}\), it generates two sub-feature maps by channel separation \(X_{i1},X_{i2}\in R^{C/2g\times H\times W}\). As shown in Figure 4, after the channel separation, the upper branch outputs the channel attention map using the interrelationship between channels; the lower branch generates the spatial attention map using the feature space relationship. (1) Channel attention branch  
Firstly, feature compression along the spatial dimension is performed by \(F_{gp}\) global average pooling to generate channel statistics \(s\), for s there is \(s\in R^{C/2g\times 1\times 1}\), which embeds the global information of the feature subgraph. \(S\) is calculated as  
Figure 4: Two inverted bottleneck master modules (**a**) Inverted bottleneck module (**b**)Inverted bottleneck module with MaxPool layer added. Figure 5: Shuffle Attention module schematic. \[s=F_{gp}(X_{i1})=\frac{1}{H\times W}\sum_{i=1}^{H}\sum_{j=1}^{W}X_{i1}(i,j) \tag{1}\]  
\(s\) is multiplied with the initial feature subgraph \(X_{i1}\) after the \(F_{c}(\cdot)\) operation and the sigmod activation function, and the final output is \(X_{i1}^{\prime}\). \[X_{i1}^{\prime}=\sigma(F_{c}(s))\cdot X_{i1}=\sigma(W_{1}s+b_{1})\cdot X_{i1} \tag{2}\]  
where \(W_{1}\in R^{C/2g\times 1\times 1}\), \(b_{1}\in R^{C/2g\times 1\times 1}\), which is in the same dimension as \(s\), have the effect of scaling and panning the feature subgraphs. (2) Spatial attention branch  
The spatial attention mechanism is more concerned with where the regions of interest are as a complement to the channel attention mechanism. The separated feature subgraphs are first subjected to the \"Group Normalization\" operation (\(GN\)) to obtain their spatial information, and then the feature representation is enhanced using the \(F_{c}(\cdot)\) operation, and the final output \(X_{i2}^{\prime}\) is. \[X_{i2}^{\prime}=\sigma(W_{2}\cdot GN(X_{i2})+b_{2})\cdot X_{i2} \tag{3}\]  
where, \(W_{2}b_{2}\) is shaped as \(R^{C/2g\times 1\times 1}\). The obtained channel attention and spatial attention branch outputs are finally stitched in the channel dimension, and two feature subgraphs with the number of channels \(C/2\)\(g\) are stitched into a \(C/g\) channel subgraph. The feature subgraph that is divided into \(g\) groups, after the channel and spatial attention mechanism to the feature subgraph of \(X_{1}^{\prime},X_{2}^{\prime},\ldots,X_{g}^{\prime}\), \(g\) feature subgraphs through the aggregation operation, recovered into the same latitude output as the initial input \(X\)\(X^{\prime}\),\(X^{\prime}\in R^{C\times H\times W}\). Finally, the aggregated output is then subjected to the channel shuffle operation, which enables cross-group communication of channel dimensions, enhances mutual learning between different information, and enhances the generalization of the model.