Cross-view and cross-modal geolocalization method based on multi-scale local descriptor aggregation network
Through the multi-scale local descriptor aggregation network and the cross-batch difficult sample mining method, the problem of feature detail robustness and difficult sample mining efficiency in cross-view geolocation is solved, and high-precision cross-view geolocation and retrieval accuracy are achieved.
Patent Information
- Application Number
- CN202310233836.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-13
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2043-03-13
AI Technical Summary
Existing cross-view geolocation technology is difficult to extract robust local detail features, and difficult sample mining methods are limited by batch size, resulting in stagnant training or slow updates, making it impossible to achieve high-precision cross-view geolocation.
A multi-scale local descriptor aggregation network is designed. Features are extracted through polar coordinate transformation and local multi-scale feature attention modules. Combined with the cross-batch difficult sample mining method, the most difficult negative samples are dynamically mined from the queue and the network parameters are updated. , improve the attention and retrieval accuracy of local feature details.
It achieves high-precision cross-view geographical positioning, extracts significant local multi-scale detailed features, alleviates the problem of insufficient difficult samples in small batches during training, and improves retrieval accuracy and training efficiency.
Smart Images

Figure CN116704171B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of geographic positioning technology, and specifically relates to a cross-view geographic positioning method based on a multi-scale local descriptor generation network and cross-batch difficult sample mining. Background Art
[0002] Image-based geolocation is a very important application field in computer vision. It is a geolocation method that matches a query image with a reference database image with geo-tagged images to determine the geographic location of the query image. It is a potential auxiliary positioning method in scenarios where there is no GPS signal or the GPS signal is interfered with. Since satellite images cover a wide area and are easy to collect, cross-view geolocation based on satellite-ground street view matching has become an important research direction for image-based geolocation. This technology has important application value in the fields of autonomous driving, drone navigation, unmanned delivery, etc.
[0003] Cross-view geolocation is generally defined as an image retrieval problem. Traditional methods often use traditional image descriptors such as SIFT or VLAD to generate descriptors for each image, and match the retrieval image by the similarity between the query image descriptor and the reference image descriptor. Due to the huge perspective difference between the reference satellite image and the ground image to be queried, traditional image description methods often perform poorly. In recent years, with the rapid development of deep learning methods and the emergence of large-scale cross-view geolocation datasets, cross-view geolocation methods based on deep learning have gradually become a research hotspot. Deep metric learning methods use deep networks to learn image representations and construct a metric space. In the metric space, positive pairs of images from the same location are pushed closer, and negative pairs of images from different locations are pulled farther away, so that the query image can be matched to the corresponding reference image through similarity to achieve geolocation. In order to overcome the huge perspective difference between satellite images and ground query images and extract more discriminative image features to assist retrieval, Shi proposed a polar coordinate transformation method to transform the reference satellite image into polar coordinates to reduce the perspective difference between satellite images and ground images in Spatial-aware feature aggregation for image based cross-view geo-localization [J]. Advances in Neural Information Processing Systems, 2019, 32., and proposed a spatial-aware feature aggregation module to extract global descriptors that are robust to global spatial position differences to overcome the perspective difference. Cai and Guo proposed a new intra-batch reweighted triplet loss in Ground-to-aerial image geo-localization with a hard exemplar reweighting triplet loss [C] Proceedings of the IEEE / CVF International Conference on Computer Vision. 2019: 8391-8400. to emphasize the positive role of hard examples in end-to-end training, and perform modified logistic regression on triplets with distance correction factors. Then, the reference negative distance of the corresponding anchor sample is set, and the relative weight of the triplet is calculated by comparing it with the difficulty of the corresponding anchor sample. In order to reduce the impact of extreme hard data and less useful easy examples, upper and lower bound constraints are used for pruning.Nevertheless, the existing technology still has certain limitations: ① Although the global descriptor is robust to perspective differences, it is difficult to notice subtle differences in local image details, and it is difficult to achieve higher-precision cross-perspective geolocation. ② The current difficult sample mining methods in the field of cross-perspective geolocation either only focus on mining within small batches, which is limited by the batch size and stagnates in the middle and late stages of training due to the lack of valuable difficult samples in small batches. Alternatively, a global mining method is used to mine difficult samples during sampling, but the sample update is too slow and it is impossible to screen out truly valuable difficult negative samples in real time according to the network status. Summary of the invention
[0004] Technical issues to be solved
[0005] In order to avoid the shortcomings of the prior art, the present invention provides a cross-view and cross-modal geolocation method based on a multi-scale local descriptor aggregation network and cross-batch difficult sample mining.
[0006] Technical Solution
[0007] A cross-view and cross-modal geolocation method based on a multi-scale local descriptor aggregation network is characterized by the following steps:
[0008] Step 1: Image preprocessing and input to the network
[0009] Step 1.1: Perform polar coordinate transformation on the satellite image S and convert it to the same size as the ground image to obtain S polar ;
[0010] Step 1.2: Convert the polar coordinate satellite image S polar The fourth and fifth blocks of the two parallel twin-like VGG16 backbone networks extract high- and low-level image features respectively. and
[0011] Step 2: Input the feature map into the local multi-scale feature attention module
[0012] Step 2.1: and F l g They are input into the feature compression module respectively, that is, a 2×2 maximum pooling and a 3×3 convolution are performed to reduce the feature map size, and then a 1×1 convolution is performed to reduce redundant channel information. and
[0013] Step 2.2: and After splicing along the channel direction, it is sent to the multi-scale attention fusion module to learn the respective spatial weights, and then and After weighted addition, the final feature map F is obtained s , F s Expand it into a vector to get the final descriptor D s ; and The same operation is also input into another multi-scale attention fusion module that does not share weights. After the same operation, D g ;
[0014] Step 3: Perform batch-wide hard sample mining
[0015] Step 3.1: Perform in-batch difficult sample mining, the initial network parameters are set to θ0, the network training loss function uses the soft margin weighted triplet loss, only the difficult sample mining in the small batch is performed in the early stage of training, and four difficult sample mining stages are set. The proportion of difficult sample mining in each stage is different. As the training deepens, the proportion of difficult sample mining is continuously reduced; according to the size of the current training loss value, it is judged whether to enter the next stage of difficult sample mining. In each stage, the network parameters are changed through network back propagation. The changes of network parameters in the four stages are recorded as θ0→θ1→θ2→θ3→θ4 in sequence;
[0016] Step 4: Implement cross-batch difficult sample mining
[0017] Step 4.1: Create two queues Q sat and Q grd , Q sat Store the satellite descriptors D generated for each mini-batch s and the corresponding image category label L s ,Q grd The ground descriptors and corresponding image category labels L generated for each mini-batch are stored g ;
[0018] Step 4.2: When the last batch of difficult sample mining phase ends, cross-batch difficult sample mining is performed to update the current parameter θ4. At this time, the descriptor D generated by each small batch of samples is s and D g Will be stored in queue Q sat and Q grd ; Use the positive sample and anchor sample descriptors in the current mini-batch and all negative sample descriptors in the queue to calculate the similarity, and then mine the most difficult negative sample in the queue for each positive sample in the current mini-batch and obtain the corresponding label L s and L g , reload the corresponding satellite and ground images into the network as negative samples, generate new descriptors, and calculate the triplet loss with the descriptors of the positive samples and anchor samples in the mini-batch;
[0019] Step 4.3: Put the descriptors generated by the negative samples reloaded into the network into the corresponding queue Q sat and Q grd In the process, update the queue Q sat and Q grd ;
[0020] Step 4.4: Repeat the above steps. When the queue is full, remove the earliest descriptor and update the queue Q. sat and Q grd ;
[0021] Step 4.5: Follow the above steps to traverse all images in the training dataset, calculate the loss and back propagate, update the network weights, and get the final network parameters θ f ;
[0022] Step 5: Conduct inference testing
[0023] Step 5.1: Use the trained model parameters θ f Perform reasoning to achieve cross-view geolocation, input the query image and reference image in the test set into the trained network for testing, and obtain the query image descriptor set and the reference image descriptor set;
[0024] Step 5.2: For each query image, find the satellite image descriptor that is most similar to its descriptor according to its descriptor, and use the geographic location of the satellite image descriptor as the geographic location of the query image to achieve geolocation.
[0025] A further technical solution of the present invention: in step 2.1, the convolution step size is 1, the 2×2 pooling step size is 2, the 3×3 convolution is filled with 1, and the 1×1 convolution is filled with 0.
[0026] A computer system, characterized in that it comprises: one or more processors, and a computer-readable storage medium for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method.
[0027] A computer-readable storage medium, characterized in that it stores computer-executable instructions, which are used to implement the above method when executed.
[0028] Beneficial Effects
[0029] The present invention provides a cross-view and cross-modal geolocation method based on a multi-scale local descriptor aggregation network and cross-batch difficult sample mining, and designs a high-precision cross-view geolocation network model EffGeoNet. First, the coordinate attention optimizes the feature details by weighting the rows and columns of the input feature map. The feature compression module is responsible for compressing the feature map size, removing redundant channel information, and compressing the coding length. The multi-scale attention fusion module fuses the features of two different scales using attention weighting, thereby improving the multi-scale fusion effect. In addition, in order to solve the problem of training stagnation caused by the lack of valuable difficult samples in small batches in the middle and late stages of triple loss training, the present invention designs a cross-batch difficult sample mining method, which mines the most difficult negative samples from the queue according to the current network state, expands the scope of difficult sample mining, and updates the queue descriptor in real time, so that the network can pay more attention to the local feature details that are difficult to distinguish in satellite images and street views, thereby improving the final retrieval accuracy.
[0030] 1. The present invention can extract significant local multi-scale detail features and obtain more distinguishing cross-view image features.
[0031] 2. The cross-batch difficult sample mining method CBHER proposed in the present invention can make the difficult sample mining not limited by the batch size, and can alleviate the problem of training stagnation caused by the lack of valuable difficult samples in small batches in the middle and late stages of training. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0033] Figure 1 It is a network structure diagram of an embodiment of the present invention.
[0034] Figure 2 It is a structural diagram of the feature compression module and the multi-scale attention fusion module of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0036] The present invention provides a cross-view geolocation method based on a local descriptor aggregation convolutional network, which is used in the field of cross-view geolocation by designing a new convolutional network architecture based on local descriptor aggregation and fusion of multi-scale features. The matching architecture includes a local multi-scale feature attention module (composed of two sub-modules, a feature compression module and a multi-scale attention fusion module) and a cross-batch real-time difficult sample mining module. The feature compression module is responsible for removing redundant channel information and compressing the feature map size to obtain local descriptors, and the multi-scale attention fusion module is responsible for weighted fusion of feature information extracted by two local descriptor generation modules of different scales according to channel attention. Finally, the feature map is directly expanded into a vector to obtain the final local image descriptor. The cross-batch difficult sample mining method CBHER dynamically obtains the difficult negative samples required for the current anchor sample from the data, and is not limited by the batch size during mining.
[0037] The steps include:
[0038] Step 1: Image preprocessing and input to the network
[0039] Step 1.1: Perform polar coordinate transformation on the satellite image S and convert it to the same size as the ground image to obtain S polar , initially reducing the perspective difference.
[0040] Step 1.2: The polar coordinate satellite image S in the training set polar The fourth and fifth blocks of the two parallel twin-like VGG16 backbone networks extract high- and low-level image features respectively. and (The feature map size of the fourth block is twice that of the fifth block, so we need to add 2×2 pooling to the fourth block to reduce its size to the same as the fifth block.) Note: From here on, the following operations are performed independently in the two siamese network branches in parallel, without sharing weights and without any interaction before calculating the loss.
[0041] Step 2: Input the feature map into the local multi-scale feature attention module;
[0042] Step 2.1: Then and They are input into the parallel feature compression module to reduce the spatial size of the feature map and redundant channels, so as to obtain a shorter descriptor and improve the retrieval performance. The feature compression module first performs a 2×2 pooling operation to reduce the spatial size, and then a 3×3 convolution to learn local feature details. Finally, a 1×1 convolution is performed to reduce the number of channels to 8, and an 8-channel attention map feature is obtained. and
[0043] Step 2.2: Finally, the multi-scale features of the satellite image The input is sent to the multi-scale attention fusion module to fuse the features of two different scales. The multi-scale attention fusion module first directly adds the feature maps of the two scales and calculates the attention weight accordingly. Then a global average pooling operation is performed to obtain the channel vector. The obtained vector is connected to two 1×1 convolutions to first reduce the channel to 1 / k times of the original, and then increase the number of channels by k times, and perform channel compression and expansion operations. Batch normalization and Relu activation function are added in the middle, and then the channel is divided into two vectors. Then the two vectors are connected to a softmax function to convert them into probabilities. and The corresponding weight and After weighted multiplication, the final output of the network can be obtained Then flatten it into a vector to get the descriptor D of the final output of the network s The ground image branch is input into another multi-scale attention fusion module that does not share weights according to the same operation to obtain D g .
[0044] Step 3: Perform hard sample mining within a small batch to pave the way for hard sample mining across batches. The loss function used by the network in this method is the soft margin triplet loss function. The loss calculation method when hard sample mining is not used is as follows. First, the ground images and satellite images in the training set are marked by category during calculation. Assuming that there are C categories in the training set, the polar coordinates and satellite image descriptors of the i-th category are recorded as Ground image descriptor is denoted by In a small batch of size b, there are b pairs of ground-polar coordinate satellite images from different categories. The satellite image descriptors in each pair are selected. As anchor samples, the ground image descriptors of the same category is a positive sample, and the others come from ground image descriptors of another b-1 categories. It is a negative sample, and the ground image descriptor is selected As anchor samples, there are N = 2*b*(b-1) pairs of triplets consisting of anchor samples, positive samples, and negative samples. In the following formula, Anc, Neg, Pos represent the descriptors corresponding to the anchor samples, positive samples, and negative samples in the triplet, and d is the Euclidean distance. Calculate the following loss for all triplets in a mini-batch and then sum and average them to get the soft margin triplet loss value of the current batch.
[0045]
[0046] In order for the network to learn valuable information, we need to reduce some overly simple triplets so that they do not participate in back propagation, allowing the network to focus on valuable triplets. This is also the purpose of difficult sample mining.
[0047] Step 3.1: Because it will be difficult for the network to converge if we learn too difficult samples at the beginning, we set four stages of difficult sample mining in small batches before cross-batch difficult sample mining. The difficult sample mining ratio r in each stage decreases step by step, and is set to 1, 0.1, 0.05, and 0.01 respectively, reducing the number of calculated triplets to r*N. The ratio of difficult sample mining is dynamically adjusted according to the size of the loss value on the training set. The initial network parameters are set to θ0. If the average loss value of the current training cycle is less than 0.001, the next training stage will be entered. In each training stage, only the top 100*r% of the most difficult triplets with the largest loss value in each batch will be mined according to the size of the loss value to calculate the loss. The ratio of difficult sample mining is gradually reduced so that the mined difficult samples will not be too difficult, which will make the network difficult to converge. The network parameters are changed through network back propagation in each stage. The changes in network parameters in the four stages are recorded as θ0→θ1→θ2→θ3→θ4.
[0048] Step 3.2: When the loss value of the last intra-batch difficult sample mining phase is less than 0.001, enter the cross-batch difficult sample mining phase.
[0049] Step 4: Perform cross-batch difficult sample mining;
[0050] Step 4.1: Create two FIFO queues Q sat and Q grd , the queue lengths of the two are the same, denoted as m, which are used to store satellite image descriptors and ground image descriptors and corresponding image category labels.
[0051] Step 4.2: In each training cycle, the satellite image descriptor generated for each small batch can be recorded as and ground-level image descriptors Append to the corresponding queue Q respectively sat and Q grd At the end (b is the mini-batch size).
[0052] Step 4.3: Descriptors generated from satellite images in the current mini-batch With queue Q grd The ground descriptors stored in Calculate the similarity and use matrix operations to optimize the operation to get the similarity matrix S = X × Y T (X is the current batch The concatenated b×d matrix, Y is the descriptor in the queue The m×d matrix is concatenated (where d is the descriptor length, m is the queue length, and b is the mini-batch size, with d=512, m=500, and d=3 as options). Descriptors generated from ground images in a mini-batch With queue Q sat Satellite image descriptors stored in The operation is the same as above and will not be repeated here.
[0053] Step 4.4: According to the similarity matrix S obtained above, take the maximum value in each row. The column where the maximum value is located is the column where the descriptor corresponding to the negative ground image that is most similar to the satellite image descriptor corresponding to each row is located. Based on this, find the label corresponding to the most difficult negative sample corresponding to this descriptor. In this way, for each ground image descriptor in the current batch and satellite image descriptors Use each as an anchor sample to find the most difficult negative sample in the queue. and
[0054] Step 4.5: Find hard negative examples in step 4.4 and After the labels are obtained, the hard negative samples can be reloaded from the dataset using the available labels. and Enter the network and get the descriptor of the latest state and Use this hard negative sample descriptor with the corresponding anchor samples and positive samples in the current batch and Compute the soft-margin weighted triplet loss.
[0055] Step 4.6: When the queue is full, dequeue the descriptor that entered the queue first, and then enqueue the current batch descriptor.
[0056] Step 4.7: Follow the above steps to traverse all images in the training dataset, calculate the loss and back propagate, update the network weights, and get the final network weights θ f .
[0057] Step 5: Perform inference test, using the trained model parameters θ f Perform reasoning on the test set to achieve cross-view geolocation;
[0058] Step 5.1: Satellite image database D sat All images in the training network are input to obtain descriptors and stored, and the reference image descriptor set is recorded as Ω sat Obtain query images from multiple users who need geolocation and store them in the query image set D grd, input into the trained network to obtain the descriptor and store it, and obtain the query image descriptor set denoted as Ω grd .
[0059] Step 5.2: Ω grd Each query image descriptor in Ω sat Calculate the similarity for each reference image descriptor in . For each query image G i ∈D grd Find the satellite image S that is most similar to it j ∈D sat . Using satellite images j The position of G i The geographical location of the query image is obtained and output as the result of geographical positioning. At the same time, for each query image, several satellite images that are most similar to the query image can be returned according to the similarity, and their geographical locations can be used as auxiliary references for positioning.
[0060] In order to verify the effectiveness of this method, we compared it with other methods on the CVUSA and CVACT datasets. Both the CVUSA and CVACT datasets contain 35,532 pairs of training image pairs and 8,884 pairs of test image pairs. Each pair of data contains satellite images and street view images from the same location. The network proposed in this embodiment is compared with four of the latest cross-view geolocation methods, SAFA, DSM, L2LTR, TransGeo and other networks. The specific results are shown in the following table. The evaluation indicators are commonly used indicators in the field of image retrieval, such as recall rate (Recall) top 1, top5, top1%, etc. Combined with Table 1, it can be seen that the network EffGeoNet in this embodiment achieved the best results and reached the highest Recall top 1 (95.37% on CVUSA and 86.34% on CVACT). Compared with the second best method, EffGeoNet increased the accuracy of Recall top 1 on CVUSA by 1.0% and the accuracy of Recall top 1 on CVACT by 1.4%.
[0061] Table 1 is a comparison table of test results of the method of the present invention and other existing methods in the embodiments of the present invention.
[0062]
[0063] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be included in the protection scope of the present invention.
Claims
1. A cross-view and cross-modal geolocation method based on a multi-scale local descriptor aggregation network. Features Here are the steps: Step 1: Image preprocessing and input to the network Step 1.1: Perform polar coordinate transformation on the satellite image S and convert it to the same size as the ground image to obtain S polar ; Step 1.2: Convert the polar coordinate satellite image S polar The ground image G is input into the fourth and fifth blocks of two parallel twin-like VGG16 backbone networks, and the high- and low-level image features are extracted through the fourth block. Extract high- and low-level image features through the fifth block Step 2: Input the feature map into the local multi-scale feature attention module Step 2.1: and They are input into the feature compression module respectively, that is, a 2×2 maximum pooling and a 3×3 convolution are performed to reduce the feature map size, and then a 1×1 convolution is performed to reduce redundant channel information. and Step 2.2: and After splicing along the channel direction, it is sent to the multi-scale attention fusion module to learn the respective spatial weights, and then and After weighted addition, the final feature map F is obtained s , F s Expand it into a vector to get the final descriptor D s ; and The same operation is also input into another multi-scale attention fusion module that does not share weights. After the same operation, D g ; Step 3: Perform batch-wide hard sample mining Step 3.1: Perform batch-wide hard sample mining, with the initial network parameters set to θ 0 , the network training loss function adopts soft margin weighted triplet loss. In the early stage of training, only difficult samples in small batches are mined. Four difficult sample mining stages are set. The proportion of difficult sample mining in each stage is different. As the training deepens, the proportion of difficult sample mining is continuously reduced. Whether to enter the next stage of difficult sample mining is determined according to the size of the current training loss value. In each stage, the network parameters are changed through network back propagation. The changes in network parameters in the four stages are recorded as θ in turn. 0 →θ 1 →θ 2 →θ 3 →θ 4 ; Step 4: Implement cross-batch difficult sample mining Step 4.1: Create two queues Q sat and Q grd , Q sat Store the satellite descriptors D generated for each mini-batch s And the corresponding image category label L s ,Q grd The ground descriptor D generated for each mini-batch is stored g And the corresponding image category label L g ; Step 4.2: When the last batch of difficult sample mining phase ends, cross-batch difficult sample mining is performed to update the parameters θ at this time 4 , at this time, the descriptor D generated by each small batch of samples s and D g Will be stored in queue Q sat and Q grd ; Use the positive sample and anchor sample descriptors in the current mini-batch and all negative sample descriptors in the queue to calculate the similarity, and then mine the most difficult negative sample in the queue for each positive sample in the current mini-batch and obtain the corresponding label L s and L g , reload the corresponding satellite and ground images into the network as negative samples, generate new descriptors, and calculate the triplet loss with the descriptors of the positive samples and anchor samples in the mini-batch; Step 4.3: Put the descriptors generated by the negative samples reloaded into the network into the corresponding queue Q sat and Q grd In the process, update the queue Q sat and Q grd ; Step 4.4: Repeat the above steps. When the queue is full, remove the earliest descriptor and update the queue Q. sat and Q grd ; Step 4.5: Follow the above steps to traverse all images in the training dataset, calculate the loss and back propagate, update the network weights, and get the final network parameters θ f ; Step 5: Conduct inference testing Step 5.1: Use the trained network parameters θ f Perform reasoning to achieve cross-view geolocation, input the query image and reference image in the test set into the trained network for testing, and obtain the query image descriptor set and the reference image descriptor set; Step 5.2: For each query image, find the satellite image descriptor that is most similar to its descriptor according to its descriptor, and use the geographic location of the satellite image descriptor as the geographic location of the query image to achieve geolocation.
2. According to the cross-view and cross-modal geolocation method based on the multi-scale local descriptor aggregation network of claim 1, Features: In step 2.1, the convolution step size is 1, the 2×2 pooling step size is 2, the 3×3 convolution is padded with 1, and the 1×1 convolution is padded with 0.
3. A computer system, Features include: One or more processors, and a computer-readable storage medium for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method of claim 1.
4. A computer-readable storage medium, Features Computer executable instructions are stored, and when the instructions are executed, they are used to implement the method of claim 1.
