## 2 Proposed Networks  
### Proposed LSA-Net for Leaf Disease Identification  
Symptoms can be detected only in the leaf area, whereas the background region contains no information regarding leaf diseases. Therefore, the additional use of the ROI features that contain the leaf, background, and spot information can teach the SAC-SubNet regarding which features are more important and which features should have a decisive role in classifying leaf diseases. Hence, an additional subnetwork to extract the spot features from input leaf images is designed and subsequently combined with the SAC-SubNet. Figure 3 illustrates the proposed LSA-Net for identifying apple leaf diseases. The proposed architecture consists of two subnetworks: ROI-aware FES and SAC-SubNet. First, the ROI-aware FES is a feature extraction network comprising two modules. One is the leaf segmentation module, and the other is the spot feature encoding module. The leaf segmentation module divides an input leaf image into background, leaf, and spot areas. \[\mathbf{J}=\mathbf{f}_{\mathbf{\theta}_{seg}}(\mathbf{I}) \tag{1}\]  
where \(f_{\mathbf{\theta}_{seg}}\) is the learnable function with the parameter \(\mathbf{\theta}_{seg}\) for the leaf segmentation module. \(\mathbf{I}\) and \(\mathbf{J}\) denote the input leaf image and segmented feature map, respectively. The architecture of the \(f_{\mathbf{\theta}_{seg}}\) is a fully convolutional network (FCN), developed for semantic segmentation [41]. In the leaf segmentation module, the cropping layer applies two-dimensional cropping to the input feature maps. Two input feature maps are required. One is to be cropped, and the other is the reference to determine the size of the cropped feature map. The transposed convolution layer applies the transposed convolution to the input feature maps for up-sampling, and \(\oplus\) indicates the addition layer that adds the input feature maps by element. The spot feature encoding module maps the segmented feature map \(\mathbf{J}\) into a spot feature vector \(\mathbf{v}\). \[\mathbf{v}=f_{\mathbf{\theta}_{enc}}(\mathbf{J}) \tag{2}\]  
where \(f_{\mathbf{\theta}_{enc}}\) is the learnable function for the spot feature encoding module, and is composed of pooling and fully connected layers. The segmented feature map, \(\mathbf{J}\), is high-dimensional and contains spatial information. However, the spot feature vector, \(\mathbf{v}\), is low-dimensional and has no spatial information. This means that the spot information contained in \(\mathbf{J}\) is encoded into the low-dimensional vector \(\mathbf{v}\). Second, the SAC-SubNet is a classification network and is an advanced version of the existing VGG model, equipped with ROI-aware feature fusions to reflect the leaf spot attention mechanism. In SAC-SubNet, there are two ROI-aware feature fusions. One is early fusion, and the other is later fusion. As mentioned in the previous paragraph, the two features \(\mathbf{J}\) and \(\mathbf{v}\) have different spatial information and dimensions. Therefore, the features \(\mathbf{J}\) and \(\mathbf{v}\) are utilized for early and later fusions, respectively. \[\mathbf{F}^{early}=f_{c}(\mathbf{J},\ \mathbf{I}) \tag{3}\]  
\[\mathbf{F}^{later}=f_{c}\left(\mathbf{v},\ f_{\theta_{seg}}^{(i)}\left(\mathbf{I},\mathbf{F}^{ early}\right)\right) \tag{4}\]  
where \(f_{c}\) is the function for the early and later fusions. In the LSA-Net, simple concatenation is adopted for the function, which indicates that \(f_{c}\) has no parameters to be updated. Even though another attention model, such as scaled dot-product attention [42], can be considered, our experiment revealed that concatenation provides better performance than scaled dot-product attention. Early fusion is indicated on the left side of SAC-SubNet. Because the function \(f_{c}\) is defined as the concatenation, the segmented feature map \(\mathbf{J}\) is stacked on top of the input leaf image \(\mathbf{I}\). In Equation (3), \(\mathbf{F}^{early}=[\mathbf{I};\mathbf{J}]\) is the early fusion result.