A cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism

By combining directional frequency enhancement with an adaptive attention mechanism, the cotton target detection model is enhanced to adapt to complex environments, improving the accuracy and robustness of cotton leaf disease detection and enabling automatic identification and precise localization of disease targets.

CN123160873APending Publication Date: 2026-11-24ZHEJIANG FORESTRY UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611688039.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-29
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Existing cotton target detection methods suffer from low detection accuracy due to significant changes in target scale, severe background interference, insufficient extraction of directional texture features, and limited ability to focus on key target regions in complex field environments.

Method used

A cotton target detection method based on directional frequency enhancement and adaptive attention mechanism is adopted. The directional frequency enhancement aggregation module extracts multi-directional structural information and local texture information, and the adaptive directional gradient guided self-attention module enhances the feature representation ability of key target regions.

Benefits of technology

It improves the accuracy and robustness of cotton target detection, adapts to complex environments such as multiple light exposures, leaf shading, and changes in lesion size, and realizes automatic identification of cotton leaf diseases and precise location of lesions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123160873A_ABST
    Figure CN123160873A_ABST
Patent Text Reader

Abstract

The application discloses a cotton leaf disease detection method based on a direction frequency enhancement and an adaptive attention mechanism, and belongs to the technical field of computer vision. In view of problems such as great variation in disease scale, insufficient direction texture extraction and strong background interference in a complex cotton field environment, a detection network is constructed by fusing a direction frequency enhancement aggregation module and an adaptive direction gradient guided self-attention module. First, a public data set is labeled, checked and divided. Then, multi-scale features are extracted, multi-direction structure responses and local texture information are fused through the direction frequency enhancement aggregation module, and the attention is adaptively adjusted by using a direction gradient prior and spatial saliency, so that the disease area features are strengthened. Finally, disease categories, disease spot coordinates and prediction confidence are output. The application can improve the recognition and positioning capability of cotton leaf diseases in a complex field environment, and provides technical support for intelligent monitoring and precise prevention.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of crop leaf disease detection technology. In particular, it relates to a cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanisms. Background Technology

[0002] As an important economic crop, cotton's growth status directly affects its yield and quality. During cotton cultivation, diseases, leaf abnormalities, and changes in plant condition can all impact normal growth. Therefore, research on intelligent detection technology for cotton leaf diseases is of great significance for improving field management efficiency and reducing the cost of manual inspections.

[0003] With the development of computer vision and deep learning technologies, intelligent detection methods based on image feature learning are gradually being applied to the field of agricultural target recognition. Traditional cotton field inspection mainly relies on manual inspection, which suffers from problems such as high labor input, low detection efficiency, and susceptibility to experience-based results, making it difficult to meet the needs of large-scale, intelligent monitoring. In contrast, deep learning detection methods can automatically extract image features to achieve target localization and recognition, providing an effective technical approach for intelligent cotton monitoring.

[0004] However, in real cotton field environments, factors such as varying lighting, background interference, foliage occlusion, and target scale variations make target features susceptible to interference. Furthermore, cotton targets exhibit significant scale differences and rich local texture details, and existing detection models still have limited ability to extract features from small targets, weakly textured regions, and complex backgrounds. Therefore, enhancing the model's ability to express directional textures, multi-scale structures, and key region features, and improving the accuracy of cotton target detection in complex environments, remains a problem that needs to be solved. Summary of the Invention

[0005] To address the shortcomings of existing cotton target detection methods in complex field environments, such as significant target scale variations, severe background interference, insufficient extraction of directional texture features, and limited ability to focus on key target regions, this invention aims to provide a cotton target detection method based on directional frequency enhancement and adaptive attention mechanisms. By enhancing the model's ability to perceive the directional structural information, multi-scale feature information, and key region feature information of cotton targets, the impact of complex environmental factors on the detection results is reduced, thereby improving the accuracy and robustness of cotton target detection.

[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: The technical solution of the present invention will be described in detail with reference to specific embodiments. A cotton target detection method based on directional frequency enhancement and adaptive attention mechanism includes the following steps:

[0007] S1: Obtain a publicly available cotton leaf disease image dataset, preprocess the image data, and label and verify the target category information and location information in the dataset to construct a cotton leaf disease detection dataset. Divide the dataset into a training set, a validation set, and a test set, and perform data augmentation processing on the training set to improve sample diversity.

[0008] S2: Construct a cotton target detection model, which includes a backbone feature extraction network, a directional frequency enhancement aggregation module, an adaptive directional gradient guided self-attention module, and a detection prediction network. The directional frequency enhancement aggregation module extracts multi-directional structural information and local texture information from the cotton target region and adaptively fuses directional features at different scales. The adaptive directional gradient guided self-attention module constructs directional prior information, guides the attention feature interaction process, and enhances the model's ability to express features of key target regions.

[0009] S3: The cotton leaf disease target detection model is trained using the training set, the model parameters are optimized and adjusted using the validation set, and the performance of the trained cotton target detection model is evaluated using the test set.

[0010] S4: Input the cotton target image to be detected into the trained cotton target detection model, and perform feature enhancement through the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module, and output the cotton leaf disease category, lesion bounding box location and prediction confidence.

[0011] S5: Set up a control model to carry out ablation experiments. Compare the basic detection model without the improved module, the detection model with the added directional frequency enhancement aggregation module, and the complete detection model with both the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module. Through detection accuracy index and visualization analysis of detection results, verify the effect of the synergistic effect of the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module on improving the detection performance of cotton leaf disease targets.

[0012] Based on the above technical solutions, and by combining the innovatively added directional frequency enhancement aggregation module and adaptive directional gradient guided self-attention module, this invention achieves the following beneficial effects:

[0013] The directional frequency enhancement aggregation module can enhance the model's ability to extract cotton target edges, texture details, and scale variation features by using multi-directional structural information and local texture change information. At the same time, it can improve the model's ability to recognize cotton targets of different sizes by combining a multi-scale directional feature adaptive fusion mechanism. The adaptive directional gradient guided self-attention module can enhance the response of key target areas by using directional prior information and guide attention feature interaction by using saliency information to reduce the impact of invalid information such as background clutter and occluded areas on the detection process in complex field environments.

[0014] The synergistic effect of these two technologies enables the model to simultaneously possess directional structure perception capabilities and spatial relationship modeling capabilities. This allows for the joint optimization of target texture information, multi-scale structural information, and key area information, thereby improving the accuracy and robustness of cotton leaf disease detection in complex field environments and enhancing the accuracy and robustness of cotton target detection. This provides technical support for intelligent cotton monitoring and precision agricultural management. Attached Figure Description

[0015] Figure 1 This is the cotton leaf disease detection method used in this invention.

[0016] Figure 2 This is a schematic diagram of the cotton leaf disease detection model based on directional frequency enhancement and adaptive attention mechanism proposed in this invention.

[0017] Figure 3 The image shown is of a cotton target to be detected in an embodiment of the present invention.

[0018] Figure 4 This is a schematic diagram of cotton target detection results in an embodiment of the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are some embodiments of this application, but not all embodiments.

[0020] The technical solution of the present invention will be further described in detail below through embodiments and in conjunction with the accompanying drawings.

[0021] See Figure 1 This embodiment provides a cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism, including the following steps:

[0022] S1: Obtain a publicly available cotton leaf disease image dataset, preprocess the image data, and label and verify the target category information and location information in the dataset to construct a cotton leaf disease detection dataset. Divide the dataset into a training set, a validation set, and a test set, and perform data augmentation processing on the training set to improve sample diversity.

[0023] S2: Construct a cotton target detection model, which includes a backbone feature extraction network, a directional frequency enhancement aggregation module, an adaptive directional gradient guided self-attention module, and a detection prediction network. The directional frequency enhancement aggregation module extracts multi-directional structural information and local texture information from the cotton target region and adaptively fuses directional features at different scales. The adaptive directional gradient guided self-attention module constructs directional prior information, guides the attention feature interaction process, and enhances the model's ability to express features of key target regions.

[0024] S3: The cotton leaf disease target detection model is trained using the training set, the model parameters are optimized and adjusted using the validation set, and the performance of the trained cotton target detection model is evaluated using the test set.

[0025] S4: Input the cotton target image to be detected into the trained cotton target detection model, and perform feature enhancement through the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module, and output the cotton leaf disease category, lesion bounding box location and prediction confidence.

[0026] S5: Set up a control model to carry out ablation experiments. Compare the basic detection model without the improved module, the detection model with the added directional frequency enhancement aggregation module, and the complete detection model with both the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module. Through detection accuracy index and visualization analysis of detection results, verify the effect of the synergistic effect of the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module on improving the detection performance of cotton leaf disease targets.

[0027] See Figure 2 This is a schematic diagram of a cotton leaf disease detection model based on directional frequency enhancement and adaptive attention mechanism according to an embodiment of the present disclosure.

[0028] This embodiment proposes a directional frequency enhancement aggregation module for performing directional perception, multi-scale spatial modeling, and frequency information-guided fusion processing on input features.

[0029] The input to the directional frequency enhancement aggregation module is the two-dimensional feature map output from the previous layer network:

[0030]

[0031] Where: B represents the batch size of the input features; C represents the number of input feature channels; H represents the feature map height; and W represents the feature map width.

[0032] After processing by the directional frequency enhancement aggregation module, the enhanced features are output:

[0033]

[0034] in, This indicates the number of output feature channels. This module mainly includes: a multi-scale directional peripheral feature extraction unit; a directional adaptive path selection unit; a directional frequency description generation unit; a frequency-guided feature fusion unit; and an output feature mapping unit.

[0035] First, the input feature X is fed into multiple parallel directional peripheral feature extraction branches. Each branch employs a one-dimensional directional convolutional structure of different scales to expand the feature receptive range and enhance spatial structural information at different scales. In this embodiment, multiple scale convolutional kernel sizes are set:

[0036]

[0037] Each scale corresponds to a directional peripheral feature extraction branch. For any scale... Horizontal feature extraction is performed on the input feature X:

[0038]

[0039] in, This represents a one-dimensional depthwise convolution operation along the horizontal direction, used to extract the horizontal spatial response from the input features. Subsequently, the horizontal response is further processed for vertical feature extraction.

[0040]

[0041] Meanwhile, to obtain spatial information under different orientations, the input features are first convolved in the vertical direction:

[0042] Then perform horizontal convolution:

[0043] The horizontal and vertical path features are obtained through the two directional decomposition methods described above. and vertical-horizontal path features .

[0044] To dynamically adjust the response ratio of the two paths based on the dominant texture direction in the input features, the response intensities in the horizontal and vertical directions are first calculated:

[0045]

[0046]

[0047] The two directional responses are combined:

[0048] The fusion weights are obtained through the direction weight generation function:

[0049]

[0050] in, and The learnable parameter matrix in the direction weight generation process is shown. Represents a non-linear activation function. This represents the Sigmoid function. This represents the fusion weight of the horizontal-vertical path features in the i-th scale branch, and its value ranges from 0 to 1. 1.

[0051] Based on the obtained directional fusion weights, the two directional decomposition paths are weighted and fused:

[0052]

[0053] in, This represents the directional adaptive peripheral feature output by the i-th scale branch.

[0054] To further enhance the ability to express peripheral structural information and reduce repetitive responses in the convolution center region, this embodiment introduces a center suppression mechanism in the peripheral branches of each direction.

[0055] Perform local spatial mapping on the input features:

[0056]

[0057] The response characteristics of the central region are obtained. Subsequently, the degree of suppression of the central response is controlled by learnable parameters.

[0058]

[0059] in, This indicates a learnable and adjustable parameter; Used to limit the adjustment range. After center suppression, the final scale-oriented peripheral features are obtained:

[0060]

[0061] Obtaining the horizontal gradient response using directional filtering:

[0062]

[0063] in: This represents the horizontal gradient filter kernel.

[0064] Obtain the vertical gradient response:

[0065]

[0066] Simultaneously, the oblique gradient response is obtained using two directional filter kernels:

[0067]

[0068]

[0069] In addition, to describe local structural changes, the Laplace response is introduced:

[0070]

[0071] in: This represents the Laplacian filter kernel. To further describe the degree of texture variation in a region, the local variance is calculated:

[0072] First, calculate the local mean:

[0073] Calculate the local second-order mean:

[0074] Obtaining local changes:

[0075] Finally, the above six types of information are integrated:

[0076] The six-dimensional directional frequency description features are obtained:

[0077] Among them, the six channels represent: horizontal frequency information; vertical frequency information; diagonal frequency information; anti-diagonal frequency information; curvature change information; and local texture change information, respectively.

[0078] The aforementioned directional frequency description feature F is input into the weight generation unit, and then:

[0079]

[0080] Obtain the response weights corresponding to different scale branches:

[0081]

[0082] Then, normalization is performed using the Softmax function:

[0083]

[0084] in: This represents the weighted response corresponding to the i-th scale branch. represents the normalized scale fusion weight, and n represents the number of directional peripheral feature branches.

[0085] Using the obtained scale weights, the multi-scale directional features after center suppression are weighted and fused:

[0086]

[0087] Where Z represents the directional frequency enhancement feature after fusion.

[0088] To ensure the module output meets the feature channel requirements of subsequent networks, a feature Z input channel mapping layer will be implemented:

[0089]

[0090] Where Y represents the final output feature of the directional frequency enhancement aggregation module. This indicates a channel-adjustable convolution operation.

[0091] The final output features are obtained: ,in, This indicates the number of output feature channels after channel mapping.

[0092] This embodiment provides an adaptive directional gradient-guided self-attention module for enhancing the directional structure and spatial relationships of input features. This module extracts directional gradient information from the input features to construct prior features with directional constraints, and uses these prior features to guide the attention calculation process, enabling the network to adaptively adjust the feature response based on the edge direction, texture structure, and spatial saliency of the target region.

[0093] The module input is the two-dimensional feature output from the previous layer network:

[0094] First, the input feature X is input into the gradient directional prior generation unit. To reduce computational cost and extract key structural information, channel mapping is performed on the input feature:

[0095]

[0096] in: This represents the directional analysis features after channel adjustment. Subsequently, gradient extraction convolution is used to obtain the horizontal and vertical responses:

[0097]

[0098]

[0099] in: Indicates the gradient response in the horizontal direction; This represents the gradient response in the vertical direction. The gradient magnitude at the spatial location is calculated based on the gradients in both directions.

[0100] Where: M represents the gradient intensity at the current position, To prevent small constants from causing numerical anomalies, the direction angle is also calculated:

[0101] in: This represents the local orientation information corresponding to the input features. The above process yields a basic orientation description containing edge strength and orientation information.

[0102] First, set up n learnable direction centers:

[0103] in: This represents the i-th directional center, used to characterize regions with different directions. Calculate the direction angle. Angular distances from the centers in each direction:

[0104]

[0105] Weights are assigned to continuous directions based on angular distance:

[0106]

[0107] in: This represents the probability that the current position belongs to the i-th direction; This represents the directional distribution width parameter; n represents the number of directions.

[0108] Weighting the direction probabilities using gradient magnitude:

[0109] in: This represents the response in the i-th direction.

[0110] The final soft direction description is obtained:

[0111] Based on the statistical features of orientation at different scales, multi-scale fusion is performed on the orientation description to obtain the prior features of orientation gradient:

[0112]

[0113] P represents the fused directional gradient prior features; This represents the directional statistical characteristics at the i-th scale; This represents the fusion weight corresponding to the i-th scale.

[0114] To prioritize attention calculations on regions with distinct structural features, this embodiment further calculates spatial saliency based on the directional description results. First, the directional distribution entropy is calculated based on the directional description:

[0115]

[0116] Where: E represents the degree of uncertainty in the directional distribution at the current location. Further calculation of the directional structure confidence level:

[0117]

[0118] Where: C represents the confidence level of the current position's orientation structure. Simultaneously, the orientation expectation is calculated based on the orientation distribution:

[0119]

[0120] in: This represents the positional encoding corresponding to the i-th direction. Combining gradient strength, direction confidence, and direction expectation, a spatial position saliency score is calculated to measure the importance of different spatial positional features.

[0121]

[0122] Where: T represents the spatial location saliency score, used to measure the importance of different spatial location features; M represents the gradient magnitude; C represents the directional structure confidence score; and R represents the directional expectation information.

[0123] After obtaining the directional prior information, the input features are mapped to the query, key, and value features required for attention computation.

[0124] Input the input feature X into the attention mapping layer:

[0125] in, This represents the basic attention features generated from the input features.

[0126] Simultaneously, the directional gradient prior feature P is input into the prior mapping layer:

[0127]

[0128] in, This indicates directional prior enhancement features. This indicates the direction prior adjustment parameter.

[0129] The basic attention features are fused with the orientation prior enhancement features:

[0130]

[0131] Subsequently, the fused features were divided into two sets of query features, two sets of key features, and one set of value features:

[0132]

[0133] in: and This represents two sets of query features; and V represents two sets of key features; V represents value features.

[0134] Meanwhile, based on the characteristics of directional confidence enhancement values:

[0135] in: This represents the value characteristics after the directional structure is enhanced.

[0136] To prioritize attention calculations for structurally significant regions, a sorting index is generated based on the spatial salience score T:

[0137]

[0138] in: This represents the position index arranged from highest to lowest significance. The position is then rearranged for the two sets of query features, the two sets of key features, and the value features respectively.

[0139]

[0140]

[0141]

[0142]

[0143]

[0144] in: This indicates that feature rearrangement is performed according to the index. This step prioritizes structurally prominent regions for attention calculation.

[0145] After token rearrangement, two attention branches are calculated separately.

[0146] First branch:

[0147] Second branch:

[0148] in: , These represent the attention matrices corresponding to the two attention branches; , This represents the output features of the two branches. Then, the outputs of the two branches, the prior orientation, and the confidence information are concatenated:

[0149]

[0150] Input fusion gate function:

[0151]

[0152] Where G represents the dynamic fusion weights of the two attention branches. The final fused feature is obtained as follows:

[0153]

[0154] Further incorporate directional prior residuals:

[0155] in: Indicates the direction prior residual adjustment parameter. This represents the direction prior residual mapping function. Finally, it is processed through output mapping:

[0156]

[0157] Where: Y represents the final output feature of the adaptive directional gradient guided self-attention module.

[0158] See Figure 3 This is an image of cotton leaf disease to be detected in an embodiment of the present invention.

[0159] To verify the effects of the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module in this invention on the detection performance of cotton leaf diseases, further ablation experiments were conducted.

[0160] Specifically, using the same dataset partitioning method, training parameters, and evaluation metrics, comparative experiments were conducted on the basic detection model, the detection model with the added directional frequency enhancement aggregation module, and the detection model with both the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module. The ablation experiment results are shown in the table below:

[0161] serial number DPFGA ADHOGSA P / % AP@50 / % 1 × × 87.8 88.2 2 √ × 89.3 90.5 3 √ √ 90.1 91.2

[0162] See Figure 4This is a schematic diagram of cotton leaf disease detection results in an embodiment of the present invention. Comprehensive experimental results show that the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module can effectively complement each other. The former enhances the ability to extract disease texture structure information, while the latter optimizes the ability to express key region features. Their synergistic effect can further improve the cotton leaf disease detection model's ability to identify disease targets in complex environments.

[0163] This solution effectively addresses the shortcomings of traditional detection methods in expressing the characteristics of small lesions, fusing multi-scale disease information, and adapting to complex field environments. Through the synergistic effect of directional frequency enhancement and adaptive attention mechanisms, it improves the model's ability to extract information on lesion texture structure, spatial relationships, and key areas. It adapts to actual cotton field application scenarios such as multiple light exposures, leaf shading, and changes in lesion scale, enabling automatic identification of cotton leaf diseases and precise lesion location, thus providing technical support for intelligent monitoring and early control of cotton diseases.

Claims

1. A cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism, characterized in that, Includes the following steps: S1: Obtain a publicly available cotton leaf disease image dataset, preprocess the image data, and label and verify the target category information and location information in the dataset to construct a cotton leaf disease detection dataset. Divide the dataset into a training set, a validation set, and a test set, and perform data augmentation processing on the training set to improve sample diversity. S2: Construct a cotton target detection model, which includes a backbone feature extraction network, a directional frequency enhancement aggregation module, an adaptive directional gradient guided self-attention module, and a detection prediction network; wherein, the directional frequency enhancement aggregation module is used to extract multi-directional structural information and local texture information in the cotton target region, and adaptively fuse directional features at different scales; The adaptive directional gradient guided self-attention module is used to construct directional prior information, guide the attention feature interaction process, and enhance the model's ability to express features of key target regions. S3: The cotton leaf disease target detection model is trained using the training set, the model parameters are optimized and adjusted using the validation set, and the performance of the trained cotton target detection model is evaluated using the test set. S4: Input the cotton target image to be detected into the trained cotton target detection model, and perform feature enhancement through the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module, and output the cotton leaf disease category, lesion bounding box location and prediction confidence. S5: Set up a control model to carry out ablation experiments. Compare the basic detection model without the improved module, the detection model with the added directional frequency enhancement aggregation module, and the complete detection model with both the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module. Through detection accuracy index and visualization analysis of detection results, verify the effect of the synergistic effect of the directional frequency enhancement aggregation module and the adaptive directional gradient guided self-attention module on improving the detection performance of cotton leaf disease targets.

2. The cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism according to claim 1, characterized in that, The directional frequency enhancement aggregation module includes multi-scale directional feature extraction, directional weight generation, and feature fusion processes. For input feature X, directional response features are extracted using different directional filter kernels: wherein, denotes a horizontal direction gradient response, denotes a vertical direction gradient response, and denotes a horizontal and vertical direction filter kernel, respectively; Further utilize the oblique direction filter kernel to obtain the oblique gradient response: wherein, denotes a horizontal direction gradient response, denotes a vertical direction gradient response, and denotes a horizontal and vertical direction filter kernel, respectively; Simultaneously, the response to local structural changes is obtained through Laplace filtering: wherein denotes the curvature variation response, L denotes a Laplacian filter kernel.

3. The cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism according to claim 2, characterized in that, The directional frequency description generation process further includes local texture change calculation and directional frequency weight generation; First, calculate the local mean of the input feature X: Calculate the local mean of the squared input features: Local texture variation features are obtained based on local statistical information: By fusing the directional response features and local texture change features, a six-dimensional directional frequency description feature is obtained: Where F represents the directional frequency description feature; Input the directional frequency description feature into the weight generation unit: Based on the weights, fusion weights corresponding to branches at different scales are generated, and multi-scale directional features are weighted and fused.

4. The cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism according to claim 1, characterized in that, The adaptive directional gradient guided self-attention module includes directional gradient prior generation, directional structure evaluation, and attention feature reconstruction processes. First, the input features are calculated in the direction gradient to obtain the gradient amplitude and direction information: where M represents a gradient magnitude, denotes a direction angle, and denote horizontal and vertical gradient responses, respectively; According to the direction angle Construct soft direction description features and compute direction distribution entropy: wherein denotes the directional response corresponding to the i-th directional interval; The direction structure confidence is obtained according to the direction entropy: Wherein, C represents the direction structure confidence; Further, the spatial position saliency score is obtained by combining the gradient amplitude, direction confidence and direction expectation information: Wherein, T represents the spatial position saliency score, and R represents the direction expectation information.

5. The cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism according to claim 4, characterized in that, The attention feature reconstruction process includes attention feature generation, saliency sorting, feature rearrangement and double-branch attention fusion process; After mapping the input features, two groups of query features, two groups of key features and one group of value features are obtained: wherein: and denote two sets of query features; and denote two sets of key features; V denotes a value feature; Meanwhile, according to the directional confidence boost value feature: wherein: represents the value characteristic after the directional structure enhancement; According to the spatial position saliency score T, a sorting index is generated: wherein: represents a position index arranged in order of significance from high to low; Using the index, the features in the subsequent attention calculation are rearranged: wherein: represents an operation of rearranging the spatial positions according to the index I, represents a value feature after saliency sorting; The rearranged features are input into the double-branch attention calculation: First branch: Second branch: wherein: , respectively represent the attention matrices corresponding to the two attention branches; , represent the output features of the two branches. Input fusion gating function: Wherein: G represents the dynamic fusion weight of the two attention branches, and the fused features are finally obtained: wherein, denotes the attention fusion weight, and Z denotes the fused enhanced feature.

6. The cotton leaf disease detection method based on directional frequency enhancement and adaptive attention mechanism according to claim 1, characterized in that, In the S3, the training parameters are set as follows: the training round is 200 rounds, the batch size is 8, the input image size is 640*640, and the optimizer adopts AdamW.