Lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection method

By introducing the fast convolution module FCL, enhanced attention module EMA and small-scale detection head in the Yolov10 model, the drone remote sensing wheat ear detection algorithm is optimized, which solves the problems of low detection accuracy and slow speed, and realizes the unmanned Real-time, high-precision wheat ear detection on machine hardware.

CN119418212AInactive Publication Date: 2025-02-11ANHUI UNIV

Patent Information

Application Number
CN202510013147.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-06
Publication Date
2025-02-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing drone remote sensing wheat ear detection algorithm has insufficient calculation accuracy and reliability, and is difficult to deploy on drone hardware, and has low detection accuracy under natural field conditions.

Method used

A lightweight Yolov10 model is proposed. By building a fast convolution module FCL and an enhanced attention module EMA, the model is optimized to adapt to the drone hardware equipment, and a small-scale detection head is added to improve the detection accuracy of small target wheat ears.

Benefits of technology

Real-time wheat ear detection deployed on drone hardware is realized, which significantly improves the detection accuracy of small target wheat ears and solves the problems of low detection accuracy and slow speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418212A_ABST
    Figure CN119418212A_ABST
Patent Text Reader

Abstract

The invention relates to an agricultural unmanned aerial vehicle remote sensing image processing technology, compared with the prior art, a lightweight network architecture is adopted, real-time detection can be conveniently achieved on unmanned aerial vehicle hardware equipment, and meanwhile, the detection precision of small target wheat ears shot by an unmanned aerial vehicle is remarkably improved by introducing a small-scale detection head and a multi-head attention mechanism. The method comprises the following steps: processing a lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection data set; constructing a lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection model; training a lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection model; and verifying the lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection model. The invention provides a reliable technical framework for wheat ear detection and wheat yield estimation by using the unmanned aerial vehicle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of agricultural unmanned aerial vehicle remote sensing image processing, and in particular to a lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection method. Background Art

[0002] As one of the three major food crops in the world, wheat leads the world in both production and consumption in my country, providing the main food source for nearly half of the domestic population. Fast and accurate wheat ear detection plays an important role in monitoring wheat growth, yield estimation and intelligent field management. UAV remote sensing has been widely used in agricultural production due to its real-time data transmission capability and high mobility. Using UAV remote sensing images to obtain real-time wheat ear detection results is a research hotspot in the field of smart agriculture at this stage. However, the computational accuracy and reliability of existing deep learning-based image detection algorithms are usually based on a large number of network parameters and training processes. Due to the limitations of computing resources and storage capacity of UAV equipment, such algorithms are difficult to deploy on UAV hardware. Therefore, using lightweight detection algorithms to efficiently and accurately obtain real-time wheat ear detection results is the key to the application of UAV remote sensing technology in real-world farmland wheat ear detection.

[0003] With the rapid development of artificial intelligence technology, target detection algorithms based on deep learning have become the main means of wheat ear detection at this stage. Among them, two-stage target detection algorithms can achieve higher detection accuracy, but they have problems such as large model size and long detection time, so it is difficult to deploy them in drone environments with limited performance; single-stage target detection algorithm Yolo series models are very suitable for deployment in embedded systems because they can perform positioning and classification at the same time, thereby improving detection speed.

[0004] The core idea of ​​the Yolo algorithm is to transform the target detection problem into a single regression problem, and directly predict the location and category of the target in the image through a convolutional neural network. With the continuous development of the Yolo series of algorithms, each version has been optimized and improved in terms of network structure, loss function, anchor frame adjustment, and resolution, which significantly improves the speed and accuracy of target detection. Among them, the consistent dual allocation strategy proposed by Yolov10 avoids the need for non-maximum suppression to eliminate repeated anchor frames during the reasoning process, greatly reduces the post-processing time, and achieves the fastest reasoning speed in models with similar detection accuracy.

[0005] However, due to the limitations of drone endurance, power consumption, and performance, how to strike a balance between detection speed and memory consumption remains a very challenging task. In addition, the complex background of images taken by drones under natural field conditions and the different sizes of wheat ears have a significant impact on the detection accuracy of the algorithm. To solve these problems, this paper optimizes the Yolov10 model to make it lightweight to meet the deployment requirements of drone hardware equipment. At the same time, by introducing a multi-head attention mechanism and adding detection heads, the model's detection accuracy for small target wheat ears is effectively improved. This optimized model provides a reliable technical framework for wheat ear detection and wheat yield estimation. Summary of the invention

[0006] This paper aims to solve the problems of low detection accuracy and slow speed of the existing UAV remote sensing wheat ear detection algorithm, and proposes a lightweight small target detection model of Yolov10. The model adopts a lightweight network architecture, which is easy to deploy on UAV hardware equipment to achieve real-time detection. At the same time, by introducing a small-scale detection head and a multi-head attention mechanism, the detection accuracy of small target wheat ears taken by UAVs is significantly improved.

[0007] In order to achieve the above object, the technical solution of the present invention is as follows:

[0008] A lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps:

[0009] 11) Dataset processing of lightweight Yolov10 drone remote sensing wheat ear real-time detection: Collect wheat field images taken by drones, load high-definition digital cameras onto octorotor drone platforms, set flight altitudes of 20m, 50m, and 150m, and side swing angles of 30, 60, and 90 degrees to take images of wheat in the heading and maturity stages respectively; perform preprocessing of orthorectification, non-overlap cropping, image Gaussian smoothing, and data color mean square error transformation enhancement on the acquired wheat field images, crop them into RGB images of size 640×640, and use annotation and marking tools to annotate the images, where the wheat ear part is interactively marked by delineating a bounding box including all pixels of the wheat ear; finally generate a YOLO format dataset, where each image corresponds to a txt text file to record the wheat ear bounding box information; manually select and exclude images without wheat ears, and construct a total of 8,000 YOLO datasets, which are randomly divided into training set, validation set, and test set in a ratio of 6:2:2.

[0010] 12) Construct a lightweight Yolov10 model for real-time detection of wheat ears in drone remote sensing: Use the lightweight convolution module GhostConv to build a fast convolution module FCL; build a small-scale detection layer in the head of the Yolov10 network to detect small target wheat ears in drone images; and build an enhanced attention module EMA in the main part of Yolov10 to enhance the ability to separate the target and background.

[0011] 13) Training of lightweight Yolov10 drone remote sensing wheat ear real-time detection model: taking the training set image as input, calculating the error between the predicted box and the true box as the loss, the loss calculation includes positioning loss and confidence loss; continuously optimizing and updating the model parameters, iterating the training for 200 times, and saving the model parameters with the best performance for drone wheat ear detection result verification.

[0012] 14) Verification of lightweight Yolov10 UAV remote sensing wheat ear real-time detection model: Obtain the wheat field image taken by the drone to be processed, perform orthorectification, non-overlapping cropping, image Gaussian smoothing, and data color mean square error transformation enhancement preprocessing, and then input it into the trained lightweight Yolov10 wheat ear real-time detection model to finally obtain the wheat ear marking results.

[0013] The dataset processing of the lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps:

[0014] 21) Collect images of wheat fields taken by drones. A high-definition digital camera was mounted on an octorotor drone platform to take images of wheat at the heading and maturity stages at flight altitudes of 20m, 50m and 150m and side swing angles of 30, 60 and 90 degrees;

[0015] 22) The acquired wheat field images were preprocessed by orthorectification, non-overlap cropping, image Gaussian smoothing, and data color mean square error transformation enhancement, and then cropped into RGB images of size 640×640. The images were annotated using the annotation tool Lambelme, where the wheat ears were interactively labeled by defining a bounding box including all pixels of the wheat ears.

[0016] 23) Finally, a YOLO format dataset is generated. Each image corresponds to a txt text file, which records the wheat ear bounding box information;

[0017] 24) Images without wheat ears were manually selected and excluded to construct a total of 8,000 YOLO datasets, which were randomly divided into training set, validation set, and test set in a ratio of 6:2:2.

[0018] The construction of the lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps:

[0019] 31) Construct the fast convolution module FCL, FCL is the abbreviation of the fast convolution module Fast Conv Lan:

[0020] 311) Use GhostConv to construct a lightweight feature extractor: the extractor includes three convolutional layers, namely, a convolutional layer with a convolution kernel of 3, a stride of 1, and a padding of 1, and two 1x1 convolutional layers;

[0021] 312) The features obtained by the three convolutional layers are concatenated together in the channel dimension to generate a feature map with the same number of channels as the standard convolutional layer;

[0022] 313) Perform a convolution operation with a convolution kernel of 3, a batch normalization operation and a SiLU activation function;

[0023] 314) Use the lightweight feature extractor obtained in the above steps to build a fast convolution module FCL. The input data of FCL is the output feature map of the original image after passing through the feature extraction convolution layer CBS of the Yolov10 network twice. CBS contains two convolution layers with a convolution kernel size of 3, a stride of 1, and a padding of 1, a batch normalization layer, and a SiLU activation function.

[0024] 315) FCL divides the input feature map by channel, and the lightweight feature extractor obtains the features of the first part of the data, and splices the features obtained from the first part with the second part of the data by channel;

[0025] 316) A total of five FCL modules were constructed and loaded into the trunk and neck of the optimized model to efficiently extract features of drone-photographed images;

[0026] 32) Construct a small-scale detection layer and add it to the head position of the Yolov10 network. Expand the original three different-scale detection heads (20×20, 40×40, 80×80) of the Yolov10 model head to four-scale feature detection (20×20, 40×40, 80×80, 160×160). By adding a small-scale detection head (160×160), it is beneficial to the detection of small target wheat ears in the images taken by drones.

[0027] 321) The output features of the second FCL module at the neck position of the Yolov10 network are upsampled once and concatenated with the output features of the first FCL module at the head position of the Yolov10 network. After that, they are passed through a C2fCIB feature extraction module of the Yolov10 network to form a small target detection layer, named the fourth detection head.

[0028] 33) Build an enhanced attention module EMA in the backbone of the Yolov10 network. EMA is the abbreviation of Enhanced Multi-Attention.

[0029] 331) The input data of the EMA module is the output two-dimensional feature map of the multi-scale information fusion pooling module SPPF in the Yolov10 network, and the output of the EMA module is an enhanced feature map with the same shape as the input; the EMA module includes four feature extraction convolutional layers CBS of the Yolov10 network and a multi-head self-attention module;

[0030] 332) Construct a multi-head self-attention module, which flattens the input two-dimensional feature image data into a one-dimensional vector, splits the vector into three vectors of query Q, key K and value V, and generates h groups of Q (Q0.....Qh-1) vectors, h groups of K (K0.....Kh-1) vectors and h groups of V (V0.....Vh-1) vectors through linear transformation;

[0031] 333) Each set of query, key and value corresponds to one attention head, with a total of h attention heads, and each attention head corresponds to a different linear transformation parameter;

[0032] 334) For each attention head, a scaled dot product attention operation is performed; specifically, the dot product of the query and the key is calculated, and the attention score is obtained after a scaling operation. The softmax function is used to convert the attention score into a probability distribution, so that the correlation between different feature points is converted into a normalized weight; the attention score is calculated using the following expression:

[0033] ,

[0034] in is the multi-head attention score, is the query vector, is the key vector, is a value vector, For splicing operation, represents the attention head, is a linear transformation, with a total of h attention heads. represents the weight matrix, Represents the hth attention head calculation The weight matrix of the vector;

[0035] 335) Concatenate the outputs of all h attention heads together to form a long vector; perform a linear transformation on the concatenated vector to integrate information from different heads and obtain the final multi-head attention weights;

[0036] 336) Perform weighted fusion on the module’s input two-dimensional feature X and multi-head attention score to generate an enhanced feature map :

[0037] ,

[0038] in, is a learnable scaling factor used to control the strength of attention, The function converts the input real number vector into a probability distribution, that is, each output value is in the range [0,1] and the sum of all output values ​​is 1;

[0039] 337) The calculation process of the EMA module is as follows: First, perform a feature extraction convolution layer CBS operation on the input to obtain the first CBS output feature map; perform channel segmentation on the feature map, and pass the first part of the feature map through the multi-head self-attention module to obtain an enhanced feature map ; The enhanced feature map is residually connected with the first part of the feature map, and then two feature extraction convolution layer CBS operations and one residual connection are performed; it is spliced ​​with the second part of the feature map obtained by channel segmentation and then a feature extraction convolution layer CBS operation is performed to obtain the output of EMA;

[0040] At this point, the optimization of the Yolov10 model is completed, and the optimized lightweight Yolov10 UAV wheat ear real-time detection model is obtained.

[0041] The training of the lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps:

[0042] 41) Input the training set data of the wheat field data set photographed by the drone after preprocessing into the optimized Yolov10 model and calculate the loss function;

[0043] 42) Loss calculation includes positioning loss and confidence loss;

[0044] 421) The localization loss calculates the difference between the bounding box predicted by the model and the true bounding box, using Loss function calculation:

[0045] ,

[0046] in, It is to calculate the ratio of the intersection area of ​​the predicted box and the real box to the joint area, ranging from [0, 1]. is the center point of the prediction box, is the center point of the real frame, Represents the Euclidean distance between the two center points of the predicted box and the true box;

[0047] 422) Confidence loss is used to measure whether each predicted bounding box contains the target object. The confidence loss is calculated using the Confidence Loss function. The calculation formula of Confidence Loss is:

[0048] ,in, is the true value, 1 means there is a target, 0 means there is no target; is the predicted value of the model;

[0049] 423) The total loss function of the model is the sum of the positioning loss and the confidence loss:

[0050] ;

[0051] 43) Use the Total Loss loss function to fine-tune the optimization model, back-propagate and update the model parameters, and determine whether the set number of rounds has been reached 200 times. If so, the trained lightweight Yolov10 UAV remote sensing wheat ear real-time detection model is obtained, otherwise return to step 41) to reload the data and continue training.

[0052] Beneficial Effects

[0053] The invention relates to an optimization model of Yolov10, and a fast convolution module FCL is constructed and applied to the model trunk and neck position to realize lightweight feature extraction. FCL significantly reduces the computational cost by generating a minimum feature mapping set, and can retain the basic features of the image and reduce the model parameters in the feature extraction stage. Therefore, it is conducive to being deployed in unmanned aerial vehicle equipment with limited computing resources, so that the unmanned aerial vehicle can be carried for real-time detection; in addition, a small target detection head is added to the head of the Yolov10 model to further improve the detection accuracy of small target wheat ears, and effectively solve the problem of wheat ear missed detection; at the same time, a multi-head attention mechanism is introduced to construct an enhanced attention module, and a plurality of different attention heads are focused on different parts of the model input, so as to enhance the ability to capture diverse information. The module can focus on high-level features, reduce the number of model parameters, and avoid important original features that may be lost in multiple convolution operations; the optimized lightweight Yolov10 model not only maintains a high detection accuracy, but also can be effectively deployed in unmanned aerial vehicle equipment to realize real-time detection of wheat ear positions and quantities in wheat fields, and provides a reliable technical path for wheat ear detection and wheat yield estimation in smart agriculture. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 is a method sequence diagram of the present invention;

[0055] Figure 2This is an overall schematic diagram of the optimized Yolov10 in an embodiment of the present invention;

[0056] Figure 3 This is a schematic diagram of an FCL module in an embodiment of the present invention;

[0057] Figure 4 This is a schematic diagram of an EMA module in an embodiment of the present invention;

[0058] Figure 5 Schematic diagram of a multi-head attention mechanism in an embodiment of the present invention; DETAILED DESCRIPTION

[0059] In order to have a further understanding and recognition of the structural features and the effects achieved by the present invention, a preferred embodiment and accompanying drawings are used for detailed description as follows:

[0060] like Figure 1 As shown, the present invention provides a lightweight Yolov10 unmanned aerial vehicle remote sensing wheat ear real-time detection method, the method comprising the following steps:

[0061] The first step is to establish and divide the data set:

[0062] (1) Considering that wheat ears have different morphologies at different growth stages, UAV remote sensing images of wheat from the booting stage to the maturity stage were collected. The flight altitudes were set to 20 m, 50 m, and 150 m, and the side swing angles were set to 30, 60, and 90 degrees. Wheat ear images were collected under different weather conditions to create a dataset. The use of this dataset can increase the diversity of the model's learning samples for the target wheat ears, thereby helping the model to better learn the different morphologies of wheat ears at different stages and environments, so that the model can be better applied to actual detection.

[0063] (2) The obtained UAV wheat images were preprocessed by orthorectification, non-overlap cropping, image Gaussian smoothing, and data color mean square error transformation enhancement, where the cropping size was 640×640;

[0064] (3) Use the annotation tool Lambelme to annotate the preprocessed images and finally generate a dataset in YOLO format. The wheat ears are interactively labeled by defining a bounding box including all pixels of the wheat ears. Each image corresponds to a txt text file that records the bounding box information.

[0065] (4) A total of 8,000 YOLO data sets need to be constructed and randomly divided into training set, validation set and test set in a ratio of 6:2:2.

[0066] The second step is to build a basic Yolov10 model: the present invention compares different model configuration files, selects the Yolov10 model, adjusts and configures the corresponding training parameters, including setting the number of training rounds to 200, so that it is more suitable for the detection task.

[0067] The third step is Figure 2 As shown, the Yolov10 model is optimized, specifically:

[0068] (1) Construct a lightweight feature extractor FCL (Fast Conv Lan) module and apply the FCL module to the trunk and neck positions of the Yolov10 model, such as Figure 2 There are five positions shown in 1.2, 1.4, 1.5, 2.1, and 2.2. The core module of FCL is GhostConv;

[0069] (2) The multi-head attention mechanism is added to the Yolov10 backbone to construct the enhanced attention module EMA. EMA focuses attention on high-level features, which can enhance the ability to separate the target from the background, while maintaining accuracy and reducing the number of parameters. This helps the model to more effectively capture the wheat ears with complex backgrounds in the real field images taken by drones, thereby increasing the model recognition accuracy. The EMA module can also avoid the loss of some important original features that may occur in the backbone of the model during multiple convolution operations.

[0070] (3) Based on the three different scale detection heads on the head of the Yolov10 model, a small scale detection head is added to detect small target wheat ears in remote sensing images taken by drones. The specific implementation plan is in the second FCL module on the neck of the Yolov10 model (description Figure 1 2.2) After one upsampling, the first FCL of the head (description Figure 1 After the modules in 1.2) are spliced ​​together, they pass through the C2fCIB module to form a small target detection head, named the fourth detection head;

[0071] The following is an introduction to the relevant operations of step three using a specific example:

[0072] Construct FCL module for the trunk and neck position of Yolov10 model to extract input feature information in a lightweight way; Figure 2It is a model of FCL, which includes two CBS modules and two GhostConv modules. The CBS module is a feature extraction module in the Yolo series, which is used for convolution operations in neural networks. The CBS module includes a convolution operation with a convolution kernel of 3x3, a step size of 2, and a padding of 1, a batch normalization layer, and an activation function SiLU; the ghost convolution GhostConv module is a 3x3 convolution and two 1x1 convolutions, and the previously processed data is spliced; FCL first performs a 3x3 CBS process on the input data, then divides it equally by channel, performs a normal convolution operation with a convolution kernel of 3x3 and a padding of 1 on the first part of the data, performs two GhostConv operations on the second part of the data, splices the feature results of the three parts together by channel, and then performs a CBS operation. The purpose of this is to reduce the number of parameters and computational complexity, and to increase the speed of model operation without reducing the prediction accuracy, which is conducive to the final integration of the model into the drone hardware equipment;

[0073] The EMA module is constructed in the neck part of the Yolov10 model. The core idea of ​​the EMA module is to enhance the expression of multi-scale features and fuse feature maps of different sizes to capture contextual information of different scales. The input data of the EMA module is the output two-dimensional feature map of the multi-scale information fusion pooling module SPPF in the Yolov10 network. The output of the EMA module is an enhanced feature map with the same shape as the input. The EMA module includes four feature extraction convolutional layers CBS of the Yolov10 network and a multi-head self-attention module.

[0074] The multi-head self-attention module flattens the input two-dimensional feature image data into a one-dimensional vector, splits the vector into three vectors of query Q, key K and value V, and generates h groups of Q (Q 0 .....Q h-1 ) vector, h group K (K 0 .....K h-1 ) vector and h group V (V 0 .....V h-1 ) vector; each set of query, key and value corresponds to an attention head, with a total of h attention heads, and each attention head corresponds to a different linear transformation parameter; for each attention head, a scaled dot product attention operation is performed; specifically, the dot product of the query and the key is calculated, and the attention score is obtained after a scaling operation. The softmax function is used to convert the attention score into a probability distribution, so that the correlation between different feature points is converted into a normalized weight;

[0075] The outputs of all h attention heads are concatenated together to form a long vector. The concatenated vector is linearly transformed to integrate the information from different heads to obtain the final multi-head attention weights and calculate the attention score:

[0076] ,

[0077] in is the multi-head attention score, is the query vector, is the key vector, is a value vector, For splicing operation, represents the attention head, is a linear transformation, with a total of h attention heads. represents the weight matrix, Represents the hth attention head calculation The weight matrix of the vector;

[0078] Perform weighted fusion on the module’s input two-dimensional feature X and multi-head attention scores to generate an enhanced feature map :

[0079] ,

[0080] in, is a learnable scaling factor used to control the strength of attention, The function converts the input real number vector into a probability distribution, that is, each output value is in the range [0,1] and the sum of all output values ​​is 1. The expression is:

[0081]

[0082] in, is the i-th component in the input vector, is the jth component in the input vector n is the length of the input vector, express The exponential function of ;

[0083] The construction of the EMA module is carried out by performing the following steps: performing a feature extraction convolutional layer CBS operation to obtain a feature map; performing channel segmentation on the feature map, and obtaining an enhanced feature map by passing the first part of the feature map through the multi-head self-attention module , perform a residual connection with the first part of the data; perform two feature extraction convolution layer CBS operations, perform a residual connection; splice with the second part of the feature map obtained by channel segmentation; perform a feature extraction convolution layer CBS;

[0084] On the basis of the original three different scale detection heads on the head of the Yolov10 model, a small scale detection head is added; for wheat images taken by drones, wheat ears are usually small targets. Since only three scale prediction heads (20×20, 40×40, 80×80) are used, Yolov10 is prone to missed detection and false detection when processing extremely small targets; what needs to be detected in the present invention is the wheat ears taken by the drone. When the drone is used to take wheat field images at high altitude, the wheat ears to be detected are relatively small in size. In order to improve the detection accuracy of the Yolov10 model for small target objects, the present invention adds a small scale detection head on the basis of the three scale detection heads of Yolov10, and expands the original three scales (20×20, 40×40, 80×80) to four scale feature detection (20×20, 40×40, 80×80, 160×160); the specific implementation plan includes the second FCL module on the neck of the Yolov10 model (description Figure 1 2.2 position) after one upsampling, and the first FCL of the head (description Figure 1 1.2 in the figure), and then add the C2fCIB module to form a small target detection head, named the fourth detection head; the C2fCib module is a module in Yolov10 that enhances the feature extraction capability and is used to optimize the performance of the model. In target detection applications, it can help the model better identify and locate objects at different scales and perspectives. The C2fCib module combines different convolution and normalization techniques and introduces an enhancement module to improve the representation capability and robustness of the network;

[0085] The fourth step is to iteratively train the optimized Yolov10 model. The steps include:

[0086] (1) Input the training set data into the optimized Yolov10 model and calculate the loss function;

[0087] (2) The localization loss calculates the difference between the bounding box predicted by the model and the true bounding box, using Loss function calculation:

[0088] ,

[0089] in, It is to calculate the ratio of the intersection area of ​​the predicted box and the real box to the joint area, ranging from [0, 1]. is the center point of the prediction box, is the center point of the real frame, Represents the Euclidean distance between the two center points of the predicted box and the true box;

[0090] (3) Confidence loss is used to measure whether each predicted bounding box contains the target object. The confidence loss is calculated using the Confidence Loss function. The calculation formula of Confidence Loss is:

[0091] ,

[0092] in, is the true value, 1 means there is a target, 0 means there is no target; is the predicted value of the model;

[0093] (4) Model total loss function Total Loss:

[0094] ;

[0095] (5) Use the Total Loss function to fine-tune the optimization model, back-propagate and update the model parameters, and determine whether the set number of rounds has been reached 200 times. If so, the trained lightweight Yolov10 UAV remote sensing wheat ear real-time detection model is obtained. Otherwise, return to step 4 (1) to reload the data and continue training.

[0096] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited to the above embodiments. The above embodiments and descriptions only describe the principles of the present invention. The present invention may be subject to various changes and improvements without departing from the spirit and scope of the present invention. These changes and improvements fall within the scope of the present invention. The scope of protection claimed by the present invention is defined by the attached claims and their equivalents.

Claims

1. A lightweight Yolov10 UAV remote sensing wheat ear real-time detection method, characterized in that: The following steps are involved: 11) Dataset processing of real-time detection of wheat ears by remote sensing using lightweight Yolov10 drones: Collect images of wheat fields taken by drones, load a high-definition digital camera onto an eight-rotor drone platform, set flight altitudes of 20m, 50m, and 150m, and side swing angles of 30, 60, and 90 degrees to take images of wheat at the heading and maturity stages; perform preprocessing of orthorectification, non-overlap cropping, image Gaussian smoothing, and data color mean square error transformation enhancement on the acquired wheat field images, and then crop them into RGB images with an image size of 640×640. Use the annotation and marking tool to annotate the images, in which the wheat ears are interactively marked by defining a bounding box including all pixels of the wheat ears; finally generate a YOLO format dataset, with each image corresponding to a txt text file for recording the wheat ear bounding box information; Images without wheat ears were manually selected and excluded, and a total of 8,000 drone remote sensing real-time detection data sets were constructed, which were divided into training set, validation set, and test set in a ratio of 6:2:2; 12) Construct a lightweight Yolov10 model for real-time detection of wheat ears in drone remote sensing: Use the lightweight convolution module GhostConv to build a fast convolution module FCL; build a small-scale detection layer in the head of the Yolov10 network to detect small target wheat ears in drone images; build an enhanced attention module EMA in the main part of Yolov10 to enhance the ability to separate targets and backgrounds; 13) Training of lightweight Yolov10 drone remote sensing wheat ear real-time detection model: taking training set images as input, calculating the error between the predicted box and the real box as loss, the loss calculation includes positioning loss and confidence loss; continuously optimizing and updating model parameters, iterating training 200 times, and saving the best performance model parameters for drone wheat ear detection result verification; 14) Verification of lightweight Yolov10 UAV remote sensing wheat ear real-time detection model: Obtain the wheat field image taken by the drone to be processed, perform orthorectification, non-overlapping cropping, image Gaussian smoothing, and data color mean square error transformation enhancement preprocessing, and then input it into the trained lightweight Yolov10 wheat ear real-time detection model to finally obtain the wheat ear marking results.

2. The method for real-time detection of wheat ears by remote sensing of a lightweight Yolov10 unmanned aerial vehicle according to claim 1 is characterized in that: The construction of the lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps: 21) The lightweight Yolov10 UAV remote sensing wheat ear real-time detection model is divided into three stages: the first stage uses GhostConv to build a fast convolution module FCL; the second stage adds a small-scale detection head to the head position of the Yolov10 network; the third stage builds an enhanced attention module EMA in the backbone of the Yolov10 network; 22) Construction of the first stage fast convolution module FCL; 221) Use GhostConv to construct a lightweight feature extractor: the extractor includes three convolutional layers, namely, a convolutional layer with a convolution kernel size of 3, a stride of 1, and a padding of 1, and two convolutional layers with a convolution kernel size of 1; 222) The feature maps obtained by the three convolutional layers are concatenated together in the channel dimension to generate a feature map; 223) Perform a convolution operation with a kernel size of 3, a batch normalization operation and a SiLU activation on the feature map to obtain the lightweight feature extractor output; 224) Use the lightweight feature extractor obtained in the above steps to build a fast convolution module FCL. The input data of FCL is the output feature map of the original image after passing through the feature extraction convolution layer CBS of the Yolov10 network twice. CBS contains two convolution layers with a convolution kernel size of 3, a stride of 1, and a padding of 1, a batch normalization layer, and a SiLU activation function. 225) FCL divides the input feature map by channel to obtain two feature maps. The lightweight feature extractor processes the first feature map, and the processed first feature map is concatenated with the second feature map by channel to obtain the output of FCL. 23) In the second stage, a small-scale detection layer is constructed at the head position of the Yolov10 network, named the fourth detection head; the output features of the second FCL module at the neck position of the Yolov10 network are upsampled once and concatenated with the output features of the first FCL module at the head position of the Yolov10 network, and then passed through a C2fCIB feature extraction module to obtain the output of the small-scale detection layer; 24) In the third stage, an enhanced attention module EMA is built on the backbone of the Yolov10 network; 241) The input of the EMA module is the output feature map of the multi-scale information fusion pooling module SPPF in the Yolov10 network, and the output of the EMA module is an enhanced feature map with the same shape as the input; 242) The EMA module includes four feature extraction convolutional layers CBS of the Yolov10 network and a multi-head self-attention module; 243) The multi-head self-attention module first flattens the input two-dimensional feature map into a one-dimensional vector, splits the vector into three vectors of query Q, key K and value V, and generates h groups of Q (Q 0 .....Q h-1 ) vector, h group K (K 0 .....K h-1 ) vector and h group V (V 0 .....V h-1 )vector; 244) Each set of query, key and value corresponds to one attention head, with a total of h attention heads, and each attention head corresponds to a different linear transformation parameter; 245) For each attention head, a scaled dot product attention operation is performed; specifically, the dot product of the query Q and the key K is calculated, and the attention score is obtained after a scaling operation. The softmax function is used to convert the attention score into a probability distribution, so that the correlation between different feature points is converted into a normalized weight; the attention score is calculated using the following expression: , in is the multi-head attention score, is the query vector, is the key vector, is a value vector, For splicing operation, represents the attention head, is a linear transformation, with a total of h attention heads. represents the weight matrix, Represents the hth attention head calculation The weight matrix of the vector; 246) Concatenate the outputs of all h attention heads together to form a long vector; perform a linear transformation on the concatenated vector to integrate information from different heads to obtain the final multi-head attention score; 247) Perform weighted fusion on the module’s input two-dimensional feature X and multi-head attention score to generate an enhanced feature map : , in, is a learnable scaling factor used to control the strength of attention, The function converts the input real number vector into a probability distribution, that is, each output value is in the range [0,1] and the sum of all output values ​​is 1. The expression is: , in, is the i-th component in the input vector, is the jth component in the input vector n is the length of the input vector, express The exponential function of ; 248) The calculation process of the EMA module is as follows: First, perform a feature extraction convolution layer CBS operation on the input to obtain the first CBS output feature map; perform channel segmentation on the feature map, and pass the first part of the feature map through the multi-head self-attention module to obtain an enhanced feature map ; The enhanced feature map is residually connected with the first part of the feature map, and then two feature extraction convolution layer CBS operations and one residual connection are performed; it is spliced ​​with the second part of the feature map obtained by channel segmentation and then a feature extraction convolution layer CBS operation is performed to obtain the output of EMA; At this point, the three-stage optimization of the Yolov10 model is completed, and the optimized lightweight Yolov10 UAV wheat ear real-time detection model is obtained.

3. The method for real-time detection of wheat ears by remote sensing of a lightweight Yolov10 unmanned aerial vehicle according to claim 1 is characterized in that: The training of the lightweight Yolov10 UAV remote sensing wheat ear real-time detection model includes the following steps: 31) Input the training set data into the optimized Yolov10 model, forward propagate to obtain the wheat ear detection results, calculate the loss, and perform gradient backpropagation to update the model parameters; 32) Loss calculation includes positioning loss and confidence loss; 321) The localization loss calculates the difference between the bounding box predicted by the model and the true bounding box, using Loss function calculation: , in, It is to calculate the ratio of the intersection area of ​​the predicted box and the real box to the joint area, ranging from [0, 1]. is the center point of the prediction box, is the center point of the real frame, Represents the Euclidean distance between the two center points of the predicted box and the true box; 322) Confidence loss is used to measure whether each predicted bounding box contains the target object. The confidence loss is calculated using the Confidence Loss function. The calculation formula of Confidence Loss is: , in, is the true value, 1 means there is a target, 0 means there is no target; is the predicted value of the model; 323) The total loss function of the model is the sum of the positioning loss and the confidence loss: ; 33) Use the Total Loss loss function to fine-tune the optimization model, back-propagate and update the model parameters, and determine whether the set number of rounds has been reached 200 times. If so, the trained lightweight Yolov10 UAV remote sensing wheat ear real-time detection model is obtained, otherwise return to step 31) and reload the data to continue training.

Citation Information

Patent Citations

  • Wheat ear detection method based on improved YOLOv5

    CN114973002A

  • Space small target detection method based on position coding

    CN117079098A

  • Dynamic scene VSLAM optimization method based on fusion attention mechanism and lightweight neural network

    CN117710645A

  • Rice disease detection method, product, medium and equipment

    CN118072147A

  • Small target pest detection method based on YOLOv7 algorithm

    CN119091119A

Cited By

  • Target detection method based on EcoDetect-YOLOv2

    CN120070873A

  • Wheat ear automatic detection and counting method based on improved RT-DETR

    CN120580580A