Unmanned aerial vehicle visual odometer navigation positioning method based on attention mechanism
By applying the visual odometer navigation and positioning method based on attention mechanism in drone task scenarios, using GoogLeNet convolutional neural network model and transfer learning technology, the applicability of drones in outdoor environments is solved, and high-precision, low computational volume and real-time navigation and positioning effects are achieved.
Patent Information
- Application Number
- CN202411488715.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-10-23
AI Technical Summary
In the prior art, the visual odometer navigation and positioning method is less applicable in drone mission scenarios, especially in a long and large-scale working environment outdoors, it is susceptible to light and weather changes, and is sensitive to camera parameters.
Using the drone visual odometer navigation and positioning method based on attention mechanism, relying on the GoogLeNet convolutional neural network model, through transfer learning of the vehicle-mounted visual odometer model, a relationship model between image features and drone position in the drone task environment is established, and the convolutional neural network structure is optimized to adapt to the drone task scenario.
With only a small amount of drone picture data, the ideal visual odometer navigation and positioning effect is achieved, the accuracy of displacement estimation is improved, the calculation amount and time consumption are reduced, and the real-time requirements are met.
Smart Images

Figure CN119555072A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of navigation and positioning, and relates to a navigation and positioning method of a visual odometer of an unmanned aerial vehicle based on an attention mechanism. Background Art
[0002] Part 1: When a moving body, such as an unmanned platform or robot, enters an unknown environment, it has no knowledge of its position and surrounding environment and can only obtain information through various sensors. Humans obtain a large amount of information based on the visual system. The moving body is assumed to be like a human, observing and understanding the surrounding objects and environment through the eyes, knowing its position, and observing and exploring the world. With the development of computer vision (CV), in recent decades, self-motion estimation has gradually been achieved by attaching visual sensors to obtain rich information. The information obtained by visual sensors is the richest, most comprehensive and most intuitive, the cost is relatively low, and the application range of detection is also relatively wide. The process of estimating camera self-motion through visual sensors is called visual odometry (VO). VO has been widely used in many types of unmanned platforms and robots, all over the air, on land, and underwater.
[0003] The current mainstream visual odometer navigation and positioning method is calculated based on the geometric relationship of the image, which requires stable and textured features, is easily affected by light and weather changes, and is very sensitive to camera parameters. It is not suitable for drones to work outdoors for a long time and over a large range. Most visual odometer solutions based on convolutional neural network structures are aimed at ground vehicle environments, while the images collected by drones are mostly tilted downward aerial pictures, which cover a wide range, have many content categories and high density, and the flight trajectory is more flexible than that of cars on urban roads, making the traditional visual odometer navigation and positioning solution based on ground vehicle environments less applicable to drones. Summary of the invention
[0004] The purpose of the present invention is to address the technical defect that the traditional visual odometer navigation and positioning method for ground vehicle-mounted environment in the UAV mission scenario has poor applicability, and propose a UAV visual odometer navigation and positioning method based on an attention mechanism. Relying on the GoogLeNet convolutional neural network model, firstly, a vehicle-mounted visual odometer model based on the GoogLeNet convolutional layer structure is trained based on a relatively mature and complete vehicle-mounted public data set, and then a UAV visual odometer model is constructed by a direct push transfer learning method, and a UAV target data set is introduced to train the network model, and finally a relationship model between image features and UAV postures in the UAV mission environment is established, and the positioning of the UAV visual odometer based on the GoogLeNet convolutional layer structure is completed; the method optimizes the convolutional neural network based on the attention mechanism, adopts the vehicle-mounted visual odometer and combines it with transfer learning, and migrates it to the UAV mission scenario, so that a relatively ideal effect can still be achieved when there are only a few UAV image data.
[0005] In order to achieve the above object, the present invention adopts the following technical scheme:
[0006] The method for visual odometer navigation and positioning of a drone based on an attention mechanism, relying on a convolutional layer structure based on GoogLeNet, comprises the following steps:
[0007] S1. Collect and create UAV vision-pose datasets, specifically:
[0008] S11, using drones to collect videos of the ground at different altitudes and speeds and different trajectories;
[0009] S12, using a motion estimation structure algorithm to offline solve the camera pose and mileage motion information to obtain solved pose sequence data;
[0010] S13, create a FLYING dataset containing time-series images and pose sequence data, and save the images and pose labels respectively for model training;
[0011] S2, obtaining a vehicle environment dataset and executing S12 and S13 to transform the public dataset into a form that is homogeneous with the FLYING dataset;
[0012] S3. Build the overall network architecture of the on-board visual odometry model, including designing the convolutional layer structure of the encoding layer, image position encoding, attention mechanism to solve the relationship between sequences, and setting the loss function;
[0013] S4, model training, specifically: setting the sample sequence length and the sample overlap sampling value, and repeating the collection of one picture at a time in order to produce the next sample;
[0014] When S4 is implemented, the sample sequence length is set to 5 or 6, that is, each sample consists of 5 or 6 sequence pictures; the overlapping sampling value of the sample is set to 1; S4 is adapted to the cyclic convolutional neural network structure and is within the memory range of the desktop computer;
[0015] S5. Perform model testing and evaluation on the vehicle visual odometry model based on the vehicle environment dataset. Test the model saved during the training process on the test set to evaluate the model performance, and select the model with better test results for subsequent transfer learning.
[0016] S6. Use direct transfer learning method to train the UAV visual odometry model and obtain the UAV visual odometry network structure model based on attention mechanism.
[0017] The drone collection described in S11 specifically includes: collecting straight-moving, turning, and ascending and descending moving picture data respectively and moving in the scene for as long as possible to ensure that the collected original data is obtained by traversing the drone's visual posture.
[0018] The first three digits of the calculated data in S12 represent the position coordinates, and the last four digits represent the rotation quaternion.
[0019] The vehicle-mounted environment dataset described in S2 is a vehicle-mounted urban and suburban road public dataset.
[0020] The overall network architecture described in S3 includes CNN, a multi-head attention unit and a forward transmission unit; the CNN described in S3 includes a convolutional layer; the convolutional layer includes a coding layer, and the coding layer is a coding layer of a flownet structure.
[0021] The convolutional layer in the overall network architecture of S3 is used for feature extraction, learning the relationship between sequences and balancing the weight distribution; the relationship between sequences is no longer learned in sequence according to time labels, but the temporal relationship is marked as position encoding and then learned, which is specifically implemented through the CNN-attention module. The structure of each encoder layer is the same, but the weights are not shared; each encoder layer includes a multi-head attention module and a feed forward module, and each module is connected to add&norm; each feature vector extracted by the convolutional layer will be input into the stacked multi-head attention module and feed forward module to obtain an output.
[0022] The vehicle-mounted visual odometer model described in S3 relies on a convolutional layer structure based on GoogLeNet.
[0023] The loss function described in S3 is set based on the minimum mean square error criterion between the ground truth pose information and the predicted information.
[0024] S6 describes a direct push transfer learning method for training the UAV visual odometry model, specifically: a portion of the images in the FLYING dataset are selected as a validation set, a portion of the images are selected as a test set, and the remaining scene sequences are selected as a training set. Based on the model and parameters saved by the unmanned vehicle visual odometry model, the same configuration file and network structure are used, and the dataset path and some hyperparameters are modified before training to obtain a UAV visual odometry network structure model based on the attention mechanism.
[0025] Beneficial Effects
[0026] The present invention proposes a UAV visual odometer navigation and positioning method based on attention mechanism, which has the following beneficial effects compared with the prior art:
[0027] 1. The network structure model attention VO based on the visual odometer navigation and positioning method based on the attention mechanism inputs a sequence of pictures, solves the camera poses in between, extracts the feature vectors between pictures by the convolutional neural network, and connects the attention mechanism to learn the constraint relationship between sequences;
[0028] 2. The visual odometry navigation and positioning method based on the attention mechanism trains and tests the network model. The accuracy of displacement estimation is much higher than the classic visual odometry method VISO2-M, but not as good as ORB SLAM with optimization and detection. It does not require camera parameters, feature matching, map alignment and other processes, and does not face the problem of feature loss when the scene conversion is accelerated.
[0029] 3. The visual odometry navigation and positioning method based on the attention mechanism adopts transfer learning to transfer the visual odometry model to the UAV mission scenario, so that a relatively ideal effect can be achieved even with only a small amount of UAV image data. In practical applications, the training of the vehicle environment data set model can be completed in advance as a general model, and then the collected UAV aerial images can be used for transfer learning to train the UAV visual odometry model in the required mission scenario;
[0030] 4. The visual odometry navigation and positioning method based on the attention mechanism has the advantages of small computational complexity and fast speed. It is superior to VISO2M and ORB SLAM in terms of algorithm time consumption. When the drone captures pictures at a frequency of 20Hz or lower, the model can meet the real-time requirements. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 This is a result diagram of the pose calculation of six adjacent frames of images according to the present invention;
[0032] Figure 2 The overall network architecture of the vehicle visual odometer model is built for S3 of the present invention;
[0033] Figure 3 Construct the convolutional layer structure in the vehicle visual odometer model for S3 of the present invention;
[0034] Figure 4 Build a CNN-attention model for the vehicle visual odometer in the present invention S3 to solve the relationship between sequences;
[0035] Figure 5 The calculation process of the multi-head attention mechanism in the vehicle visual odometer model built for S3 of the present invention;
[0036] Figure 6 This is the direct push transfer learning training process of the present invention;
[0037] Figure 7 Some video screenshots obtained during the specific implementation of the present invention;
[0038] Figure 8 The output content corresponding to the third step of data preprocessing of the present invention;
[0039] Fig. 9 A display diagram of the data set composition of the present invention;
[0040] Fig.10 It is a training error curve during the specific implementation of the present invention. DETAILED DESCRIPTION
[0041] The following is a further explanation and detailed description of the UAV visual odometer positioning method based on the attention mechanism of the present invention in conjunction with the accompanying drawings and embodiments.
[0042] Example 1
[0043] The method for navigation and positioning of a UAV visual odometer based on an attention mechanism is based on a GoogLeNet convolutional neural network model, and is combined with an existing online vehicle-mounted public urban and suburban road data set (including 11 scenes with a total of more than 20,000 images) and a self-collected UAV aerial photography data set (including 15 scenes with a total of 8,740 images). First, a vehicle-mounted visual odometer model based on a GoogLeNet convolutional layer structure is trained based on a relatively mature and complete vehicle-mounted public data set, and then a UAV visual odometer model is constructed through a direct push transfer learning method, and a UAV target data set is introduced for network model training. Finally, a relationship model between image features and UAV posture in a UAV mission environment is established to complete the positioning of the UAV visual odometer based on the GoogLeNet convolutional layer structure.
[0044] A drone visual odometer navigation and positioning method based on attention mechanism, relying on the convolutional layer structure based on GoogLeNet, includes the following steps:
[0045] S1. Collect and create UAV vision-pose datasets, specifically:
[0046] S11, using drones to collect videos of the ground at different altitudes and speeds and different trajectories;
[0047] S12, using a motion estimation structure algorithm to offline solve the camera pose and mileage motion information to obtain solved pose sequence data;
[0048] S13, create a FLYING dataset containing time-series images and pose sequence data, and save the images and pose labels respectively for model training;
[0049] S2, obtaining a vehicle environment dataset and executing S12 and S13 to transform the public dataset into a form that is homogeneous with the FLYING dataset;
[0050] S3. Build a vehicle-mounted visual odometry model, including designing the convolutional layer structure of the encoding layer, image position encoding, attention mechanism to solve the relationship between sequences, and setting the loss function;
[0051] S4, model training, specifically: setting the sample sequence length and the sample overlap sampling value, and repeating the collection of one picture at a time in order to produce the next sample;
[0052] When S4 is implemented, the sample sequence length is set to 5 or 6, that is, each sample consists of 5 or 6 sequence pictures; the overlapping sampling value of the sample is set to 1; S4 is adapted to the cyclic convolutional neural network structure and is within the memory range of the desktop computer;
[0053] S5. Perform model testing and evaluation on the vehicle visual odometry model based on the vehicle environment dataset. Test the model saved during the training process on the test set to evaluate the model performance, and select the model with better test results for subsequent transfer learning.
[0054] S6. Use direct transfer learning method to train the UAV visual odometry model and obtain the UAV visual odometry network structure model based on attention mechanism.
[0055] The drone collection described in S11 specifically includes: collecting straight-moving, turning, and ascending and descending moving picture data respectively and moving in the scene for as long as possible to ensure that the collected original data is obtained by traversing the drone's visual posture.
[0056] The first three digits of the calculated data in S12 represent the position coordinates, and the last four digits represent the rotation quaternion.
[0057] The vehicle-mounted environment dataset described in S2 is a vehicle-mounted urban and suburban road public dataset.
[0058] The overall network architecture described in S3 includes CNN, a multi-head attention unit and a forward transmission unit; the CNN described in S3 includes a convolutional layer; the convolutional layer includes a coding layer, and the coding layer is a coding layer of a flownet structure.
[0059] The convolutional layer in the overall network architecture described in S3 is used for feature extraction, learning the relationship between sequences and balancing the weight distribution; the relationship between sequences is no longer learned in sequence according to time labels, but the temporal relationship is marked as position coding before learning.
[0060] The vehicle-mounted visual odometer model described in S3 relies on a convolutional layer structure based on GoogLeNet.
[0061] The loss function described in S3 is set based on the minimum mean square error criterion between the ground truth pose information and the predicted information.
[0062] S6 describes a direct push transfer learning method for training the UAV visual odometry model, specifically: a portion of the images in the FLYING dataset are selected as a validation set, a portion of the images are selected as a test set, and the remaining scene sequences are selected as a training set. Based on the model and parameters saved by the unmanned vehicle visual odometry model, the same configuration file and network structure are used, and the dataset path and some hyperparameters are modified before training to obtain a UAV visual odometry network structure model based on the attention mechanism.
[0063] In specific implementation, the drone visual odometer navigation and positioning method based on the attention mechanism is based on the GoogLeNet convolutional layer structure and includes the following steps:
[0064] Step 1: Collect and create drone vision-pose dataset;
[0065] Step 1.1, data collection, the drone is used to shoot and collect videos on the ground at different altitudes and speeds and in different trajectories. During the shooting process, the drone gimbal maintains a fixed angle relative to the body. The scene contains trees, buildings of various shapes, vehicles, and moving objects. At the same time, the collection process of some scenes also includes changes in light. Collect the moving picture data of straight, turning, and lifting separately, and move in the scene as long as possible to ensure the richness of the collected original data.
[0066] Step 1.2: Use the motion estimation structure algorithm to calculate the camera pose and mileage information offline. The first three digits of the data represent the position coordinates, and the last four digits represent the rotation quaternion q=q 0 +q 1 i+q 2 j+q 3 k, the result of pose calculation for 6 consecutive frames is as follows: Figure 1 As shown:
[0067] Step 1.3: Dataset creation: Create a dataset named FLYING and create an image sequence folder "Images" and a pose folder "Poses" in it to save the corresponding images and converted pose labels for model training.
[0068] Step 2: Download the KITTI public dataset of urban and suburban roads (including 11 scenes and more than 30,000 images). Similar to steps 1.2 and 1.3, convert the KITTI dataset into a form that is homogeneous with the FLYING dataset.
[0069] Step 3: Network design;
[0070] Overall architecture: The overall architecture of the network is as follows Figure 2 As shown in the figure, the input data is a sample of the produced time series pictures. Before entering the network structure, two adjacent pictures are stacked to form a tensor. First, the convolutional layer is used to extract features to reduce the features of the high-dimensional picture, and then the feature vector is sent to the attention mechanism for learning the sequence constraint relationship, and the camera's 7-degree-of-freedom posture information is output, of which the first 3 degrees of freedom represent displacement and the last 4 degrees of freedom are the posture changes of the rotation quaternion. The network is based on the self-attention mechanism and introduces a multi-head attention mechanism to balance the weight distribution. The model no longer calculates sequentially according to the time label, but identifies the temporal relationship as a position code to learn the relationship between sequences.
[0071] Step 3.1, convolutional layer structure design: Figure 3 As shown in the figure, the encoding layer in the flownet structure is used as the convolution layer structure in this structure. The parameters of CNN have been marked in the figure above. The size of the convolution kernel is gradually reduced from 7×7, 5×5 to 3×3 to capture small local features in the image. The reduction in the size of the feature map indicates that more abstract features are collected. The number of convolution kernels gradually increases from 128, 512 to 1024. The increase in the number of feature maps after the convolution layer indicates that richer features are collected. The two pictures are stacked and input into CNN in order to obtain a feature vector representing the geometric relationship between the pictures. The feature vector is stretched in one dimension and input into the subsequent attention mechanism.
[0072] Step 3.2, image position encoding: Since the attention mechanism itself does not consider the order of elements, position encoding is required to add additional information to each element in the sequence so that the model can utilize the position information of the elements. In the visual odometry task, the images extracted from the video stream have a time series relationship, and preserving the mutual sequence relationship between images is the encoding process of the features. The images are sequentially input into the network structure to obtain the corresponding relative camera pose, and the image order is identified by encoding the position information of the images:
[0073]
[0074] Among them, angle is the calculated angle, hid_idx is the serial position of the picture, d_hid is the number of dimensions after encoding, and the sin and cos values of the angle are solved in each picture and combined as the position code of the picture.
[0075] Step 3.3: Attention mechanism solves the relationship between sequences: Figure 4 As shown in the figure, the encoded adjacent image features and position encoding information are sent to the attention mechanism to learn the constraint relationship between sequences. The attention part is composed of 4 stacked parts called encoders. The structure of each encoder layer is the same, but the weights are not shared. Each encoder layer is composed of a multi-head attention module and a feed forward module, and each module is connected to add&norm. Each feature vector extracted by the convolution layer is input into the stacked multi-head attention module and feed forward module to obtain an output.
[0076] In the multi-head attention mechanism, there are multiple query, key, and value weight matrices. These matrices are randomly initialized and map the encoded input elements to different subspaces. The calculation process of the multi-head attention mechanism is as follows: Figure 5 As shown, set n_head = 4. Each header in the mechanism has an independent query, key, and value weight matrix. Copy the input into n_head parts and enter different self-attention mechanisms respectively. Concatenate the matrices obtained by self-attention output and multiply them by the weight matrix ω. 0 The output vector z is obtained and then transmitted backward. The code of the forward transmission process is as follows:
[0077]
[0078]
[0079] After the multi-head attention operation, it passes through the add&norm module, and the output of this module when input x is:
[0080] y = LayerNorm(x + SubLayer(x))
[0081] Then, the fully connected feedforward network and add&norm module are input for dimensionality reduction. The elements in the input sequence go through the same feedforward neural network structure, but they are independent of each other. Finally, the output dimension is mapped to 7 dimensions, which represents the change of camera pose between pictures.
[0082] Step 3.4, loss function setting: decompose the pose information Y into displacement and rotation The predicted pose obtained by the neural network is The loss function for M sequences of length T is calculated by the mean square error:
[0083]
[0084] Among them, ||·|| 2 is the 2-norm, and β is the proportional factor of the balance weight. The neural network parameters are calculated to minimize the error between the ground truth pose information and the predicted information, so as to train the optimal parameters w *
[0085] Step 4, model training, set the sample sequence length to 5 or 6, that is, each sample consists of 5 or 6 sequence pictures; set the sample overlap sampling value to 1, and repeat the collection of one picture at a time in order to make the next sample; in order to adapt to the cyclic convolutional neural network structure and run normally within the desktop memory range, use the center cropping method (CenterCrop) to process the picture to reduce the GPU load and greatly improve the calculation speed; use the Adam optimizer, set the learning rate to 0.00001, n-head to 4, the number of encoder layers to 4, the value and key dimensions to 256, and the coupling coefficient in the loss function to 100. The parameters of the CNN part are initialized by the trained flownet model parameters, the remaining weights are randomly initialized, and the bias is initialized from 0.
[0086] Step 5: Based on the model testing and evaluation of the vehicle environment dataset, the model saved during the training process is tested in the test set to evaluate the performance of the model, and the model with better test results is selected for subsequent transfer learning. Set the length of the image sequence processed each time during the test to 6, the overlap value to 5, and put the samples into the trained network model in order. Take the first five images of each image sequence and align them with the last five images, and predict the relative position of the camera through the neural network model. For example, for the image sequence 0, 1, 2, 3, 4, 5, convert the images into 0, 1, 2, 3, 4 and 1, 2, 3, 4, 5 according to the method defined in the data processing file, and combine them into image pairs of 0-1, 1-2, 2-3, 3-4, and 4-5.
[0087] Step 6: Figure 6, adopt the direct push transfer learning method to train the UAV visual odometry model. Select a part of the pictures in the FLYING dataset as the validation set, a part of the pictures as the test set, and the rest of the scene sequence as the training set. Based on the model and parameters saved by the unmanned vehicle visual odometry model, the same configuration file and network structure are used. After modifying the dataset path and some hyperparameters, the training is carried out to obtain the attention VO network structure model of UAV visual odometry based on the attention mechanism.
[0088] 1. Data collection: The drone data collected by this patent is DJI's Wu1, and the load camera resolution is 12.76 million pixels. The drone is driven at different altitudes and speeds to capture videos on the ground in different trajectories. The scene contains trees, buildings of various shapes, vehicles, and moving objects. There are even flocks of birds occupying a large part of the image. At the same time, the acquisition process of some scenes includes changes in light. Some screenshots of the video obtained are as follows: Figure 7 shown.
[0089] 2. Data preprocessing: Refer to the data preprocessing file in the previous article and modify preprocess.py for the FLYING dataset. Preprocess the data to lay the foundation for the network training in the following article. The first step is to clear the unused pictures; the second step is to convert the representation of the pose into three-dimensional position and Euler angle; the third step is to calculate the mean and variance of the picture. Due to the large number of scene sequences, Figure 8 This is the output content corresponding to the third step of data preprocessing.
[0090] like Fig. 9 Construct the target dataset FLYING, and select 40, 47 as the validation set, 32, 45, 47 as the test set, and the rest of the scene sequences as the training set, which contains about 8,000 pictures. The training sample sets of the two models are made in the same way, and 5 or 6 pictures are sampled as a sample sequence by repeating one picture at a time in the order of pictures, and the pose labels are converted into the relative camera pose information between pictures. In order to run normally in the experimental platform, the center-cropped pictures are used in the training of both models.
[0091] 3. Transfer learning: Select 40 and 42 of the FLYING dataset as validation sets, 32 and 45 as test sets, and the remaining scene sequences as training sets. Based on the model and parameters saved in the unmanned vehicle visual odometer model, the adam optimization algorithm is still used to modify the dataset path and some hyperparameters before training to obtain the attention VO network structure model of the drone visual odometer based on the attention mechanism. During the training process, it takes about 200 epochs for the model's training loss and validation loss to converge to a suitable range. When the model converges well, save the corresponding network and parameters. Record the decline curve of the training loss during training as follows: Fig.10 As shown in the figure, curve A represents the training loss and curve B represents the validation loss. The iterative process is accompanied by a small range of loss fluctuations, which is due to the fact that some scene pictures are similar to the data in the previous article.
[0092] 5. Data evaluation: The average displacement, rotation error, and processing time of the visual odometer based on the UAV test dataset are compared with the results of the traditional VISO2M model as shown in Tables 1 and 2.
[0093] Table 1 Average displacement and rotation errors
[0094]
[0095] Table 2 Comparison of test time based on FLYING dataset (s)
[0096]
[0097] Through data analysis, the error of scene sequence 47 is lower than that of other test scene sequences, which is consistent with the intuitive analysis of the trajectory diagram. The main reason is that the altitude of the drone changes less in scene 47. Since the KITTI dataset is a vehicle environment dataset, there is no altitude change. On this basis, the visual odometry model trained by transfer learning has poor adaptability to changes in altitude variables.
[0098] In terms of model testing time, the attention mechanism effectively improves the parallel computing capability of the network and has obvious advantages in time performance. When the frequency is adjusted to about 20Hz, the attention VO model can still meet the real-time requirements.
[0099] This embodiment describes in detail a data acquisition device, training method, and test results of a drone visual odometer designed based on an attention mechanism of the present invention.
[0100] The above is only a preferred embodiment of the present invention, and the present invention should not be limited to the contents disclosed in the embodiment and the drawings. Any equivalent or modification completed without departing from the spirit disclosed in the present invention shall fall within the scope of protection of the present invention.
Claims
1. A UAV visual odometer navigation and positioning method based on attention mechanism, characterized in that: Relying on the convolutional layer structure based on GoogLeNet, the following steps are included: S1. Collect and create UAV vision-pose datasets, specifically: S11, using drones to collect videos of the ground at different altitudes and speeds and different trajectories; S12, using a motion estimation structure algorithm to offline solve the camera pose and mileage motion information to obtain solved pose sequence data; S13, create a FLYING dataset containing time-series images and pose sequence data, and save the images and pose labels respectively for model training; S2, obtaining a vehicle environment dataset and executing S12 and S13 to transform the public dataset into a form that is homogeneous with the FLYING dataset; S3. Build the overall network architecture of the on-board visual odometry model, including designing the convolutional layer structure of the encoding layer, image position encoding, attention mechanism to solve the relationship between sequences, and setting the loss function; S4, model training, specifically: setting the sample sequence length and the sample overlap sampling value, and repeating the collection of one picture at a time in order to produce the next sample; S5. Perform model testing and evaluation on the vehicle visual odometry model based on the vehicle environment dataset. Test the model saved during the training process on the test set to evaluate the model performance, and select the model with better test results for subsequent transfer learning. S6. Use direct transfer learning method to train the UAV visual odometry model and obtain the UAV visual odometry network structure model based on attention mechanism.
2. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1 is characterized in that: The drone collection described in S11 specifically includes: collecting straight-moving, turning, and ascending and descending moving picture data respectively and moving in the scene for as long as possible to ensure that the collected original data is obtained by traversing the drone's visual posture.
3. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1 is characterized in that: The first three digits of the calculated data in S12 represent the position coordinates, and the last four digits represent the rotation quaternion.
4. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1 is characterized in that: The vehicle-mounted environment dataset described in S2 is a vehicle-mounted urban and suburban road public dataset.
5. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1 is characterized in that: The overall network architecture described in S3 includes a CNN-attention module and a forward transmission unit; the CNN-attention module described in S3 includes a convolutional layer and several encoder layers; the convolutional layer includes a coding layer, and the coding layer is a coding layer of a flownet structure; the number of encoder layers is greater than or equal to 2.
6. The method for visual odometer navigation and positioning of unmanned aerial vehicle based on attention mechanism according to claim 5 is characterized in that: The convolutional layer in the overall network architecture of S3 is used for feature extraction, learning the relationship between sequences and balancing the weight distribution; the relationship between sequences is no longer learned in sequence according to the time label, but the temporal relationship is marked as a position code before learning, which is specifically implemented through the CNN-attention module. The structure of each encoder layer is the same, but the weights are not shared; each encoder layer includes a multi-head attention module and a feed forward module, and each module is connected to add&norm; each feature vector extracted by the convolutional layer will be input into the stacked multi-head The attention module and feed forward module obtain an output.
7. The method for visual odometer navigation and positioning of unmanned aerial vehicle based on attention mechanism according to claim 6 is characterized in that: The vehicle-mounted visual odometer model described in S3 relies on a convolutional layer structure based on GoogLeNet.
8. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1 is characterized in that: The loss function described in S3 is set based on the minimum mean square error criterion between the ground truth pose information and the predicted information.
9. The method for visual odometer navigation and positioning of unmanned aerial vehicles based on attention mechanism according to claim 1, characterized in that: S6 describes a direct push transfer learning method for training the UAV visual odometry model, specifically: a portion of the images in the FLYING dataset are selected as a validation set, a portion of the images are selected as a test set, and the remaining scene sequences are selected as a training set. Based on the model and parameters saved by the unmanned vehicle visual odometry model, the same configuration file and network structure are used, and the dataset path and some hyperparameters are modified before training to obtain a UAV visual odometry network structure model based on the attention mechanism.
Citation Information
Patent Citations
Visual mileage calculation method based on attention convolutional neural network
CN114463420A
Monocular vision inertial navigation positioning method based on self-supervised deep learning
CN114526728A
Training method for visual inertial odometer model, posture estimation method and apparatuses, electronic device, computer-readable storage medium, and program product
WO2023165093A1