Apple leaf disease multi-classification method based on complex environment background

By constructing the LCAMNet model and utilizing the MSDM and MFEN modules combined with an improved triplet attention mechanism, the accuracy and robustness issues of apple leaf disease identification under complex environments were resolved, achieving efficient disease classification.

CN120411618BActive Publication Date: 2026-02-06INNER MONGOLIA AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510477090.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-16
Publication Date
2026-02-06
Estimated Expiration
2045-04-16

AI Technical Summary

Technical Problem

Existing technologies lack accuracy and robustness in identifying apple leaf diseases in complex environments, making it difficult to effectively distinguish diverse and complex lesions, and they are sensitive to environmental factors such as light and shade.

Method used

A lightweight fusion attention multi-branch network (LCAMNet) model is constructed. By combining a multi-scale downsampling module (MSDM) and a multi-scale feature extraction module (MFEN) with an improved triplet attention mechanism, diverse feature information is captured, thereby enhancing the model's recognition ability.

Benefits of technology

It improves the accuracy and robustness of apple leaf disease classification, is suitable for resource-constrained and complex environments, and has good versatility and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411618B_ABST
    Figure CN120411618B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on complex environmental background under apple leaf disease multi-classification method, comprising the following steps: constructing public dataset FGVC8 and self-built complex environmental background dataset SCEBD, and the collected image data is preprocessed;Through joint multiple downsampling strategies, construct multi-scale downsampling module MSDM;Multi-scale feature extraction module MFEN is constructed, and the diversified feature information of apple leaf disease is captured through multi-branch structure;Improved triplet attention mechanism is introduced in MFEN, to further extract key feature information;Establish light fusion attention multi-branch network LCAMNet model.The application uses the above-mentioned kind of based on complex environmental background under apple leaf disease multi-classification method, improves the accuracy and robustness of disease identification, suitable for resource-constrained and background complex apple leaf disease classification task, with good versatility and high efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of agricultural information and computer vision, and particularly relates to a method for classifying apple leaf diseases based on complex environmental backgrounds. BACKGROUND

[0002] China is the largest apple producer in the world, with annual output accounting for more than 50% of the world's total, ranking first in the world. The growth process of apples is easily affected by fungal, viral and other pathogens, which can cause a series of diseases. If early diseases are not discovered and measures are not taken in time, the diseases will spread and spread rapidly, affecting the quality and yield of apples and causing huge agricultural losses. Artificial identification of apple leaf diseases is labor-intensive and time-consuming, and is easily affected by subjective factors such as fatigue and emotion. Therefore, it is necessary to use information technology to realize the rapid detection of apple leaf disease types.

[0003] In the early days, machine learning-based methods were widely used for crop leaf disease identification, mainly by manually designing global features (such as color, texture, shape) to describe the disease spots, and using traditional image processing techniques (such as edge detection, gray level co-occurrence matrix, etc.) to extract features, and then inputting the classifier (such as SVM, KNN, etc.) for identification. However, these methods have significant shortcomings: first, the global feature description ability is limited, and it is difficult to accurately capture the local features of complex disease spots; second, it is sensitive to image noise, illumination changes and environmental factors, resulting in unstable features and affecting the classification accuracy.

[0004] In recent years, with the rapid development of computer technology and the continuous improvement of image recognition accuracy, convolutional neural networks (CNN) have shown significant advantages in automatic feature extraction and data recognition. By introducing local connection, weight sharing and other operations, CNN can automatically learn and extract multi-level features from raw images without the need for manual feature design. This makes CNN perform well in various image recognition tasks, especially in the field of crop disease identification.

[0005] However, although CNN has made significant progress in the identification of crop diseases, applying this deep learning method to apple leaf disease classification still faces some major challenges. The diversity and complexity of apple leaf disease spots make disease identification extremely difficult. In addition, environmental factors such as light, shadow, and leaf reflection can also affect image quality, and thus affect the training and accuracy of the CNN model. Due to the diversity of apple leaf disease spots and environmental interference, how to improve the robustness and accuracy of the model in these complex scenarios remains an important problem in current research. SUMMARY

[0006] The application aims to provide a multi-classification method for apple leaf diseases based on complex environmental backgrounds, improve the accuracy and robustness of disease identification, and be suitable for apple leaf disease classification tasks with limited resources and complex backgrounds, and have good universality and high efficiency.

[0007] To achieve the above-mentioned purpose, the application provides a multi-classification method for apple leaf diseases based on complex environmental backgrounds, comprising the following steps:

[0008] Step S1, constructing a public dataset FGVC8 and a self-built complex environmental background dataset SCEBD, and preprocessing the collected image data;

[0009] Step S2, proving that two 3x3 convolutions in series are equal to one 5x5 convolution, and further comparing the calculation amount of the two;

[0010] Step S3, constructing a multi-scale downsampling module MSDM by combining multiple downsampling strategies;

[0011] Step S4, constructing a multi-scale feature extraction module MFEN to capture diversified feature information of apple leaf diseases through a multi-branch structure;

[0012] Step S5, introducing an improved triple attention mechanism in MFEN to further extract key feature information;

[0013] Step S6, based on the above-constructed MSDM module and MFEN module and the improved triple attention mechanism, establishing a lightweight fusion attention multi-branch network LCAMNet model.

[0014] Preferably, in step S3, a multi-scale downsampling module MSDM is constructed by combining multiple downsampling strategies, and the MSDM module contains two branches, the first branch includes two paths, and the operations of maximum pooling path 1 and average pooling path 2 are applied in parallel to extract global features and significant features in the image respectively;

[0015] Firstly, average pooling extracts global features of the image by averaging pixel values in the pooling area, reduces the influence of local noise, and makes the model capture the overall information of the image;

[0016] Secondly, maximum pooling extracts local significant features by selecting the maximum value in the pooling window, highlighting the texture and morphological changes in the disease area;

[0017] Then, the results of maximum pooling and average pooling are spliced to realize the complementarity of significant features and global features;

[0018] Finally, 1x1 convolution, batch normalization BN and ReLU activation function are used to aggregate the channels.

[0019] Preferably, in step S3, the second branch includes path 2 and path 3, which are parallel convolution downsampling modules;

[0020] In path 3, the input feature map is first passed through a 3x3 deep convolution with a step size of 2 + BN to reserve and downsample the overall features; then it is passed through a 1x1 conv + BN + Relu to adjust the number of channels, ensuring that the channel of the output feature map matches that of path 1 and path 2 of the first branch;

[0021] In path 4, the input feature map is first passed through a 1x1 conv + BN + Relu, then through a 3x3 deep convolution with a step size of 2 + BN, and finally through a 1x1 conv + BN + Relu to extract local features; the results of path 3 and path 4 are spliced to fuse the overall and local features;

[0022] The first branch and the second branch are spliced in the channel dimension, integrating the global and local features extracted by the two branches. The spliced feature map is further optimized through channel shuffling to enhance the interaction between channels and promote information fusion.

[0023] Preferably, in step S4, a multi-scale feature extraction module MFEN is constructed to capture the diversified feature information of apple leaf diseases by evenly distributing the input channel number into four independent branches: feature reservation branch, local detail branch, deep feature branch, and prominent feature branch.

[0024] Preferably, in the feature reservation branch, the input feature obtains the output feature through a jump connection, preserving the low-level information of apple leaf diseases.

[0025] Preferably, the local detail branch is used to extract the lesion edge, local texture change, and disease area of apple leaf disease pictures. In the local detail branch, the input feature map of the second branch is first passed through a 1x1 convolution to adjust the number of channels of the feature map; then the feature map is passed through a BN layer and a Relu layer; subsequently, the feature map is passed through a 3x3 deep convolution and a BN; the deep convolution independently convolves on each input channel to extract local features on each channel, which is suitable for extracting fine-grained and independent feature information; finally, the feature map is passed through a 1x1 point convolution to fuse the local features extracted in each channel of the deep convolution; by weighting and combining the features of different channels, the model captures global information across channels.

[0026] Preferably, the deep feature branch extracts the multi-level performance of the apple leaf disease picture, the feature map input by the third branch is first subjected to 1x1 convolution, BN and Relu; then subjected to two 3x3 deep convolution, BN; and finally subjected to 1x1 convolution, BN and Relu; two cascaded 3x3 deep convolution are used in this branch to reduce the network parameters and the amount of calculation.

[0027] Preferably, in the significant feature branch, the feature map input by the fourth branch is first extracted by a max-pooling layer; then, the feature map is further processed by 1x1 convolution to ensure that the features in different channels are fused and the expression ability of the overall features is improved.

[0028] The output feature maps of the above four branches are subjected to a splicing operation and channel shuffling is introduced to optimize the information flow and fusion between different channels; the channel shuffling operation realizes information exchange of features from different convolution channels by rearranging the features of each channel.

[0029] Preferably, in step S5, the triplet attention mechanism includes three branches, the first two branches capture the interaction information between channels and spaces respectively, and the third branch is used to establish a separate spatial attention; the outputs of the three branches are fused to generate the final attention features.

[0030] The initial tensor X C×H×W , C is the number of image channels, H is the image height, and W is the image width; for the first branch, the input shape is unchanged CxHxW, which is responsible for aggregating the interaction features of H and W, i.e., the spatial dimensions; for the second branch, the shape of the tensor obtained by the rotation operation is HxCxW, which is responsible for aggregating the interaction features of C and W, i.e., the channel and W spatial dimensions; for the third branch, the shape of the tensor obtained by the rotation operation is WxHxC, which is responsible for aggregating the interaction features of H and C, i.e., the H spatial dimension and the channel.

[0031] Then, the triplet tensor is passed to Z-pool, which is responsible for reducing the zero dimension of the tensor to 2 by splicing the average pooling and max-pooling features in this dimension.

[0032] Then, two cascaded 3x3 convolution layers and Relu are used to reduce the zero dimension of the tensor to 1; the attention weight is generated by a sigmoid activation layer and then applied to the input tensor, and the rotated tensor is restored to the original input shape; the final attention mechanism is obtained by averaging the sum of the results of the three branches.

[0033] Preferably, in step S6, a lightweight fusion attention multi-branch network LCAMNet model is established, the LCAMNet model comprising a 3x3 basic convolution Conv1, a maximum pooling layer with a 3x3 pooling kernel and stages 2, 3 and 4, and a 1x1 size convolution Conv5, an average pooling layer and a fully connected layer;

[0034] wherein the stages 2, 3 and 4 each contain a multi-scale down-sampling module MSDM and a multi-scale feature extraction module MFEN; an improved triple attention mechanism is superimposed after the MFEN of the stage 4;

[0035] For a multi-channel input image, the LCAMNet model first performs preliminary processing on the input image through a Conv1 layer with a size of 3x3 and a step size of 2 to extract low-level features; then, a maximum pooling layer with a size of 3x3 and a step size of 2 is used to down-sample the image to reduce the dimension of the output feature and obtain an output feature map;

[0036] Then, the feature map passes through the stages 2, 3 and 4 to compress redundant information and gradually extract features of the apple leaf disease image; wherein each stage includes a cascaded multi-scale down-sampling module MSDM and a multi-scale feature extraction module MFEN; the MSDM module is used to down-sample the extracted features to preserve key features while improving computational efficiency; on this basis, the MFEN module is superimposed to further capture multi-scale features of the disease;

[0037] The MSDM and MFEN modules are stacked three times, and at the end of the stage 4, an improved triple attention mechanism is introduced to further extract key feature information and enhance the expression ability of the model;

[0038] Finally, a 1x1 convolution layer Conv5 is connected to adjust the number of channels for feature fusion, followed by a 7x7 average pooling layer processing and a fully connected layer classifier for classification to output the final classification result;

[0039] The training process of the LCAMNet model is as follows:

[0040] First, data preprocessing is performed, including data cleaning, image size adjustment, data set division, data enhancement and data normalization;

[0041] Next, the hyperparameters in the training process are set, including the training rounds Epoch, the batch size, the optimizer and the loss function, and the model weights are initialized;

[0042] Then, the data batches are sent into the model for training;

[0043] In the training process, the Batch size is added by 1 every time a batch of data is sent to the training set; if the Batch size reaches the maximum value, the Epoch is added by 1, and the next batch of data is inputted for training; if the Epoch reaches the maximum value set, the training is ended, and the model is finally evaluated by using the test set; if the Epoch does not reach the maximum value, the data is grouped according to the set batch size, and the model is continuously trained.

[0044] Therefore, the apple leaf disease multi-classification method based on a complex environment background is adopted, different down-sampling operations are adopted for different channels through the multi-scale down-sampling module (MSDM), and the features between different channels are further fused by using channel mixing, the information loss caused by a single down-sampling operation is effectively avoided, and the recognition accuracy of the network is improved; based on the multi-dimensional feature extraction network (MFEN), the diversified feature information of the apple leaf disease is captured through the multi-branch structure; the channel separation and mixing mechanism is introduced in the MFEN, the feature exchange between channels is promoted, and the feature extraction capability is further improved; the improved ternary attention module is integrated into the MFEN, two cascaded 3*3 convolutions are adopted instead of the original 7*7 convolution, and the original normalization operation is removed, the linear expression capability of the network is improved, the parameter amount is reduced, the focusing capability of the model on the key disease area is enhanced, and the accuracy and robustness of disease identification are improved; the LCAMNet has good universality and high efficiency, and is suitable for apple leaf disease classification tasks with limited resources and complex background.

[0045] The technical solutions of the present application will be further described in detail below with the help of the drawings and examples. BRIEF DESCRIPTION OF DRAWINGS

[0046] Figure 1 is a flow chart of data preprocessing of the present application;

[0047] Figure 2 is the dataset division of the FGVC8 apple leaf disease image of the present application;

[0048] Figure 3 is the dataset division of the SCEBD apple leaf disease image of the present application;

[0049] Figure 4 is an output schematic diagram of one 5*5 convolution and two serial 3*3 convolutions of the present application; wherein (a) is an output schematic diagram of one 5*5 convolution; (b) is an output schematic diagram of two serial 3*3 convolutions;

[0050] Figure 5 is a MSDM structure diagram of the present application;

[0051] Figure 6is a MFEN structural diagram of the application;

[0052] Figure 7 is a modified triple attention mechanism structural diagram of the application;

[0053] Figure 8 is an LCAMNet structural diagram of the application;

[0054] Figure 9 is a training flowchart of the LCAMNet model of the application;

[0055] Figure 10 is a feature extraction network and down-sampling network structural diagram of the ShuffleNetV2 in the embodiment of the application; wherein, (a) is a feature extraction network structural diagram; (b) is a down-sampling network structural diagram;

[0056] Figure 11 is a three-dimensional visualization of the accuracy, floating point number and parameter quantity on the SCEBD in the embodiment of the application;

[0057] Figure 12 is a three-dimensional visualization of the accuracy, GFLOPs and parameter quantity on the FGVC8 dataset in the embodiment of the application. DETAILED DESCRIPTION

[0058] The technical solutions of the application are further described below through the drawings and embodiments.

[0059] The application discloses an apple leaf disease multi-classification method based on a complex environment background, comprising the following steps:

[0060] Step S1, constructing a public dataset FGVC8 and a self-built complex environment background dataset SCEBD, and preprocessing the collected image data.

[0061] Step S11, constructing a public dataset FGVC8.

[0062] A public dataset from the CVPR2021 FGVC8 plant pathology recognition challenge is used, and the dataset contains 18632 apple leaf images shot in the field. These images are shot at different maturity stages of apples and different times of the day, the background is non-uniform, and the resolution of most images is 2676*4000. The apple leaf images in the dataset cover multiple disease categories, including alternaria leaf spot, rust, powdery mildew, black spot and healthy leaves.

[0063] Among them, the number of samples of alternaria leaf spot, healthy leaves, powdery mildew, rust and black spot selected by the application is 489, 529, 485, 503 and 504 respectively. After processing, these images form the FGVC8 data set, and the class distribution is shown in Table 1.

[0064] Table 1 FGVC8 data set picture class number distribution

[0065] Class Number Image Type Picture Number 0 Alternaria Leaf Spot 489 1 Healthy Leaf 529 2 Powdery Mildew 485 3 Rust 503 4 Scab 504

[0066] Step S12, self-built complex environment background data set SCEBD.

[0067] The application also constructs an apple leaf disease data set in a complex environment background-SCEBD, which uses four data sources. Among them, part of the alternaria leaf spot, healthy, rust and powdery mildew, and black spot comes from the FGVC8 data set, and the number of pictures is 293, 183, 154, 485 and 484 respectively; part of the mosaic disease comes from Appleleaf9 (a total of 105), which integrates four different apple disease data sets, and the pixel size is not uniform; part of the gray spot disease comes from ATLDSD (a total of 121), which is an image taken by a mobile phone, and the selected gray spot disease picture comes from a real cultivated field, and the pixel size is 256*256.

[0068] In addition, using a common smart phone, apple leaf images with alternaria leaf spot, brown spot, gray spot, healthy, mosaic disease and rust in a certain area are collected, and the number is 192, 480, 362, 302, 376 and 328 respectively. The images are collected in a real orchard, and contain complex environmental backgrounds such as leaves, weeds, reflective film and fruits. The image resolution is not uniform, but it can better reflect the complexity and diversity of the image. The SCEBD image type and corresponding number distribution are shown in Table 2.

[0069] Table 2 SCEBD picture class number distribution

[0070]

[0071] Step S13, data preprocessing.

[0072] As shown in Figure 1 , for the collected picture data, data preprocessing is carried out, and the specific process is as follows:

[0073] Step S131, first data cleaning, and selecting picture data meeting the conditions.

[0074] Step S132, all pictures are scaled to 224*224 size to reduce computational complexity.

[0075] Step S133, the data set is divided into training set, validation set and test set in the ratio of 7:2:1. Among them, the data set division of FGVC8 apple leaf disease image is as shown in Figure 2 Step S133, the data set is divided into training set, validation set and test set in the ratio of 7:2:1. Among them, the data set division of FGVC8 apple leaf disease image is as shown in Figure 3 Step S133, the data set is divided into training set, validation set and test set in the ratio of 7:2:1. Among them, the data set division of FGVC8 apple leaf disease image is as shown in

[0076] Step S134, judge whether data enhancement is needed: if data enhancement is needed, data enhancement operation is performed on the training set, while the pictures of the validation set and the test set remain unchanged; if data enhancement is not needed, skip this step.

[0077] Step S135, judge whether data standardization processing is needed: if standardization is needed, the average value and the standard deviation of the RGB three channels of the data are set; if not, directly complete the data preprocessing.

[0078] Among them, nine kinds of data enhancement methods are applied to the training set image to enhance the generalization ability of the network and reduce the influence of noise, including rotation (90 degrees, 180 degrees and 270 degrees), Gaussian blur, random flip (50% probability of horizontal flip and 50% probability of vertical flip), contrast enhancement and reduction, and brightness enhancement and reduction. Through these enhancement operations, the number of images in the training set is increased to 10 times that of the original training set. It should be noted that the images of the test set and the validation set are not subjected to data enhancement.

[0079] In addition, in order to avoid that the model training is unstable due to too large or too small pixel value, and to reduce the risk of overfitting, the image is subjected to standardization processing. Specifically, the average values of the red, green and blue three channels are set to [0.485, 0.456, 0.406] respectively, and the standard deviations are set to [0.229, 0.224, 0.225]. This standardization method helps to accelerate the convergence of the model, improve the stability of the training, and make the model learn the image features more effectively.

[0080] Step S2, prove that two 3x3 convolutions in series are equal to one 5x5 convolution, and further compare the computational complexity of the two.

[0081] Step S21, prove that the 3x3 convolution in series is equal to the 5x5 convolution.

[0082] Step S211, let the size of the input image be HxW, the size of the convolution kernel be kxk, the stride be 1, and the padding be 0. C in is the number of input channels, C out is the number of output channels. The output size H'xW' after convolution is as follows:

[0083]

[0084] When the step is 1, the formula is simplified as:

[0085] H' = H - k + 1, W' = W - k + 1 (2);

[0086] Step S212, for a 5x5 convolution kernel, assuming that the size of the input is HxW, the padding is 0, and the step is 1. According to the above formula, the output size after a 5x5 convolution is as follows:

[0087] H' = H - 5 + 1 = H - 4, W' = W - 5 + 1 = W - 4 (3);

[0088] Therefore, the output feature map size of a 5x5 convolution layer is (H-4)x(W-4).

[0089] Step S213, for two consecutive 3x3 convolutions, first pass through the first 3x3 convolution, assuming that the size of the input image is HxW, then the size of the output is:

[0090] H' = H - 3 + 1 = H - 2, W' = W - 3 + 1 = W - 2; (4);

[0091] Next, the output of the first convolution is taken as the input to pass through the second 3x3 convolution. The output size after the second convolution is:

[0092] H'' = H' - 3 + 1 = H - 4, W'' = W' - 3 + 1 = W - 4 (5);

[0093] Therefore, the output feature map size after two 3x3 convolutions is (H-4)x(W-4). This is equal to the feature map size of a 5x5 convolution. As shown in Figure 4 illustrated, the diagram can also illustrate that the field of view of a 5x5 convolution is equivalent to two consecutive 3x3 convolutions.

[0094] Step S22, further compare the calculation amount of the serial 3x3 convolution and the 5x5 convolution.

[0095] Step S221, assuming that the size of the input image is HxW, the size of the output image is H out xW out , the size of the convolution kernel is kxk, the step is 1, and the padding is (k-1) / 2. C in is the number of input channels, C out is the number of output channels. When only the number of multiplication operations is considered, the calculation amount formula is:

[0096] C in x C out x H out x W out×k 2 (6);

[0097] Its computational complexity is equivalent to C in ×C out ×H×W×k 2 .

[0098] Step S222, considering the case of using a 5x5 convolution kernel, the computational complexity is:

[0099] O 5×5 =C in ×C out ×H×W×25 (7);

[0100] Step S223, use two 3x3 convolution kernels in succession, the computational complexity of the first 3x3 convolution is:

[0101]

[0102] The computational complexity of the second 3x3 convolution is:

[0103]

[0104] Therefore, the total computational complexity of the two 3x3 convolutions in series is as follows:

[0105]

[0106] Step S224, compare the computational complexity of a 5x5 convolution with that of two 3x3 convolutions in series, as follows:

[0107]

[0108] From the above formula, it can be seen that the ratio of computational complexity is related to C in and C out . When C in is large, the computational complexity of two 3x3 convolutions is significantly lower than that of a 5x5 convolution. Therefore, using two consecutive 3x3 convolutions has the same field of view as a 5x5 convolution, but the computational complexity is lower than that of a 5x5 convolution.

[0109] Step S3, construct a multi-scale down-sampling module (MSDM) to effectively avoid information loss that may be caused by a single down-sampling operation by combining multiple down-sampling strategies.

[0110] Down-sampling operation is a common processing method in convolutional neural networks, mainly used to reduce the spatial dimension of feature maps. Pooling is one of the most commonly used down-sampling methods, and common pooling types include max pooling and average pooling. Pooling reduces the size of the feature map by aggregating pixel values within a local region, thereby improving the model's robustness to translation changes.

[0111] In addition to pooling, convolution operations are also commonly used for down-sampling. When the step size of the convolution layer is set to 2, each convolution operation skips one pixel, resulting in a halving of the spatial size of the feature map. Unlike pooling, convolution operations extract image features by learning the parameters of the convolution kernel, allowing more useful information to be retained during down-sampling. The feature representation obtained by the convolution layer can more effectively reduce information loss and be more adaptable to different tasks.

[0112] However, in complex environmental backgrounds, the classification performance of apple leaf disease images is often weak, and a single down-sampling strategy can easily lead to the loss of image features, thereby affecting the classification results. To address this challenge, the present invention proposes a multi-scale down-sampling module to reduce the information loss caused by a single down-sampling operation. As shown in Figure 5 The multi-scale down-sampling module contains two branches, aiming to extract more rich feature information from multiple scales to improve classification accuracy.

[0113] The first branch (blue background area, containing path 1 and path 2) applies max pooling and average pooling operations in parallel to extract global features (path 1) and salient features (path 2) in the image, respectively. Average pooling extracts global features of the image by averaging pixel values within the pooling region, reducing the impact of local noise and allowing the model to more effectively capture the overall information of the image, especially the global relationship between complex background and disease areas.

[0114] Unlike average pooling, max pooling extracts local salient features by selecting the maximum value in the pooling window, highlighting the most representative texture and morphological changes in the disease area, which is important for distinguishing disease spots from salient areas in complex environmental backgrounds. By concatenating the results of max pooling and average pooling, the complementary relationship between salient features and global features is achieved.

[0115] Subsequently, the channels are aggregated using 1x1 convolution, batch normalization (BN) and ReLU activation function. BN is a commonly used training optimization method that can improve the generalization ability of the model, avoid overfitting and improve the robustness of the network. Relu mainly solves the problem of linear inseparability in neural networks. Through a linear transformation and the addition of a BN, Relu, the entire network can have stronger learning and fitting ability. This process helps to integrate feature information from different pooling strategies and ensures that the network can effectively integrate features at different levels, thereby improving the comprehensive representation ability of the model for image features.

[0116] The second branch (dashed box area, including path 3 and path 4) is a parallel convolution downsampling module. In path 3, the input feature map is first passed through a 3x3 deep convolution with a step size of 2 + BN to retain and downsample the overall features. The convolution operation with a step size of 2 effectively reduces the size of the feature map, while the deep convolution can learn features independently on each channel. Then, through a 1x1conv+BN+Relu, the feature map is adjusted in the number of channels through a 1x1 convolution layer to ensure that the output feature map matches the number of channels of path 1 and path 2 of the first branch.

[0117] In path 4, the input feature map is first passed through a 1x1conv+BN+Relu, then through a 3x3 deep convolution with a step size of 2 + BN, and finally through a 1x1conv, BN, Relu. This operation not only extracts local features, but also effectively reduces the spatial size of the feature map. By concatenating the results of path 3 and path 4, the global and local features can be effectively integrated.

[0118] After the first branch and the second branch complete their respective downsampling operations, their outputs will be concatenated in the channel dimension to integrate the global and local features extracted by the two branches respectively. The concatenated feature map will be further optimized through channel shuffle operation to enhance the interaction between channels and promote better information fusion. The downsampling process of MSDM, i.e. Algorithm 1, is shown in Table 3.

[0119] Table 3 Downsampling process of MSDM

[0120]

[0121]

[0122] Step S4, a multi-scale feature extraction module (MFEN) is constructed to capture the diversified feature information of apple leaf diseases through a multi-branch structure.

[0123] In a complex environment, the classification ability of apple leaf diseases is often weak, and a single size of convolution kernel network is difficult to effectively extract accurate image features. In order to solve this problem, the present application designs a multi-scale feature extraction network (MFEN) to extract multi-level features of apple leaf disease image. By introducing multi-scale feature extraction, the diversity of extracted features can be enriched, thereby improving the classification accuracy.

[0124] The structure of MFEN is shown in Figure 6 The input feature map is first subjected to channel separation operation, and the input channel number is evenly distributed to four independent branches. Then, the feature map will be processed through the following four branches, and the specific process is as follows:

[0125] Step S41, feature reservation branch.

[0126] In the feature reservation branch, the input features are directly transmitted to the output layer through the jump connection, so as to effectively reserve the low-level feature information, thereby alleviating the common feature degradation problem in deep network. By reserving the original feature information of the first stage, the network can help to capture the subtle local changes in the image more accurately, and avoid the key details from being over-abstracted or lost in the deep convolution process. In the leaf disease classification task, the disease area (such as brown spots, leaf discoloration, etc.) often has similar visual features with background noise (such as light changes, weeds, soil or leaf vein shadows). In this case, the traditional convolutional neural network may have difficulty in distinguishing these subtle differences, especially when the background noise in the image is complex. By introducing the feature reservation branch, the network can ensure that the subtle features of the disease spots are not ignored.

[0127] Step S42, local detail branch.

[0128] The local detail branch mainly extracts the disease spot edge, local texture change and micro disease area of the apple leaf disease picture. In a complex environment background, these local features are often affected by noise and background interference, so small-scale convolution can effectively focus on the details of the disease spots and reduce the interference of the background on the classification result.

[0129] In the local detail branch, the feature map input by the second branch is first subjected to 1x1 convolution to adjust the channel number of the feature map. Then the feature map is subjected to BN layer and Relu layer. Then the feature map is subjected to a 3x3 deep convolution, BN. Deep convolution is independently convolved on each input channel, which can extract local features on each channel. It is suitable for extracting fine-grained and independent feature information. Finally, the feature map is subjected to a 1x1 point convolution to fuse the local features extracted by each channel in the deep convolution. It helps the model better understand the global information across channels by weighting and combining the features of different channels.

[0130] Step S43, deep feature branch.

[0131] The deep feature branch mainly extracts the multi-level performance of apple leaf disease pictures, such as different sizes of disease spots and morphological changes. In the deep feature branch, the feature map input by the third branch is first subjected to 1x1 convolution, BN, and Relu; then subjected to two 3x3 deep convolution, BN; and finally subjected to 1x1 convolution, BN, and Relu.

[0132] Based on the proof process of step S2, two cascaded 3x3 deep convolution layers are used in this branch to significantly reduce the network parameters and computational complexity. The two cascaded 3x3 convolution layers constitute a deeper feature extraction unit, which can obtain information from a richer feature space. This structure can further capture complex local patterns and more levels of details compared to a single 5x5 convolution layer. By gradually increasing the number of convolution layers, the network can gradually extract more abstract features while reducing the interference of background noise on the disease area.

[0133] Step S44, salient feature branch.

[0134] In the salient feature branch, the feature map input by the fourth branch is first subjected to a max-pooling layer to extract features. In a complex background environment, max-pooling can effectively enhance the extraction of salient disease features, especially when the contrast between the background and the disease features is low. Pooling operation helps to preserve key local information. Then, the feature map is further processed by 1x1 convolution to ensure that the features in different channels can be better fused, thereby improving the expression ability of the overall features.

[0135] Step S45, the output feature maps of the above four branches are subjected to a concatenation operation. This process effectively integrates features from different scales and different levels to ensure that the model can fully utilize the local, global, and salient features extracted by each branch. The concatenated feature map contains rich multi-scale information, enhancing the model's overall perception ability of the disease area.

[0136] Step S46, finally, channel shuffle is introduced to further optimize the information flow and fusion between different channels. Channel shuffle operation rearranges the features of each channel so that the features from different convolution channels can exchange information better. The feature extraction process of MFEN, i.e., Algorithm 2, is shown in Table 4.

[0137] Table 4 Feature extraction process of MFEN

[0138]

[0139] Step S5, an improved triple attention mechanism is introduced in MFEN to further extract key feature information, thereby enhancing the expression ability of the model.

[0140] The triple-branch attention mechanism includes three branches, the first two branches capture the interaction information between channels and between spaces respectively, and the third branch is used to establish individual spatial attention. The outputs of the three branches are fused to generate the final attention feature. Specifically, the shape of the input tensor is CxHxW, and each branch is responsible for aggregating cross-dimension interaction features between the spatial dimensions H, W and the channel dimension C.

[0141] For the first branch, the input shape remains CxHxW, which is responsible for aggregating interaction features of H and W, i.e., the spatial dimensions; for the second branch, the shape of the tensor obtained by the rotation operation is HxCxW, which is responsible for aggregating interaction features of C and W, i.e., the channel and W spatial dimensions; for the third branch, the shape of the tensor obtained by the rotation operation is WxHxC, which is responsible for aggregating H and C, i.e., the interaction features of the H spatial dimension and the channel, and then the triple-branch tensor is passed to the Z-pool.

[0142] Z-pool(x) = [MaxPool 0d (x), AvgPool 0d (x)] (12) ;

[0143] The Z-pool layer is responsible for reducing the zero dimension of the tensor to 2 by concatenating the average pooling and maximum pooling features in this dimension. This allows the layer to retain a rich representation of the tensor while reducing its depth. The dimensions of the three branches obtained are 2xHxW, 2xCxW, and 2xHxC, respectively. Then, a convolution layer with a kernel size of 7x7, BN, and Relu are applied to reduce the zero dimension of the tensor to 1. The attention weights are generated by a sigmoid activation layer, then applied to the input tensor, and the rotated tensor is restored to the original input shape. The final attention mechanism is obtained by averaging the results of the three branches.

[0144] On this basis, the original triple-branch attention mechanism is improved. Based on the proof process of step S2, two cascaded 3x3 convolutions are used to replace the original 7x7 convolution for feature extraction, which can maintain sufficient feature extraction capability without increasing the computational burden. Compared with the larger 7x7 convolution kernel, the cascaded two 3x3 convolution kernels not only can extract more abstract features, but also avoid the redundant calculation and higher parameter quantity caused by using large convolution kernels.

[0145] In addition, a ReLU activation function is introduced between the two 3x3 convolutions. The ReLU function can effectively control the sparsity of the network, improve the ability of nonlinear transformation, and thus accelerate the gradient calculation and optimization process. By using the ReLU activation function, the interdependence between network parameters is reduced, thereby promoting more stable and efficient updating of network information. It is worth noting that in the present application, the original batch normalization (BN) module is selected to be deleted. Through experimental analysis, it is found that in the improved attention mechanism, the effect of the BN module is not obvious, and it will increase the computational burden to some extent. Therefore, in order to further improve the computational efficiency of the model and reduce unnecessary computational overhead, the BN layer is removed in the new architecture, making the network more concise while maintaining its stability in training and inference. Through these improvements, not only the computational efficiency of the model is improved, but also the effectiveness of the cross-dimensional attention mechanism in capturing feature interactions and spatial information is guaranteed. The improved triple attention mechanism structure is shown in Figure 7 Table 5 shows the further feature extraction process of the triple attention mechanism.

[0146] Table 5 shows the further feature extraction process of the triple attention mechanism.

[0147]

[0148] Step S6, based on the above-mentioned MSDM module and MFEN module and the improved triple attention mechanism, a lightweight fusion attention multi-branch network (LCAMNet) model is established.

[0149] The present application constructs a lightweight fusion attention multi-branch network (LCAMNet) model to solve the problem of apple leaf disease image classification in complex environment, and the overall structure is shown in Figure 8 The present application constructs a lightweight fusion attention multi-branch network (LCAMNet) model to solve the problem of apple leaf disease image classification in complex environment, and the overall structure is shown in

[0150] As shown in Table 6, for a multi-channel input image with a size of 224x224x3, the LCAMNet model first processes the input image through a Conv1 layer with a size of 3x3 and a step of 2 to extract low-level features. Then, a maximum pooling layer with a size of 3x3 and a step of 2 is used to downsample the image, reducing the dimension of the output feature, and obtaining an output feature map with a size of 56x56x24.

[0151] Then, the feature map goes through stage 2, stage 3 and stage 4 to compress the redundant information and extract the features of apple leaf disease image step by step. Each stage includes a cascade of multi-scale down-sampling module (MSDM) and multi-scale feature extraction module (MFEN). Using the MSDM module, the extracted features are down-sampled to improve computational efficiency while retaining key features. On this basis, MFEN is superimposed to further capture the multi-scale features of the disease. The MSDM and MFEN modules are repeated three times to stack to improve the depth feature fusion capability of the model, and each time the higher level features are extracted on the basis of the previous layer. After the three stages, the output feature dimensions are 28x28x48, 14x14x96 and 7x7x192, respectively.

[0152] Next, at the end of stage 4, an improved triple attention mechanism is introduced to further extract key feature information and enhance the model's expression ability. The output dimension of this mechanism is 7x7x192.

[0153] Finally, a 1x1 convolution layer Conv5 is connected to adjust the number of channels for feature fusion, resulting in a feature dimension of 7x7x1024. Then, a 7x7 average pooling layer is used to process, resulting in a 1024-dimensional feature vector. The feature vector is classified by a 1024x8 fully connected layer classifier to help the model make accurate classification decisions and output the final class result.

[0154] Table 6 LCAMNet architecture diagram

[0155]

[0156]

[0157] The training process of the LCAMNet model is shown in Figure 9 First, data preprocessing is performed, including data cleaning, image size adjustment, data set division, data augmentation and data normalization. Then, the hyperparameters in the training process are set, including training rounds (Epoch), batch size, optimizer and loss function, and the model weights are initialized. Then, the data batch is sent to the model for training.

[0158] During the training process, the model parameters are dynamically adjusted according to the results of the validation set to optimize the performance of the model. Every time a batch of data is sent to the training set, the Batch size is increased by 1. If the Batch size reaches the maximum value, the Epoch is increased by 1, and the next batch of data is input for training; if the Epoch reaches the maximum value set, the training is completed, and the test set is used to evaluate the final performance of the model; if the Epoch does not reach the maximum value, the data is grouped according to the set batch size and input into the model for continuous training.

[0159] Embodiment

[0160] 1. Evaluation index of the LCAMNet model of the application.

[0161] The embodiment uses Accuracy, Precision, Recall and F1-Score four indexes to evaluate the model. The definitions are as follows: the accuracy is the ratio of the number of samples correctly detected to the total number of samples; the precision is the ratio of the number of samples correctly predicted by the model to the total number of samples predicted as the class; the recall is the ratio of the number of samples correctly predicted by the model to the total number of samples actually belonging to the class; and the F1 value is the harmonic mean of the accuracy and the recall. The calculation formulas of Accuracy, Precision, Recall and F1 value are as follows:

[0162]

[0163]

[0164] Wherein, TP represents the number of samples whose label is positive sample and the model classification result is also positive sample; TN represents the number of samples whose label is negative sample and the model classification result is negative sample; FP represents the number of samples whose label is negative example and the model classification result is positive example sample; and FN represents the number of samples whose label is positive example and the model classification result is negative example.

[0165] For multi-target classification, there are mainly two statistical methods: macro average and micro average. The embodiment uses macro average as the value of recall and accuracy, and uses global average value as the value of accuracy. Taking recall as an example, the macro average is calculated as follows:

[0166]

[0167] 2. Ablation experiment of SCEBD.

[0168] This embodiment verifies the effectiveness of the method by performing ablation experiments on SCEBD. LCAMNet is improved based on the structure of ShuffleNetV2 model. Therefore, several models are designed. Among them, Baseline is the model ShuffleNetV2, and its feature extraction network and down-sampling network are as shown in Figure 10

[0169] Model1 is only to change the feature extraction layer based on ShuffleNetV2. By replacing the ShuffleNetV2 feature extraction network in (a) of Figure 6 with the MFEN in Figure 10 , Model1 is obtained.

[0170] Model2 is only to change the down-sampling layer based on ShuffleNetV2. By replacing the ShuffleNetV2 down-sampling network in (b) of Figure 5 with the MSDM in Figure 10 , Model2 is obtained.

[0171] Model3 is to change both the feature extraction layer and the down-sampling layer based on ShuffleNetV2.

[0172] Model4 is to add the improved triple attention based on Model3.

[0173] As shown in Table 7, GFLOPs represents the number of floating point operations of the model (in billions of times of calculation) for measuring the computational complexity of the model; Parameters (parameters) refer to the number of trainable weights in the model, which is usually used to measure the size of the deep learning model.

[0174] Table 7 Ablation experiment on SCEBD dataset

[0175]

[0176]

[0177] It can be seen that the performance of Model1 on the test set is better than that of Baseline, indicating that compared with the ordinary feature extraction layer of ShuffleNetV2, MFEN can more effectively extract feature information in the classification of apple leaf disease images in complex environmental backgrounds.

[0178] The test performance of Model2 is better than that of Baseline, indicating that compared with the down-sampling method adopted by ShuffleNetV2, applying MSDM to the down-sampling process of apple leaf disease images can better preserve feature information, thereby improving the recognition effect. ​

[0179] Model3 outperforms Model1 and Model2 on the test set, indicating that the joint application of MFEN and MSDM has a synergistic effect in the apple leaf disease image classification task, and its performance is better than that of the two single applications, i.e., Model3>Model1+Model2.

[0180] The test performance of Model4 is further superior to Model3, indicating that the introduction of the improved triple attention mechanism slightly increases the parameter quantity, but significantly improves the model performance.

[0181] In addition, compared with the baseline (ShuffleNetV2), the improved model still reduces the number of floating point operations and the parameter quantity, while achieving greater improvement in classification performance.

[0182] In summary, by gradually introducing MFEN, MSDM and the improved triple attention mechanism, the classification performance of the model is continuously improved, verifying the effectiveness of the method proposed in the application.

[0183] 3、Comparison with classical deep learning networks.

[0184] In this embodiment, the performance of the method proposed in the application is compared with that of VGG, ResNet, ResNext, DenseNet and other classical convolutional neural network models on the self-built SCEBD dataset, and the experimental results are shown in Table 8.

[0185] Table 8 Comparison of performances of different deep learning models in SCEBD

[0186] Models Accuracy Recall Precision F1 GFLOPs Parameters VGG13 89.03 89.04 89.15 89.03 11.36G 133.05M ResNet34 88.52 88.54 89.02 88.66 3.68G 21.80M ResNext50 85.97 85.99 86.48 86.12 4.29G 25.03M DenseNet201 90.56 90.56 90.67 90.60 4.39G 20.01M MobileVit 91.84 91.85 91.91 91.83 0.27G 1.27M GoogLeNet 92.09 92.09 92.20 92.11 1.60G 7.01M InceptionResNetV2 91.58 91.59 92.14 91.71 6.50G 55.84M EfficientNetB0 91.33 91.35 91.54 91.34 0.42G 8.43M ShuffleNetV2 88.01 88.00 88.98 88.21 0.04G 1.31M MobileNetV2 89.80 89.79 90.52 89.93 0.33G 3.51M GhostNet 90.31 90.35 91.09 90.45 0.16G 5.18M LCAMNet 92.60 92.64 92.85 92.64 0.03G 1.30M

[0187] The LCAMNet proposed in the application is based on the ShuffleNetV2 model, which integrates multi-branch feature extraction, multi-scale down-sampling module and attention mechanism and other technologies, uses a simpler overall model structure, and reduces network parameters as much as possible. Therefore, among all the models participating in the experiment, the parameter quantity of LCAMNet is lower than that of ShuffleNetV2, and compared with the classical deep learning network, LCAMNet has the best classification performance on apple leaf disease image, which shows that LCAMNet is a high-performance, lightweight apple leaf disease image recognition model. As shown in the three-dimensional visualization analysis of accuracy, GFLOPs and parameter quantity Figure 11 , it is further verified that LCAMNet has excellent classification ability and computing efficiency compared with other deep learning models in Table 8.

[0188] 4、Comparison with the performance of the same crop disease image classification model.

[0189] The proposed method is compared with the performance of the same crop disease image classification model on the SCEBD dataset, as shown in Table 9.

[0190] Table 9 Comparison of LCAMNet and the same crop disease image classification model on SCEBD

[0191] Models Accuracy Recall Precision F1 GFLOPs Parameters Re-GoogLeNet 93.37 93.36 93.79 93.46 2.80G 9.11M ALS-Net 91.07 91.09 91.28 91.13 0.73G 1.18M LBMRNet 90.05 90.06 91.54 90.30 0.17G 0.91M LCAMNet 92.60 92.64 92.85 92.64 0.03G 1.30M

[0192] It can be seen that the performance of ALS-Net and LBMRNet algorithms is inferior to that of LCAMNet algorithm. This is because although ALS-Net improves ShuffleNetV2, its multi-scale feature acquisition is only performed at the initial stage of the network, and these features are not effectively fused into each stage, thereby limiting the ability of feature extraction. Although LMBRNet improves the feature extraction layer and the down-sampling layer, its multi-residual structure causes useless information to be constantly retained, affecting the final recognition effect. In contrast, Re-GoogLeNet optimizes GoogLeNet and introduces an attention mechanism to retain important features of GoogLeNet, and retains part of the original features through residual connection. Although its performance is better than that of LCAMNet, its large number of floating points and high parameter amount make it may not be suitable for resource-limited scenarios.

[0193] 5. Model comparison based on public dataset.

[0194] In this paper, the proposed method is tested on the public dataset FGVC8 together with several classical deep learning models and the same crop disease image classification model to verify the effectiveness and superiority of the proposed method. As shown in Table 10, the performance comparison results of the proposed method and various classical convolutional neural networks and the same crop disease image classification model on the FGVC8 public dataset are shown.

[0195] Table 10 Comparison of different deep learning models and the same crop disease image classification model on the FGVC8 dataset

[0196] Models Accuracy Recall Precision F1 GFLOPs Parameters GoogLeNet 95.31 95.33 95.56 95.39 1.60G 7.01M InceptionResNetV2 94.92 94.93 95.40 95.06 6.50G 55.84M EfficientNetB0 91.80 91.88 92.13 91.92 0.42G 8.43M ShuffleNetV2 91.80 91.96 91.89 91.86 0.04G 1.31M MobileVit 94.53 94.54 95.05 94.63 0.27G 1.27M Re-GoogLeNet 96.48 96.50 96.58 96.49 2.80G 9.11M ALS-Net 92.97 93.03 93.55 93.08 0.73G 1.18M LBMRNet 91.02 91.13 91.75 91.30 0.17G 0.91M LCAMNet 95.31 95.29 95.81 95.39 0.03G 1.30M

[0197] The experimental results show that the recognition accuracy of the proposed method on the public dataset is comparable to that of GoogLeNet and InceptionResNetV2, and the number of floating point operations (FLOPs) and the number of model parameters are significantly lower than those of the two models.

[0198] The method has the obvious advantages in calculation efficiency, and helps to reduce the consumption of computing resources. In addition, the recognition accuracy of the method on the public data set is significantly higher than that of ShuffleNetV2, and the number of floating point operations and the parameter amount are slightly lower than those of ShuffleNetV2, and the LCAMNet is better in fusing the multi-branch feature extraction, the multi-scale down-sampling module and the attention mechanism and other technologies in ShuffleNetV2, so that it is suitable for different data sets.

[0199] Further, compared with the same crop disease image classification model, the experimental results show that the method has lower recognition accuracy than Re-GoogLeNet, but the number of floating point operations and the model parameter amount are far lower than Re-GoogLeNet, which reflects the significant optimization in the consumption of computing resources. The optimization makes the method greatly reduce the calculation cost while maintaining high recognition accuracy, so that it is more suitable for application scenarios with limited computing resources, such as mobile devices or embedded systems.

[0200] In summary, the experimental results fully verify the effectiveness of the method on the public data set. Compared with some deep learning networks, the method significantly reduces the calculation complexity while maintaining competitive recognition accuracy, and has strong practical application value and promotion potential, as shown in Table 10. Through three-dimensional visualization analysis of accuracy, GFLOPs and parameter amount on FGVC8 as shown in Table 10, the universality and generality of LCAMNet are further verified, that is, it has low GFLOPs and parameter amount, but the accuracy and other indicators are only second to Re-GoogLeNet and GoogLeNet. Figure 12

[0201] ​Therefore, the application adopts the above-mentioned apple leaf disease multi-classification method based on a complex environment background, a multi-scale downsampling module (MSDM) effectively avoids information loss caused by a single downsampling operation by using different downsampling operations on different channels and further fusing features between different channels by channel mixing, thereby improving the recognition accuracy of the network; a multi-dimensional feature extraction network (MFEN) captures diversified feature information of apple leaf diseases through a multi-branch structure; a channel separation and mixing mechanism is introduced in the MFEN to promote feature exchange between channels and further improve the feature extraction capability; an improved triple attention module is integrated into the MFEN, two cascaded 3x3 convolutions are used instead of the original 7x7 convolution, and the original normalization operation is removed. While improving the linear expression capability of the network, the parameter amount is reduced, the focusing capability of the model on the key disease area is enhanced, and the accuracy and robustness of disease recognition are improved. The LCAMNet has good universality and high efficiency, and is suitable for apple leaf disease classification tasks with limited resources and complex background.

[0202] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, but not to limit it, although the present application has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that: it can still modify or equivalently replace the technical solutions of the present application, and these modifications or equivalent replacements cannot make the modified technical solutions deviate from the spirit and scope of the technical solutions of the present application.

Claims

1. A multi-classification method for apple leaf diseases under complex environmental conditions, characterized in that, Includes the following steps: Step S1: Construct the public dataset FGVC8 and the self-built complex environment background dataset SCEBD, and preprocess the collected image data; Step S2: Construct a multi-scale downsampling module (MSDM) by combining multiple downsampling strategies; The MSDM module contains two branches. The first branch includes two paths, which extract global features and salient features from the image by applying max pooling path 1 and average pooling path 2 in parallel. The second branch, consisting of paths 3 and 4, is a parallel convolutional downsampling module; The downsampled outputs of the first and second branches are concatenated along the channel dimension to integrate the global and local features extracted from the two branches. The concatenated feature map is further optimized through channel shuffling. Step S3: Construct the multi-scale feature extraction module MFEN to capture diverse feature information of apple leaf diseases through a multi-branch structure; A multi-scale feature extraction module (MFEN) is constructed to capture diverse feature information of apple leaf diseases by evenly distributing the number of input channels into four independent branches. The four independent branches are: feature preservation branch, local detail branch, deep feature branch, and salient feature branch. The output feature maps of the above four branches are concatenated, and channel shuffling is introduced to optimize the information flow and fusion between different channels. The channel shuffling operation realizes the exchange of information between features from different convolutional channels by rearranging the features of each channel. Step S4: Introduce an improved triplet attention mechanism into MFEN to further extract key feature information; The triplet attention mechanism consists of three branches. The first two branches capture the interaction information between channels and between spaces, respectively. The third branch is used to establish a separate spatial attention. The outputs of the three branches are fused to generate the final attention feature. Step S5: Based on the constructed MSDM and MFEN modules and the improved triplet attention mechanism, establish the lightweight fusion attention multi-branch network LCAMNet model; A lightweight fusion attention multi-branch network model, LCAMNet, is established. The LCAMNet model includes a 3×3 basic convolution Conv1, a max pooling layer with a 3×3 pooling kernel, and stages 2, 3, and 4, as well as a 1×1 convolution Conv5, an average pooling layer, and a fully connected layer. Among them, stages 2, 3 and 4 all include a multi-scale downsampling module MSDM and a multi-scale feature extraction module MFEN; an improved triplet attention mechanism is superimposed on the MFEN of stage 4. The LCAMNet model was used to classify images of diseases on apple leaves.

2. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 1, characterized in that, Based on the first branch of the constructed multi-scale downsampling module MSDM, global and salient features in the image are extracted. The specific process is as follows: First, average pooling extracts global features of the image by averaging the pixel values ​​within the pooling region, reducing the impact of local noise and enabling the model to capture the overall information of the image. Secondly, max pooling extracts local salient features by selecting the maximum value in the pooling window, highlighting texture and morphological changes in the diseased area; Then, by concatenating the results of max pooling and average pooling, the complementary nature of salient features and global features is achieved. Finally, channels are aggregated using 1×1 convolution, batch normalization (BN), and ReLU activation functions.

3. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 1, characterized in that, In path 3 of the second branch of the multi-scale downsampling module MSDM, the input feature map is first passed through a 3×3 depthwise convolution with a stride of 2 and BN to preserve and downsample the overall features; then it is passed through a 1×1 convolution with BN and ReLU to adjust the number of channels, ensuring that the number of channels of the output feature map matches the first branch's paths 1 and 2. In path 4, the input feature map is first passed through a 1×1 convolution + BN + ReLU, then through a 3×3 depthwise convolution + BN with a stride of 2, and finally through a 1×1 convolution + BN + ReLU to extract local features; by concatenating the results of path 3 and path 4, the overall features and local features are fused.

4. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 1, characterized in that, In the feature-preserving branch, the input features are used to obtain the output features through skip connections, thus preserving low-level information about apple leaf diseases.

5. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 4, characterized in that, The Local Details branch is used to extract the edges of lesions, local texture variations, and diseased areas from apple leaf disease images. In the Local Details branch, the input feature map first undergoes a 1×1 convolution to adjust the number of channels. Then, the feature map passes through a Batch Normalization (BN) layer and a ReLU layer. Subsequently, the feature map undergoes a 3×3 depthwise convolution with BN. The depthwise convolution is performed independently on each input channel, extracting local features on each channel, which is suitable for extracting fine-grained, independent feature information. Finally, the feature map undergoes a 1×1 pointwise convolution to fuse the local features extracted from each channel in the depthwise convolution. By weighting and combining features from different channels, the model captures global information across channels.

6. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 5, characterized in that, The deep feature branch extracts multi-layer representations of apple leaf disease images. The input feature map first goes through a 1×1 convolution, BN, and ReLU; then through a 3×3 depthwise convolution, BN; then through another 3×3 depthwise convolution, BN; and finally through a 1×1 convolution, BN, and ReLU. Two cascaded 3×3 depthwise convolutions are used in this branch to reduce network parameters and computational cost.

7. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 6, characterized in that, In the salient feature branch, the input feature map first extracts features through a max pooling layer; then, the feature map is further processed through a 1×1 convolution to ensure that features from different channels are fused, thereby improving the overall expressive power of the features.

8. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 1, characterized in that, In step S4, an improved triplet attention mechanism is introduced into MFEN to further extract key feature information. The specific process is as follows: initial tensor C is the number of image channels, H is the image height, and W is the image width; for the first branch, the input shape remains unchanged. It is responsible for aggregating the interactive features of H and W, i.e., the spatial dimensions; for the second branch, the shape of the tensor obtained through rotation operations is... It is responsible for aggregating the interactive features of C and W, i.e., the channel and W spatial dimensions; for the third branch, the shape of the tensor obtained through rotation operation is... It is responsible for aggregating H and C, namely the interaction features of H spatial dimensions and channels; The triplet tensor is then passed to the Z-pool layer, which is responsible for reducing the zeroth dimension of the tensor to 2 by concatenating the average pooling and max pooling features in that dimension. Then, two cascaded 3×3 convolutional layers, ReLU, are used to reduce the zeroth dimension of the tensor to 1; attention weights are generated by a sigmoid activation layer and then applied to the input tensor, restoring the rotated tensor to the original input shape; The final attention mechanism is obtained by averaging the results of the three branches.

9. The method for multi-classification of apple leaf diseases under complex environmental conditions according to claim 1, characterized in that, In step S5, for the multi-channel input image, the LCAMNet model first performs preliminary processing on the input image through a Conv1 layer of size 3×3 and stride=2 to extract low-level features; then, it uses a max pooling layer of size 3×3 and stride=2 to downsample the image, reduce the dimension of the output features, and obtain the output feature map. Then, the feature map goes through stages 2, 3 and 4 to compress redundant information and gradually extract features from apple leaf disease images. Each stage includes a cascaded multi-scale downsampling module MSDM and a multi-scale feature extraction module MFEN. The MSDM module is used to downsample the extracted features, improving computational efficiency while retaining key features. On this basis, the MFEN module is superimposed to further capture the multi-scale features of the disease. The MSDM and MFEN modules are stacked three times, and an improved triplet attention mechanism is introduced at the end of stage 4 to further extract key feature information and enhance the expressive power of the model. Finally, a 1×1 convolutional layer (Conv5) is connected to adjust the number of channels for feature fusion. Then, a 7×7 average pooling layer and a fully connected classifier are used for classification to output the final category result. The training process of the LCAMNet model is as follows: First, data preprocessing is performed, including data cleaning, image resizing, dataset partitioning, data augmentation, and data normalization. Next, set the hyperparameters for the training process, including the number of training epochs, batch size, optimizer, and loss function, and initialize the model weights; Then, the data is fed into the model in batches for training; During training, the batch size is incremented by 1 for each batch of data sent to the training set. If the batch size reaches its maximum value, the epoch is incremented by 1, and the next batch of data is input for training. If the epoch reaches its maximum value, training ends, and the model's performance is evaluated using the test set. If the epoch does not reach its maximum value, the data is grouped according to the set batch size and sent to the model for further training.

Citation Information

Patent Citations

  • Classification method and device for apple leaf diseases, terminal, medium and program product

    CN119600370A

  • Overhead transmission line defect detection method based on multi-scale feature fusion

    CN119624922A