Soybean leaf disease identification method based on multi-scale feature fusion Transformer

By adopting a multi-scale feature fusion MSFF-Transformer model in soybean leaf disease identification, combining global and local branching, multi-head self-attention and pyramid pooling mechanism is introduced, the problem that cannot take into account both global and local features in the existing technology is solved. Achieved disease identification with high accuracy and strong generalization capabilities.

CN119399635APending Publication Date: 2025-02-07JIANGSU UNIV
View PDF 0 Cites 6 Cited by

Patent Information

Application Number
CN202411672472.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The prior art cannot take into account both global and local features in soybean leaf disease recognition, and convolutional neural networks are difficult to adapt to images of different scales.

Method used

Using the MSFF-Transformer model based on multi-scale feature fusion, through a structure combining global and local branch, a multi-head self-attention mechanism is introduced, and a pyramid pooling and self-attention mechanism is combined to optimize the channel attention module. Get global spatial dependencies between different scales.

Benefits of technology

It significantly improves the accuracy of soybean leaf diseases, has stronger generalization ability, can accurately identify multiple soybean leaf diseases, and can be deployed to mobile terminals to provide technical support for real-time detection of soybean diseases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399635A_ABST
    Figure CN119399635A_ABST
Patent Text Reader

Abstract

The invention discloses a soybean leaf disease identification method based on multi-scale feature fusion Transform, and the method comprises the following steps: S1, obtaining different types of soybean leaf disease images from a public data set, S2, carrying out the preprocessing operation of the collected soybean leaf disease images, including rotation, overturning, brightness adjustment and contrast adjustment; s3, constructing a soybean leaf disease identification model; s4, verifying the trained model; s5, obtaining a to-be-identified soybean leaf disease image; s6, inputting a to-be-identified soybean leaf image into the constructed soybean leaf disease identification model, and identifying and outputting a disease type through the classifier; a pyramid pooling module and a self-attention mechanism are introduced, and a channel attention module is optimized, so that a global spatial dependency relationship among different scales can be obtained, and the recognition accuracy of the model is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of crop disease identification, and specifically relates to a soybean leaf disease identification method based on multi-scale feature fusion MSFF-Transformer. Background Art

[0002] Soybean is an important legume and one of the most widely grown cash crops worldwide. Rich in protein and oil, soybean is an important food source for humans and livestock, and is also a raw material for a wide range of industrial uses. However, soybean diseases account for about 15%-30% of annual yield losses. Soybean leaf diseases, as a more common type of soybean disease, have a direct negative impact on soybean yield and quality, and also cause certain losses to farmers and consumers. Therefore, rapid and accurate identification of soybean leaf diseases is crucial for agricultural production and economic development.

[0003] At present, traditional disease identification methods mainly rely on manual experience, with low accuracy and efficiency. In recent years, with the rapid development of artificial intelligence and computer vision technology, machine learning methods and deep learning methods have been applied in the field of image recognition. However, traditional machine learning algorithms have obvious deficiencies in feature extraction and processing of high-dimensional data, and traditional deep learning algorithms, especially models based on convolutional neural networks (CNNs), have excellent performance in automatic feature extraction and processing of complex data, but their local connection structure limits their ability to model global information. At the same time, in actual use, the size and shape of the acquired soybean leaf images may vary greatly, and convolutional neural networks (CNNs) cannot adapt well to different scales.

[0004] Therefore, it is necessary to design a deep learning model for identifying soybean leaf diseases. This method can overcome the deficiency of convolutional neural networks that cannot take into account both global and local features, so as to realize the processing of global information of images of different scales. Summary of the invention

[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a soybean leaf disease recognition method based on MSFF-Transformer, which can overcome the shortcomings of convolutional neural networks that cannot take into account both global and local features, so as to realize the processing of global information of images of different scales. At the same time, it can effectively improve the recognition accuracy of soybean leaf diseases and provide technical support for large-scale automated detection of soybean diseases.

[0006] The technical solution of the present invention for solving the problems of the prior art is:

[0007] A soybean leaf disease recognition method based on multi-scale feature fusion MSFF-Transformer includes the following steps:

[0008] S1: Obtain different types of soybean leaf disease images from a public dataset, wherein the types of soybean leaf diseases include bacterial leaf blight, Cercospora leaf blight, downy mildew, frog eye disease, health, potassium deficiency, soybean rust and target spot.

[0009] S2: Perform preprocessing operations on the collected soybean leaf disease images, including rotation, flipping, brightness adjustment, contrast adjustment, etc., to increase the diversity and robustness of the data.

[0010] S3: constructing a soybean leaf disease recognition model, and training the soybean leaf disease recognition model.

[0011] S4: Verify the trained model, using accuracy, precision, recall and F1-Score as evaluation indicators. By comparing the performance of traditional models, the superiority of the soybean leaf disease recognition model is verified.

[0012] S5: Acquire a soybean leaf disease image to be identified;

[0013] S6: Input the soybean leaf image to be identified into the constructed soybean leaf disease identification model, identify and output the disease type through the classifier.

[0014] Preferably, in step S3, the soybean leaf disease recognition model is constructed based on a multi-scale feature fusion MSFF-Transformer network;

[0015] S3.1: Constructing the global branch of the soybean leaf disease recognition model

[0016] In the global branch of MSFF-Transformer, the height, width and channels of the input image are set to 224×224×3 and downsampled by a linear fusion layer. For the global branch, in Stage 1, the input image is first split into 4×4 patches, each of which is 4×4×3 in size. Since each patch is flattened into a 48-dimensional vector, this step produces a 56×56×48 patch embedding. Then, a linear embedding layer is used to map each 48-dimensional vector to a 96-dimensional vector, resulting in a 56×56×96 feature map. Finally, the output dimension of Stage 1 is 56×56×96 through the CEST module. In Stage 2, the feature map is reduced to 28×28×192 by a 4×4 patch merging operation. The merging operation is achieved by flattening each 2×2 patch into a vector and expanding its dimension to 192 through linear projection. The output dimension of Stage 2 is also 28×28×192 through the CEST module. Similar to Stage 2, the output dimensions of Stage 3 and Stage 4 are 14×14×384 and 7×7×768 respectively.

[0017] In the present invention, multi-head self-attention (MSA) and window multi-head self-attention (W-MSA) mechanisms are introduced in CEST Block. The calculation complexity formulas of MSA and W-MSA are as follows:

[0018] Ω(MSA)=4hwC 2 +2(hw) 2 C

[0019] Ω(W-MSA)=4hwC 2 +2M 2 HkDJ

[0020] Among them, h represents the height of the feature map, w represents the width of the feature map, C represents the depth of the feature map, and M represents the size of each window.

[0021] In CEST Block (Conv-Enhanced Swin Transformer Block): For the i-th stage, feature g i-1 First, it undergoes layer normalization, then it undergoes feature learning through W-MSA, and then it obtains g through residual connection. i ', then normalized by the layer, and finally the output feature g is obtained through Hybrid-MLP and residual connection i In the subsequent CEST Block structure, it is only necessary to replace the W-MSA layer with the SW-MSA layer in the feature calculation part, and the other structures remain unchanged. The above process can be expressed as:

[0022] g i =W-MSA(LN(g i-1 ))+g i-1

[0023] g i =Hybrid-MLP(LN(g i '))+g i '

[0024] g i ' +1 =SW-MSA(LN(g i ))+g i

[0025] g i+1 =Hybrid-MLP(LN(g i ' +1 ))+g i ' +1

[0026] Among them, W-MSA represents window multi-head self-attention layer, SW-MSA represents window multi-head self-attention layer with displacement, LN represents layer normalization, and Hybrid-MLP represents hybrid convolutional multi-layer perceptron.

[0027] In the Hybrid-MLP structure: First, the input features are linearly transformed through a 1×1 convolution layer to increase the channel dimension. Second, the features are processed through a 3×3 depth-separable convolution layer. Finally, a 1×1 convolution layer is used to restore the channel dimension of the image and output the final feature representation. This process can be expressed as:

[0028] Hybrid-MLP(x)=f 1×1 (f depth3×3 (f 1×1 (x)))

[0029] Among them, f 1×1 represents a convolution operation with a kernel size of 1×1, f depth3×3 Represents a depthwise separable convolution operation with a kernel size of 3×3.

[0030] S3.2: Constructing local branches of soybean leaf disease recognition model

[0031] First, two 3×3 convolutional layers are used to divide the image into 4×4 sub-image blocks. Second, a 3×3 depthwise separable convolutional layer is used to further refine the feature representation. Finally, the module introduces a combination of two sets of 1×1 convolutions and 3×3 depthwise separable convolutions, which are repeated three times to gradually extract higher-level features. These convolution operations are followed by the Mish activation function, which is mathematically defined as follows. At the same time, the batch normalization operation is combined.

[0032] Mish(x) = xtanh(ln(1+e x ))

[0033] S3.3: Constructing global and local information fusion modules

[0034] The calculation process of the PESSA module (Pyramid Enhanced Split Attention with Self-Attention) can be divided into the following five steps. Here, assume that the input feature map X∈R C×H×W :

[0035] (1) The PESC module (Pyramid Enhanced Split and Concat) is used to divide the input feature map X into multiple groups of feature maps by channel. In the divided channel feature maps, convolution kernels of different sizes are used to extract the multi-scale spatial information in the image, and pyramid pooling operations are added to obtain a multi-scale feature map F.

[0036] (2) Use the SE Weight module to assign different weights to F in the channel dimension and generate the corresponding channel attention vector.

[0037] (3) The channel attention vectors are re-weighted and fused through the Softmax operation to obtain the updated attention weights.

[0038] (4) Perform a point multiplication weighted operation on the new attention weight and F to obtain a preliminary output feature map Y.

[0039] (5) A self-attention mechanism is added to the preliminary output feature map Y. Y is processed by the self-attention module to capture long-distance dependencies in the spatial dimension, thereby obtaining the global spatial context information and obtaining the final output feature map Z.

[0040] In the PESC module: First, the PESC module divides the input X into two parts according to the number of channels; second, it uses 3×3 and 5×5 convolution kernels to perform convolution operations to generate two sets of dual-scale feature maps; then, pyramid pooling operations are performed on the two sets of feature maps, and the sizes of the pooling layers used are: 1×1 pooling, 2×2 pooling, 3×3 pooling and 6×6 pooling; finally, the two sets of feature maps are spliced ​​to obtain the output feature map F.

[0041] Feature map P after pyramid pooling i With the dual-scale feature map F i The relationship between them is:

[0042] P i =PPM(F i )

[0043] Where i=0,1; PPM stands for pyramid pooling. The final output feature map F is:

[0044] F=Cat([P 0 ,P 1 ])

[0045] Among them, Cat represents the splicing operation.

[0046] S3.4: Training a soybean leaf disease recognition model

[0047] The training process is based on the PyTorch1.7.0 deep learning framework. The batch size of the dataset is set to 32, the learning rate is set to 0.0001, the number of epochs is set to 300, the AdamW optimizer is used, and the weight decay is set to 0.05.

[0048] Preferably, in step S6, the soybean leaf disease recognition model is deployed on a mobile terminal, and the soybean leaf diseases in actual farmland are identified through the mobile terminal, providing a convenient diagnostic tool for farmers and agricultural experts.

[0049] Compared with the prior art, the present invention has the following beneficial effects:

[0050] 1. The soybean leaf disease recognition model constructed in the present invention has higher recognition accuracy and stronger generalization ability. The recognition accuracy rates of bacterial leaf blight, Cercospora leaf blight, downy mildew, frog eye disease, health, potassium deficiency, soybean rust and target spot are 100.0%, 95.6%, 95.5%, 96.7%, 98.2%, 97.1%, 97.5% and 95.4%, respectively. At the same time, the soybean leaf disease recognition model can be deployed on the mobile terminal to provide technical support for real-time detection of soybean diseases, and is expected to be widely used in the agricultural field.

[0051] 2. The present invention proposes a new attention mechanism PESSA, introduces a pyramid pooling module and a self-attention mechanism, and optimizes the channel attention module, which can obtain the global spatial dependency between different scales, thereby effectively improving the recognition accuracy of the model.

[0052] 3. The present invention is not only applicable to the identification of soybean leaf diseases, but can also be extended to the disease monitoring of other crops, providing extensive technical support for agricultural disease prevention and control. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to make the purpose, technical solution and advantages of the invention more clear, the present invention will be further described in detail below with reference to the accompanying drawings, in which:

[0054] Figure 1 It is a flow chart of the soybean leaf disease identification method based on MSFF-Transformer of the present invention;

[0055] Figure 2 Images of eight types of soybean leaf diseases, namely: (a) bacterial leaf blight, (b) Cercospora leaf blight, (c) downy mildew, (d) frog eye disease, (e) healthy, (f) potassium deficiency, (g) soybean rust, and (h) target spot.

[0056] Figure 3 The overall structure diagram of MSFF-Transformer

[0057] Figure 4 The structure diagram of two consecutive CEST modules

[0058] Figure 5 This is the structure diagram of the PESSA attention module.

[0059] Figure 6 The structure diagram of the PESC module DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0061] like Figure 1 As shown, a soybean leaf disease recognition method based on MSFF-Transformer includes the following steps:

[0062] S1: Obtain different types of soybean leaf disease images from a public dataset, wherein the types of soybean leaf diseases include bacterial leaf blight, cercospora leaf blight, downy mildew, frog eye disease, health, potassium deficiency, soybean rust, and target spot;

[0063] S2: preprocessing operations are performed on the collected soybean leaf disease images, including rotation, flipping, brightness adjustment, contrast adjustment, etc., to increase the diversity and robustness of the data;

[0064] S3: constructing a soybean leaf disease recognition model, and training the soybean leaf disease recognition model;

[0065] S4: Verify the trained model, using accuracy, precision, recall and F1-Score as evaluation indicators. By comparing the performance of traditional models, the superiority of the soybean leaf disease recognition model is verified;

[0066] S5: Acquire a soybean leaf disease image to be identified;

[0067] S6: Input the soybean leaf image to be identified into the constructed soybean leaf disease identification model, identify and output the disease type through the classifier.

[0068] See also Figure 1 ,In step S6, the soybean leaf disease recognition model is deployed on the mobile terminal, and the soybean leaf diseases in the actual farmland are identified through the mobile terminal, providing a convenient diagnostic tool for farmers and agricultural experts.

[0069] During the specific implementation process, a soybean leaf disease recognition model was constructed based on the MSFF-Transformer network;

[0070] Combination Figure 3 As shown in the figure, the buckwheat disease recognition model is constructed through the following steps:

[0071] S3.1: Constructing the global branch of the soybean leaf disease recognition model

[0072] In order to improve the accuracy of classification, a dual-branch parallel network structure is designed. The dual-branch structure can capture the global and local features of the image at the same time, enhancing the model's multi-scale feature extraction capabilities. Especially in complex image classification tasks, the model can integrate these two features to a greater extent without interfering with each other, which can improve the accuracy and robustness of the model.

[0073] In MSFF-Transformer, the height, width, and channels of the input image are set to 224×224×3. The global branch is used to extract global features of the image and downsample it through a linear fusion layer (Patch Merging). For the global branch, in Stage 1, the input image is first split into 4×4 patches, and the size of each patch is 4×4×3. Since each patch is flattened into a 48-dimensional vector, this step produces a 56×56×48 patch embedding. Then, a linear embedding layer is used to map each 48-dimensional vector to a 96-dimensional vector, resulting in a 56×56×96 feature map, and finally the output dimension of Stage 1 is 56×56×96 through the CEST module. In Stage 2, the feature map is reduced to 28×28×192 by a 4×4 patch merging operation. The merging operation is achieved by flattening each 2×2 patch into a vector and extending its dimension to 192 by linear projection. Similarly, the output dimension of Stage 2 obtained by the CEST module is 28×28×192. Similar to Stage 2, the output dimensions of Stage 3 and Stage 4 are 14×14×384 and 7×7×768, respectively.

[0074] like Figure 4 As shown, for the i-th stage, the feature g i-1 First, it undergoes layer normalization, then it undergoes feature learning through W-MSA, and then it obtains g through residual connection. i ', then normalized by the layer, and finally the output feature g is obtained through Hybrid-MLP and residual connection i In the subsequent CEST Block structure, it is only necessary to replace the W-MSA layer with the SW-MSA layer in the feature calculation part, and the other structures remain unchanged. The above process can be expressed as:

[0075] g i =W-MSA(LN(g i-1 ))+g i-1

[0076] g i =Hybrid-MLP(LN(g i '))+gi '

[0077] g i ' +1 =SW-MSA(LN(g i ))+g i

[0078] g i+1 =Hybrid-MLP(LN(g i ' +1 ))+g i ' +1

[0079] Among them, W-MSA represents window multi-head self-attention layer, SW-MSA represents window multi-head self-attention layer with displacement, LN represents layer normalization, and Hybrid-MLP represents hybrid convolutional multi-layer perceptron.

[0080] The design of Hybrid-MLP is as follows Figure 4 As shown. First, the input features are linearly transformed through a 1×1 convolutional layer to increase the channel dimension. This step is similar to the linear layer in the traditional MLP, but retains the spatial information. Secondly, the features are processed through a 3×3 depthwise separable convolutional layer. The depthwise separable convolution is divided into two stages: depthwise convolution and pointwise convolution, which can reduce the amount of calculation and parameters while maintaining high performance and enhancing the ability to extract local features. Finally, a 1×1 convolutional layer is used to restore the channel dimension of the image and output the final feature representation. This process can be expressed as:

[0081] Hybrid-MLP(x)=f 1×1 (f depth3×3 (f 1×1 (x)))

[0082] Among them, f 1×1 represents a convolution operation with a kernel size of 1×1, f depth3×3 Represents a depthwise separable convolution operation with a kernel size of 3×3.

[0083] S3.2: Constructing local branches of soybean leaf disease recognition model

[0084] In order to effectively capture the more distinguishing local subtle features of soybean leaf diseases, a local feature extraction module is proposed. The composition of the module is as follows: Figure 3As shown in the local feature module in . First, two 3×3 convolutional layers are used to divide the image into 4×4 sub-image blocks. Secondly, the feature representation is further refined through a 3×3 depthwise separable convolutional layer. Then, the module introduces a combination of two sets of 1×1 convolutions and 3×3 depthwise separable convolutions, and repeats them three times to gradually extract higher-level features and capture more local information and inter-channel relationships. Finally, the extracted local features are input into the PESSA module. These convolution operations are followed by the Mish activation function, which is mathematically defined as follows, to enhance the nonlinear expression ability. At the same time, the batch normalization operation is combined to ensure the stability and efficiency of training. For the local branch, in order to facilitate subsequent feature fusion, the output dimension of the feature map of the local branch is also 7×7×768.

[0085] Mish(x) = xtanh(ln(1+e x ))

[0086] S3.3: Constructing global and local information fusion modules

[0087] like Figure 5 As shown in the figure, the calculation process of the PESSA module can be divided into the following five steps. Here, it is assumed that the input feature map X∈R C×H×W :

[0088] (1) The PESC module is used to divide the input feature map X into multiple groups of feature maps by channel. In the divided channel feature maps, convolution kernels of different sizes are used to extract the multi-scale spatial information in the image, and pyramid pooling operations are added to obtain a multi-scale feature map F.

[0089] (2) Use the SE weight module to assign different weights to F in the channel dimension and generate the corresponding channel attention vector.

[0090] (3) The channel attention vectors are re-weighted and fused through the Softmax operation to obtain the updated attention weights.

[0091] (4) Perform a point multiplication weighted operation on the new attention weight and F to obtain a preliminary output feature map Y.

[0092] (5) A self-attention mechanism is added to the preliminary output feature map Y. Y is processed by the self-attention module to capture long-distance dependencies in the spatial dimension, thereby obtaining the global spatial context information and obtaining the final output feature map Z.

[0093] The PESC module in PESSA is as follows Figure 6As shown in the figure. First, PESC is a module for extracting multi-scale features of images. It divides the input X into two parts according to the number of channels. Then, it uses 3×3 and 5×5 convolution kernels to perform convolution operations to generate two sets of dual-scale feature maps. Then, pyramid pooling operations are performed on the two sets of feature maps. The sizes of the pooling layers used are: 1×1 pooling, 2×2 pooling, 3×3 pooling and 6×6 pooling, which enhances the model's ability to capture features of different scales. After the above operations, the number of channels of the feature map after pyramid pooling will increase to 5 times the original. Finally, the two sets of feature maps are spliced ​​to obtain the output feature map F.

[0094] Feature map P after pyramid pooling i With the dual-scale feature map F i The relationship between them is:

[0095] P i =PPM(F i )

[0096] Where i=0,1; PPM stands for pyramid pooling. The final output feature map F is:

[0097] F=Cat([P 0 ,P 1 ])

[0098] Among them, Cat represents the splicing operation.

[0099] S3.4: Training a soybean leaf disease recognition model

[0100] The training process is based on the PyTorch1.7.0 deep learning framework. The batch size of the dataset is set to 32, the learning rate is set to 0.0001, the number of epochs is set to 300, the AdamW optimizer is used, and the weight decay is set to 0.05.

[0101] In order to comprehensively evaluate the performance of the model, a variety of evaluation indicators are used, including accuracy, precision, recall and F1-Score. These indicators evaluate the performance of the model from different angles to ensure its effectiveness and reliability in practical applications.

[0102] Accuracy refers to the proportion of correctly classified samples among all predictions, that is, the ratio of the number of correctly predicted samples to the total number of samples:

[0103]

[0104] Precision refers to the proportion of positive samples that are actually positive among the results predicted by the model:

[0105]

[0106] Recall rate refers to the proportion of results that are actually positive samples that are predicted by the model. The higher the recall rate, the stronger the model's ability to find positive samples:

[0107]

[0108] The F1 score is a comprehensive measure that takes into account both precision and recall. It is the harmonic mean of precision and recall:

[0109]

[0110] Among them, TP means the number of samples predicted by the model as positive and actually positive; TN means the number of samples predicted by the model as negative and actually negative; FP means the number of samples predicted by the model as positive but actually negative; FN means the number of samples predicted by the model as negative but actually positive.

[0111] In order to evaluate the effect of the MSFF-Transformer model, it was compared with various soybean leaf disease recognition methods, including Xception, VGG16, DenseNet201, Vision-Transformer, Swin-Transformer and Biformer. The experimental results are shown in Table 1:

[0112] Table 1 Comparison results between MSFF-Transformer and existing models

[0113] Model Accuracy / % Precision / % Recall / % F1 / % Xception 89.13% 87.42% 89.51% 88.27% VGG16 91.30% 89.63% 91.32% 90.38% DenseNet201 93.48% 92.15% 93.69% 92.84% Vision-Transformer 92.65% 91.22% 92.76% 91.91% Swin-Transformer 95.34% 94.51% 95.72% 95.06% BiFormer 95.76% 95.16% 95.90% 95.51% MSFF-Transformer 96.89% 95.96% 97.00% 96.43%

[0114] By comparison, it can be seen that MSFF-Transformer outperforms other comparison methods in all evaluation indicators, with an accuracy rate of 96.89%. Compared with other models, the MSFF-Transformer model has the highest accuracy, precision, recall and F1 score.

[0115] The above embodiments are only used to illustrate the design ideas and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, any equivalent changes or modifications made based on the principles and design ideas disclosed by the present invention are within the protection scope of the present invention.

Claims

1. A soybean leaf disease recognition method based on multi-scale feature fusion Transformer, characterized in that: The following steps are involved: S1: Obtain different types of soybean leaf disease images from a public dataset, wherein the types of soybean leaf diseases include bacterial leaf blight, cercospora leaf blight, downy mildew, frog eye disease, health, potassium deficiency, soybean rust, and target spot; S2: preprocessing operations are performed on the collected soybean leaf disease images, including rotation, flipping, brightness adjustment, and contrast adjustment, to increase the diversity and robustness of the data; S3: constructing a soybean leaf disease recognition model, and training the soybean leaf disease recognition model; S4: Verify the trained model, using accuracy, precision, recall and F1-Score as evaluation indicators; verify the superiority of the soybean leaf disease recognition model by comparing the performance of traditional models; S5: Acquire a soybean leaf disease image to be identified; S6: Input the soybean leaf image to be identified into the constructed soybean leaf disease identification model, identify and output the disease type through the classifier.

2. The method according to claim 1, characterized in that: In step S3, the soybean leaf disease recognition model construction process is: S3.1: Constructing the global branch of the soybean leaf disease recognition model In the global branch of MSFF-Transformer, the height, width and channels of the input image are set to 224×224×3 and downsampled by a linear fusion layer. For the global branch, in the first stage, the input image is first split into 4×4 patches, and the size of each patch is 4×4×3. Since each patch is flattened into a 48-dimensional vector, this step produces a 56×56×48 patch embedding. Then, a linear embedding layer is used to map each 48-dimensional vector to a 96-dimensional vector to obtain a 56×56×96 feature map, and finally a CEST module is used to obtain the Stage 2 feature map. The output dimension of 1 is 56×56×96; in the second stage Stage2, the feature map is reduced to 28×28×192 by a 4×4 patch merging operation. The merging operation is achieved by flattening each 2×2 patch into a vector and extending its dimension to 192 through linear projection. The output dimension of Stage2 is also 28×28×192 through the CEST module; similar to Stage2, the output dimensions of the third stage Stage3 and the fourth stage Stage4 are 14×14×384 and 7×7×768 respectively; Multi-head self-attention MSA and window multi-head self-attention W-MSA mechanisms are introduced in the CEST module; the calculation complexity formulas of MSA and W-MSA are as follows: Ω(MSA)=4hwC 2 +2(hw) 2 C Ω(W-MSA)=4hwC 2 +2M 2 hwC Among them, h represents the height of the feature map, w represents the width of the feature map, C represents the depth of the feature map, and M represents the size of each window; Ω(MSA) and Ω(W-MSA) represent the symbols of the multi-head self-attention MSA and window multi-head self-attention W-MSA mechanism functions respectively; In CEST Block: For the i-th stage, feature g i-1 First, the layer is normalized, then the feature is learned by W-MSA, and g is obtained through residual connection. i ', then normalized by the layer, and finally the output feature g is obtained through the hybrid convolutional multi-layer perceptron Hybrid-MLP and residual connection i ; In the subsequent CEST module structure, it is only necessary to replace the W-MSA layer with the SW-MSA layer in the calculation feature part, and the other structures remain unchanged; the above process can be expressed as: g i '=W-MSA(LN(g i-1 ))+g i-1 g i =Hybrid-MLP(LN(g i '))+g i ' g i ' +1 =SW-MSA(LN(g i ))+g i g i+1 =Hybrid-MLP(LN(g i ' +1 ))+g i ' +1 Among them, W-MSA represents the window multi-head self-attention layer, SW-MSA represents the window multi-head self-attention layer with displacement, LN represents layer normalization, and Hybrid-MLP represents the hybrid convolutional multi-layer perceptron; In the Hybrid-MLP structure: first, the input features are linearly transformed through a 1×1 convolution layer to increase the channel dimension; second, the features are processed through a 3×3 depth-separable convolution layer; finally, a 1×1 convolution layer is used to restore the channel dimension of the image and output the final feature representation; this process can be expressed as: Hybrid-MLP(x)=f 1×1 (f depth3×3 (f 1×1 (x))) Among them, f 1×1 represents a convolution operation with a kernel size of 1×1, f depth3×3 represents a depthwise separable convolution operation with a kernel size of 3×3; S3.2: Construction of local branches of soybean leaf disease recognition model; First, two 3×3 convolutional layers are used to divide the image into 4×4 sub-image blocks; second, a 3×3 depthwise separable convolutional layer is used to further refine the feature representation; finally, the module introduces a combination of two sets of 1×1 convolutions and 3×3 depthwise separable convolutions, and repeats them three times to gradually extract higher-level features; these convolution operations are followed by the Mish activation function, which is mathematically defined as follows; at the same time, combined with batch normalization operations; Mish(x)=xtanh(ln(1+e x )) S3.3: Constructing global and local information fusion modules The calculation process of the PESSA module can be divided into the following five steps; here, assuming that the input feature map X∈R C×H×W : (1) The PESC module is used to divide the input feature map X into multiple groups of feature maps by channel. In the divided channel feature maps, convolution kernels of different sizes are used to extract the multi-scale spatial information in the image, and pyramid pooling operations are added to obtain a multi-scale feature map F. (2) Use the SE Weight module to assign different weights to F in the channel dimension and generate the corresponding channel attention vector; (3) Re-weight and fuse the channel attention vectors through the Softmax operation to obtain the updated attention weights; (4) Perform a point multiplication weighted operation on the new attention weight and F to obtain a preliminary output feature map Y; (5) Add a self-attention mechanism to the preliminary output feature map Y, process Y through the self-attention module, capture long-distance dependencies in the spatial dimension, so as to obtain the global spatial context information and obtain the final output feature map Z; In the PESC module: First, the PESC module divides the input X into two parts according to the number of channels; second, it uses 3×3 and 5×5 convolution kernels to perform convolution operations to generate two sets of dual-scale feature maps; then, pyramid pooling operations are performed on the two sets of feature maps, and the sizes of the pooling layers used are: 1×1 pooling, 2×2 pooling, 3×3 pooling and 6×6 pooling; finally, the two sets of feature maps are spliced ​​to obtain the output feature map F; Feature map P after pyramid pooling i With the dual-scale feature map F i The relationship between them is: P i =PPM(F i ) Where i = 0, 1; F i represents a dual-scale feature map; PPM represents pyramid pooling; the final output feature map F is: F=Cat([P0,P1]) Among them, Cat represents the splicing operation; S3.4: Training a soybean leaf disease recognition model The training process is based on the PyTorch1.7.0 deep learning framework.

3. The method according to claim 2, characterized in that In the PyTorch1.7.0 deep learning framework, the batch size of the dataset is set to 32, the learning rate is set to 0.0001, the number of iterations is set to 300, the AdamW optimizer is used, and the weight decay is set to 0.

05.

4. The method according to claim 1, characterized in that: In step S6, the soybean leaf disease recognition model is deployed on the mobile terminal, and the soybean leaf diseases in the actual farmland are identified through the mobile terminal, providing a convenient diagnostic tool for farmers and agricultural experts.

Citation Information

Cited By

  • Leaf vegetable disease detection method based on few-sample learning and prototype attention

    CN120107791A

  • Jujube tree disease and insect pest monitoring and identifying method and system based on remote sensing technology

    CN120236250A

  • Method and system for monitoring and identifying diseases and insect pests of jujube trees based on remote sensing technology

    CN120236250B

  • Improved soybean seed test system and method based on Faster-R-CNN

    CN120451521A

  • Sprouting vegetable disease detection system based on image recognition

    CN120526224A