A method and system for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on coordinated attention mechanism

By designing a lightweight LKCAFormer network, combined with large kernel convolution and cross-scale attention mechanism, the problems of low efficiency and insufficient precision in corn leaf disease diagnosis are solved, and efficient and accurate disease segmentation is achieved on resource-constrained devices.

CN120014275BActive Publication Date: 2025-09-12INNER MONGOLIA AGRICULTURAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510103002.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-22
Publication Date
2025-09-12
Estimated Expiration
2045-01-22

AI Technical Summary

Technical Problem

Existing technologies have low efficiency and poor accuracy in diagnosing corn leaf diseases. Traditional algorithms cannot run efficiently on resource-constrained devices and have difficulty handling complex backgrounds and insufficient segmentation accuracy of highly similar diseased areas.

Method used

A lightweight cross-scale large-kernel convolutional segmentation network LKCAFormer based on a coordinated attention mechanism is designed. It combines a multi-level large-kernel convolutional CNN and an encoder of an attention module to capture global features through large-kernel convolution, and uses a cross-scale attention decoder to fuse high-level semantic features and low-level spatial details to generate disease segmentation results.

Benefits of technology

It improves the segmentation accuracy of diseased areas, reduces the number of model parameters, and improves the inference speed. It is suitable for complex backgrounds and small diseased areas, and performs particularly well on resource-constrained devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120014275B_ABST
    Figure CN120014275B_ABST
Patent Text Reader

Abstract

The present invention belongs to the field of smart agriculture and discloses a method for constructing a cross-scale large-kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism. The network constructs a large-kernel convolution collaborative attention module (LK-COA), in which large-kernel convolution is used to model the global image to obtain global features, and then COA attention is used to extract more tiny spots and focus on lesion segmentation. The module's superposition aggregation has the ability to obtain local edge features and detail features, while enhancing the extraction of small spots and alleviating the spot adhesion phenomenon. The CSDecoder decoder is designed to fuse shallow features rich in detail and edge information with deep features with strong semantic features, and then accurately restore them to ultimately output a fine segmentation result.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to but is not limited to the field of smart agriculture, and in particular relates to a method and system for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism. Background Art

[0002] Corn is one of my country's most important food crops and a crucial raw material for animal husbandry and light industry. However, due to climate change and environmental factors, the incidence of corn leaf diseases is increasing year by year. Leaf diseases not only impair photosynthesis and affect corn plant growth, but also threaten corn quality and yield, resulting in significant economic losses for growers. Timely and accurate detection and diagnosis of plant diseases is crucial for effective disease management. Traditional corn leaf disease diagnosis methods rely on manual observation of symptoms and spots, combined with expert experience. However, on large-scale farms, manual diagnosis is inefficient, inaccurate, labor-intensive, and difficult to perform. Therefore, automated analysis of corn leaf diseases using computer vision technology can not only improve the efficiency of disease diagnosis but also help growers more accurately implement disease prevention and control, significantly improving corn yield and quality. Field corn leaf diseases are often plagued by complex backgrounds, small diseased areas with rich textures, and similar symptoms, which severely impact the accuracy of disease segmentation.

[0003] Convolutional neural networks (CNNs), one of the core architectures of deep learning, have undergone significant evolution and become a universal framework in agriculture. Subsequently, CNN-based segmentation networks began to emerge, such as U-Net (Ronneberger et al., 2015), PSPNet (Zhao et al., 2017), SegNet (Sun et al., 2019), and various versions of DeepLab (Chen et al., 2014, 2017, 2019). A growing number of researchers have leveraged the strong transferability and high accuracy of these models to analyze crop leaves and diseases, achieving promising results. DeepLab V3+, a member of the DeepLab family, boasts powerful contextual information processing and multi-scale feature extraction, making it suitable for accurate segmentation in complex scenes, particularly in large-scale images with rich background information. U-Net, with its high-fidelity detail recovery and excellent performance on small sample sizes, is particularly effective in tasks requiring precise segmentation (such as small lesions and fine structures). Its low computational overhead makes it suitable for resource-constrained environments. In recent years, several improved networks have combined the strengths of DeepLab and U-Net. These networks can handle multi-scale contextual information while maintaining precise detail recovery and boundary accuracy, while also offering efficient computation and low resource consumption. Divyanth et al. (2023) collected 1050 maize leaf lesions from the Purdue University Agricultural Research and Education Center and examined the strengths and weaknesses of SegNet, U-Net, and DeepLabv3+. Ultimately, they selected U-Net and DeepLabv3+ for maize leaf and lesion segmentation, respectively. Yong Yang et al. (2023) combined the strengths of U-Net to propose an improved DeepLabv3+ model, extracting multi-scale semantic information during the encoding phase and obtaining richer spatial information during the decoding phase, resulting in higher segmentation accuracy. However, CNNs have significant limitations in processing long-range feature dependencies and spatial transformation relationships. The extraction of global features depends on the number of stacked network layers. However, the deeper the number of layers, the more severe the network degradation. Therefore, CNN-based segmentation networks struggle to strike a balance between network complexity and accuracy.

[0004] To better capture global features while simultaneously extracting local features, some researchers have begun applying self-attention to replace convolution for global feature extraction, proposing the Transformer model. ViT (Dosovitskiy et al., 2010) first employed the Transformer in computer vision, abandoning the use of convolutional layers in favor of a pure attention mechanism. Other researchers have expanded this architecture to image segmentation, including the semantic segmentation models SegFormer (Xie et al., 2021) and PoolFormer (Yu et al., 2022). These models demonstrate that the improved Transformer outperforms CNN-based models in segmentation tasks. The Transformer explicitly models global contextual information when fed high-resolution (HR) natural images with complex backgrounds. However, it fails to consider cross-resolution information transfer, resulting in an inability to generate high-quality segmented images and poor segmentation performance. In fact, global feature maps capture more granular information while containing less semantic detail, particularly for diseased corn leaf edges. Local features typically contain stronger semantic representations, especially for small, difficult-to-segment diseased regions. Therefore, maintaining both global and local features plays an important role in constructing a maize leaf disease segmentation model. Summary of the Invention

[0005] In response to the problems existing in the prior art, the present invention provides a lightweight cross-scale large-kernel convolutional segmentation network LKCAFormer based on a coordinated attention mechanism for accurate segmentation of corn leaf diseases.

[0006] The present invention is implemented as follows: a lightweight cross-scale large kernel convolutional segmentation network LKCAFormer based on a coordinated attention mechanism for accurate segmentation of corn leaf diseases. The LKCAFormer consists of two main parts:

[0007] (1) An encoder LK-COAT with powerful feature extraction capabilities based on multi-level large-kernel convolutional CNN and attention modules; the encoder consists of three layers of LK-COA modules, and the convolution operation of each layer with ultra-large convolution kernels provides global features. Then, using skip connections, the upper layer features and the obtained global features are passed into the newly designed coordinated attention block to optimize detailed features and feature aggregation, so as to achieve coarse feature representation and fine feature representation at the same feature scale; the encoder provides both shallow features with rich local details and edge information and deep features with rich global semantics, which can accurately extract the features of leaves and lesions during the downsampling process;

[0008] (2) Cross-scale attention decoder CSDecoder; three decoders are designed to receive the low-resolution feature maps containing high-level semantic information input by the encoder to calculate the similarity weight of fine-grained high-frequency global information, and perform attention calculation with the coarse-grained low-frequency feature maps of different scales output by the upper decoder, so as to obtain a high-frequency feature map that is a fusion of fine-grained and coarse-grained features; the obtained feature maps are then upsampled and concatenated, and input into the MLP for nonlinear processing to compensate for the lack of sensitivity of the convolution operation to capturing information; the shallow features and deep features are then fused, and the aggregated feature maps are directly fed forward to the lightweight segmentation head.

[0009] Furthermore, the LKCAFormer specifically includes:

[0010] The leaf image input to the network is of size 512×512×3. In the encoder, the input image first passes through a feature extraction head consisting of two stacked 3×3 depthwise convolutions for efficient feature extraction, which outputs a feature map of 1 / 4 the size of the original image, denoted as F0. This reduces the parameter count of the initial input encoder. It then passes through a three-layer encoder to obtain feature maps F1, F2, and F3 of {1 / 8, 1 / 16, and 1 / 32} of the original image. The ultra-large convolution kernel for each feature extraction is k = {(7, 9, 11), (11, 13, 15), (15, 17, 19)}, and the channel dimension is {32, 64, 128, 160}; in the decoder stage, the feature maps F1, F2, and F3 obtained from each layer of the encoder are passed to the decoder network for feature fusion and upsampled to the F0 spatial size, and feature concatenation is performed with F0. Finally, a simple segmentation head module outputs a 512×512×Ncls segmentation result; Ncls represents the number of pre-designed categories. The encoder includes a feature extraction head, three sets of large-kernel convolution operations, and a collaborative attention module.

[0011] Furthermore, the encoder is an LK-COAT encoder, which models global information through large kernel convolution operations and uses a collaborative attention mechanism to capture local features. This allows the model to learn the interaction between local and global features, thereby obtaining richer feature representations and enhancing the extraction of edge texture features, achieving fine-grained disease area segmentation of corn leaves.

[0012] Given a feature map F∈RC×H×W, where C is the number of input channels, H and W represent the height and width of the feature map, respectively; to alleviate the high computational cost of depthwise convolution under larger kernel sizes, the depthwise convolution with a large kernel is decomposed into a depthwise convolution with a small kernel, followed by an extended depthwise convolution with a fairly large kernel; the output of the LK-COA module can be obtained by using Equations 1-5;

[0013]

[0014] The symbol * represents the convolution operation, ⊙ represents the Hadamard product; Z in formula (1) C The output feature map is obtained by applying the input feature F to the depth convolution operation W with a convolution kernel of (2d-1)x(2d-1) (d represents the expansion rate); the dilated convolution is used here to capture the details of corn leaf disease information while compensating for the convolution kernel in formula (2). Grid effect caused by depthwise separable convolution; note Indicates the removal operation; output global spatial information that eliminates background noise is represented by Z C Represents; Keeping the convolution kernel k value below 23 can effectively capture global and local information; when the convolution kernel is larger than 23, it is proved in the paper (Lau et al., 2024) that it will produce high computational complexity and memory usage; the global output feature in formula (3) After average pooling and activation function, the attention weight of the leaf information is obtained and combined with the input feature map F C Perform Hadamard product to obtain the global attention feature map The input feature map F in formula (4) C After the depth separation convolution W with a convolution kernel of 3x3 and the activation function, the attention weight of the perceived disease area is obtained and combined with the global output feature Perform Hadamard product to obtain local attention feature map Finally, formula (5) is completed and By superposition, the final feature map is obtained, which eliminates background noise, contains high-frequency features of leaf edges and high-frequency features of dense disease spots, and focuses on global and local details. Such an encoding structure can effectively extract global leaf and spot features in position, space, and channel dimensions, enhance the model's ability to represent global features, and reduce the amount of calculation. The designed LK-COAT encoder consists of three LK-COA modules, where the convolution kernels are k = 7, 11, 23, and d = 1, 2, 3.

[0015] Furthermore, the decoder specifically includes:

[0016] A network based on encoder-decoder architecture is built. Therefore, after obtaining the encoder features Afterwards, three CSDecoder decoders are deployed to gradually integrate high-level semantic features and low-level spatial details; for the i-th decoder block, the input contains the encoder features Fi at the same level, the decoder features Fi from the previous decoder block The entire decoder process can be defined as follows

[0017]

[0018] F cls =up(f seg (Cat(F S +F0))) (8)

[0019] In formula (6) represents the i-th decoder feature, f AM is the AM attention module. The feature map is passed into the up of formula (7) f The operation is to upsample to be consistent with F0 through the bilinear interpolation algorithm, and splice the multiple feature maps after upsampling, and output the feature F through the nonlinear feedforward network. D .

[0020] Furthermore, the cross-scale attention specifically includes:

[0021] The AM attention mechanism is used to optimize the leaf and spot edge segmentation and extract more microscopic spots. The similarity score matrix is ​​calculated using formula (9) in the AM module. Specifically, given the input label X∈RH×W×C, the output Z is calculated using a depthwise convolution with a kernel size of k×k and a Hadamard product, as shown below:

[0022] S=A⊙V(9)

[0023] A=L1F i (10)

[0024] V=L2F i+1 (11)

[0025] Z=W 3×3 (S)+F i+1 (12)

[0026] Where ☉ is the Hadamard product, L1 and L2 are the weight matrices of the two linear layers, and W 3×3 Represents a depthwise convolution with a kernel size of k×k; the above operation enables each spatial position (h, w) to be associated with all pixels in a k×k square area centered at (h, w); information interaction between channels can be achieved through linear layers; the output of each spatial position is the weighted sum of all pixels in the square area; compared with self-attention, using convolution to establish relationships is more memory-efficient than self-attention, especially when processing high-resolution images.

[0027] Furthermore, the LKCAFormer also includes: the loss function is a combination of cross entropy (CE) and Dice loss, the specific formula is as follows:

[0028]

[0029] Loss total =0.5*Loss CE +Loss Dice (15)

[0030] The loss function shown in formula (15) combines CE and Dice loss; in the CE loss formula (12), y c represents the true label of the sample in category c, The model outputs the predicted probability of category c. In the Dice loss formula (15), x i It is the probability value of the first element in the prediction graph belonging to a certain type of prospect, y i is the true value of the element in the label map; Dice loss is different from CE loss and is not affected by the size of the foreground. CE loss guides Dice loss in network learning; therefore, it is more reasonable to combine these two losses for network learning.

[0031] The present invention also provides a lightweight segmentation system for accurate segmentation of corn leaf diseases, comprising:

[0032] (1) An encoder module based on multi-level large kernel convolution and attention mechanism is used to extract global features and fine-grained features of the input corn leaf image;

[0033] (2) A cross-scale attention decoder module is used to fuse the high-level semantic features and low-level spatial detail features extracted by the encoder, and upsample the fused features to the input image size to generate the disease segmentation results;

[0034] (3) A data processing module for model training and inference, which preprocesses the input image to adapt it to the network input and post-processes the output result to optimize the segmentation effect.

[0035] Furthermore, the encoder module uses large kernel convolution operations to globally model the input image and combines it with a collaborative attention mechanism to capture local features in spatial and channel dimensions.

[0036] Furthermore, the decoder module utilizes a cross-scale attention mechanism to interactively fuse high-level semantic features and low-level spatial features, and restores the original resolution of the image through gradual upsampling to generate an accurate segmentation map of the diseased area.

[0037] In combination with the above technical solutions and the technical problems solved, the advantages and positive effects of the technical solutions to be protected by the present invention are as follows:

[0038] First, the present invention designs a lightweight LKCAFormer network for accurate segmentation of corn leaf diseases in the field. In the encoding stage, it combines large kernel convolution with a collaborative attention mechanism to capture global features through large kernel convolution, and the collaborative attention mechanism enhances detail extraction. In the decoding stage, the cross-scale attention mechanism is used to fuse features, accurately restore boundaries and details, effectively improve segmentation accuracy, and can improve the IoU of the diseased area by an average of 1.34% compared with traditional methods. In addition, the model parameters are reduced by 36.7% compared with the classic method Deeplab v3+, and the inference speed is increased by 8.4 times. The robustness of two different datasets, CD&S and Single-CD&S, has been verified, and it is particularly suitable for complex backgrounds and small diseased areas. The proposed solution solves the problems of insufficient accuracy of existing methods when dealing with complex backgrounds or highly similar diseased areas, the limitations of traditional convolutional networks in global feature modeling and small spot segmentation, and the high computational cost and difficulty in deployment on resource-constrained devices, providing an efficient and accurate solution for smart agricultural disease detection.

[0039] Second, as auxiliary evidence for the inventiveness of the claims of the present invention, it is also reflected in the following important aspects:

[0040] (1) The technical solution of the present invention solves a technical problem that people have long been eager to solve but have never been able to solve successfully:

[0041] On large-scale farms, manual diagnosis of corn leaf diseases is inefficient, inaccurate, labor-intensive, and difficult. Therefore, automated analysis of corn leaf diseases using computer vision technology not only improves the efficiency of disease diagnosis but also helps growers more accurately prevent and control diseases. However, traditional algorithms currently lack the ability to run on edge computing devices. This invention, through a lightweight model design approach, solves this challenge without sacrificing segmentation accuracy, demonstrating both technological innovation and practical value.

[0042] (2) The technical solution of the present invention overcomes technical prejudice:

[0043] Existing technologies perform poorly in field environments, with significant errors in the accuracy of segmenting highly similar diseases and leaves against complex backgrounds. This solution overcomes these shortcomings by using large kernel convolution and a collaborative attention mechanism to maximize the extraction of leaf edges and small disease spots. Traditional models rely heavily on high-performance hardware and cannot run efficiently on resource-constrained devices. This solution overcomes this limitation by reducing computational costs through a lightweight design. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1The overall architecture of LKCAFormer provided by the embodiment of the present invention is as follows: (a) is the overall architecture of LKCAFormer; (b) is the internal structure of LK-COAT, which consists of three LK-COA modules and adds skip connections; (c) is the internal structure of CSDecoder, which integrates features across scales through the attention mechanism;

[0045] Figure 2 is the marking visualization result provided by the embodiment of the present invention;

[0046] Figure 3 is the segmentation result of each method in the gls disease single leaf test set in the single-CD&S dataset provided by the embodiment of the present invention;

[0047] Figure 4 is the segmentation result of each method under the nls diseased single leaf test set in the single-CD&S dataset provided by the embodiment of the present invention;

[0048] Figure 5 is the segmentation result of each method in the nlb diseased single leaf test set in the single-CD&S dataset provided by the embodiment of the present invention;

[0049] Figure 6 is the segmentation result of each method in the gls disease multi-leaf test set in the CD&S dataset provided by the embodiment of the present invention;

[0050] Figure 7 is the segmentation result of each method under the nls disease multi-leaf test set in the CD&S dataset provided by the embodiment of the present invention;

[0051] Figure 8 is the segmentation result of each method under the nlb disease multi-leaf test set in the CD&S dataset provided by the embodiment of the present invention;

[0052] Figure 9 This is the leaf and spot segmentation result of each test provided by the embodiment of the present invention. DETAILED DESCRIPTION

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

[0054] The embodiment of the present invention provides a lightweight cross-scale large kernel convolutional segmentation network LKCAFormer based on a coordinated attention mechanism for accurate segmentation of corn leaf diseases. The LKCAFormer consists of two main parts:

[0055] (1) An encoder LK-COAT with powerful feature extraction capabilities based on multi-level large-kernel convolutional CNN and attention modules; the encoder consists of three layers of LK-COA modules, and the convolution operation of each layer with ultra-large convolution kernels provides global features. Then, using skip connections, the upper layer features and the obtained global features are passed into the newly designed coordinated attention block to optimize detailed features and feature aggregation, so as to achieve coarse feature representation and fine feature representation at the same feature scale; the encoder provides both shallow features with rich local details and edge information and deep features with rich global semantics, which can accurately extract the features of leaves and lesions during the downsampling process;

[0056] (2) Cross-scale attention decoder CSDecoder; three decoders are designed to receive the low-resolution feature maps containing high-level semantic information input by the encoder to calculate the similarity weight of fine-grained high-frequency global information, and perform attention calculation with the coarse-grained low-frequency feature maps of different scales output by the upper decoder, so as to obtain a high-frequency feature map that is a fusion of fine-grained and coarse-grained features; the obtained feature maps are then upsampled and concatenated, and input into a multi-layer perceptron (MLP) for nonlinear processing to compensate for the lack of sensitivity of the convolution operation to capturing information; the shallow features are then fused with the deep features, and the aggregated feature maps are directly fed forward to the lightweight segmentation head.

[0057] Specifically, the size of the leaf image input to the network is 512×512×3. In the encoder, the input image first passes through a feature extraction head consisting of two stacked 3×3 depthwise convolutions for effective feature extraction, which outputs a feature map of 1 / 4 the size of the original image, denoted as F0. This reduces the parameter count of the initial input encoder. Then, the feature maps F1, F2, F3 of the original image {1 / 8, 1 / 16, 1 / 32} are obtained through a three-layer encoder. The ultra-large convolution kernel for each feature extraction is k = {(7, 9, 11), (11, 13, 15), (15, 17, 19)}, and the channel dimension is {32, 64, 128, 160}. In the decoder stage, the feature maps F1, F2, F3 obtained from each layer of the encoder are passed to the decoder network for feature fusion and upsampled to the F0 spatial size, and feature concatenated with F0. Finally, a simple segmentation head module outputs 512×512×N cls The segmentation result. N cls represents the number of pre-designed categories, which in this paper is 3. The encoder and decoder of the network are explained in detail in the rest of this section. The encoder consists of a feature extraction head, three sets of large kernel convolution operations, and a collaborative attention module (introduced in Section 1). The attention decoder is given in Section 2, and the loss function is introduced in Section 3.

[0058] 1. Ultra-large kernel convolution and collaborative attention

[0059] Due to the high computational complexity of Transformer and the significant computational resources it requires, it is not suitable for real-time use in agricultural production sites. However, it is effective in capturing long-distance dependencies and global feature information, which is lacking in convolution operations. In recent years, some scholars have studied the use of ultra-large convolution kernels to enhance the global information capture capability of convolutional networks, while using attention mechanisms to enhance channel and spatial feature perception and long-distance dependencies. This solution can reduce the number of network layers, be more sensitive to local details, optimize parameters, and achieve better segmentation effects. Based on the above analysis, the present invention designs an LK-COAT encoder, which models global information through large-kernel convolution operations, uses a collaborative attention mechanism to capture local features, and allows the model to learn the interaction between local and global features, thereby obtaining richer feature representations and enhancing the extraction of edge texture features to achieve fine-grained disease area segmentation of corn leaves. The LK-COAT encoder is specifically shown in Figure (b). Given a feature map F∈R C ×H×W , where C is the number of input channels, H and W represent the height and width of the feature map, respectively. To alleviate the high computational cost of depthwise convolution with larger kernel sizes, the depthwise convolution with a large kernel is decomposed into a depthwise convolution with a small kernel, followed by a dilated depthwise convolution with a considerably larger kernel. The output of the LK-COA module can be obtained by using Equations 1-5.

[0060]

[0061]

[0062] The symbol * represents the convolution operation, and ⊙ represents the Hadamard product. C The output feature map is obtained by applying a depthwise convolution operation W with a convolution kernel of (2d-1)×(2d-1) (d represents the dilation rate) to the input feature F. The purpose of using dilated convolution here is to capture the details of corn leaf disease information while compensating for the convolution kernel in formula (2). Grid effect caused by depthwise separable convolution. Note Indicates the removal operation. Output the global spatial information after removing background noise with Z C Represents. Keeping the convolution kernel k value below 23 can effectively capture global and local information. When the convolution kernel is larger than 23, it is proved in the paper (Lau et al., 2024) that it will produce high computational complexity and memory usage. The global output feature in formula (3) is After average pooling and activation function, the attention weight of the leaf information is obtained and combined with the input feature map F C Perform Hadamard product to obtain the global attention feature map The input feature map F in formula (4) C After the depth separation convolution W with a convolution kernel of 3x3 and the activation function, the attention weight of the perceived disease area is obtained and combined with the global output feature Perform Hadamard product to obtain local attention feature map Finally, formula (5) is completed and The resulting feature map, which eliminates background noise and includes high-frequency features of leaf edges and dense disease spots, focuses on both global and local details. This encoding structure effectively extracts global leaf and spot features in the position, spatial, and channel dimensions, enhancing the model's ability to represent global features while reducing computational overhead. The designed LK-COAT encoder consists of three LK-COA modules, with convolution kernels of k = 7, 11, and 23, and d = 1, 2, and 3.

[0063] 2. Decoder

[0064] As mentioned before, a network based on encoder-decoder architecture is built. Therefore, after obtaining the encoder features Afterwards, three CSDecoder decoders are deployed to gradually integrate high-level semantic features and low-level spatial details, such as Figure 1 As shown. For the i-th decoder block, the input contains the encoder features Fi at the same level, the decoder features from the previous decoder block The entire decoder process can be defined as follows

[0065]

[0066] F cls =up(f seg (Cat(F S +F0))) (8)

[0067] In formula (6) represents the i-th decoder feature, f AM is the AM attention module. The feature map is passed into the up of formula (7) f The operation is to upsample to be consistent with F0 through the bilinear interpolation algorithm, and splice the multiple feature maps after upsampling, and output the feature F through the nonlinear feedforward network. D .

[0068] 2.1 Cross-Scale Attention

[0069] Due to the different illumination conditions of multiple leaves in the natural environment, the presence of leaf shadows will reduce the accuracy of leaf segmentation. In addition, the similarity between the edge color of the lesion and the leaf color and part of the background color makes it difficult to extract the true outline of the lesion. In addition, in most corn leaf images, the proportion of diseased pixels to the entire image pixels is very small, which makes the extraction of small disease features more difficult. In the encoding stage, the LK-COAT module provides global perception and local feature extraction capabilities, but there is a risk of losing the edge extraction of scattered spots or dense spot areas. Therefore, this section uses the AM attention mechanism to strengthen the optimization of leaf and spot edge segmentation and extract more microscopic spots. The AM module is shown in Figure (c). In the AM module, the similarity score matrix is ​​calculated using formula (9). Specifically, given the input label X∈R H×W×C , the output Z is calculated using depthwise convolution with kernel size k×k and Hadamard product as follows:

[0070] S=A☉V(9)

[0071] A=L1F i (10)

[0072] V=L2F i+1 (11)

[0073] Z=W 3×3 (S)+F i+1 (12)

[0074] Where ☉ is the Hadamard product, L1 and L2 are the weight matrices of the two linear layers, and W 3×3 Represents a depthwise convolution with a kernel size of k×k. The above operation enables each spatial position (h, w) to be associated with all pixels within a k×k square area centered at (h, w). Information interaction between channels can be achieved through linear layers. The output of each spatial position is the weighted sum of all pixels within the square area. Compared with self-attention, the model designed by the present invention uses convolution to establish relationships, especially when processing high-resolution images, which saves more memory than self-attention.

[0075] 3. Loss Function

[0076] This paper adopts a method that combines cross entropy (CE) and Dice loss. The specific formula is as follows:

[0077]

[0078] Loss total =0.5*Loss CE +Loss Dice (15)

[0079] The loss function shown in formula (15) combines CE and Dice loss. In the CE loss formula (12), y c represents the true label of the sample in category c, The model outputs the predicted probability of category c. In the Dice loss formula (15), x i It is the probability value of the first element in the prediction graph belonging to a certain type of prospect, y i is the true value of the element in the label map. Unlike CE loss, Dice loss is unaffected by foreground size. However, CE loss guides Dice loss in network learning. Therefore, combining these two losses for network learning is more reasonable.

[0080] The LKCAFormer network consists of two main modules: an encoder based on multi-level large-kernel convolution and attention modules, and a cross-scale attention decoder. The encoder module extracts global features from the input corn leaf image through multi-level large-kernel convolution and combines it with an attention mechanism to capture key fine-grained features. The decoder module restores the spatial resolution of the image layer by layer and utilizes a cross-scale attention mechanism to fuse the high-level semantic features extracted by the encoder with the low-level spatial detail features, thereby achieving accurate segmentation of corn leaf diseases.

[0081] The encoder uses large-kernel convolution to model the features of the input image. Large-kernel convolution expands the receptive field of the convolution kernel to capture the global context of the image while preserving local details. To enhance the correlation between features, a collaborative attention mechanism is introduced to simultaneously focus on the feature distribution in both spatial and channel dimensions. This mechanism significantly optimizes the interaction between global and local features, enabling the network to more accurately identify diseased areas and ignore irrelevant background.

[0082] The decoder utilizes a cross-scale attention mechanism to gradually fuse high-level semantic features extracted by the encoder with low-level spatial detail features. At each decoding stage, high-level features are combined with low-level features through cross-scale interactions to recover detailed information. The decoder's multi-step upsampling operation restores the feature maps to the same spatial resolution as the input image, generating precise defect segmentation results that ensure the fineness and accuracy of segmentation boundaries.

[0083] By combining the global modeling capabilities of large kernel convolution with the feature optimization capabilities of collaborative attention, LKCAFormer is able to extract global semantic information while maintaining the integrity of local features. The feature fusion strategy of the cross-scale attention decoder effectively improves the spatial accuracy and semantic consistency of the segmentation results. This method, while maintaining a lightweight design, balances efficiency and accuracy. It is particularly well-suited for the complex texture and boundary details required for corn leaf disease segmentation, providing reliable technical support for crop disease diagnosis.

[0084] To verify the effectiveness of our lightweight, coordinated attention-based, cross-scale large kernel convolutional segmentation network (LKCAFormer) for segmenting field corn leaf diseases, we used the publicly available CD&S dataset as experimental data. By combining large kernel convolution with a coordinated attention mechanism, our segmentation network achieves precise segmentation of complex lesion areas, addressing the inadequate segmentation accuracy of traditional methods when lesion boundaries are blurred.

[0085] Relevant evidence of the technical effects achieved by the embodiments of the present invention.

[0086] 1.1 Dataset

[0087] Data collection

[0088] The proposed model was evaluated on two datasets, Single-CD&S and CD&S (reference). CD&S is an open and fair corn disease recognition dataset that includes three common corn leaf diseases: northern leaf blight, northern leaf spot, and gray leaf spot. This dataset collects images in a natural environment. In addition to the diseased leaves in the foreground, there are also many diseased leaves in the background, which is complex and noisy. In order to accurately segment the leaves and diseases in the image, some images were extracted from CD&S and only the single leaf and disease area in the image were annotated to construct the Single-CD&S dataset. The original CD&S dataset annotates multiple leaves and the diseased areas.

[0089] The study consists of two consecutive parts: (1) The first stage: extracting the target leaf from the complex background. (2) The second stage is to segment the lesions based on the leaf images extracted in the first stage. Therefore, each original image requires leaf, disease, and background labels. The sample data is annotated using the labelme (Russell, Torralba, Murphy, & Freeman, 2008) (https: / / github.com / wkentaro / labelme) tool. The labeled visualization results are as follows Figure 2. In order to reduce overfitting and improve the robustness and generalization ability of the model, the Augmentor module (Bloice, Roth, & Holzinger, 2019) is used to perform geometric transformations such as random left flipping or right flipping, random cropping, random sampling, and color and brightness enhancement or reduction. In addition, the powerful data augmentation method in the semantic segmentation library MMsegmentation (Contributors, 2020) is also applied. The three corn leaf disease datasets are divided into training sets and test sets in a ratio of 8:2. In addition, during the training stage, each data is divided into training sets and validation sets in a ratio of 9:1 for cross-validation. The training set, validation set, and data augmentation details are given in Table 1.

[0090] Table 1 Details of the corn leaf disease dataset used

[0091]

[0092] 1.2 Experimental Setup

[0093] Experimental data details. Our experiments are based on the public code repository MMSSegmentation Contributors (2020) and PyTorch (Paszke et al., 2019). Our model was trained on two NVIDIA GTX 4090 GPUs. During training, images were randomly cropped to 512×512. Training was performed using the AdamW (Loshchilov & Hutter, 2018) optimizer with a cosine learning rate decay strategy. The hyperparameters are: momentum 0.9, weight decay 1e-2, batch size 16, epochs 500, initial learning rate 1e-4, and minimum learning rate 1e-7. To prevent overfitting, the descent path rate was set to 0.1.

[0094] Evaluation Metrics. Quantitative metrics used in this experiment include: Precision (Zhang et al., 2022), Intersection over Union (IoU) (Xie et al., 2021), Dice coefficient (Garcia-Garcia, Oltz-Escolano, Oprea, Verena-Martínez, & Garcia-Rodriguez, 2017), and Recall (Li et al., 2023). Higher IoU and Dice values ​​generally indicate a higher degree of overlap between the predicted and true results, which indicates a more accurate segmentation result.

[0095]

[0096] Where TP represents a positive that is classified as a true positive. TN represents a true negative that is correctly classified. FP represents a pixel that is classified as a leaf but is actually a background. FN represents a pixel that is classified as a background but is actually a leaf.

[0097] 1.3 Comparative Experiment

[0098] In this subsection, the proposed method is compared with popular deep learning semantic segmentation methods, including the CNN-based methods U-Net, DeepLab v3+, the Transformer-based methods SegFormer, PVT2, and the lightweight methods TopFormer, AFFormer and SwiftFormer, to further verify the feasibility and effectiveness of LKCAFormer.

[0099] Specifically, U-Net is a simple skip-connection structure that fuses shallow features with semantic features multiple times. DeepLab v3+ adopts the ASPP spatial pooling pyramid structure, expanding the receptive field through dilated convolutions. SegFormer uses hierarchical Transformer blocks, while the decoder employs a lightweight MLP structure. TopFormer employs layer-by-layer feature refinement, effectively capturing global context while avoiding detail loss. AFFormer employs a parallel architecture, utilizing prototype representations as specific learnable local descriptions to replace the decoder and preserve rich image semantics on high-resolution features. SwiftFormer designs an efficient additive attention mechanism to learn consistent global context at multiple scales. Each method was trained and tested on three corn disease leaf image datasets. The performance of each method was measured using seven evaluation metrics: Dice, Recall, IoU, Precision, FPS, total number of parameters, and FLOPs / G. Tables 2, 3, and 4 report the comparative segmentation results of the three diseases on the Single-CD&S dataset.

[0100] As shown in Table 2, the proposed method achieves the best segmentation performance on the gls test set. This method outperforms the CNN models U-net and DeepLab v3+ in terms of segmentation accuracy. Compared to U-net, the IoU for background, leaf, and lesion segmentation is 1.14%, 0.6%, and 3.15% higher, respectively. DeepLab v3+ is 0.92% lower than the proposed method in IoU for leaf segmentation, 2.54% lower in IoU for lesion segmentation, and 1.77% lower in IoU for background segmentation. Compared to the proposed method, SegFormer achieves 0.45% lower IoU for leaf segmentation, 2.83% lower IoU for lesion segmentation, and 0.96% lower IoU for background segmentation. Compared to PVT2, the proposed method achieves 0.58% higher IoU for leaf segmentation, 1.79% higher IoU for lesion segmentation, and 0.57% higher IoU for background segmentation. Compared to the lightweight models TopFormer and AFFormer, the proposed method shows improvements in segmentation performance. Furthermore, SwiftFormer's segmentation accuracy is close to and better than the other methods, but not as good as the proposed method. Compared to SwiftFormer, the proposed method improves the IoU of leaf segmentation by 0.35%, the IoU of disease segmentation by 0.47%, and the IoU of background segmentation by 0.78%.

[0101] Table 2 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the gls test set in the Single-CD&S dataset

[0102]

[0103] According to Table 3, the proposed method demonstrates the best segmentation performance on the corn leaf disease test set. Compared to U-net, the proposed method achieves 1.08% and 3.51% improvements in IoU for leaf and lesion segmentation, respectively, while the IoU for background segmentation is comparable, with a 0.03% improvement. DeepLab v3+ performs inferior to the proposed method in background, leaf, and lesion segmentation accuracy. The IoU for background segmentation is 1.24% lower than that of the proposed method, the IoU for leaf segmentation is 1.74% lower than that of the proposed method, and the IoU for lesion segmentation is 2.12% lower than that of the proposed method. Furthermore, the proposed method outperforms SegFormer by 0.72% in IoU for disease segmentation. PVT2's segmentation performance is weaker than that of the proposed method, with performance lower by 0.21%, 1.01%, and 1.08% in IoU for background, leaf, and lesion segmentation, respectively. SwiftFormer achieves higher segmentation accuracy than lightweight methods such as Topformer and AFFormer, but the proposed method achieves higher segmentation accuracy than SwiftFormer by 0.56% in IoU for background segmentation, 0.62% in IoU for leaf segmentation, and 0.95% in IoU for lesion segmentation. In summary, SwiftFormer achieves higher segmentation accuracy, outperforming other methods, but not as well as the method in this study.

[0104] Table 4 shows the experimental results on the corn leaf disease test set. The proposed method demonstrates the best segmentation performance. Topformer performs poorly in leaf and disease segmentation, falling 4.63% and 7.56% below the proposed method in terms of Intersection of Union (IoU). AFFormer slightly outperforms the proposed method in terms of background segmentation, but is 1.23% and 0.54% lower in terms of leaf and disease segmentation. Compared to the above methods, the CNN-based U-net and DeeplabV3+ achieve similar segmentation results, but both perform lower than the proposed method. The Transformer-based Segformer method performs similarly to the proposed method in terms of disease segmentation IoU, only 0.13% lower, but falls 1.88% and 1.11% lower in terms of leaf and background segmentation IoU. The PVT2 method performs 0.61%, 1.61%, and 0.78% lower than the proposed method in terms of background, leaf, and disease segmentation IoU, respectively. SwiftFormer achieves similar segmentation results to U-net and DeeplabV3+. In summary, the methods in this study have improved segmentation accuracy compared to other methods.

[0105] Table 3 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the nls test set in the Single-CD&S dataset

[0106]

[0107] Table 4 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the nlb test set in the Single-CD&S dataset

[0108]

[0109]

[0110] To better validate the performance of the proposed method in real-world scenarios, each method was trained and tested on the CD&S dataset, which features complex backgrounds and multiple leaf diseases, and compared with the proposed method. Tables 5, 6, and 7 report the segmentation performance comparisons of the proposed method and other methods on the three disease test sets. Comparing Table 5 with Table 2 reveals that all methods perform worse in segmenting multiple leaves and diseased regions than in segmenting single leaves and diseased regions. The proposed method still achieves the best segmentation performance in Table 5, achieving 99.02%, 97.39%, and 70.52% IoU for background, leaf, and disease segmentation, respectively. This is 2.55%, 0.65%, and 6.83% higher than PVT2, which performs the worst in disease segmentation. Among lightweight methods, the Topformer method performs 2.15%, 0.83%, and 4.6% lower than the proposed method in IoU for background, leaf, and disease segmentation, respectively. The AFFomer and SwiftFormer methods achieved similar segmentation performance, but were, on average, 0.18%, 0.46%, and 1.82% lower than the proposed method. Compared to DeepLab v3+, the proposed method achieved 1.91% and 4.54% higher IoU for background and disease segmentation, respectively. The IoU for leaf segmentation was comparable, with a 0.04% improvement. The U-net method performed inferior to the proposed method in background, leaf, and disease segmentation accuracy. The IoU for background segmentation was 1.24% lower than the proposed method, the IoU for leaf segmentation was 0.21% lower, and the IoU for disease segmentation was 6.19% lower.

[0111] Table 6 presents the segmentation performance comparison of the proposed method with other methods on the nls test set. While the overall segmentation performance is poor, the proposed method still achieves the highest segmentation accuracy, achieving 98.02%, 95.19%, and 67.28% for background, leaf, and disease segmentation IoUs. The worst performer is the lightweight AFFormer, achieving 91.37%, 87.96%, and 59.11% for background, leaf, and disease segmentation IoUs. Segformer's background, leaf, and disease segmentation accuracy is inferior to that of the proposed method. The IoU for background segmentation is 1.01% lower than that of the proposed method, the IoU for leaf segmentation is 2.88% lower than that of the proposed method, and the IoU for disease segmentation is 1.65% lower than that of the proposed method. Furthermore, the proposed method outperforms U-net by 4.85% for disease segmentation, 2.01% for leaf segmentation, and 3.24% for background segmentation IoU. DeeplabV3+ reduces the IoU of disease segmentation by 5.37%, the IoU of leaf segmentation by 0.84%, and the IoU of background segmentation by 0.82%.

[0112] Table 5 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the gls test set in the CD&S dataset

[0113]

[0114] Table 6 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the nls test set in the CD&S dataset

[0115]

[0116] Table 7 shows the experimental results on the corn leaf disease test set. The proposed method demonstrates the best segmentation performance. The Transformer-based Segformer method performs 6.62% lower than the proposed method in terms of IoU for disease segmentation, and 2.33% and 2.18% lower in terms of IoU for leaf and background segmentation. The proposed method outperforms the PVT2 method by 2.74%, 1.44%, and 9.27% ​​in terms of IoU for background, leaf, and disease segmentation, respectively. U-net and DeeplabV3+ achieve similar segmentation results, but DeeplabV3+ performs better overall, performing 2.01%, 0.54%, and 4.2% lower than the proposed method in terms of IoU for background, leaf, and disease segmentation. The proposed method achieves similar segmentation performance to the lightweight Topformer, outperforming the proposed method by 3.05%, 1.81%, and 2.62% in terms of IoU for background, leaf, and disease segmentation, respectively. The segmentation performance of the AFFormer method is poor, with only 95.68%, 95.06%, and 59.45% IoU for background, leaf, and disease segmentation. In summary, in terms of segmentation accuracy, the method in this study has improved compared to other methods.

[0117] Table 7 Quantitative comparison of CNN-based and Transformer-based SOTA methods on the nlb test set in the CD&S dataset

[0118]

[0119] Table 8 presents a comparison of the methods across the remaining evaluation metrics. As shown in Table 8, the proposed method achieves a 7.36ms improvement in FPS over U-net. Furthermore, the total number of parameters and floating-point operations of this method is only 12.7% and 0.14% of those of U-net. PVT2 outperforms all other methods in terms of FPS, but has more than twice the number of parameters of the proposed method. AFFormer has the fewest parameters and floating-point operations, but its FPS is 0.94ms less than that of the proposed method. Compared to Topformer, this method achieves a 6.4ms improvement in FPS. Furthermore, the total number of parameters and FLOPs is 1.46M and 1.05G less than Topformer, respectively. A comprehensive comparison of all parameters shows that the proposed method achieves the best segmentation performance with minimal computational overhead. This algorithm achieves a good balance between segmentation accuracy and inference speed.

[0120] Table 8 Results of different methods on other evaluation indicators

[0121]

[0122] Figure 3 , Figure 4 , Figure 5The segmentation results of each method are shown in the single-CD&S dataset for the single leaf test set of gls, nls and nlb diseases. Figure 3 As shown in the figure, the white dotted box marks the specific disease area where the color of the lesion is similar to that of the leaf due to the influence of lighting conditions. This area is the key to analyzing the effect of disease segmentation. Comparing 2(a) and 2(c), U-net can correctly segment most diseases, but the segmentation is poor in specific areas, and the detail information is obviously lost. However, comparing 2(c) and 2(d), it can be found that the segmentation effect of deeplabv3+ is worse than that of U-net. The segmentation effect of Segformer in 2(e) is better than the previous two methods, but the disease segmentation effect is poor in some edge areas. It has strong global modeling capabilities and some local detail information is lost. Comparing 3(f), 3(h) and 3(i), AFFormer can remove other noises such as lighting to a certain extent and focus on disease segmentation, but its ability to segment disease edges is poor. Figure 3 The proposed method LKCAFormer in (j) can effectively compensate for the loss of fine-grained information caused by aggregating different resolutions, providing accurate segmentation performance in specific areas. At the same time, the segmentation effect of leaf edge diseases is good. Figure 4 This is the segmentation result of single leaf disease using nls. Since the characteristics of nls are that the disease spots are relatively concentrated and the disease areas are dispersed, the segmentation differences between all methods are small. Among them, the AFFormer method in 3(h) has poor segmentation of the disease area and only segments a small number of obvious disease spots. Methods 4(c), 4(d), 4(f) and 4(g) can basically segment dense disease spots, but their ability to segment the edges of the disease spots is poor, and there are incorrect segmentations. 4(e) has poor segmentation effect on independent disease spots at the edge. There are differences between 4(i) and 4(j) at the obvious stripes on the leaves. SwiftFormer mixes the stripe color with the disease spots, while the proposed method is more accurate in segmentation and has better segmentation effect on the disease spots at the edge of the leaves. Figure 5 The results of nlb single leaf disease segmentation are presented. The white dotted box marks the specific area with dense lesions. Compared with 5(a) and 5(c), the U-net method has poor lesion segmentation effect in the specific area. Methods 5(d), 5(e), 5(f) and 5(i) have poor lesion segmentation in the specific area. At the same time, the above methods mistakenly identify the main veins of the leaves with a similar color to the lesions as lesions, resulting in incorrect segmentation. Compared with 5(h) and 5(j), the proposed method can segment more dense lesions in specific areas, and has better effect on the segmentation of lesion edges in larger areas around the main veins. From the above experimental results, it can be seen that the LKCAFormer method can not only segment the leaf edge area more clearly, but also segment the edges of the spots more accurately, and has better segmentation performance.

[0123] Figure 6 , Figure 7 , Figure 8 The segmentation results of each method are shown in the CD&S dataset for the gls, nls, and nlb diseased multi-leaf test sets. Figure 6 The GLS disease shown is densely distributed and, due to the influence of lighting, the color of the light reflected from some leaves is similar to the color of the lesions, making it easy to segment incorrectly. Comparing 6(a) and 6(c), the segmentation of the dense lesion area is relatively complete, but there are cases where leaves are mistakenly segmented as lesions. At the same time, due to the influence of lighting, the segmentation effect of the lesions in the shadow area is poor. 6h) has the best segmentation effect for lesions in the shadow area, but compared with 8(b), it is found that the marked lesions are not correctly segmented. 6(f) and 6(g) have poor segmentation effect on the edges of dense lesions and some incorrect segmentation occurs. The method proposed in 6(j) has good overall segmentation effect. For 6(b), most of the marked lesions are correctly segmented with less incorrect segmentation. Figure 7 The results of NLS segmentation of multiple leaf diseases in an environment with similar background and leaf colors are presented. Due to the presence of grass and corn plants in the background, which are similar in color to the leaves, methods 7(c), 7(d), 7(g), 7(h), and 7(i) all have varying degrees of incorrect segmentation in leaf segmentation. Other methods, such as 7(e) and 7(f), fail to effectively segment leaves affected by lighting and located at the edge, while the proposed method 7(j) correctly segments leaves compared to 7(b). In terms of disease segmentation, due to the small and dispersed size of NLS lesions, all methods have comparable performance in segmenting relatively large lesions. However, the proposed method 7(j) performs relatively well in segmenting small lesions. Other methods, such as 7(c) and 7(d), mistakenly segment lesions from non-disease areas, and methods 7(g) and 7(i) mistakenly segment background as lesions. Figure 8 The results of nlb multi-leaf disease segmentation are presented. Because the color of the background is affected by the lighting and is similar to that of the leaves, the leaves are incorrectly segmented, such as 8(e), 8(f), and 8(h). Comparing the proposed method 8(j) with 8(c) and 8(d), it can be seen that the performance of the lesion segmentation is similar, and most of the labeled lesions can be segmented out, but 8(j) is better in the segmentation of lesion edges and leaf edges. From the above experimental results, it can be seen that the LKCAFormer method can eliminate background noise as much as possible in the CD&S test set with multiple leaves in complex backgrounds, focus on the leaf area, and segment the edges of lesions of different shapes that are either scattered or dense, showing better segmentation effect.

[0124] 1.4 Ablation Experiment

[0125] In this section, five sets of ablation experiments are designed to verify the adaptability of all LK-COA modules to different model architectures and their effectiveness in optimizing global feature modeling and detail feature methods. Specifically, in Test 1, LKCAFormer-TR is a model in which the LK-COA module is removed and replaced with three Transformer blocks. Test 2 removes the traditional Transformer block and adds one LK-COA module. Test 3 adds two LK-COA modules. Test 4 adds three LK-COA modules, which is the proposed model, and Test 5 adds four LK-COA modules. In addition, the ablation experiments in this section use three disease datasets from single-CD&S. The evaluation results of the ablation study are recorded in Table 9.

[0126] Table 9 Ablation study results of three corn leaf datasets

[0127]

[0128] As shown in Table 9, comparing Experiments 1 and 2, segmentation accuracy dropped significantly after replacing the traditional transformer block with the proposed LK-COA module. However, when three LK-COA modules were added, resulting in the model from Experiment 4, the IOU for lesion segmentation on the three corn disease test sets improved by 3.11%, 1.26%, and 1.89%, respectively, compared to Experiment 1. Conversely, when four LK-COA modules were added, lesion segmentation accuracy decreased in Experiment 5, but background and leaf segmentation accuracy improved. This is attributed to the global feature perception of the large kernel convolution. Considering the overall segmentation performance of lesions, leaves, and background, the encoder stacked with three LK-COA modules achieved a more balanced improvement in segmentation accuracy. While taking into account global features, it also optimized the model's ability to extract details and edge features, effectively improving the segmentation performance of background, leaves, and lesions. Figure 9 The results of leaf and spot segmentation for each test are shown. Figure 8 In Tests 1 and 4, replacing the LK-COA module enables the model to extract more microscopic spots and achieve more refined segmentation of leaves and spot edges. Comparing the results of Test 4 with those of other tests shows that the proposed method not only more clearly segments the outlines of leaves and lesions, but also extracts more small lesion areas, clearly segments lesion edges, and alleviates the clumping of small lesions in densely packed areas. The experimental results demonstrate that this method improves the segmentation of lesions on different corn leaves.

[0129] It should be noted that the embodiments of the present invention can be implemented by hardware, software, or a combination of software and hardware. The hardware portion can be implemented using dedicated logic; the software portion can be stored in a memory and executed by an appropriate instruction execution system, such as a microprocessor or dedicated design hardware. Those skilled in the art will appreciate that the above-mentioned devices and methods can be implemented using computer-executable instructions and / or contained in processor control code, for example, such as a carrier medium such as a disk, CD or DVD-ROM, a programmable memory such as a read-only memory (firmware), or a data carrier such as an optical or electronic signal carrier. The devices and modules of the present invention can be implemented by hardware circuits such as very large-scale integrated circuits or gate arrays, semiconductors such as logic chips, transistors, or programmable hardware devices such as field programmable gate arrays, programmable logic devices, etc., can also be implemented by software executed by various types of processors, or can be implemented by a combination of the above-mentioned hardware circuits and software, such as firmware.

[0130] The above description is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with this technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered by the scope of protection of the present invention.

Claims

1. A method for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism, characterized in that: The following steps are involved: Step 1: Build an encoder based on multi-level large kernel convolution and attention modules to extract global features and fine-grained features; The encoder consists of three layers of large kernel convolution and a collaborative attention module. The large kernel convolution reduces computational cost by decomposing a large kernel into multiple small kernel convolutions and extending the depthwise convolution. At the same time, the collaborative attention mechanism is combined to capture the high-frequency features of leaf edges and the fine-grained features of disease spots. Step 2: Construct a cross-scale attention decoder to fuse global semantic information with local feature information. The decoder consists of three cross-scale attention decoding modules. Each module receives the encoder features at the same level and features from the previous decoder, and gradually integrates the high-level semantic features and low-level spatial detail features extracted by the encoder. The similarity weight of the fine-grained high-frequency information is calculated through the attention mechanism, and is fused with the coarse-grained low-frequency information before being upsampled to the original spatial size. Step 3: In the decoder stage, features are fused through a cross-scale attention mechanism and upsampled to the resolution of the input image to generate disease segmentation results.

2. The method for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 1, characterized in that: The size of the input leaf image is 512×512×3. The encoder first extracts features through a feature extraction head consisting of two stacked three-by-three depthwise convolutions, and outputs a feature map that is one-quarter the size of the original image, thereby effectively reducing the number of encoder parameters.

3. The method for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 1, characterized in that: The cross-scale attention mechanism introduces deep convolution with a square kernel size into the input feature map to calculate the weighted value in the spatial area, uses the information interaction between channels to optimize the global and local feature extraction capabilities of the feature map, and establishes the relationship between pixels through convolution to reduce the memory overhead of high-resolution image processing.

4. The method for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 1, characterized in that: The loss function is designed by combining cross entropy loss and Dice loss, where: Cross entropy loss is used to calculate the error between the predicted probability of each pixel belonging to the target category in the model output and the true label; Dice loss is used to enhance the segmentation ability of small target areas by calculating the degree of overlap between the predicted image and the true label image in the target category; The combination of cross entropy loss and Dice loss cooperates with each other during the network training process to improve segmentation accuracy.

5. The method for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 1, characterized in that: The fused features output by the decoder are nonlinearly processed through the designed lightweight segmentation head module, and a segmentation result map consistent with the size of the input image is directly generated. The segmentation result includes multiple predefined categories, each of which represents a disease type or healthy area.

6. A system for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism, characterized by: include: (1) An encoder module based on multi-level large kernel convolution and attention mechanism to extract global features and fine-grained features; The encoder consists of three layers of large kernel convolution and a collaborative attention module. The large kernel convolution reduces computational cost by decomposing a large kernel into multiple small kernel convolutions and extending the depthwise convolution. At the same time, the collaborative attention mechanism is combined to capture the high-frequency features of leaf edges and the fine-grained features of disease spots. (2) A cross-scale attention decoder module for fusing global semantic information with local feature information; the decoder includes three cross-scale attention decoding modules, each of which receives the encoder features at the same level and features from the previous decoder, gradually integrates the high-level semantic features and low-level spatial detail features extracted by the encoder, calculates the similarity weight of fine-grained high-frequency information through the attention mechanism, and fuses it with the coarse-grained low-frequency information before upsampling to the original spatial size; (3) A data processing module for model training and inference, which fuses features through a cross-scale attention mechanism and upsamples them to the resolution of the input image to generate disease segmentation results.

7. The system for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 6 is characterized in that: The encoder module uses large kernel convolution operations to globally model the input image and combines it with a collaborative attention mechanism to capture local features in spatial and channel dimensions.

8. The system for constructing a cross-scale large kernel convolution corn leaf disease segmentation model based on a coordinated attention mechanism according to claim 6 is characterized in that: The decoder module uses a cross-scale attention mechanism to interactively fuse high-level semantic features and low-level spatial features, and restores the original resolution of the image by progressive upsampling to generate an accurate segmentation map of the diseased area.

Citation Information

Patent Citations

  • Retinal blood vessel image segmentation method based on large kernel convolution

    CN117830325A