A method for UAV target visual localization based on multi-source priors
Through the multi-source prior visual positioning method of UAV targets, combined with deep learning and feature decoupling representation, the problem of precise positioning of UAVs in complex backgrounds is solved, and an efficient and low-cost method suitable for micro UAVs is achieved. Cost targeting.
Patent Information
- Application Number
- CN202311588919.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-27
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-11-27
AI Technical Summary
Existing UAV target positioning methods require a variety of sensors, are high-cost and are not suitable for micro-UAVs. It is especially difficult to achieve accurate positioning in complex backgrounds.
A UAV target visual positioning method based on multi-source priors is used to improve target detection accuracy through feature decoupling representation and adversarial learning. Combined with UAV IMU parameters and target tracking algorithms, a deep learning model is used to estimate height information and reduce laser sensitivity. Dependence on sensors such as ranging.
It achieves target visual positioning suitable for micro-UAVs, reduces costs, improves the reliability and accuracy of positioning, and can effectively complete flight missions in complex backgrounds.
Smart Images

Figure CN117611668B
Abstract
Description
Technical Field
[0001] The present invention discloses a method for visual positioning of unmanned aerial vehicle targets based on multi-source priors, belongs to the field of computer applications, and relates to a method for visual positioning of unmanned aerial vehicle targets. Background Art
[0002] Drones are characterized by light weight, small shape, and high detection accuracy. They can fly at different altitudes and adjust the flight angle according to actual conditions. Drones are small in size and highly flexible in flight. They can fly in different scenes, such as forests, seas, grasslands, etc., and their flight areas are relatively restricted. In recent years, the drone industry has developed rapidly and is mainly used in industries such as industry, agriculture, and the military. For example, plant protection drones use drones to carry medicine boxes to spray pesticides; drones use drones to carry cameras for large-scale aerial photography; drones for street photography that achieve aerial bird's-eye views; and other new drones are used in environmental protection and post-disaster rescue. Therefore, the organic combination of drone technology and artificial intelligence is the core and focus of the current drone technology field, and has important theoretical and practical significance for promoting the development and application of drone technology.
[0003] The common UAV target positioning methods currently usually require multiple sensors to be installed on the UAV, so a larger UAV is needed as a carrier. In tasks that require multi-machine coordination, the required cost is relatively high. For example, application publication number CN115712121A (a method, device, equipment and medium for UAV target positioning) requires two laser rangings using a laser rangefinder; and the existing pure visual type positioning methods often only use single prior information such as target detectors, and cannot complete flight missions under complex backgrounds and conditions well. For example, application publication number CN115144867A (a target detection and positioning method based on a three-axis gimbal camera mounted on a UAV) only uses a target detection method to complete the positioning task by locking the target in the center of the field of view at all times, and does not use the situation where there are many targets in the field of view. Summary of the invention
[0004] The purpose of the present invention is to provide a multi-source prior-based UAV target visual positioning method to address the deficiencies described in the background technology, improve the existing target detection method through feature decoupling representation and adversarial learning, effectively improve the accuracy of small target detection under the perspective of the UAV, and introduce a height estimation branch, so as not to rely on sensors such as laser ranging to provide height information for the guidance algorithm, and finally combine with multi-source information such as UAV IMU parameters and target tracking algorithms to jointly guide the UAV target visual positioning. The target visual positioning suitable for micro-UAVs is achieved, the cost is reduced, and it has good reliability.
[0005] In order to achieve the above object, the present invention is implemented by adopting the following technical solutions.
[0006] A method for visual positioning of unmanned aerial vehicle targets based on multi-source priors includes the following steps:
[0007] Step 1: Use the dataset with drone altitude labels as training data for the model and preprocess the data;
[0008] Step 2: Build a scale-invariant feature adversarial decoupling module and add it to the target detection model (such as YOLOv7). Use the training samples in step 1 to train the deep learning model. i (i represents the training set image number, i.e. Image i Represents the i-th training set image) as the input of the target detection model with the decoupling module added, and obtains two prediction results, namely, height estimation and target detection. The output value of the above target detection model is compared with the actual value, and the different output values are derived through the loss function. The error is transmitted to all neurons using the back propagation algorithm; according to the value of the transmitted error, the weights and bias values of neurons in each layer are updated using the stochastic gradient descent method, and the adjustment amplitude is made according to the learning rate each time;
[0009] Step 3, repeat step 2, and set the number of iterations to be sufficient for the model parameters to converge to the optimal value;
[0010] Step 4: Use the model target detection branch trained in step 3 to design a mapping relationship by calculating the ratio of the current target box to the entire screen;
[0011] Step 5: Use the model height estimation branch trained in step 3 to estimate the current height of the drone from the target based on the current camera image of the drone, thereby determining the current flight speed of the drone.
[0012] Step 6: Use the target detection branch of the model trained in step 3, combined with the ByteTrack target tracking algorithm (a tracking method based on the tracking-by-detection paradigm), and implement the tracking of the selected target, and determine the flight attitude of the drone based on the position of the selected target in the field of view;
[0013] Step 7, repeat steps 4, 5, and 6 in sequence, and automatically send control instructions to the drone according to the obtained results to realize autonomous flight of the drone until the drone reaches the target. At this time, the GPS position of the drone is obtained and combined with the current altitude estimation result to solve the specific GPS coordinates of the target.
[0014] The datasets in step 1 include but are not limited to the AU-AIR dataset, which is the first multimodal drone dataset for target detection and can be used in scenarios such as target detection and traffic monitoring. The data has multimodal data, including time, GPU position, IMU and other parameters.
[0015] As a preferred embodiment of the present invention, the specific process of step 1 is as follows:
[0016] Extract all the drone image names and corresponding height labels in the dataset to form name-height pairs, which are expressed as follows:
[0017]
[0018] Using D filename-altitude After performing K-Means clustering and clustering the data into 5 height categories according to the height values, the target detection annotations are extracted according to the file name to obtain the final training data, which is shown as follows:
[0019]
[0020] Among them, i represents the data sequence number of the training set, Image represents the training set image, Image i represents the i-th training set image, Altitude_class represents the height category after clustering, Altitude_class i Indicates the height category corresponding to the i-th image, Bboxs indicates the target position and category in the image, Bboxs i Indicates the target position and category corresponding to the i-th image, and N represents the total number of images in the training set.
[0021] As a preferred solution of the present invention, the specific process of constructing the scale-invariant feature adversarial decoupling module in step 2 is:
[0022] S2-1. Construct feature segmenter:
[0023] Suppose the feature layer of the i-th training set image after feature extraction before inputting the target detection head is x i , use tensor slicing to convert x i Divided into two groups of features, this process is expressed as:
[0024]
[0025] in represents the feature segmenter, and Represents two sets of features after segmentation;
[0026] S2-2. Design a scale feature loss function to constrain the feature segmenter during training so that the segmented is the scale feature, and this process is expressed as:
[0027]
[0028] in yes The output after the softmax operation is: is the height label of the i-th sample, when When it is close to 0, the eigenvector This can be considered as a scale feature Right now
[0029] The scale-invariant feature loss function is the loss function of the target detection task, set as when When it is close to 0, the eigenvector This can be considered as a scale feature Right now
[0030] S2-3. Design an adversarial canonical correlation regularization term loss function to minimize the correlation between scale-invariant features and scale features during training. Specifically, it can be expressed as:
[0031] Suppose given two sets of features extracted by FS and Its canonical correlation can be expressed as:
[0032]
[0033]
[0034] Where W scale and W det is a trainable vector, and Respectively represent W scale and W det The transpose of and is the vector after projection; W scale and W det Can matrix and Projected onto and
[0035] The correlation coefficient is defined as:
[0036]
[0037] Based on this formula, and The correlation coefficient between can be calculated by;
[0038] In order to optimize the convenience of the process, use As the objective function; first, freeze the backbone network and feature splitter Then train W scale and W det To maximize ρ 2 When ρ 2 After reaching the maximum value, unfreeze and Freeze W scale and W det To minimize ρ 2 ; The above two operations (freezing and thawing) are performed alternately until ρ 2 Converges to a minimum value; at this point, the vector W scale and W det Get the best value and
[0039] As a preferred embodiment of the present invention, the specific process of step 4 is as follows:
[0040] 4-1. Calculate the ratio θ of the area of the specified target frame to the area of the entire screen;
[0041] 4-2. Calculate the flight step length of the drone according to the ratio θ in step 4-1. The calculation formula is as follows:
[0042]
[0043] In step 4-2, the larger the target proportion, the smaller the UAV flight step length, which can be adjusted according to the specific task.
[0044] As a preferred solution of the present invention, the specific process of step 6 is:
[0045] 6-1. Get the target detection result of the first frame and do IOU (Intersection Over Union) matching with the specified target frame;
[0046] 6-2. Input the successfully matched detection frame into the target tracking algorithm to obtain the specified target position;
[0047] 6-3. Convert the target position coordinates to the aircraft coordinate system to calculate the yaw angle, roll angle, and pitch angle.
[0048] As a preferred solution of the present invention, the specific process of step 7 is:
[0049] 7-1. According to the results of steps 4, 5, and 6, three control instructions of speed, step length, and angle are sent to the drone to drive the drone to fly over the target;
[0050] 7-2. The drone flies to the sky directly above the target, stops flying, and reads the longitude x, latitude y and altitude h of the drone at this moment. The altitude value h' obtained by the altitude estimation branch is subtracted from the altitude value of the drone to obtain the final coordinates of the target. Specifically expressed as:
[0051]
[0052] Compared with the prior art, the present invention adopts the above technical solution and has the following technical effects:
[0053] 1. The multi-source prior-based UAV target visual positioning method of the present invention fills the gap in the existing target positioning method that requires the support of multiple sensors, realizes target visual positioning suitable for micro-UAVs, has low cost, and uses multiple prior information to jointly control the flight of the UAV, and has good reliability.
[0054] 2. The present invention is based on a multi-source prior UAV target visual positioning method. With the help of deep learning technology, only visual sensors are needed to achieve accurate positioning of UAV targets. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 It is a flow chart of the UAV target visual positioning method based on multi-source priors of the present invention;
[0056] Figure 2 It is a structural diagram of the scale-invariant feature adversarial decoupling module of the present invention;
[0057] Figure 3 It is a schematic diagram of multi-source prior information used in the present invention. DETAILED DESCRIPTION
[0058] The following will be combined with the attached Figures 1 to 3 The method of the present invention is described in detail with specific embodiments.
[0059] It is worth mentioning that the embodiments of the present invention are described in detail below, and examples of the embodiments are shown in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.
[0060] With the increasing maturity of deep learning and drone technology, more and more deep learning applications have been implemented in the drone industry, which has aroused widespread interest and praise. However, existing drone target positioning methods often rely on multiple sensors such as laser ranging and inertial navigation, which are costly and not friendly to micro-drones. Deep learning is developing rapidly and can collaboratively guide drone autonomous flight and target positioning through multi-functional deep learning algorithms, replacing the functions of multiple sensors. Based on this idea, the present invention proposes a drone target visual positioning method based on multi-source priors.
[0061] like Figure 1 As shown, the present invention proposes a UAV target visual positioning method based on multi-source priors, comprising the following steps:
[0062] Step 1, using a data set with drone altitude labels (the data set includes but is not limited to the AU-AIR data set) as training data for the model to preprocess the data;
[0063] Extract all the drone image names and corresponding height labels in the dataset to form name-height pairs, which are expressed as follows:
[0064]
[0065] Using D filename-altitude After performing K-Means clustering and clustering the data into 5 height categories according to the height values, the target detection annotations are extracted according to the file name to obtain the final training data, which is shown as follows:
[0066]
[0067] Among them, i represents the data sequence number of the training set, Image represents the training set image, Image i represents the i-th training set image, Altitude_class represents the height category after clustering, Altitude_class i Indicates the height category corresponding to the i-th image, Bboxs indicates the target position and category in the image, Bboxs i Indicates the target position and category corresponding to the i-th image, and N represents the total number of images in the training set.
[0068] Step 2: Build a scale-invariant feature adversarial decoupling module and add it to the target detection model (such as YOLOv7). The specific structure diagram is as follows: Figure 2 As shown. Use the training samples in step 1 to train the deep learning model. i (i represents the training set image number, i.e. Image iRepresents the i-th training set image) as the input of the target detection model with the decoupling module added, and obtains two prediction results, namely height estimation and target detection. The output value of the above target detection model is compared with the actual value, and the error is derived for different output values through the loss function. The error is transmitted to all neurons by the back propagation algorithm. According to the value of the transmitted error, the stochastic gradient descent method is used to update the weights and bias values of neurons in each layer, and the amplitude of each adjustment is made according to the learning rate.
[0069] The specific process is:
[0070] S2-1, construct feature segmenter;
[0071] Suppose the feature layer of the i-th training set image after feature extraction before inputting the target detection head is x i , use tensor slicing to convert x i Divided into two groups of features, this process is expressed as:
[0072]
[0073] in represents the feature segmenter, and Represents two sets of features after segmentation;
[0074] S2-2. Design a scale feature loss function to constrain the feature segmenter during training so that the segmented is the scale feature, and this process is expressed as:
[0075]
[0076] in yes The output after the softmax operation is: is the height label of the i-th sample, when When it is close to 0, the eigenvector This can be considered as a scale feature Right now
[0077] The scale-invariant feature loss function is the loss function of the target detection task, set as when When it is close to 0, the eigenvector This can be considered as a scale feature Right now
[0078] S2-3. Design an adversarial canonical correlation regularization term loss function to minimize the correlation between scale-invariant features and scale features during training. Specifically, it can be expressed as:
[0079] Suppose given two sets of features extracted by FS and Its canonical correlation can be expressed as:
[0080]
[0081]
[0082] Where W scale and W det is a trainable vector, and Respectively represent W scale and W det The transpose of and is the vector after projection; W scale and W det Can matrix and Projected onto and
[0083] The correlation coefficient is defined as:
[0084]
[0085] Based on this formula, and The correlation coefficient between can be calculated by;
[0086] In order to optimize the convenience of the process, use As the objective function; first, freeze the backbone network and feature splitter Then train W scale and W det To maximize ρ 2 When ρ 2 After reaching the maximum value, unfreeze and Freeze W scale and W det To minimize ρ 2 ; The above two operations (freezing and thawing) are performed alternately until ρ 2 Converges to a minimum value; at this point, the vector W scale and W det Get the best value and
[0087] Step 3: Repeat step 2 and set the number of iterations to be sufficient for the model parameters to converge to the optimal value.
[0088] like Figure 3 As shown, the processes of steps 4, 5, and 6 correspond to Figure 3 The "Object Detection", "Height Estimation", and "Object Tracking" branches in .
[0089] Step 4: Use the model target detection branch trained in step 3 to design a mapping relationship. By calculating the proportion of the current target box to the entire screen, the larger the proportion of the target box, the smaller the flight step length of the drone.
[0090] The specific process is as follows:
[0091] 4-1. Calculate the ratio θ of the area of the specified target frame to the area of the entire screen;
[0092] 4-2. Calculate the flight step length of the drone according to the ratio θ in step 4-1. The calculation formula is as follows:
[0093]
[0094] In step 4-2, the larger the target proportion, the smaller the UAV flight step length, which can be adjusted according to the specific task.
[0095] Step 5: Use the model height estimation branch trained in step 3 to estimate the current height of the drone from the target based on the current camera image of the drone, thereby determining the current flight speed of the drone.
[0096] Step 6: Use the target detection branch of the model trained in step 3, combined with the ByteTrack target tracking algorithm, to track the selected target, and determine the flight attitude of the drone based on the position of the selected target in the field of view;
[0097] The specific process is as follows:
[0098] 6-1. Get the target detection result of the first frame and do IOU matching with the specified target frame;
[0099] 6-2. Input the successfully matched detection frame into the target tracking algorithm to obtain the specified target position;
[0100] 6-3. Convert the target position coordinates to the aircraft coordinate system to calculate the yaw angle, roll angle, and pitch angle.
[0101] Step 7, repeat steps 4, 5, and 6 in sequence, and automatically send control instructions to the drone according to the obtained results to realize autonomous flight of the drone until the drone reaches the target. At this time, the GPS position of the drone is obtained and combined with the current altitude estimation result to solve the specific GPS coordinates of the target;
[0102] The specific process is as follows:
[0103] 7-1. According to the results of steps 4, 5, and 6, three control instructions of speed, step length, and angle are sent to the drone to drive the drone to fly over the target;
[0104] 7-2. The drone flies to the sky directly above the target, stops flying, and reads the longitude x, latitude y and altitude h of the drone at this moment. The altitude value h' obtained by the altitude estimation branch is subtracted from the altitude value of the drone to obtain the final coordinates of the target. Specifically expressed as:
[0105]
[0106] The present invention provides a multi-source prior-based UAV target visual positioning method, which has the characteristics of low cost and high efficiency. The present invention can also adapt to various types of UAVs, does not rely on multiple sensors, and has good robustness for targets of different scales.
[0107] The above embodiments are only for illustrating the technical idea of the present invention, and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for visual positioning of unmanned aerial vehicle targets based on multi-source priors, characterized in that: The steps include: Step 1: Use the dataset with drone altitude labels as training data for the model and preprocess the data; Step 2: Build a scale-invariant feature adversarial decoupling module and add it to the target detection model. Use the training samples from step 1 to train the deep learning model. i As the input of the target detection model with the decoupling module, two prediction results of height estimation and target detection are obtained respectively. The output value of the above target detection model is compared with the actual value. Different output values are derived through the loss function, and the error is transmitted to all neurons using the back propagation algorithm. According to the value of the transmitted error, the weights and bias values of neurons in each layer are updated using the stochastic gradient descent method, and the adjustment amplitude is made according to the learning rate each time. i represents the training set image number, i.e. Image i represents the i-th training set image; Step 3, repeat step 2, and set the number of iterations to be sufficient for the model parameters to converge to the optimal value; Step 4: Use the model target detection branch trained in step 3 to design a mapping relationship. By calculating the proportion of the current target box to the entire screen, the larger the proportion of the target box, the smaller the flight step length of the drone. Step 5: Use the model height estimation branch trained in step 3 to estimate the current height of the drone from the target based on the current camera image of the drone, thereby determining the current flight speed of the drone. Step 6: Use the target detection branch of the model trained in step 3, combined with the ByteTrack target tracking algorithm, to track the selected target, and determine the flight attitude of the drone based on the position of the selected target in the field of view; Step 7, repeat steps 4, 5, and 6 in sequence, and automatically send control instructions to the drone according to the obtained results to realize autonomous flight of the drone until the drone reaches the target. At this time, the GPS position of the drone is obtained and combined with the current altitude estimation result to solve the specific GPS coordinates of the target; The specific process of constructing the scale-invariant feature adversarial decoupling module described in step 2 is: S2-1. Construct feature segmenter: Suppose the feature layer of the i-th training set image after feature extraction before inputting the target detection head is x i , use tensor slicing to convert x i Divided into two groups of features, this process is expressed as: in represents the feature segmenter, and Represents two sets of features after segmentation; S2-2. Design a scale feature loss function to constrain the feature segmenter during training so that the segmented is the scale feature, and this process is expressed as: in yes The output after the softmax operation is: is the height label of the i-th sample, when When it is close to 0, the eigenvector This can be considered as a scale feature Right now The scale-invariant feature loss function is the loss function of the target detection task, set as when When it is close to 0, the eigenvector This can be considered as a scale feature Right now S2-3. Design an adversarial canonical correlation regularization term loss function to minimize the correlation between scale-invariant features and scale features during training. Specifically, it can be expressed as: Suppose given two sets of features x extracted by FS scale and x det , its canonical correlation is expressed as: Where W scale and W det is a trainable vector, and Respectively represent W scale and W det The transpose of x' scale and x' det is the vector after projection; W scale and W det Can transform the matrix x sacle and x det Project to x' scale and x' det ; The correlation coefficient is defined as: Based on this formula, X' scale and X' det The correlation coefficient between can be calculated by; For the convenience of the optimization process, use ρ 2 (x' scale ,x' det ) as the objective function; First, freeze the backbone network and feature splitter Then train W scale and W det To maximize ρ 2 When ρ 2 After reaching the maximum value, unfreeze and Freeze W scale and W det To minimize ρ 2 ; The above two operations, i.e. freezing and thawing, are performed alternately until ρ 2 Converges to a minimum value; at this point, the vector W scale and W det Get the best value and 2. The method for visual positioning of unmanned aerial vehicle targets based on multi-source priors according to claim 1 is characterized in that: The specific process described in step 1 is: Extract all the drone image names and corresponding height labels in the dataset to form name-height pairs, which are expressed as follows: Using D filename-altitude After performing K-Means clustering and clustering the data into 5 height categories according to the height values, the target detection annotations are extracted according to the file name to obtain the final training data, which is shown as follows: Among them, i represents the data sequence number of the training set, Image represents the training set image, Image i represents the i-th training set image, Altitude_class represents the height category after clustering, Altitude_class i Indicates the height category corresponding to the i-th image, Bboxs indicates the target position and category in the image, Bboxs i Indicates the target position and category corresponding to the i-th image, and N represents the total number of images in the training set.
3. The method for visual positioning of unmanned aerial vehicle targets based on multi-source priors according to claim 1 is characterized in that: The specific process described in step 4 is: 4-1. Calculate the ratio θ of the area of the specified target frame to the area of the entire screen; 4-2. Calculate the flight step length of the drone according to the ratio θ in step 4-1. The calculation formula is as follows:
4. The method for visual positioning of unmanned aerial vehicle targets based on multi-source priors according to claim 1 is characterized in that: The specific process described in step 6 is: 6-1. Get the target detection result of the first frame and do IOU matching with the specified target frame; 6-2. Input the successfully matched detection frame into the target tracking algorithm to obtain the specified target position; 6-3. Convert the target position coordinates to the aircraft coordinate system to calculate the yaw angle, roll angle and pitch angle.
5. The method for visual positioning of unmanned aerial vehicle targets based on multi-source priors according to claim 1 is characterized in that: The specific process described in step 7 is: 7-1. According to the results of steps 4, 5, and 6, three control instructions of speed, step length, and angle are sent to the drone to drive the drone to fly over the target; 7-2. The drone flies to the sky directly above the target, stops flying, and reads the longitude x, latitude y and altitude h of the drone at this moment. The altitude value h' obtained by the altitude estimation branch is subtracted from the altitude value of the drone to obtain the final coordinates of the target. Specifically expressed as:
