A target detection method based on frequency domain-boltzmann cooperation
Patent Information
- Application Number
- CN202611037170.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-13
- Publication Date
- 2026-10-27
AI Technical Summary
[0009]发明目的:为了解决现有农作物病虫害目标检测方法在复杂田间场景下存在的小目标特征易丢失、大核计算冗余、边界结构信息利用不充分以及遮挡区域细节恢复能力较弱等问题,本发明提出了一种基于频域-玻尔兹曼协同的目标检测方法,通过重新设计骨干网络的频域扩展与稀疏感知范式、特征交互的先验能量引导场,以及跨尺度融合的一致性门控结构,以实现在保证轻量化与实时性的前提下,大幅提高复杂茶园背景下的病虫害检测精度
[0042]1、本发明在浅中层引入多级解耦的WTConv小波卷积,在不增加空间分辨率运算负担的前提下,利用频域分解捕获病虫害高频边缘;在高层创新性地提出了基于Boltzmann稀疏选择的ESConv模块,网络能够根据当前目标的尺度,自适应地“开启”5×5、9×9或15×15的最优卷积分支,从而在获取超大感受野的同时,将无效分支的计算量清零,极大提升了模型推理的实时性。
Smart Images

Figure CN122990165A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the interdisciplinary field of computer vision, artificial intelligence and smart agriculture, and specifically relates to a target detection method based on frequency domain-Boltzmann collaboration, which is applied to the target detection of crop diseases and pests. Background Technology
[0002] As a globally important economic crop, tea's yield and quality directly impact agricultural economic benefits and tea farmers' income. However, during its growth cycle, tea is highly susceptible to various pests and diseases. Traditional monitoring of tea pests and diseases relies mainly on manual field inspections by plant protection experts or tea farmers. This method is not only time-consuming, labor-intensive, subjective, and inefficient, but also prone to missed or false detections, often leading to missed opportunities for optimal control. This can result in large-scale outbreaks of pests and diseases, pesticide overuse, and disruption of the ecological balance.
[0003] In recent years, with the rapid development of computer vision and deep learning technologies, object detection algorithms based on convolutional neural networks and Transformer architectures have been widely applied in the field of smart agriculture. While single-stage detectors, represented by the YOLO series, are fast, their reliance on post-processing steps such as non-maximum suppression makes them prone to missed detections due to bounding box fusion in scenarios with dense pests and diseases. End-to-end Transformer detectors, represented by DETR, eliminate non-maximum suppression, but suffer from slow convergence and high computational complexity. RT-DETR, by introducing an efficient hybrid encoder and an IOU-aware query selection mechanism, successfully achieves a balance between real-time performance and high accuracy.
[0004] However, when existing RT-DETR models are directly applied to real-world tea pest and disease detection scenarios, the following serious limitations and technical bottlenecks are exposed:
[0005] First, backbone networks suffer from low feature extraction efficiency and limited scale perception capabilities in complex backgrounds. Tea garden backgrounds contain numerous interwoven branches and leaves, light spots, and soil; the high-frequency textures of these disturbances are extremely similar to tiny pests and diseases. When extracting multi-scale features, traditional backbone networks, if using large convolutional kernels, introduce quadratically increasing redundant computations, causing the model to lose real-time performance; if small convolutional kernels are used, they cannot acquire sufficient receptive fields to perceive the global context of large-area lesions.
[0006] Second, the global interaction in the feature encoding stage lacks physical prior guidance. RT-DETR's AIFI (Attention-Based Intra-Scale Feature Interaction) module performs self-attention computation on all tokens indiscriminately. In the tea garden scenario, pests and diseases often occupy only a very small part of the image (even less than 1%), and a large amount of computational resources are wasted on useless background tea leaves and soil. Moreover, when faced with pests partially obscured by leaves, conventional attention mechanisms are prone to losing key local details.
[0007] Third, the cross-scale fusion stage disrupts the physical structural continuity of the occluded target. The native CCFF (Cross-Scale Feature Fusion) module fuses high- and low-level features through simple concatenation or addition operations. When the target is largely occluded, the low-level network extracts broken physical fragments, while the high-level network extracts abstract semantics. This brute-force concatenation leads to distortion of the target structure, and the network cannot distinguish between real and fake occluded areas, thus outputting incomplete bounding boxes.
[0008] In summary, there is an urgent need to propose an improved detection model for tea pests and diseases in natural settings to address challenges such as large-core computational redundancy, loss of occluded features, and the submersion of small targets. Summary of the Invention
[0009] Purpose of the invention: To address the problems of existing crop pest and disease target detection methods in complex field scenarios, such as easy loss of small target features, redundancy of large kernel computation, insufficient utilization of boundary structure information, and weak ability to recover details in occluded areas, this invention proposes a target detection method based on frequency domain-Boltzmann collaboration. By redesigning the frequency domain extension and sparse perception paradigm of the backbone network, the prior energy guiding field of feature interaction, and the consistency gating structure of cross-scale fusion, this invention aims to significantly improve the detection accuracy of pests and diseases in complex tea garden backgrounds while ensuring lightweight and real-time performance.
[0010] Technical solution: This invention discloses a target detection method based on frequency domain-Boltzmann collaboration, comprising:
[0011] Collect datasets and perform annotation, data augmentation, and dataset partitioning to construct training, validation, and test sets;
[0012] The target detection model FB-RTDETR is constructed with the following structure:
[0013] The backbone network uses the WES-LS module to construct a multi-scale feature extraction layer. The WES-LS module deploys WTConv modules in the shallow and middle layers to lightly expand the receptive field, and uses the energy-sparse convolution block ESConv module as an energy-sparse selective large kernel-small kernel collaborative sensing unit in the high layer.
[0014] The OECS-AIFI module is used to replace the global interactive component AIFI module in the feature encoding stage. At the same time, edge prior and occlusion context awareness mechanism are introduced, and sparse weights are generated by combining Boltzmann distribution.
[0015] The SOCR-CCFF module is constructed as a cross-scale feature fusion module, and fracture features are adaptively repaired through a consistency gating mechanism.
[0016] The FB-RTDETR object detection model is trained end-to-end using a dataset to obtain the optimal object detection model. The image to be detected is input into the trained model, and the model outputs the object category, bounding box coordinates, and confidence score.
[0017] Furthermore, the data augmentation includes random image flipping, random rotation, random cropping, random scaling, and color perturbation, and also employs a combination of Mosaic enhancement and MixUp enhancement strategies; wherein Mosaic enhancement enriches the background and increases the relative number of small objects by stitching together multiple images, while MixUp enhancement smooths category boundaries by linearly interpolating and mixing different images and their labels.
[0018] Furthermore, the processing procedure of the WTConv module is as follows:
[0019] The input features are fed into a multi-level decoupled architecture that includes one spatial domain processing branch and three cascaded frequency domain processing branches:
[0020] The first branch directly performs ordinary convolution on the input features to preserve high-resolution local spatial features; the second branch performs a first-level wavelet transform on the input features, decomposing them into a first low-frequency component and a first high-frequency component, and performs convolution on the decomposed features to extract first-level frequency domain features; the third branch receives the first low-frequency component output from the second branch as input, performs a second-level wavelet transform on it, further decomposing it into a second low-frequency component and a second high-frequency component, and performs convolution on the decomposed features to extract second-level frequency domain features; the fourth branch receives the second low-frequency component output from the third branch as input, performs a third-level wavelet transform on it, and performs convolution to extract the deepest third-level frequency domain features within the maximum receptive field.
[0021] Then, a bottom-up, stepwise alternating restoration and reconstruction mechanism is adopted:
[0022] The third-level frequency domain features are restored by the first inverse wavelet transform and then added element-wise with the second-level frequency domain features to obtain the first-level reconstructed features. The first-level reconstructed features are restored upward by the second inverse wavelet transform and then added element-wise with the first-level frequency domain features to obtain the second-level reconstructed features. The second-level reconstructed features are restored to the original spatial resolution by the third inverse wavelet transform and then added element-wise with the local spatial domain features to output the multi-scale frequency domain enhanced features.
[0023] Furthermore, the processing procedure of the ESConv module is as follows: the input high-level features are input in parallel into large kernel convolution branches with multiple kernel sizes to obtain multi-scale candidate features. ;
[0024] Global average pooling is introduced as the energy evaluation function g(·) to calculate the local energy response of each scale branch. Based on the local energy response, sparse weights are calculated and assigned to each branch using the Boltzmann distribution. The specific mathematical formula for calculating the sparse weights of each branch using the Boltzmann distribution is as follows:
[0025] ;
[0026] A Top-k truncation mechanism is introduced to force the weights of weaker branches with poor responses to be reduced to zero, generating a sparse weight mask, as shown in the following formula: ,in, The threshold for sparse weights;
[0027] The candidate features Its corresponding sparse weight mask and sparse weights Element-wise multiplication and weighted summation are performed, and finally, channel aggregation is completed through a 3×3 convolutional layer to output global high-level features.
[0028] Furthermore, the specific structure of the OECS-AIFI module is as follows:
[0029] First, multivariate prior responses are constructed for features at different levels: the mid-to-low-level features S3 of the backbone network are extracted, and the scale is aligned through convolution and adaptive pooling to extract edge prior response terms. ;
[0030] The mid-to-high-level features S4 of the backbone network are extracted and then aligned to the scale using strip pooling and adaptive pooling. This allows for the extraction of occlusion context response items;
[0031] Simultaneously, the highest-level feature S5 of the backbone network is reduced in dimensionality through convolution and used as the semantic response term ƒ( );
[0032] The three-layer response terms obtained from the above processing are fused, and the joint score of the three is used to construct a new energy field, as shown in the following formula:
[0033]
[0034] in, , The prior is normalized to Min-Max to eliminate the influence of dimensions;
[0035] Then use the Boltzmann formula to Convert to interaction probability A hard threshold is set to filter background tokens. During multi-head self-attention computation, the similarity calculation of the Q and K matrices only occurs when... The process is performed on a sparse subset of key tokens that exceed the threshold, followed by... The output is multiplied into matrix V.
[0036] Furthermore, the target detection model of the FB-RTDETR includes two SOCR-CCFF modules. The input of the first SOCR-CCFF module is the output feature of the OECS-AIFI module and the mid-to-high-level features S4 of the backbone network. The input of the second SOCR-CCFF module is the output feature of the first SOCR-CCFF module and the low-level features S3 of the backbone network. The output feature of the second SOCR-CCFF module is used as the first output feature. After being fused with the output feature of the first SOCR-CCFF module, it becomes the second output feature. The second output feature is then fused with the output feature of the OECS-AIFI module to become the third output feature. The first, second, and third output features are then input to the decoder for detection.
[0037] Furthermore, the SOCR-CCFF module consists of three parts: a semantic context path, a structural repair path, and a spatial consistency gating fusion branch; the features input to the SOCR-CCFF module are set as high-level features. Low-level features ;
[0038] In the semantic context path, high-level features and low-level features are concatenated and then subjected to convolutional activation processing to generate semantic features that represent conventional fusion information. ;
[0039] In the structural repair path, the input high-level features are upsampled to align the dimensions, and then fed together with the low-level features into a channel mean pooling layer to compress the spatial dimensions. Channel mean pooling is then used to extract... and Given the grayscale topology, calculate the absolute difference matrix between the two, and generate the structural fracture mapping C=|Mean( )-Mean( Mapping high-level and low-level features to the generated structural fractures. Figure 3 The data is stitched together along the channel dimension and then processed by convolutional activation to generate structural features that emphasize the reconstruction of occluded regions. ;
[0040] In the consistency-gated fusion branch, after concatenating high-level features, low-level features, and structural fracture maps, a spatial consistency-gated mask G with values ranging from 0 to 1 is generated through convolution and the Sigmoid activation function. Using the spatial consistency-gated mask G, the semantic features and structural features are adaptively weighted and summed using soft routing, and finally, cross-scale fusion features are output.
[0041] Beneficial effects:
[0042] 1. This invention introduces multi-level decoupled WTConv wavelet convolution in the shallow and middle layers, capturing high-frequency edges of pests and diseases through frequency domain decomposition without increasing the computational burden of spatial resolution; in the high layer, it innovatively proposes an ESConv module based on Boltzmann sparse selection, which can adaptively "open" the optimal convolutional branches of 5×5, 9×9 or 15×15 according to the scale of the current target, thereby obtaining a huge receptive field while clearing the computational cost of invalid branches, greatly improving the real-time performance of model inference.
[0043] 2. This invention reshapes the allocation logic of the attention mechanism, greatly improving the detection rate of small and hidden targets: Traditional AIFI blindly calculates attention across the entire image. The OECS-AIFI module constructed in this invention cleverly "borrows" high-frequency edge priors from shallow layers, "borrows" long-range occlusion priors from strip pooling, and generates sparse masks using Boltzmann energy fields. The forced attention matrix interacts only between key tokens containing insect bodies and lesions, completely preventing small target features from being overwhelmed by massive background green leaf information.
[0044] 3. This invention proposes a structure repair mechanism based on consistency gating. The proposed SOCR-CCFF module accurately locates the "physical fracture zone (structural conflict zone)" across scales through channel mean absolute difference and designs independent structure repair paths and gating masks. The network can adaptively rely on efficient semantic paths in normal regions and activate repair paths to fill in missing features in occluded fracture regions, outputting highly complete and robust detection bounding boxes. Attached Figure Description
[0045] Figure 1This is a schematic diagram of the overall architecture and method flow of the FB-RTDETR model of the present invention;
[0046] Figure 2 This is a schematic diagram of the internal structure of WTConv in the WES-LS backbone module of the present invention;
[0047] Figure 3 This is a schematic diagram of the internal structure of ESConv in the WES-LS backbone module of the present invention;
[0048] Figure 4 This is a schematic diagram of the multivariate prior response extraction and sparse mask generation structure in the OECS-AIFI module of the present invention;
[0049] Figure 5 This is a schematic diagram of the structural repair path and consistency gating fusion mechanism in the SOCR-CCFF module of the present invention;
[0050] Figure 6 This is a diagram showing the training results of the FB-RTDETR model of this invention. Detailed Implementation
[0051] This invention proposes a target detection method based on frequency domain-Boltzmann collaboration. This embodiment applies this method to the detection of tea pests and diseases. The entire detection system relies on a deep learning framework (such as PyTorch), and its core includes an innovative end-to-end detection network called FB-RTDETR. The specific implementation steps are as follows:
[0052] Step 1: Data Preparation and Preprocessing
[0053] 1. Image Acquisition and Construction of the TEA-leaf-disease-dataset
[0054] Tea garden scenes in natural environments are extremely complex. This example uses the TEA-leaf-disease-dataset. This dataset contains rich real-world tea garden scenes, covering different lighting conditions (strong sunlight on sunny days, diffuse reflection on cloudy days, and backlighting in the early morning) and different shooting angles. The labeled categories cover major tea pests and diseases, such as the tea green leafhopper, tea geometrid moth, tea anthracnose, and tea leaf blight. The data is labeled with bounding boxes in COCO format.
[0055] 2 Hybrid Data Augmentation Strategy
[0056] To address the issues of highly imbalanced distribution (long-tailed distribution) of some categories in the dataset and a large range of target scales (coexistence of large lesions and extremely small insects), this embodiment employs a carefully designed joint data augmentation pipeline during the training phase:
[0057] Basic geometric and optical transformations: Random horizontal / vertical flipping, random rotation (±15 degrees), random scaling, and random perturbation of brightness, contrast, and saturation in the HSV color space are performed on the input image with a set probability to simulate sensor noise and drastic changes in illumination, thereby enhancing basic robustness.
[0058] Mosaic enhancement strategy: Randomly select four images from the training set, randomly scale and crop them, and then stitch them together to form a new synthetic image. This operation reduces the absolute physical size of pests and diseases in the image without increasing the input size, greatly enriching the sample quantity of small targets and forcing the model to learn more fine-grained features.
[0059] MixUp Enhancement Strategy: Weight Parameters Generated Using a Beta Distribution This involves pixel-level linear interpolation to blend two different images and their labels. , In tea disease detection, the boundaries of many early lesions are extremely blurred with those of healthy leaves. MixUp effectively improves the model's ability to classify and generalize about blurred lesion edges by softening the label boundaries.
[0060] The processed dataset is divided into training, validation, and test sets in a ratio of approximately 8:1:1.
[0061] Step 2: Construction of the FB-RTDETR detection model
[0062] The FB-RTDETR model is based on the native RT-DETR model at a macro level. See [link / reference]. Figure 1 It comprises a multi-scale feature extraction backbone network, a hybrid encoder, and a decoder. The core innovation of this invention lies in the disruptive reconstruction of the backbone network, the encoder's global interaction layer, and the cross-scale fusion layer.
[0063] 1. Backbone Network Reconstruction: The implementation of the WES-LS module replaces the BasicBlock in the native RT-DETR, as detailed below:
[0064] Traditional backbone networks (such as ResNet and CSPDarknet) rely solely on spatial convolution when processing tea garden images. The WES-LS module proposed in this invention deploys WTConv modules in the shallow and mid-layers (i.e., high-resolution stages) of the network, and ESConv modules in the deep layers.
[0065] The specific operational mechanism of WTConv (wavelet frequency domain decoupled convolution):
[0066] Subtle textures such as the antennae of pests and diseases, and the halos around lesions, represent high-frequency abrupt changes in an image. WTConv introduces Haar Discrete Wavelet Transform (DWT) to decouple features while performing lossless downsampling. Let the input feature be X, and the number of channels be C.
[0067] First branch: Spatial domain direct pass-through branch. Performs a regular 3×3 convolution, preserving the original high-resolution spatial local response.
[0068] The second branch (first-level frequency domain): Perform a first-level 2D Haar wavelet transform on X, decomposing it into one low-frequency approximation component (LL) and three high-frequency detail components (LH, HL, HH). At this point, the spatial resolution is halved, and the number of channels becomes 4C. Features are then extracted by depthwise separable convolution.
[0069] The third branch (secondary frequency domain): DWT is performed again on the low-frequency component (LL) generated by the second branch to enter the frequency domain space of a deeper level and macroscopic receptive field, and then extracted by convolution.
[0070] Fourth branch (third-level frequency domain): Perform a third DWT on the low-frequency components of the third branch to extract the most abstract global frequency domain response under a very large receptive field, and then perform convolution calculation.
[0071] Stepwise reconstruction: To restore the original resolution, inverse wavelet transform (IWT) is employed. The features of the fourth branch are upsampled using IWT and added to the features of the third branch; the result is then upsampled again using IWT and added to the features of the second branch; finally, after a third IWT upsampled process, it is added to the spatial features of the first branch. This process injects incredibly rich multi-scale high-frequency boundary information into the network with extremely low FLOPs.
[0072] The specific computational mechanism of the ESconv module (energy sparse large kernel collaborative module):
[0073] At the highest layer of the backbone network, a very large receptive field is needed to capture the complete morphology of large-area leaf blight. However, applying large kernel convolutions globally is impractical.
[0074] Input features Parallel inputs into three large-kernel depthwise separable convolution branches of 5×5, 9×9, and 15×15 yield candidate feature sets {F5, F9, F15}.
[0075] Global average pooling (GAP) is introduced to compress the spatial dimension to 1×1. Then, a multilayer perceptron (MLP) is used as the energy function g(·) to calculate the "energy requirement" of the current image content for these three scale branches. .
[0076] The energy is mapped to probability weights using the Boltzmann distribution. :
[0077]
[0078] in This represents the annealing temperature coefficient. Subsequently, to avoid redundant computational consumption, a Top-k (K=1) truncation mechanism is introduced to forcibly reduce the weights of weaker branches with negligible responses to zero, generating a binary sparse weight mask. :
[0079]
[0080] in, The threshold for the top-k sparse weights among all candidate branch weights (K=1 in this embodiment, which is the maximum weight value). During the feature fusion stage, the network integrates multi-scale candidate features. Its corresponding sparse weight mask and probability weights Perform element-wise multiplication and weighted summation (i.e., only for the mask) High-energy branches are used for feature activation. Unselected branches ( The computation is skipped directly during the inference phase. Finally, channel aggregation is completed through a 3×3 dynamic small kernel layer. This design enables the model to achieve intelligent perception of "allocating computing power as needed according to the target size".
[0081] 2. Hybrid Encoder Interaction Layer: Implementation of the OECS-AIFI Module
[0082] The original AIFI only performs self-attention interaction on the highest layer features, which causes the tiny tea aphids to lose features at low resolution, and the attention is diluted by the massive background.
[0083] The present invention, OECS-AIFI, introduces multidimensional prior physics:
[0084] Edge prior extraction: Mid-to-low-level features S3 rich in fine-grained information are extracted from the backbone network. After scale alignment via convolutional pooling, strong high-frequency contours are extracted using convolutional kernels equivalent to the Sobel operator to obtain edge prior terms. : ,in, This is a learnable weight matrix used for feature dimension alignment and linear transformation.
[0085] Occlusion context prior extraction: Mid-to-high-level features S4 are extracted, and strip pooling is introduced. Strip pooling uses 1×N and N×1 elongated pooling kernels, specifically designed to capture the long-range continuity of slender insect bodies (such as the tea geometrid moth) longitudinally or laterally severed by leaves, thus obtaining the occlusion prior. .
[0086] Energy field fusion and sparsification: The semantic term ƒ is obtained by dimensionality reduction of the highest-level features. Integrating these three elements to construct a new energy field:
[0087]
[0088] in , Normalized to [0,1] using Min-Max. Then converted to interaction probabilities using the Boltzmann formula. :
[0089]
[0090] Set a hard threshold to filter background tokens. During multi-head self-attention (MSA) computation, the similarity calculation of the Q and K matrices is performed only on the sparse subset of key tokens whose Pi is higher than the threshold, and then Pi is multiplied into the output of the V matrix. This step not only reduces the complexity from O( The linearity of the model further enables it to "keep a close eye" on the exposed edges of the target even under severe occlusion.
[0091] 3. Cross-scale fusion layer: Implementation of the SOCR-CCFF module
[0092] Traditional top-down fusion can lead to feature alignment misalignment due to direct splicing. SOCR-CCFF aims to repair structural breaks caused by occlusion. In this embodiment, two SOCR-CCFF modules are set up. The input of the first SOCR-CCFF module is the output feature of the OECS-AIFI module and the mid-to-high-level features S4 of the backbone network. The input of the second SOCR-CCFF module is the output feature of the first SOCR-CCFF module and the low-level features S3 of the backbone network. The output feature of the second SOCR-CCFF module is used as the first output feature. After being fused with the output feature of the first SOCR-CCFF module, it becomes the second output feature. The second output feature is then fused with the output feature of the OECS-AIFI module to become the third output feature. The first, second, and third output features are then input to the decoder for detection.
[0093] The input is set as high-level semantic features. (After upsampling) and low-level detail features .
[0094] Structural fracture mapping extraction: and By applying Channel Mean Pooling, the channel dimension is compressed to 1, extracting the pure spatial grayscale topological representation Mean( ) and Mean( ) Calculate the absolute difference matrix to generate the fracture mapping map:
[0095] C = |Mean( )-Mean( )|
[0096] The larger the value in matrix C, the more intense the conflict between high-level abstract semantics and low-level physical fragments at that coordinate (i.e., a typical occlusion edge).
[0097] Dual-path parallel computing:
[0098] Semantic path: This handles the normal blending of unobstructed areas.
[0099] Structural repair path: Combine high and low layer features with fracture mapping map C, which provides spatial cues.
[0100]
[0101] This forces the convolution kernel to perform feature completion and reconstruction on the broken regions based on the location cues provided by C.
[0102] Spatial consistency gating fusion:
[0103] Generate gate mask: G = Sigmoid(Conv(Concat( , , C))).
[0104] Final soft router output: .
[0105] When a region experiences severe occlusion, G approaches 1, and the model automatically adopts... The repair results; in flat and healthy leaf areas, G approaches 0, and the model employs efficient... .
[0106] Step 3: Model Training and Inference
[0107] 1. Training Phase
[0108] The FB-RTDETR was trained end-to-end using the constructed TEA-leaf-disease-dataset.
[0109] Matching and Loss Calculation: Label assignment is performed using the Hungarian Algorithm based on bipartite graph matching within a one-to-one framework. The loss function consists of three parts: Varifocal Loss for classification, L1 Loss for bounding box regression, and GIoU Loss.
[0110] Optimizer and Hyperparameters: The AdamW optimizer was selected to prevent overfitting. The initial learning rate was set to 1×10⁻⁶. -4 The backbone network learning rate is set to 1×10⁻⁶. -5 A cosine annealing learning rate decay strategy was employed. The batch size was set to 16 or 32, and the total number of training epochs was set to 300. The Boltzmann temperature of ESConv was monitored during the initial training phase. A higher value is used to encourage the network to explore all branches, and then the network is gradually annealed to a low temperature to make the weights sparse and converge.
[0111] 2. Reasoning and Deployment
[0112] After training is complete, extract the model weights with the highest accuracy on the validation set.
[0113] The video stream or image of the tea garden to be detected is input into the FB-RTDETR model. Since the DETR architecture naturally removes NMS post-processing, after the model's forward propagation is completed, it directly outputs a set number of query results through the multilayer perceptron (MLP) and linear layer of the detection head. Each result includes: the predicted category and its confidence score, the normalized center point coordinates, and the bounding box information such as width and height.
[0114] The background is filtered based on a set confidence threshold (e.g., 0.5), and the location boxes and categories of tea pests and diseases are finally overlaid and rendered on the original image, providing a high-precision decision-making basis for drone spraying or tea garden management systems.
[0115] See Figure 6 In this embodiment, the model begins to converge around the 15th round, and by the 23rd round, the validation loss and accuracy have completely stabilized. This is a typical model learning and convergence process.
[0116] Accuracy: Validation accuracy stabilized at approximately 82% (0.82) after 15 rounds. Training accuracy steadily increased throughout all 23 rounds, reaching approximately 92% (0.92) in round 23.
[0117] Loss: The validation loss stabilized at around 0.64 after 15 rounds. The training loss steadily decreased, reaching around 0.29 by 23 rounds.
[0118] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A target detection method based on frequency domain-Boltzmann collaboration, characterized in that, include: Collect datasets and perform annotation, data augmentation, and dataset partitioning to construct training, validation, and test sets; The target detection model FB-RTDETR is constructed with the following structure: The backbone network uses the WES-LS module to construct a multi-scale feature extraction layer. The WES-LS module deploys WTConv modules in the shallow and middle layers to lightly expand the receptive field, and uses the energy-sparse convolution block ESConv module as an energy-sparse selective large kernel-small kernel collaborative sensing unit in the high layer. The OECS-AIFI module is used to replace the global interactive component AIFI module in the feature encoding stage. At the same time, edge prior and occlusion context awareness mechanism are introduced, and sparse weights are generated by combining Boltzmann distribution. The SOCR-CCFF module is constructed as a cross-scale feature fusion module, and fracture features are adaptively repaired through a consistency gating mechanism. The FB-RTDETR object detection model is trained end-to-end using a dataset to obtain the optimal object detection model. The image to be detected is input into the trained model, and the model outputs the object category, bounding box coordinates, and confidence score.
2. The target detection method based on frequency domain-Boltzmann coordination according to claim 1, characterized in that, The data augmentation includes random image flipping, random rotation, random cropping, random scaling, and color perturbation, and also employs a combination of Mosaic augmentation and MixUp augmentation strategies. Mosaic augmentation enriches the background and increases the relative number of small objects by stitching together multiple images, while MixUp augmentation smooths category boundaries by linearly interpolating different images and their labels.
3. The target detection method based on frequency domain-Boltzmann coordination according to claim 1, characterized in that, The processing procedure of the WTConv module is as follows: The input features are fed into a multi-level decoupled architecture that includes one spatial domain processing branch and three cascaded frequency domain processing branches: The first branch directly performs ordinary convolution calculation on the input features to preserve high-resolution local features in the spatial domain; the second branch performs a first-level wavelet transform on the input features, decomposing them into a first low-frequency component and a first high-frequency component, and performs convolution calculation on the decomposed features to extract the first-level frequency domain features. The third branch receives the first low-frequency component output from the second branch as input, performs a second-level wavelet transform on it, further decomposes it into a second low-frequency component and a second high-frequency component, and performs convolution calculation on the decomposed features to extract the second-level frequency domain features. The fourth branch receives the second low-frequency component output from the third branch as input, performs a third-level wavelet transform on it, and performs convolution calculation to extract the deepest third-level frequency domain features under the maximum receptive field. Then, a bottom-up, stepwise alternating restoration and reconstruction mechanism is adopted: The third-level frequency domain features are restored by the first inverse wavelet transform and then added element-wise with the second-level frequency domain features to obtain the first-level reconstructed features. The first-level reconstructed features are restored upward by the second inverse wavelet transform and then added element-wise with the first-level frequency domain features to obtain the second-level reconstructed features. The second-level reconstructed features are restored to the original spatial resolution by the third inverse wavelet transform and then added element-wise with the local spatial domain features to output the multi-scale frequency domain enhanced features.
4. The target detection method based on frequency domain-Boltzmann coordination according to claim 1, characterized in that, The ESConv module processes the input high-level features in parallel into large-kernel convolution branches with multiple kernel sizes to obtain multi-scale candidate receptive fields. ; Global average pooling is introduced as the energy evaluation function g(·) to calculate the local energy response of each scale branch. Based on the local energy response, sparse weights are calculated and assigned to each branch using the Boltzmann distribution. The specific mathematical formula for calculating the sparse weights of each branch using the Boltzmann distribution is as follows: ; in Let be the annealing temperature coefficient; a Top-k truncation mechanism is introduced to force the weights of weaker branches with poor responses to be zero, generating a sparse weight mask, as shown in the following formula: ,in, The threshold for sparse weights; The activated high-energy branches are weighted and summed, and finally the channels are aggregated through a 3×3 dynamic small kernel layer to output global high-level features.
5. The target detection method based on frequency domain-Boltzmann coordination according to claim 1, characterized in that, The specific structure of the OECS-AIFI module is as follows: First, multivariate prior responses are constructed for features at different levels: the mid-to-low-level features S3 of the backbone network are extracted, and the scale is aligned through convolution and adaptive pooling to extract edge prior response terms. ; The mid-to-high-level features S4 of the backbone network are extracted and then aligned to the scale using strip pooling and adaptive pooling. This allows for the extraction of occlusion context response items; Simultaneously, the highest-level feature S5 of the backbone network is reduced in dimensionality through convolution and used as the semantic response term ƒ( ); The three-layer response terms obtained from the above processing are fused, and the joint score of the three is used to construct a new energy field, as shown in the following formula: ; in, , The prior is normalized to Min-Max to eliminate the influence of dimensions. and These represent the hyperparameter weight coefficients of the edge prior and the occlusion context prior, respectively; Then use the Boltzmann formula to Convert to interaction probability A hard threshold is set to filter background tokens. During multi-head self-attention computation, the similarity calculation of the Q and K matrices only occurs when... The process is performed on a sparse subset of key tokens that exceed the threshold, followed by... The output is multiplied into matrix V.
6. The target detection method based on frequency domain-Boltzmann coordination according to claim 1, characterized in that, The target detection model of the FB-RTDETR includes two SOCR-CCFF modules. The input of the first SOCR-CCFF module is the output feature of the OECS-AIFI module and the mid-to-high-level features S4 of the backbone network. The input of the second SOCR-CCFF module is the output feature of the first SOCR-CCFF module and the low-level features S3 of the backbone network. The output feature of the second SOCR-CCFF module is used as the first output feature. After being fused with the output feature of the first SOCR-CCFF module, it becomes the second output feature. The second output feature is then fused with the output feature of the OECS-AIFI module to become the third output feature. The first, second, and third output features are then input to the decoder for detection.
7. A target detection method based on frequency domain-Boltzmann coordination according to claim 1 or 6, characterized in that, The SOCR-CCFF module consists of three parts: a semantic context path, a structural repair path, and a spatial consistency-gated fusion branch; the features input to the SOCR-CCFF module are defined as high-level features. Low-level features ; In the semantic context path, high-level features and low-level features are concatenated and then subjected to convolutional activation processing to generate semantic features that represent conventional fusion information. ; In the structural repair path, the input high-level features are upsampled to align the dimensions, and then fed together with the low-level features into a channel mean pooling layer to compress the spatial dimensions. Channel mean pooling is then used to extract... and Given the grayscale topology, calculate the absolute difference matrix between the two, and generate the structural fracture mapping C=|Mean( )-Mean( The high-level features, low-level features, and the generated structural fracture map are concatenated along the channel dimension and then processed by convolutional activation to generate structural features that emphasize the reconstruction of occluded regions. ; In the consistency-gated fusion branch, after concatenating high-level features, low-level features, and structural fracture maps, a spatial consistency-gated mask G with values ranging from 0 to 1 is generated through convolution and the Sigmoid activation function. Using the spatial consistency-gated mask G, the semantic features and structural features are adaptively weighted and summed using soft routing, and finally, cross-scale fusion features are output.