A method and system for real-time wheat ear detection based on UAV edge computing
By using the drone edge computing and air-frequency joint detection model WH-Det, the problems of cloud latency and complex environment in drone wheat ear detection are solved, realizing real-time, high-precision wheat ear detection and yield estimation on drones.
Patent Information
- Application Number
- CN202611294585.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-10
AI Technical Summary
Existing drone-based wheat detection technologies suffer from issues such as cloud processing delays, insufficient detection accuracy in complex field environments, large model parameters, and slow inference speeds, making it difficult to achieve high-precision, real-time wheat detection on drone-borne equipment.
A real-time wheat ear detection method based on UAV edge computing is adopted. The WH-Det spatial-frequency joint detection model is used to detect wheat canopy images in the field in real time. The model is combined with a cross-image space deduplication strategy for counting and yield estimation. The model includes a directional Laplacian Gaussian extraction module, a strip-guided attention fusion module, and an environment-robust frequency domain module.
It enables real-time and accurate wheat ear detection on UAV-borne equipment, reduces data transmission delay, adapts to complex farmland environments, and provides an efficient means of wheat yield prediction.
Smart Images

Figure CN123071872A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wheat ear detection technology, and in particular to a real-time wheat ear detection method and system based on UAV edge computing. Background Technology
[0002] Wheat is one of the most important food crops in the world, and the stability of its yield is directly related to food security. Wheat ear detection is the core link in wheat yield prediction and spatial distribution monitoring. By accurately counting the number of wheat ears per unit area and combining it with variety characteristics (such as thousand-grain weight), the final yield can be effectively estimated. Traditional wheat ear surveys mainly rely on manual field counting, which has the following significant drawbacks: (1) it is time-consuming and labor-intensive, and it is difficult to cover large-scale farmland; (2) the results are greatly affected by the experience of the surveyors, the sampling range and subjective judgment, and the repeatability is poor; (3) it is impossible to achieve continuous and dynamic monitoring of the growth period.
[0003] In recent years, crop phenotypic detection methods based on UAV low-altitude remote sensing and deep learning have gradually emerged. UAVs equipped with high-resolution RGB cameras can quickly acquire canopy images of large areas of wheat fields, and then automatically identify and count wheat ears using target detection algorithms. However, existing technical solutions still face the following key bottlenecks: (1) Delay problem of cloud processing mode. Existing solutions mostly adopt the workflow of "UAV data collection → ground station / cloud transmission → offline processing", which has high data transmission delay and cannot meet the real-time detection requirements. In addition, farmland environment is often located in remote areas with unstable network conditions, making cloud processing solutions unreliable.
[0004] (2) Insufficient detection accuracy in complex field environments. Wheat ears are slender and tend to droop and cross when mature; adjacent wheat ears are severely stuck together under high-density planting; wheat ears are highly similar in color and texture to leaves, stems, and soil background; in addition, factors such as changes in lighting, motion blur, and differences in shooting angle during UAV flight further exacerbate the detection difficulty. Existing lightweight detectors based on pure CNN (such as the YOLO series) are effective in simple scenarios, but are prone to missed detections and false detections in complex field environments; although Transformer-based detectors have stronger global context modeling capabilities, they have high computational overhead and are difficult to run in real time on resource-constrained edge devices.
[0005] (3) Current high-precision detection models often have large parameter scales and slow inference speeds, making them unsuitable for deployment on embedded GPU platforms on UAVs; while lightweight models, although having fast inference speeds, lack robustness and detection accuracy in complex field environments. How to achieve high precision, high robustness, and real-time inference simultaneously with minimal parameters and computational overhead is the core contradiction currently facing the technology.
[0006] Therefore, there is an urgent need to provide a method and system for real-time wheat ear detection based on UAV edge computing, which can run in real time on UAV-borne edge devices and has high robustness to complex field environments. Summary of the Invention
[0007] The purpose of this invention is to provide a method and system for real-time wheat ear detection based on UAV edge computing, so as to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, this invention provides a real-time wheat ear detection method based on UAV edge computing, comprising the following steps: S1. Use drones to collect low-altitude remote sensing images of the target wheat field at preset flight altitude and flight path to obtain wheat canopy images in the field. S2. The collected wheat canopy images in the field are transmitted in real time to the UAV-borne edge computing device, and the wheat canopy images in the field are scaled to a fixed size and normalized. S3. Real-time edge detection is performed on the processed wheat canopy image in the field using the pre-set air-frequency joint detection model WH-Det deployed on the UAV's airborne edge computing device, and the detection results of the wheat ear target are output. S4. Based on the detection results, a cross-image space deduplication strategy is introduced to remove duplicate detections between different images. The wheat ears are counted and the yield per mu is estimated based on the deduplicated wheat ear results. S5. Transmit the detection results, counting results, and yield per mu results to the ground station.
[0009] Preferably, the space-frequency joint detection model WH-Det includes: The directional Laplacian Gaussian extraction module is used to extract shallow features from wheat canopy images in the field. The strip-guided attention fusion module is used to adaptively fuse shallow features across scales through dynamic weighting guided by strip context, resulting in fused features. The environmental robust frequency domain module is used to perform frequency domain denoising and feature enhancement on the fused features to obtain enhanced features. The output module is used to output the predicted bounding box of the wheat target based on the enhanced features, including the detection number, bounding box center coordinates, bounding box width and height, and confidence score.
[0010] Preferably, the directional Laplacian Gaussian extraction module extracts shallow features from wheat canopy images in the field, including: For the input wheat canopy image in the field, initial feature mapping is performed using a 7×7 convolution to obtain the basic features. ; An isotropic LoG branch is introduced, and a Laplacian Gaussian filter with fixed parameters is used to extract the fundamental feature isotropic edge response. This highlights the abrupt change in grayscale between the outline of the wheat ears and the background. Four fixed-directional LoG depthwise separable convolutional filters are constructed to extract the basic feature structure response from the horizontal, vertical, main diagonal, and anti-diagonal directions. ; Basic feature orientation weights are generated through global average pooling and two 1×1 convolutions. The contribution of each branch is dynamically adjusted based on the current image content. Based on directional weights, the basic feature structure response in each direction is... Weighted fusion yields structural response fusion features. ; Basic features Edge response and structural response fusion features Perform residual fusion to obtain residual fusion features. ; Residual fusion characteristics Grouped convolution and depthwise separable convolution are used to achieve two downsampling operations to obtain shallow features.
[0011] Preferably, the strip-guided attention fusion module performs multi-scale feature encoding and cross-scale fusion based on shallow features, including: Based on shallow features, the HG-Stage module is used to downsample and generate a multi-scale feature pyramid. For two feature maps from different scales and Channel alignment is achieved through convolution, mapping to a unified channel dimension. : ,in, , Both indicate channel alignment operations; After channel alignment, the features are fused and the local representations are reconstructed using depthwise separable convolutions to obtain the fused features. ; Fusion features Apply the baseline stripe count along both the row and column directions. and Adaptive average pooling to extract strip context The strip context is then concatenated to obtain the strip context features. ,in, Indicates the direction of the line. Indicates column direction; Features at the current scale Generate query Q In the context of stripes Generate key Sum Calculate the strips to guide attention: And based on the strip-guided attention, the enhanced features are reconstructed: ; Based on enhanced features Weight maps are generated using depthwise separable convolutions and sigmoid functions. The final fused features are obtained based on the weight graph. ,in, This represents the Sigmoid function. Indicates element-wise multiplication. Represents the ReLU function. This represents the joint weighted graph of spatial channels. This represents the final fused feature of the output.
[0012] Preferably, the environment-robust frequency domain module performs frequency domain denoising and feature enhancement on the fused features, including: Convolutional layers are used to process input features Channel expansion to To obtain extended features ; For extended features Perform a two-dimensional real-valued FFT and take the mean along the spatial dimension to obtain the spectral description vector. Channel-level gating weights are generated using a lightweight MLP and Sigmoid algorithm. , This is used to adaptively adjust the frequency domain response of each channel, where... This represents the Sigmoid function. For two-dimensional real-valued Fourier transform, This indicates that the mean of the Fourier transform result is taken; Extended features Divide the image into p×p non-overlapping local image blocks, and perform a two-dimensional FFT on each block to obtain local frequency domain features. Using learnable local frequency domain filters With gate weights Forming a sample adaptive filter Filter each local block: ,in, Indicates element-wise multiplication; An autocorrelation power spectrum enhancement mechanism is introduced to enhance local features using power spectrum residuals and spatial autocorrelation responses: ; ; ; in, , For learnable scaling parameters, This represents the complex conjugate operation. Indicates the inverse Fourier transform. The autocorrelation response representing the spatial domain, Represents the power spectrum. This represents the spatial characteristics recovered after frequency domain enhancement; After restoring spatial feature maps for all image patches, feature selection is performed using depthwise separable convolution and gated feedforward to obtain the final enhanced features. The formula is: ; ; In the formula, This indicates output projection convolution. This represents the feature map of the channel dimension after equal division. This represents the spatial characteristics recovered after frequency domain enhancement. This represents an array that is divided equally along the channel dimension.
[0013] Preferably, the output module employs a Transformer decoder and uses an IoU-aware query selection mechanism to enhance the final features. Multi-layer decoder iterations are performed to obtain the predicted bounding box of the wheat target. The format of the predicted bounding box is as follows: ,in, For the test number, ( () represents the coordinates of the bounding box center. The bounding box width and height, This represents the confidence score.
[0014] Preferably, step S4 specifically includes: The detection results are filtered using a preset confidence threshold, and non-maximum suppression is performed on single-frame images. For each image, based on the UAV's RTK-GPS coordinates at the time of capture, flight altitude H, and camera intrinsic parameters, the center pixel coordinates of each wheat ear detection box are determined. Mapped to geospatial coordinates; The geographic coordinates of all detection boxes in all images are aggregated to construct a KD-Tree spatial index, with spatial proximity thresholds used. Perform a radius lookup and select locations with a spatial distance less than [specified value]. The detection bounding boxes are assigned to the candidate matching group; For each candidate matching group, if the detection boxes in the group come from the same image, all of them are retained; if they come from different images, the one with the highest confidence is used, or the confidence-weighted average of the geographic coordinates is taken, and a unique wheat ear record is output. The final count is performed using the set of wheat ear records after deduplication. A thermal distribution map of wheat ear density is generated based on the geographical coordinates after deduplication. The yield per mu is estimated by combining the thousand-grain weight parameter of the variety and the number of ears per mu-yield regression model.
[0015] This invention also provides a real-time wheat ear detection system based on UAV edge computing, comprising: The low-altitude remote sensing image acquisition module is used to acquire low-altitude remote sensing images of the target wheat field using a drone at a preset flight altitude and flight path, obtain wheat canopy images in the field, and transmit the wheat canopy images in the field to the edge image preprocessing module. The edge image preprocessing module is used to scale wheat canopy images in the field to a fixed size and perform normalization processing; The edge image detection module is used to perform real-time edge detection on the processed wheat canopy image in the field according to the pre-deployed space-frequency joint detection model WH-Det, and obtain the detection result of the wheat ear target; The wheat ear detection and yield estimation module is used to remove duplicate detections between different images by adopting a cross-image space deduplication strategy based on the detection results, and to count and estimate the yield per acre based on the deduplicated wheat ear results. The transmission module is used to transmit the detection results, counting results, and yield per acre results to the ground station.
[0016] Therefore, the present invention employs the above-mentioned method and system for real-time wheat ear detection based on UAV edge computing, which has the following beneficial effects: (1) Through real-time inference of the edge-end air-frequency joint detection model WH-Det, data processing is not required in the cloud or ground station, realizing true airborne end-to-end real-time detection, reducing data transmission delay, and enabling data to be generated quickly in remote farmland without network coverage.
[0017] (2) The model carried by this invention can cope with complex environments such as changes in lighting, motion blur and background noise, and can ensure the accuracy of algorithm recognition. Moreover, it does not rely on external parameters such as drone altitude and camera focal length. It can complete the detection and counting of wheat ears through the image itself, which has a wider range of applications and provides an efficient and convenient technical means for wheat yield prediction.
[0018] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of a real-time wheat ear detection method based on UAV edge computing according to an embodiment of the present invention; Figure 2 This is a comparative schematic diagram of the thermal distribution diagram of the present invention. Detailed Implementation
[0020] The technical solution of the present invention will be further described below with reference to the accompanying drawings and embodiments.
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0022] Example like Figure 1 As shown, this invention provides a real-time wheat ear detection method based on UAV edge computing, comprising the following steps: S1. Using a drone, acquire low-altitude remote sensing images of the target wheat field at a preset flight altitude and flight path to obtain wheat canopy images. Specifically, using an RGB camera mounted on the drone, acquire low-altitude remote sensing images of the target wheat field at a preset flight altitude H (3-15 meters) and a serpentine flight path to obtain a sequence of RGB image sequences of the wheat canopy. The flight path overlap rate should be no less than 70%, the lateral overlap rate no less than 60%, and the resolution of each image should be no less than 1920×1080 pixels.
[0023] S2. The collected wheat canopy images in the field are transmitted in real time to the UAV's onboard edge computing device. The wheat canopy images in the field are scaled to a fixed size and normalized. Specifically, the wheat canopy images in the field are scaled to 640×640 pixels.
[0024] S3. Real-time edge detection is performed on the processed wheat canopy image in the field using the pre-set air-frequency joint detection model WH-Det deployed on the UAV's airborne edge computing device, and the detection results of the wheat ear target are output.
[0025] The space-frequency joint detection model WH-Det includes: The directional Laplacian Gaussian extraction module is used to extract shallow features from wheat canopy images in the field. The specific process includes: Input field wheat canopy images Initial feature mapping is performed using 7×7 convolution to expand the receptive field of the front end and obtain basic features. .
[0026] Introducing an isotropic LoG branch, a fixed-parameter Laplacian Gaussian filter is used to extract the fundamental isotropic edge response features: Highlighting the abrupt change in grayscale between the wheat ear outline and the background, among which, For Gaussian filtering, use the parameter-determined isotropic Laplacian operator. Represents the ReLU activation function. This indicates batch normalization.
[0027] Four fixed-directional LoG depthwise separable convolutional filters are constructed to extract the basic feature structure response from the horizontal (0°), vertical (90°), main diagonal (45°), and anti-diagonal (135°) directions. , is represented as: ,in, Indicates the first A fixed directional LoG depth convolution filter is used to describe the local extended texture of the wheat ears under different postures.
[0028] To adaptively select effective orientations based on the input image, basic feature orientation weights are generated through global average pooling and two 1×1 convolutions. The contribution of each directional branch is dynamically adjusted based on the current image content. The directional weight expression is as follows: , ,in, , This represents a learnable mapping function. This represents the gated function.
[0029] Based on directional weights, the basic feature structure response in each direction is... Weighted fusion yields structural response fusion features. The expression is: .
[0030] Basic features Edge response and structural response fusion features Perform residual fusion to obtain residual fusion features. The expression is: ,in, This is a learnable directional scaling factor.
[0031] Residual fusion characteristics Two downsampling operations are performed using grouped convolutions and depthwise separable convolutions with a stride of 2, reducing the spatial resolution to 160×160 and completing shallow feature extraction.
[0032] The strip-guided attention fusion module is used to adaptively fuse shallow features across scales through dynamic weighting guided by strip context, resulting in fused features. Specifically, it includes: Based on shallow features, a multi-scale feature pyramid is generated by downsampling using the HG-Stage module. HG-Stage is a core component module in the backbone network HGNetV2. The SGAF module is used to perform cross-scale feature fusion on the multi-scale feature pyramid, as follows: For two feature maps from different scales and Channel alignment is achieved through convolution, mapping to a unified channel dimension. : ,in, , Both indicate channel alignment operations.
[0033] After channel alignment, the features are fused and the local representations are reconstructed using depthwise separable convolutions to obtain the fused features. ; Fusion features Apply the baseline stripe count along both the row and column directions. and Adaptive average pooling to extract strip context The strip context is then concatenated to obtain the strip context features. , , ,in, Indicates the direction of the line. Indicates column direction, This represents the batch size, the number of C channels, and n represents the number of context markers.
[0034] Features at the current scale Generate query Q In the context of stripes Generate key Sum Calculate the strips to guide attention: And reconstruct enhanced features based on strip-guided attention. The expression is: .
[0035] Based on enhanced features Weight maps are generated using depthwise separable convolutions and sigmoid functions. The final fused features are obtained based on the weight graph. ,in, This represents the Sigmoid function. Indicates element-wise multiplication. Represents the ReLU function. This represents the joint weighted graph of spatial channels. This represents the final fused feature of the output.
[0036] This module adopts a two-way path of top-down and bottom-up. Each level of SGAF is fused sequentially: P5→P4, P4→P3, P3→P2, and then fused in reverse to achieve full interaction of multi-scale features.
[0037] The environmental robust frequency domain module is used to perform frequency domain denoising and feature enhancement on the fused features to obtain enhanced features, specifically including: Convolutional layers are used to process input features Channel expansion to To obtain extended features ; For extended features Perform a two-dimensional real-valued FFT and take the mean along the spatial dimension to obtain the spectral description vector. Channel-level gating weights are generated using a lightweight MLP and Sigmoid algorithm. , This is used to adaptively adjust the frequency domain response of each channel, where... This represents the Sigmoid function. For two-dimensional real-valued Fourier transform, This indicates that the mean of the Fourier transform result is taken; Extended features Divide the image into p×p non-overlapping local image blocks, and perform a two-dimensional FFT on each block to obtain local frequency domain features. Using learnable local frequency domain filters With gate weights Forming a sample adaptive filter Filter each local block: ,in, Indicates element-wise multiplication; An autocorrelation power spectrum enhancement mechanism is introduced to enhance local features using power spectrum residuals and spatial autocorrelation responses: ; ; ; in, , For learnable scaling parameters, This represents the complex conjugate operation. Indicates the inverse Fourier transform. The autocorrelation response representing the spatial domain, Represents the power spectrum. This represents the spatial characteristics recovered after frequency domain enhancement; After restoring spatial feature maps for all image patches, feature selection is performed using depthwise separable convolution and gated feedforward to obtain the final enhanced features. The formula is: ; ; In the formula, This indicates output projection convolution. This represents the feature map of the channel dimension after equal division. Represents the spatial characteristics recovered after frequency domain enhancement. This represents an array that is divided equally along the channel dimension.
[0038] The output module is used to output the predicted bounding box of the wheat target based on the enhanced features, including the detection number, bounding box center coordinates, bounding box width and height, and confidence score.
[0039] Specifically, the output module uses a Transformer decoder and employs an IoU-aware query selection mechanism to enhance the final features. Multi-layer decoder iterations are performed to obtain the predicted bounding box of the wheat target. The format of the predicted bounding box is as follows: ,in, For the test number, ( () represents the coordinates of the bounding box center. The bounding box width and height, This represents the confidence score.
[0040] S4. Based on the detection results, a cross-image space deduplication strategy is introduced to remove duplicate detections between different images. The count of wheat ears is then performed based on the deduplicated results to estimate the yield per acre. Specifically, this includes: The detection results are filtered with a confidence threshold of 0.5, and non-maximum suppression is performed on single-frame images to remove duplicate detection boxes within the same image.
[0041] For each image, based on the UAV's RTK-GPS coordinates at the time of capture, flight altitude H, and camera intrinsic parameters, the center pixel coordinates of each wheat ear detection box are determined. Mapping to geospatial coordinates The expression is: ; ; In the formula, Indicates the longitude of the image. Indicates the image dimension. Represents the pixel x-coordinate, Represents the pixel y-coordinate. Indicates the straight-line distance from the aircraft to the target. Indicates the camera's focal length.
[0042] The geographic coordinates of all detection boxes in all images are aggregated to construct a KD-Tree spatial index, with spatial proximity thresholds used. Perform a radius lookup and select locations with a spatial distance less than [specified value]. The detection bounding boxes are assigned to the candidate matching group, where, =3 cm, approximately 1.0-1.5 times the typical diameter of a wheat ear.
[0043] For each candidate matching group, if the detection boxes in the group come from the same image, all of them are retained; if they come from different images, the one with the highest confidence is used, or the confidence-weighted average of the geographic coordinates is taken, and a unique wheat ear record is output.
[0044] The final count is performed using the deduplicated set of wheat ear records. A heat map of wheat ear density is generated based on the deduplicated geographical coordinates. The yield per mu (unit of land area) is then estimated using the variety's thousand-grain weight parameter and a regression model of ears per mu versus yield. The expression for the estimated yield per mu is: Estimated yield per mu = Number of ears tested after weight reduction × Average number of grains per ear × 1000 grains weight (g) / 1000 / Sampling area (mu).
[0045] In this step, the cross-image spatial deduplication algorithm has a computational complexity of O(NlogN), which can be executed efficiently on edge devices. The spatial threshold is set based on the physical size of the wheat ears, avoiding dependence on image resolution and overlap rate parameters. Only cross-image duplicate detections are merged, and different adjacent wheat ears in the same image will not be mistakenly merged, resulting in higher accuracy.
[0046] S5 transmits structured data such as wheat ear detection results, counting results, and yield per mu to the ground station via a 4G / 5G or WiFi wireless communication module.
[0047] This invention also provides a real-time wheat ear detection system based on UAV edge computing, comprising: The low-altitude remote sensing image acquisition module is used to acquire low-altitude remote sensing images of the target wheat field using a drone at a preset flight altitude and flight path, obtain wheat canopy images in the field, and transmit the wheat canopy images in the field to the edge image preprocessing module. The edge image preprocessing module is used to scale wheat canopy images in the field to a fixed size and perform normalization processing; The edge image detection module is used to perform real-time edge detection on the processed wheat canopy image in the field according to the pre-deployed space-frequency joint detection model WH-Det, and obtain the detection result of the wheat ear target; The wheat ear detection and yield estimation module is used to remove duplicate detections between different images by adopting a cross-image space deduplication strategy based on the detection results, and to count and estimate the yield per acre based on the deduplicated wheat ear results. The transmission module is used to transmit the detection results, counting results, and yield per acre results to the ground station.
[0048] To verify the detection performance of WH-Det, it was compared with various mainstream methods using the SPIKE dataset. The comparison results are shown in Table 1. Experimental results show that WH-Det consistently demonstrates superior detection performance: compared with the latest end-to-end detector DEIMv2-N, its mAP@0.5 metric is improved by 2.91%, the mAP@0.5:0.95 metric is improved by 1.35%, and the recall rate is significantly improved by 4.09%. In terms of model complexity and inference efficiency, WH-Det maintains an extremely lightweight architecture design while significantly improving detection accuracy, requiring only 3.65 million parameters and a computational cost of 7.2 GFLOPs. Although its frame rate (FPS) is slightly lower than the YOLO model, which prioritizes speed, WH-Det achieves a significant improvement in accuracy with only a negligible speed loss; furthermore, its overall computational cost remains extremely low, fully demonstrating that this model is very suitable for wheat ear detection tasks.
[0049] Table 1. Comparison of results from different mainstream methods on the SPIKE dataset.
[0050] To gain a deeper understanding of the limitations of the WH-Det model in feature representation under extreme field scenarios, Grad-CAM was used for heat map visualization and comparison, such as... Figure 2 As shown, the high-response regions of YOLOv12n are often scattered across leaf margins, stem textures, and high-frequency background structures, highlighting its sensitivity to background clutter. While the activation regions of DEIM-N and DEIMv2-N are more concentrated, attention leakage and response overlap still exist in dense areas, leading to blurred boundaries between adjacent targets. In contrast, the heatmap of WH-Det precisely locates the main structure, edge contours, and spines of the wheat ear, with almost no activation in background leaves or shaded areas. These visualization results demonstrate that WH-Det can actively suppress complex background interference while rigorously focusing on key target regions, effectively capturing recognition features, and achieving high-precision spatial localization.
[0051] Therefore, the present invention adopts the above-mentioned method and system for real-time wheat ear detection based on UAV edge computing. Through real-time inference of the edge-end air-frequency joint detection model WH-Det, data processing is not required in the cloud or on the ground, realizing true airborne end-to-end real-time detection, reducing data transmission delay, and can quickly generate data in remote farmland without network coverage. At the same time, it can cope with complex environments such as changes in lighting, motion blur and background noise, and has high recognition accuracy.
[0052] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.
Claims
1. A method for real-time detection of wheat ears based on UAV edge computing, characterized in that, Includes the following steps: S1. Use drones to collect low-altitude remote sensing images of the target wheat field at preset flight altitude and flight path to obtain wheat canopy images in the field. S2. The collected wheat canopy images in the field are transmitted in real time to the UAV-borne edge computing device, and the wheat canopy images in the field are scaled to a fixed size and normalized. S3. Real-time edge detection is performed on the processed wheat canopy image in the field using the pre-set air-frequency joint detection model WH-Det deployed on the UAV's airborne edge computing device, and the detection results of the wheat ear target are output. S4. Based on the detection results, a cross-image space deduplication strategy is introduced to remove duplicate detections between different images. The wheat ears are counted and the yield per mu is estimated based on the deduplicated wheat ear results. S5. Transmit the detection results, counting results, and yield per mu results to the ground station.
2. The method for real-time wheat ear detection based on UAV edge computing according to claim 1, characterized in that: The space-frequency joint detection model WH-Det includes: The directional Laplacian Gaussian extraction module is used to extract shallow features from wheat canopy images in the field. The strip-guided attention fusion module is used to adaptively fuse shallow features across scales through dynamic weighting guided by strip context, resulting in fused features. The environmental robust frequency domain module is used to perform frequency domain denoising and feature enhancement on the fused features to obtain enhanced features. The output module is used to output the predicted bounding box of the wheat target based on the enhanced features, including the detection number, bounding box center coordinates, bounding box width and height, and confidence score.
3. The method for real-time wheat ear detection based on UAV edge computing according to claim 2, characterized in that, The directional Laplacian Gaussian extraction module extracts shallow features from wheat canopy images in the field, including: For the input wheat canopy image in the field, initial feature mapping is performed using a 7×7 convolution to obtain the basic features. ; An isotropic LoG branch is introduced, and a Laplacian Gaussian filter with fixed parameters is used to extract the fundamental feature isotropic edge response. This highlights the abrupt change in grayscale between the outline of the wheat ears and the background. Four fixed-directional LoG depthwise separable convolutional filters are constructed to extract the basic feature structure response from the horizontal, vertical, main diagonal, and anti-diagonal directions. ; Basic feature orientation weights are generated through global average pooling and two 1×1 convolutions. The contribution of each branch is dynamically adjusted based on the current image content. Based on directional weights, the basic feature structure response in each direction is... Weighted fusion yields structural response fusion features. ; Basic features Edge response and structural response fusion features Perform residual fusion to obtain residual fusion features. ; Residual fusion characteristics Grouped convolution and depthwise separable convolution are used to achieve two downsampling operations to obtain shallow features.
4. The method for real-time wheat ear detection based on UAV edge computing according to claim 2, characterized in that, The strip-guided attention fusion module performs multi-scale feature encoding and cross-scale fusion based on shallow features, including: Based on shallow features, the HG-Stage module is used to downsample and generate a multi-scale feature pyramid. For two feature maps from different scales and Channel alignment is achieved through convolution, mapping to a unified channel dimension. : ,in, , Both indicate channel alignment operations; After channel alignment, the features are fused and the local representations are reconstructed using depthwise separable convolutions to obtain the fused features. ; Fusion features Apply the baseline stripe count along both the row and column directions. and Adaptive average pooling to extract strip context The strip context is then concatenated to obtain the strip context features. ,in, Indicates the direction of the line. Indicates column direction; Features at the current scale Generate query Q In the context of stripes Generate key Sum Calculate the strips to guide attention: And based on the strip-guided attention, the enhanced features are reconstructed: ; Based on enhanced features Weight maps are generated using depthwise separable convolutions and sigmoid functions. The final fused features are obtained based on the weight graph. ,in, This represents the Sigmoid function. Indicates element-wise multiplication. Represents the ReLU function. This represents the joint weighted graph of spatial channels. This represents the final fused feature of the output.
5. The method for real-time wheat ear detection based on UAV edge computing according to claim 4, characterized in that: The environment robust frequency domain module performs frequency domain denoising and feature enhancement on the fused features, including: Convolutional layers are used to process input features Channel expansion to To obtain extended features ; For extended features Perform a two-dimensional real-valued FFT and take the mean along the spatial dimension to obtain the spectral description vector. Channel-level gating weights are generated using a lightweight MLP and Sigmoid algorithm. , This is used to adaptively adjust the frequency domain response of each channel, where... This represents the Sigmoid function. For two-dimensional real-valued Fourier transform, This indicates that the mean of the Fourier transform result is taken; Extended features Divide the image into p×p non-overlapping local image blocks, and perform a two-dimensional FFT on each block to obtain local frequency domain features. Using learnable local frequency domain filters With gate weights Forming a sample adaptive filter Filter each local block: ,in, Indicates element-wise multiplication; An autocorrelation power spectrum enhancement mechanism is introduced to enhance local features using power spectrum residuals and spatial autocorrelation responses: ; ; ; in, , For learnable scaling parameters, This represents the complex conjugate operation. Indicates the inverse Fourier transform. The autocorrelation response representing the spatial domain, Represents the power spectrum. This represents the spatial characteristics recovered after frequency domain enhancement; After restoring spatial feature maps for all image patches, feature selection is performed using depthwise separable convolution and gated feedforward to obtain the final enhanced features. The formula is: ; ; In the formula, This indicates output projection convolution. This represents the feature map of the channel dimension after equal division. This represents the spatial characteristics recovered after frequency domain enhancement. This represents an array that is divided equally along the channel dimension.
6. The method for real-time wheat ear detection based on UAV edge computing according to claim 5, characterized in that: The output module employs a Transformer decoder and uses an IoU-aware query selection mechanism to enhance the final features. Multi-layer decoder iterations are performed to obtain the predicted bounding box of the wheat target. The format of the predicted bounding box is as follows: ,in, For the test number, ( () represents the coordinates of the bounding box center. The bounding box width and height, This represents the confidence score.
7. The method for real-time wheat ear detection based on UAV edge computing according to claim 6, characterized in that, Step S4 specifically includes: The detection results are filtered using a preset confidence threshold, and non-maximum suppression is performed on single-frame images. For each image, based on the UAV's RTK-GPS coordinates at the time of capture, flight altitude H, and camera intrinsic parameters, the center pixel coordinates of each wheat ear detection box are determined. Mapped to geospatial coordinates; The geographic coordinates of all detection boxes in all images are aggregated to construct a KD-Tree spatial index, with spatial proximity thresholds used. Perform a radius lookup and select locations with a spatial distance less than [specified value]. The detection bounding boxes are assigned to the candidate matching group; For each candidate matching group, if the detection boxes in the group come from the same image, all of them are retained; if they come from different images, the one with the highest confidence is used, or the confidence-weighted average of the geographic coordinates is taken, and a unique wheat ear record is output. The final count is performed using the set of wheat ear records after deduplication. A thermal distribution map of wheat ear density is generated based on the geographical coordinates after deduplication. The yield per mu is estimated by combining the thousand-grain weight parameter of the variety and the number of ears per mu-yield regression model.
8. A real-time wheat ear detection system based on UAV edge computing, comprising executing the real-time wheat ear detection method based on UAV edge computing as described in any one of claims 1-7, characterized in that, include: The low-altitude remote sensing image acquisition module is used to acquire low-altitude remote sensing images of the target wheat field using a drone at a preset flight altitude and flight path, obtain wheat canopy images in the field, and transmit the wheat canopy images in the field to the edge image preprocessing module. The edge image preprocessing module is used to scale wheat canopy images in the field to a fixed size and perform normalization processing; The edge image detection module is used to perform real-time edge detection on the processed wheat canopy image in the field according to the pre-deployed space-frequency joint detection model WH-Det, and obtain the detection result of the wheat ear target; The wheat ear detection and yield estimation module is used to remove duplicate detections between different images by adopting a cross-image space deduplication strategy based on the detection results, and to count and estimate the yield per acre based on the deduplicated wheat ear results. The transmission module is used to transmit the detection results, counting results, and yield per acre results to the ground station.
