A sugarcane leaf disease detection method based on a double-branch cross-attention fusion network

CN122990451APending Publication Date: 2026-10-27南宁桂电电子科技研究院有限公司 +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610472508.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-10
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0002]甘蔗是全球重要的糖料与生物能源作物,红腐病、褐条病、锈病等叶部病害常导致其产量下降、品质变差 ;过去,判断甘蔗是否生病主要依赖植保专家或农户的肉眼观测,这种方式不仅耗时费力,且受个人主观判断影响较大 ;特别是在病害初期或复杂的田间环境下,极易发生误判,难以满足大规模现代农业实时监控的需求

Benefits of technology

[0020]抗干扰能力可逐步提升,BCAF模块的“背景抑制”路径能借助ViT的全局视野过滤红土、枯叶等干扰,显著降低误判率;多尺度病斑检测更精准。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990451A_ABST
    Figure CN122990451A_ABST
Patent Text Reader

Abstract

The application discloses a sugarcane leaf disease detection method based on a double-branch cross-attention fusion network, and belongs to the technical field of computer vision and intelligent agriculture. In view of the problems of low detection precision, high missing detection rate and the like caused by the large scale span of sugarcane disease spots, strong background interference and special leaf shape in a complex field environment. The method firstly performs Mosaic data enhancement preprocessing on the image; then a double-branch heterogeneous network is constructed, a local branch adopts an improved EfficientNet and embeds a coordinate attention module, and a global branch adopts a visual transformer (ViT) to extract global semantics; the core lies in designing a bidirectional cross-attention fusion (BCAF) module, path A is used to realize "local guiding global" to correct focusing deviation, and path B is used to realize "global suppressing local" to filter background noise; finally, a classification head containing Focal Loss is used to output a diagnosis result. The application significantly improves the recognition sensitivity of early micro disease spots, and has high practical application value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of computer vision and smart agriculture technology, specifically to a method for detecting sugarcane leaf diseases based on EfficientNet and Vision Transformer (ViT). Background Technology

[0002] Sugarcane is an important sugar and bioenergy crop globally. Leaf diseases such as red rot, brown stripe, and rust often lead to reduced yield and poor quality. In the past, determining whether sugarcane was diseased mainly relied on visual observation by plant protection experts or farmers. This method was not only time-consuming and laborious, but also greatly affected by personal subjective judgment. Especially in the early stages of disease or in complex field conditions, misjudgment was very easy to occur, making it difficult to meet the needs of real-time monitoring in large-scale modern agriculture.

[0003] With the development of computer vision technology, convolutional neural networks (CNNs) such as ResNet, VGG, and EfficientNet have begun to be widely used in plant disease detection to extract texture, color, and shape features from leaf images. However, in actual sugarcane field detection, the field environment includes soil, weeds, and dead leaves, and the lighting and shadows vary greatly. Traditional CNN models can often only focus on local details, resulting in a limited field of view. When the red soil, weeds, and disease spots in the background are similar in color or texture, the algorithm is prone to "mimicry interference," leading to misjudgments and having weak anti-interference capabilities.

[0004] Furthermore, sugarcane diseases exhibit a wide range of scales at different stages, with early-stage lesions often appearing as punctate spots and later spreading into linear necrotic areas. A single CNN model struggles to capture the overall distribution characteristics, while pure ViT models tend to overlook tiny local lesions, leading to missed detections. Due to the slender shape of sugarcane leaves and the fact that diseases are often distributed along leaf veins, the global average pooling processing method commonly used in existing networks loses key location information and cannot accurately pinpoint ambiguous lesions. Currently available hybrid CNN and ViT models mostly employ simple feature concatenation or addition, failing to establish a deep interaction between local details and global context at the semantic level, making it difficult to effectively bridge the "semantic gap" between the two types of heterogeneous features.

[0005] Therefore, designing a deep learning algorithm that can accurately capture local details, combine global information to reduce background interference, and adapt to the morphology of sugarcane leaves is the key to the intelligent upgrading of the sugarcane industry. Summary of the Invention

[0006] To address the core challenges encountered in detecting diseases on sugarcane leaves—numerous background interference, large differences in lesion size, elongated and randomly distributed lesions, and insufficient feature extraction by a single model—this invention designs a detection method based on a bi-branch cross-attention fusion network.

[0007] The core idea is to deeply integrate local and global features to enhance the model's resistance to interference and its recognition accuracy in complex field environments, thereby providing technical support for precision plant protection. To achieve the above objectives, the specific steps are as follows:

[0008] S1: Image data preprocessing. First, adjust the collected images of sugarcane leaves in the field to a uniform size and standardize them.

[0009] S2: Construct a local feature extraction branch based on the improved EfficientNet and a global feature extraction branch based on ViT.

[0010] EfficientNet was selected as the base network to extract local detail features such as leaf texture, color and shape. ViT divided the preprocessed image into fixed-size image blocks and performed linear projection processing. After adding position encoding, the image was fed into the Transformer encoder, which captured the overall correlation of the image through a self-attention mechanism and extracted the global features of disease distribution.

[0011] The improvements include:

[0012] A coordinate attention module (CA) is added to the MBConv module of the EfficientNet network. This module decomposes the channel attention into feature encodings in two directions: horizontal and vertical, and finally generates a feature map that can perceive direction and position.

[0013] S3: Design a bidirectional cross-attention fusion (BCAF) module to implement feature interaction.

[0014] First, the local features extracted by the CNN branch and the global features extracted by the ViT branch are input into the BCAF module together, and deep fusion is achieved through the two paths.

[0015] One of the paths acts as a "local guides global" approach, using the features output by ViT as the query basis and the features output by CNN as a reference. It uses the detailed information captured by CNN to correct the attention direction of ViT, allowing the model to focus on the real lesion areas.

[0016] Another approach is to "globally suppress local features". It uses the features output by CNN as the query basis and the features output by ViT as the reference. With the help of global information obtained by ViT (such as leaf outline and surrounding environment), it actively weakens the feature influence of non-leaf areas such as red soil and weeds.

[0017] S4: Output disease diagnosis results.

[0018] The fused features output from the BCAF module are fed into a global average pooling layer and a multilayer perceptron classification head. During training, Focal Loss is used as the loss function, and the weights of early micro-lesions and difficult-to-distinguish samples are increased by adjusting the parameters. Finally, the disease category of the leaf is given.

[0019] The advantages of this invention are:

[0020] The anti-interference capability can be gradually improved. The "background suppression" path of the BCAF module can filter out interference such as red soil and dead leaves with the help of ViT's global view, significantly reducing the false judgment rate; multi-scale lesion detection is more accurate.

[0021] "Two-way cross-query" enables precise matching of local details and global features, which can not only see early small spots and lesions, but also identify late-stage contiguous necrotic areas, thus resolving the contradiction between "seeing the whole picture" and "seeing clearly".

[0022] Adapted to the shape of sugarcane leaves, the coordinate attention mechanism retains accurate positional information, making it more accurate in identifying strip-shaped lesions distributed along the leaf veins; balancing accuracy and deployment efficiency, it uses EfficientNet with a lightweight fusion design, which controls the amount of computation and the scale of parameters while ensuring high accuracy, making it suitable for use on agricultural mobile devices or embedded devices. Attached Figure Description

[0023] Figure 1 This is a flowchart of the steps of the present invention;

[0024] Figure 2 A schematic diagram illustrating the improved coordinate attention module structure in the EfficientNet branch;

[0025] Figure 3 This is a schematic diagram of the internal interaction logic of the bidirectional cross-attention fusion module; Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this invention easier to understand, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be noted that the specific embodiments given herein are only for explaining the invention and are not intended to limit it. This embodiment uses a dual-branch cross-attention fusion network (DBCAF-Net) to detect sugarcane leaf diseases, and the specific steps are as follows: Figure 1 As shown:

[0027] S1: Image acquisition and data augmentation preprocessing.

[0028] First, images of sugarcane leaf diseases are collected in the field to create the original dataset. To ensure the images meet the model's input standards and improve the model's adaptability to complex field environments, two processing steps are performed:

[0029] First, size normalization is performed, adjusting all input images to the correct size. A fixed resolution.

[0030] Secondly, Mosaic data augmentation involves randomly selecting four images, cropping and scaling them, and then stitching them together to generate new training samples. This not only enriches the background types, such as allowing red soil and weeds to appear in the samples simultaneously, but also increases the number of samples with minor diseases.

[0031] S2: Construct a dual-branch heterogeneous feature extraction network.

[0032] In this embodiment, EfficientNetV2 is used as the base network for the CNN branch. Considering the characteristics of sugarcane leaves being slender and the lesions being distributed along the leaf veins, a coordinate attention (CA) module is added to the MBConv module of the network.

[0033] The calculation process of the CA module is as follows:

[0034] Assume the input feature map is The size is To capture precise location information, pooling kernels are used along the horizontal (X-axis) and vertical (Y-axis) directions, respectively. and Perform feature encoding.

[0035] In the vertical direction, for a height of The Channel output The calculation formula is:

[0036]

[0037] In the horizontal direction, for a width of The Channel output The calculation formula is:

[0038]

[0039] The two aggregated feature vectors mentioned above are concatenated, transformed by convolution, and activated nonlinearly to generate a pair of orientation-aware attention weights:

[0040] and .

[0041] Final output features for:

[0042]

[0043] in, This represents element-wise multiplication under the broadcast mechanism. Through this step, the model can accurately locate the coordinates of strip-shaped lesions distributed longitudinally along the leaf veins.

[0044] The global feature extraction branch adopts the standard ViT structure. The input image is segmented into... The image patch, after being embedded by linear projection and position encoding, is input into the L-layer Transformer Encoder.

[0045] The output global feature sequence is denoted as:

[0046] , where N is the number of image patches and C is the feature dimension. This feature includes the overall outline of the sugarcane leaf and information about the field environment context.

[0047] S3: Bidirectional Cross-Attention Feature Fusion (BCAF)

[0048] like Figure 3 As shown, the BCAF module solves the feature misalignment problem through a "bidirectional query" mechanism.

[0049] S31: Feature Reshaping

[0050] Let the output features of the CNN branch be... .

[0051] First, flatten its spatial dimensions and reshape it into a sequence form. ,in The purpose is to work with the output of ViT. Perform matrix operations.

[0052] S32: Path A: Local guides global.

[0053] Linear projection: definition For Query, i.e. . For Key and Value, i.e. , Then we have:

[0054]

[0055]

[0056]

[0057] in, , , This is the learnable weight matrix for the Query, Key, and Value in path A.

[0058] Attention calculation:

[0059]

[0060] in, This is the scaling factor; This is the attention map, representing the dependence of each global image patch of ViT on the local texture of the CNN.

[0061] Feature correction:

[0062] .

[0063] S33: Path B: Global suppression of local.

[0064] Linear projection: definition For Query, i.e. . For Key and Value, i.e. , Then we have:

[0065]

[0066]

[0067]

[0068] in, , , This is the learnable weight matrix for the Query, Key, and Value in path B.

[0069] Attention calculation:

[0070]

[0071] At this point, if ViT considers a certain global region to be the background of sugarcane leaves, then and The matching degree will decrease. The weight of the global region will decrease as the matching degree decreases.

[0072] Feature suppression and recovery:

[0073]

[0074] Finally, Reshaping Spatial dimension.

[0075] S4: Disease Category Prediction Based on Focal Loss

[0076] The fused features are then passed as input to a fully connected layer for classification. To address the imbalance between easy and difficult samples in disease samples, this implementation uses Focal Loss as the loss function.

[0077] Loss function calculation formula:

[0078]

[0079] in, This represents the model's predicted probability for the true class.

[0080] It is a balancing factor used to adjust the ratio of positive to negative samples.

[0081] For focusing parameters; by introducing When the model fails to accurately identify a particular sample, that is... When the loss is small, the loss weight increases; conversely, when the sample is accurately identified, the weight decreases.

[0082] The above-described embodiments are merely one implementation of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention.

Claims

1. A method for detecting sugarcane leaf diseases based on a two-branch cross-attention fusion network, characterized in that, Includes the following steps: Step 1: Image data acquisition and preprocessing. Acquire the image of the sugarcane leaf to be detected and perform preprocessing. Step 2: Dual-branch feature extraction, constructing parallel local and global branches; the local branch uses a convolutional neural network to extract local texture features of lesions, and the global branch uses a visual transformer to extract semantic features of the global distribution of diseases; Step 3: Bidirectional Cross-Attention Feature Fusion, inputting the local texture features and the global semantic features into the Bidirectional Cross-Attention Fusion (BCAF) module for deep semantic interaction; Step 4: Disease category prediction. Based on the merged characteristics, output the diagnostic results of sugarcane leaf diseases.

2. The method for detecting sugarcane leaf diseases based on a bi-branch cross-attention fusion network according to claim 1, characterized in that: In step one, the Mosaic data augmentation strategy is adopted; specifically, four sugarcane leaf images are randomly selected, scaled, cropped, and stitched together to enrich the image background complexity and balance the distribution of diseased samples. The local branches in step two adopt the EfficientNet backbone network; and the coordinate attention (CA) module is embedded in the moving flip bottleneck convolution (MBConv) module of the EfficientNet; The coordinate attention module captures the spatial information of sugarcane leaf lesions in the following way: it performs one-dimensional feature aggregation on the input feature map along the horizontal and vertical directions respectively to generate an attention weight map with direction awareness and position sensitivity; it then uses the generated weight map to reweight the original feature map to retain the precise position information of the lesions on the slender leaves. The BCAF module in step three includes two parallel paths, A and B: Path A (Local-to-Global Focus Correction Path): uses global semantic features as the query vector and local texture features as the key and value vectors, utilizing local details to correct the focus of the global view; Path B (Global-to-Local Background Suppression Path): uses local texture features as the query vector and global semantic features as the key and value vectors, utilizing global environmental semantics to suppress the feature response of non-leaf background regions; In step four, the Focal Loss function is used for optimization during the model training phase; the training weight of the model for early small lesion samples is increased by adjusting the focusing parameters.

3. A sugarcane leaf disease detection system implementing the methods of claims 1 and 2, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the sugarcane leaf disease detection method.