A crop disease detection model construction method based on high-resolution prior

By constructing a high-resolution prior crop disease detection model, the problem of insufficient detection accuracy of small target lesions in existing technologies is solved, achieving high-precision and stable detection of early-stage diseases, which is applicable to complex farmland environments.

CN121616607BActive Publication Date: 2026-04-10GUIZHOU UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-02-03
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing crop disease detection methods are insufficient in utilizing high-resolution details and sensitivity in the initial detection of small target lesions, making it difficult to achieve accurate detection in complex farmland environments.

Method used

A crop disease detection model based on high-resolution priors is constructed. Multi-scale features are obtained through feature extraction units, frequency domain features are enhanced by adaptive and efficient space-frequency fusion units, target detection is performed by combining multi-scale detection heads, and lesion localization is performed by RT-DETR decoder.

Benefits of technology

It improves the detection accuracy and stability of small lesions in the early stages of crop diseases, and can accurately detect tiny lesions with an area of ​​less than 32×32 pixels, making it suitable for complex farmland environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121616607B_ABST
    Figure CN121616607B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of computer vision and deep learning, and discloses a crop disease detection model construction method based on high-resolution priori, which comprises the following steps: collecting a crop disease original image, generating a crop disease initial stage representation graph, and constructing a disease initial stage representation sample set; defining a network model; the network model comprises a feature extraction unit, an adaptive efficient space-frequency fusion unit, a modulation and fusion unit, and a multi-scale detection head; wherein the feature extraction unit performs multi-scale feature extraction to obtain high-resolution priori features and low-resolution features; the adaptive efficient space-frequency fusion unit realizes multi-level frequency domain feature enhancement; the modulation and fusion unit generates multi-scale fusion features; the multi-scale detection head outputs different scale disease spots for the multi-scale fusion features; and the network model is trained by using the disease initial stage representation sample set to construct a crop disease detection model. According to the above technical scheme, the detection precision and stability of a small disease spot target in the initial stage of crop disease can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer vision and deep learning, and particularly relates to a crop disease detection model construction method based on high-resolution priori. BACKGROUND

[0002] In the process of agricultural production, crop disease is one of the main factors affecting crop yield and quality. At the early stage of crop disease, only small and unobvious disease spots appear on the surface of leaves, stems or fruits. If the disease can be detected and located at this stage, and timely control measures are taken, the spread of the disease can be inhibited to some extent, the amount of pesticide used can be reduced, and economic losses can be reduced. Therefore, the crop disease detection technology based on images has important application value in the field of agricultural production management and plant protection.

[0003] With the development of computer vision technology, the crop disease detection method based on image analysis gradually evolves from traditional artificial feature extraction method to deep learning method. Early researches mostly extract artificial design features such as color, texture and shape of disease spots, and realize disease recognition by combining support vector machine, random forest and other classifiers. This kind of method has relatively simple implementation process, but it has certain dependence on imaging environment, background complexity and disease spot scale change.

[0004] In recent years, convolutional neural networks have made significant progress in image classification and object detection, and are widely used in automatic identification of crop diseases. The common technology is to model crop disease detection as an image classification problem, and to identify the disease class of the whole crop leaf or plant image: for example, using deep convolutional networks such as AlexNet, GoogLeNet, etc. to classify multiple crop leaf diseases and realize automatic identification of crop diseases. This kind of method usually takes the whole image as input, obtains global semantic features through deep feature extraction network, and outputs corresponding disease class label; another kind of technical solution introduces crop disease detection into the target detection framework, and uses general target detection networks such as Faster R-CNN, YOLO, SSD to frame and classify crop disease spots. This kind of method realizes the position detection and class identification of disease spots in the image through the steps of candidate region generation, feature extraction and classification regression.

[0005] But in practical application, the initial lesion has the characteristics of small area, unclear features and easy to be submerged by the background. The existing disease detection methods are obviously insufficient for the detection of such lesions: the image classification-based method takes the whole leaf or plant image as input, focusing on the overall semantic features, which is difficult to accurately describe the position, number and spatial distribution of small target lesions, resulting in the decline of classification stability and reliability; the method based on general object detection framework can realize lesion positioning, but its network often uses multiple downsampling, which is easy to lose high-resolution details and high-frequency features, and has limited detection ability for small-scale and low-contrast initial lesions. Although some methods introduce multi-scale feature fusion or feature pyramid to improve the performance of small targets, they are mostly limited to spatial scale fusion and fail to fully exploit the fine-grained information of lesions in texture, edge, etc. In complex farmland environment, leaf veins, background texture and light changes are easy to be confused with initial lesions, causing false detection and missed detection.

[0006] Therefore, there is an urgent need for a technical solution to address the lack of high-resolution detail utilization and the low sensitivity of small-scale lesions in small target disease detection, and to meet the demand for early and accurate detection of crop diseases. SUMMARY

[0007] To achieve the above-mentioned purpose, the present application provides a crop disease detection model construction method based on high-resolution prior, comprising the following steps:

[0008] Collecting crop disease original images, generating crop disease initial representation maps, labeling the crop disease initial representation maps, and constructing disease initial representation sample sets;

[0009] Defining a network model; the network model is used to output disease features according to the crop disease initial representation images; the network model includes a feature extraction unit, an adaptive efficient spatial-frequency fusion unit, a modulation and fusion unit, and a multi-scale detection head; wherein the feature extraction unit performs multi-scale feature extraction on the input image based on the backbone network to obtain high-resolution prior features and low-resolution features ; the adaptive efficient spatial-frequency integration unit constructs an adaptive frequency filter to realize multi-level frequency domain feature enhancement and ensure the capture of lesion texture and edge details at different scales; the modulation and fusion unit uses the high-resolution prior features to conditionally modulate the low-resolution features , and outputs fusion features ; then multi-scale feature fusion is performed to form multi-scale fusion features; the multi-scale detection head uses a multi-scale deformable attention mechanism for target detection, and outputs lesions of different scales for the multi-scale fusion features;

[0010] The disease initial representation sample set is used to train the network model to construct a crop disease detection model.

[0011] The labeling of the initial stage image of the crop disease includes preliminary labeling, labeling verification and correction.

[0012] In the preliminary labeling, the crop disease spot region of the initial stage image of the crop disease is preliminarily detected to determine the bounding box information of the disease spot target. The bounding box of the disease spot target is determined according to the visually distinguishable change region of the crop disease spot in the image.

[0013] In the labeling verification and correction, fine labeling is performed on the micro disease spot in the initial stage of the disease.

[0014] In the feature extraction unit, when the multi-scale feature extraction of the input image is performed based on the backbone network, four feature maps with different resolutions, C2, C3, C4 and C5, are output. The four feature maps with different resolutions are gradually decreased in spatial resolution from high to low, representing different types of disease spot information. The features include C3 feature map, C4 feature map and C5 feature map.

[0015] The adaptive spectral filter is deployed on the feature layer where the output C2 feature map, C3 feature map, C4 feature map and C5 feature map are located, to realize multi-level frequency domain feature enhancement.

[0016] Further, the method for obtaining the high-resolution prior feature is as follows:

[0017] The C2 feature map is projected and normalized in the channel to map to a 256-dimensional feature space to form a high-resolution prior feature, denoted as .

[0018] The context information is extracted through multi-scale convolution in the horizontal and vertical directions, and the spatial and channel attention is combined to enhance the discrimination ability of the C2 feature, denoted as .

[0019] The processing process of the adaptive spectral filter on the input feature includes:

[0020] The shared feature embedding is performed to generate an embedded feature based on the input feature.

[0021] Parallel spatial and frequency domain modeling is performed. In the spatial domain branch, the embedded feature is reserved as the spatial feature . In the frequency domain branch, the embedded feature is processed in the spatial dimension to perform two-dimensional fast Fourier transform to obtain the corresponding frequency domain .

[0022] The dynamic frequency domain filtering weight is calculated, weighted fusion is performed, and a space-frequency fusion feature is generated ;

[0023] Through a learnable fusion coefficient The spatial domain And the space-frequency fusion feature Weighted fusion is performed, and an enhanced feature is output .

[0024] The modulation and fusion unit utilizes high-resolution prior features To conditionally modulate low-resolution features The process includes:

[0025] The high-resolution prior features are processed by multi-scale dilated convolution to extract context information under different receptive fields and spliced to generate spliced features ;

[0026] A spatial gating attention module is used to generate a spatial attention map , and the spliced features are spatially weighted

[0027] A squeeze-and-excitation module is used to generate channel attention factors, and modulation parameters γ and β are generated

[0028] The modulation parameters are applied to the low-resolution features to realize feature modulation and fusion, and output the fused features .

[0029] Further, multi-scale feature fusion includes:

[0030] The RT-DETR Transformer encoder is copied and the parameters are frozen to form a stable feature enhancement encoder, which generates features after fusing original multi-scale features and cross-scale enhancement information; the features after fusing original multi-scale features and cross-scale enhancement information are injected into the original low-resolution feature stream to update the low-resolution features ;

[0031] A feature pyramid network top-down path is constructed, starting from C5 to generate P5, P4, and P3 features in turn; a bottom-up feature transmission path is constructed by introducing a path aggregation network, starting from P3 features to generate N3, N4, and N5 features in turn

[0032] Among them, the N3 feature retains a higher spatial resolution and is suitable for detecting early-stage disease spot targets; the N5 feature focuses on detecting developed disease spots

[0033] The N3, N4, and N5 features are fused to form a multi-scale fusion feature, which is used as the input of the multi-scale detection head.

[0034] The multiscale detection head adopts an RT-DETR decoder, the RT-DETR decoder comprises 6 layers of Transform layers, each layer uses 300 queries, and target assignment is performed through a Hungarian matching algorithm.

[0035] Further, when the crop disease detection model is constructed, an AdamW optimizer is used for end-to-end training, the initial learning rate is set to 1x10 -4 , the weight decay coefficient is 0.05; a cosine annealing learning rate scheduling strategy is adopted, and the number of training rounds is set to 72 epochs;

[0036] In the training process, synchronous batch normalization is adopted to ensure the consistency of multi-GPU training.

[0037] The data enhancement strategy includes random horizontal flipping, random scaling and color jittering.

[0038] The present application effectively fuses the spatial information and frequency information in the crop disease image by introducing high-resolution prior information, while maintaining the overall spatial structure characteristics of the disease spot, enhancing the representation ability of the high-frequency characteristics such as disease spot texture change and edge details, thereby improving the detection accuracy and stability of the model for small disease spot targets in the early stage of crop disease. BRIEF DESCRIPTION OF DRAWINGS

[0039] Figure 1 is a crop disease detection model construction method based on high-resolution prior according to an embodiment of the present application;

[0040] Figure 2 is a construction step diagram of a disease early stage representation sample set according to an embodiment of the present application;

[0041] Figure 3 is a structure diagram of a crop disease detection model according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] The present application is based on high-resolution prior and spatial-frequency fusion technology, introduces high-resolution features as prior information to ensure the sensitivity and detection ability of the model for small disease spot targets, effectively captures the subtle feature changes in the early stage of disease, and avoids excessive dependence on low-resolution features; at the same time, adaptive spectral filters and multi-scale directional context attention modules are integrated into the architecture to realize adaptive selection of different frequency components and enhance the perception ability of disease spot texture and edge features. The crop disease detection model constructed through these improvements can effectively detect small disease spots and improve the detection accuracy of early crop disease detection.

[0043] The specific implementation of the present application will be described in detail below in conjunction with the drawings in the specification.

[0044] The application provides a crop disease detection model construction method based on high-resolution prior art, as shown in the formula (I): Figure 1 The method comprises the following steps:

[0045] Step S100: Collecting a crop disease original image, preprocessing the original image to generate a crop disease initial stage feature map, labeling the crop disease initial stage feature map, and constructing a disease initial stage feature sample set;

[0046] The step of constructing the disease initial stage feature sample set is as shown in the formula (II): Figure 2 The step of constructing the disease initial stage feature sample set comprises the following steps:

[0047] 1) Data collection and screening: collecting public agricultural disease data sets, research institution resources and actually shot crop disease images, especially images of the initial stage of diseases, recording the crop and disease categories corresponding to each image; after obtaining the images, uniformly preprocessing the image files: removing blurred, occluded or damaged samples, correcting and unifying the definition and meaning of disease categories, and ensuring that the image and disease category information are accurate and consistent; after preprocessing the images, generating crop disease initial stage feature images.

[0048] 2) Preliminary labeling: using a deep learning assisted labeling tool to preliminarily detect the crop disease lesion area of the crop disease initial stage feature image, determining the boundary box information of the lesion target, and uniformly labeling the crop disease initial stage feature image in COCO format.

[0049] The boundary box of the lesion target is determined according to the visually changeable area of the crop lesion in the image, wherein the visually changeable forms include: (1) the obvious difference in color distribution of the lesion area relative to healthy tissue, including brightness reduction, hue shift or saturation change; (2) the abnormal performance of the lesion area in the texture statistical characteristics, including uneven gray, spot distribution or local roughness change; (3) the closed or semi-closed contour formed by the lesion area in the spatial structure, and the edge usually shows irregular shape or fuzzy boundary.

[0050] When labeling, the principle of completely covering the above-mentioned visually changeable area is adopted to ensure that the main edge and internal texture information of the lesion are contained in the boundary box.

[0051] 3) Labeling verification and correction: manually reviewing and correcting all lesion target labeling results, focusing on fine labeling of small lesions in the initial stage of diseases, and generating labeled images.

[0052] The micro lesion usually shows: (1) occupying a smaller pixel area in the spatial scale, incomplete boundary or lower contrast; (2) only showing slight changes in color and brightness, which is easy to be confused with leaf veins, background texture or light noise; (3) mainly reflecting high-frequency fine-grained changes in the texture level, such as local spots, granular distribution or weak edge structure.

[0053] In the labeling process, the micro lesion is supplemented with attribute labels for subsequent network model learning of different scales and significant lesions, wherein the attribute labels include lesion size level, clarity level and other information.

[0054] 4) Generating a dataset; crop disease early stage characterization images and corresponding labels and attribute labels are sorted into a crop disease early stage characterization sample set, which is divided into a training set, a validation set and a test set according to a preset ratio, for model training and evaluation.

[0055] The present application provides an embodiment: after data acquisition, strict screening and labeling, the corresponding lesion area of the crop disease early stage characterization image is ensured to be accurate to the pixel level, and finally a crop disease early stage characterization sample set including 2877 images, covering 20404 labeled objects, and a total of 17 disease categories is constructed; and the data set is divided into a training set, a validation set and a test set according to a ratio of 7:2:1, for subsequent model training, parameter optimization and performance evaluation.

[0056] Step S110: defining a network model;

[0057] In this step, the network model is defined in combination with ResNet-50vd network, Transformer encoder and RT-DETR decoder structure, and the network model is used to output disease characteristics according to the crop disease early stage characterization image.

[0058] Specifically, the network model includes a feature extraction unit, an adaptive efficient space-frequency fusion unit, a modulation and fusion unit and a multi-scale detection head.

[0059] The feature extraction unit P111 adopts ResNet-50vd as the backbone network, and performs multi-scale feature extraction of the input image based on the backbone network, and obtains high-resolution prior features.

[0060] As shown in P310, Figure 3 The backbone network performs multi-scale feature extraction on the input image (crop disease early stage characterization image), and the input image is represented as , the backbone network contains 4 convolution stages, respectively output C2, C3, C4 and C5 four different resolution feature maps, the resolution of each feature map is 1 / 4, 1 / 8, 1 / 16 and 1 / 32 of the original picture, and the number of channels is 256, 512, 1024 and 2048 respectively. The four feature maps are gradually decreased from high to low in spatial resolution, representing different types of lesion information:

[0061] 1) C2 feature map has the highest resolution, mainly retains the edge profile, fine-grained texture and local color change of the lesion, and is particularly sensitive to the initial small lesion;

[0062] 2) C3 and C4 feature maps take into account local details and context semantics to some extent, describing the local structure of the lesion and the relationship with the surrounding tissue;

[0063] 3) C5 feature map has the lowest resolution, focusing on global semantic information, which is conducive to disease classification, but has limited ability to locate small lesions.

[0064] Based on the characteristics of the above feature maps, C2 feature map is selected as the source of high-resolution prior information to make up for the lack of details in small-scale lesion detection at the early stage of disease. The features of C3, C4 and C4 feature maps are used as low-resolution features .

[0065] After determining the source of high-resolution prior information, the C2 feature map is projected and normalized in the channel to map to a 256-dimensional feature space, forming a high-resolution prior feature, denoted as ; At the same time, the multi-scale direction context attention module MSDCA is introduced, which extracts context information through multi-scale convolution in horizontal and vertical directions, and combines spatial and channel attention to enhance the discrimination ability of C2 feature, denoted as:

[0066] .

[0067] The adaptive efficient space-frequency integration unit P112 uses an adaptive spectrum filter (ASF) to realize multi-level frequency domain feature enhancement, ensuring that it can capture lesion texture and edge details at different scales.

[0068] The adaptive spectrum filter contains a spatial branch and a frequency branch, which realizes space-frequency feature fusion after dynamic frequency filtering of the feature.

[0069] Specifically, given the input feature , where R represents the real set, B is the batch size, H and W are spatial dimensions, and C is the number of channels. The processing process of the adaptive spectrum filter is as follows:

[0070] 1) Perform shared feature embedding, generate embedding features based on input features :

[0071] In this step, the input features X are projected linearly and mapped nonlinearly to share the space, and the feature representation of the frequency domain branch is unified. Specifically, the channel dimension is expanded to the intermediate dimension by point convolution, denoted as , where expansion_ratio is the channel expansion ratio, which is a positive real number greater than 1, used to control the expansion degree of the intermediate feature dimension; and a StarReLU activation function is applied to obtain the embedding feature , denoted as:

[0072] .

[0073] 2) Parallel spatial and frequency domain modeling, as shown in P320 part of Figure 3 :

[0074] In the spatial branch, the embedding feature is directly reserved as the spatial feature , maintaining its spatial stability, represented as: ; in the frequency domain branch, the embedding feature is subjected to a two-dimensional fast Fourier transform in the spatial dimension to obtain the corresponding frequency domain , represented as: , dim is the feature dimension of tensor processing.

[0075] 3) Calculate dynamic frequency domain filtering weights and perform weighted fusion;

[0076] When generating dynamic frequency domain filtering weights, define an adjustable complex weight parameter, denoted as:

[0077] , where H0, W0 are the initial weight size, N_f is the number of filters, which is dynamically modulated by the routing MLP to achieve adaptive selection of different frequency components, denoted as:

[0078]

[0079] , where R is the feature tensor, B, , D are the three dimensions of the feature, is the dynamic complex modulation weight, b is the batch size, f is the filter index, c is the channel number, h and w represent height and width; in the weighted fusion calculation, after the inner product summation of the two input feature tensors R at the filter index, each element tensor of the feature tensor R is multiplied by the corresponding element, and the summation is performed on the index f.

[0080] Then the dynamic complex modulation weight is adaptively resampled by bicubic interpolation to ensure the size of the frequency domain representation of the input feature map, denoted as:

[0081]

[0082] wherein, is the interpolation resampling normalization weight, and ViewAsComplex is used to convert a real number tensor into a complex number tensor to meet the specific shape required for subsequent calculation.

[0083] Further, the frequency domain filtering and inverse transformation are performed, the dynamic frequency domain filter is applied to the frequency domain feature, and the spatial frequency fusion feature is converted back to the spatial domain through the inverse fast Fourier transform, to generate the spatial frequency fusion feature , denoted as:

[0084]

[0085] wherein, is the element-wise multiplication;

[0086] Next, the spatial domain feature and the spatial frequency fusion feature are weighted and fused by the learnable fusion coefficient to output the enhanced feature :

[0087]

[0088] wherein, is the intermediate feature representation of the fusion of the spatial domain structure information and the frequency domain context information.

[0089] In the present application, the adaptive spectral filter is deployed on the feature layer where the output C2 feature map, C3 feature map, C4 feature map and C5 feature map are located, to realize multi-level frequency domain feature enhancement, and ensure that the model can capture texture and edge details at different scales.

[0090] At this time, the features of the C3 feature map, C4 feature map and C5 feature map are output after the texture details and structure are strengthened by the frequency domain modulation and spatial domain reconstruction as the enhanced low resolution feature provides more discriminative feature expression for subsequent detection.

[0091] The P113 modulation and fusion unit first uses the FiLM modulation mechanism to conditionally modulate the high resolution prior feature and the low resolution feature , and then performs multi-scale feature fusion through the feature pyramid network (FPN) and the path aggregation network (PAN).

[0092] The process of conditional modulation includes:

[0093] 1) First, the high-resolution prior features from the C2 feature map are processed by multi-scale dilated convolution to extract context information under different receptive fields and generate a spliced feature , denoted as:

[0094] wherein, is the dilation rate, which is used to control the receptive field size of the convolution kernel, thereby capturing context information at different scales;

[0095] 2) A spatial gating attention module is used to generate a spatial attention map , which is used to spatially weight the spliced feature, denoted as:

[0096]

[0097] wherein, is the weighted context feature that integrates spatial saliency information;

[0098] 3) Then, a squeeze-and-excitation module is used to generate channel attention factors, generating modulation parameters γ and β, denoted as:

[0099]

[0100] wherein, is the channel-level statistical feature obtained by global average pooling, which more effectively extracts channel information from the squeeze-and-excitation module;

[0101] 4) Finally, the modulation parameters are applied to the low-resolution features , combined with a learnable fusion coefficient to realize feature modulation and fusion, outputting a fused feature , denoted as:

[0102]

[0103] wherein, is the feature representation after adaptive modulation of the low-resolution feature by the channel modulation parameter, initialized to 0.3, and the weight is adjusted adaptively during training iterations, is used as the result of conditional modulation of the low-resolution feature , and serves as an effective support feature for the subsequent cross-scale Transformer.

[0104] In the process of multi-scale feature fusion, cross-scale feature enhancement is achieved based on the Transformer encoder, which specifically includes:

[0105] ​1) Duplicate the Transformer encoder of RT-DETR and freeze the parameters to form a stable feature enhancement encoder, including:

[0106] Design a lightweight adapter module to map C3, C4 features to a feature space compatible with the frozen encoder, denoted as: where, is the fused feature mapped to the frozen Transformer encoder feature space through the lightweight adapter;

[0107] Generate two-dimensional sine-cosine positional encoding for C3, C4 features to provide spatial position information , denoted as: ;

[0108] Input the adapted C3, C4 features into the frozen encoder to generate enhanced features, then fuse them with the original features, denoted as:

[0109]

[0110] where, is the feature representation after fusing the original multi-scale features with cross-scale enhancement information, is the enhanced feature representation obtained by cross-scale context modeling through the frozen Transformer encoder, is a learnable fusion weight parameter that is updated adaptively through backpropagation during training, used to balance the contribution of cross-scale enhancement features, original adapted features, and conditional modulation features to the final fused representation.

[0111] is the feature representation after fusing the original multi-scale features with cross-scale enhancement information, and is the updated low-resolution feature

[0112] is a learnable residual enhancement coefficient used to control the injection strength of cross-scale enhancement information, and the updated (i.e., the updated features of C3, C4, and C5) represents the low-resolution features enhanced by the cross-scale Transformer encoder.

[0113] 2) Construct a feature pyramid network (FPN) top-down path, starting from the updated C5, generate P5, P4, P3 features in turn from C4, C3; introduce a path aggregation network (PAN) to construct a bottom-up feature transmission path, starting from the P3 feature to generate N3, N4, N5 features in turn. Among them, the P3, P4, P5 features mainly fuse the context information from the high-level semantics, while the N3, N4, N5 features further introduce the bottom layer high-resolution information on this basis, so that the features at different levels have both semantic discrimination ability and spatial detail expression ability.

[0114] At this time, the N3 feature retains a higher spatial resolution and is more suitable for detecting small lesion targets in the early stage of disease; the N4 feature is suitable for detecting medium-scale lesions; and the N5 feature focuses on stable detection of larger or developed lesions. The fused N3, N4 and N5 features are used as multi-scale fusion features and input into a multi-scale detection head for detection of disease targets of different scales.

[0115] The P114 multi-scale detection head uses an RT-DETR decoder to detect targets using a multi-scale deformable attention mechanism and outputs disease lesions of different scales for the multi-scale fusion features.

[0116] In the embodiment of the application, the decoder includes 6 layers of Transformer, each layer uses 300 queries (num_queries=300), and target assignment is performed through a Hungarian matching algorithm. The designed loss function uses a multi-task loss, including: ,

[0117] wherein, is a Varifocal Loss classification loss, is an L1 bounding box regression loss, is a GIoU loss, and are weights, set to .

[0118] Step S120: training the network model using a disease early stage representation sample set to construct a crop disease detection model.

[0119] The AdamW optimizer is used for end-to-end training, and the initial learning rate is set to 1x10 -4, the weight decay coefficient is 0.05; the cosine annealing learning rate scheduling strategy is adopted, and the number of training rounds is set to 72 epochs. In the training process, synchronous batch normalization (SyncBN) is used to ensure the consistency of multi-GPU training. The data enhancement strategy includes random horizontal flip, random scaling (multi-scale range 480-800), color jittering, etc. to improve the generalization ability of the model; after training combined with the early stage of disease representation sample set, the crop disease detection model is constructed.

[0120] In the inference stage, the input image is first preprocessed, including normalization and size adjustment to 640x640. The crop disease detection model outputs 300 query corresponding bounding boxes and class confidence, and the final detection result is obtained through confidence threshold screening and non-maximum suppression (NMS). For the early stage of crop disease detection task, the crop disease detection model constructed according to the method provided by the application can accurately detect the tiny disease spots with an area less than 32x32 pixels, and maintain high detection accuracy and stability in complex farmland environment.

[0121] Through the crop disease detection model construction method based on high-resolution prior provided by the application, a disease detection model for small target crop disease spots can be constructed, which overcomes the problems that the existing image classification method is difficult to realize accurate positioning of disease spots, the general target detection network is insufficient in sensitivity for small-scale disease spots, and the multi-scale feature fusion method does not fully utilize fine-grained high-frequency information; supports accurate detection and positioning of crop disease early stage disease spot targets, and provides effective technical means for early monitoring and accurate prevention and control of crop diseases.

[0122] The above disclosure is only a few specific embodiments of the application, but the application is not limited thereto, and any changes that can be thought of by those skilled in the art shall fall within the protection scope of the application.

Claims

1.A method for constructing a crop disease detection model based on high-resolution prior, characterized in that, The method comprises the following steps: Collecting crop disease original images, generating crop disease initial characterization images, labeling the crop disease initial characterization images, and constructing a crop disease initial characterization sample set; Defining a network model; The network model is used to output disease features based on early-stage crop disease characterization images. The network model includes a feature extraction unit, an adaptive high-efficiency space-frequency fusion unit, a modulation and fusion unit, and a multi-scale detection head. The feature extraction unit performs multi-scale feature extraction of the input image based on the backbone network to obtain high-resolution prior features. and low-resolution features The adaptive high-efficiency space-frequency integration unit constructs an adaptive spectrum filter to achieve multi-level frequency domain feature enhancement, ensuring the capture of lesion textures and edge details at different scales; the modulation and fusion unit utilizes high-resolution prior features. For low-resolution features Perform conditional modulation and output fused features. Then, multi-scale feature fusion is performed to form multi-scale fused features; the multi-scale detection head uses a multi-scale deformable attention mechanism to perform target detection and outputs lesions of different scales for the multi-scale fused features; The processing of the adaptive spectral filter on the input feature includes: performing shared feature embedding to generate embedded features based on the input feature ; parallel spatial and spectral domain modeling, in the spatial branch, the embedded features are reserved as spatial features ; in the spectral domain branch, the embedded features are processed performing two-dimensional fast Fourier transform on the spatial dimension to obtain corresponding frequency domain ; calculating dynamic spectral domain filtering weights, weighted fusion is performed, and spatial-frequency fusion features are generated ; through learnable fusion coefficients weighted fusion is performed on the spatial and the spatial-frequency fusion features , and enhanced features are output ; The modulation and fusion unit utilizes high-resolution prior features to conditionally modulate the low-resolution features The process of conditional modulation includes: performing multi-scale hollow convolution processing on the high-resolution prior features to extract context information under different receptive fields and splice to generate spliced features ; generating a spatial attention map through a spatial gating attention module , spatially weighting the spliced features, generating channel attention factors through a squeeze-and-excitation module, generating modulation parameters γ and β, and applying the modulation parameters to the low-resolution features to realize feature modulation and fusion and output fused features ; Training the network model using the crop disease initial characterization sample set to construct a crop disease detection model. 2.The method of claim 1, wherein, The labeling of the crop disease initial characterization images includes preliminary labeling, labeling verification and correction; Wherein, during the preliminary labeling, the crop disease initial characterization images are preliminarily detected to determine the boundary box information of the disease spot target; the boundary box of the disease spot target is determined according to the visually distinguishable change region of the crop disease spot in the image; During the labeling verification and correction, the micro disease spots in the initial stage of the disease are finely labeled. 3.The method of claim 1, wherein, The feature extraction unit performs multi-scale feature extraction on the input image based on the backbone network, and outputs four feature maps with different resolutions, C2, C3, C4 and C5, which are sequentially decreased from high to low in spatial resolution and represent different types of lesion information. The features include the C3 feature map, the C4 feature map and the C5 feature map. The adaptive spectral filter is deployed on the feature layers where the output C2 feature map, C3 feature map, C4 feature map and C5 feature map are located, to realize multi-level frequency domain feature enhancement. 4.The method of claim 3, wherein, The multi-scale feature fusion comprises: The stable feature enhancement encoder is formed by copying the Transformer encoder of the RT-DETR and freezing parameters, and generates features after fusion of original multi-scale features and cross-scale enhancement information; the features after fusion of the original multi-scale features and the cross-scale enhancement information are injected into the original low-resolution feature flow to update the low-resolution features ; A feature pyramid network top-down path is constructed to generate P5, P4 and P3 features in turn from C5; a bottom-up feature transmission path is constructed by introducing a path aggregation network to generate N3, N4 and N5 features in turn from the P3 feature; Wherein, the N3 feature is suitable for detecting the disease spot target in the initial stage of the disease; the N5 feature is suitable for detecting the developed disease spot; The N3, N4 and N5 features are fused to form multi-scale fusion features, which are used as the input of the multi-scale detection head. 5.The method of claim 1, wherein, The multi-scale detection head adopts an RT-DETR decoder, which contains 6 layers of Transformer layers, each layer uses 300 queries, and target assignment is performed through the Hungarian matching algorithm. 6.The method of claim 1, wherein, The AdamW optimizer is used for end-to-end training when the crop disease detection model is constructed, the initial learning rate is set to 1x10 -4 , and the weight decay coefficient is 0.05; the cosine annealing learning rate scheduling strategy is adopted, and the number of training rounds is set to 72 epochs. During the training process, synchronous batch normalization is used to ensure the consistency of multi-GPU training; The data enhancement strategy includes random horizontal flipping, random scaling and color jittering.

Citation Information

Patent Citations

  • Intelligent identification method, medium and system for tobacco plant diseases and insect pests

    CN117372881A

  • Medical image segmentation method based on high-resolution modal guidance and cross-modal boundary perception

    CN120765930A