Cross view image matching method based on Swin Transform

By using Swin Transformer and dual-branch network in cross-view matching, combined with feature extraction and cross-entropy loss function, the problem of insufficient robustness of traditional methods in high-altitude flying UAV image processing is solved, and higher matching accuracy is achieved. and generalization ability, especially in infrared image processing, showing excellent results.

CN118736252APending Publication Date: 2024-10-01NANJING UNIV OF SCI & TECH

Patent Information

Application Number
CN202410740881.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

The traditional cross-view matching method has insufficient robustness in processing high-altitude UAV images and is easily affected by illumination and occlusion, resulting in matching errors or missing, especially when there is a large difference between satellite and UAV images.

Method used

A cross-view image matching method based on Swin Transformer is adopted, by inputting the drone view and satellite view into the backbone network for feature extraction, using a dual-branch network and cross-entropy loss function for training, combining Patch Partition, Layer Norm and global pooling ization layer and other technologies to achieve higher matching accuracy and generalization capabilities.

Benefits of technology

The accuracy of cross-view image matching and model generalization ability are improved, especially in infrared image processing, which shows better matching effect and enhances the robustness to high-altitude flight images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736252A_ABST
    Figure CN118736252A_ABST
Patent Text Reader

Abstract

The invention provides a cross view image matching method based on a Swin Transform (Swin Transform). And carrying out image matching on the images which are obtained from the unmanned aerial vehicle carrier and the satellite carrier and are related to the same target scene, and completing two tasks of unmanned aerial vehicle target positioning and unmanned aerial vehicle navigation according to a matching result. Inputting the unmanned aerial vehicle view image and the satellite view image into a double-branch deep neural network architecture, and respectively extracting the features of the images; an image matching process is regarded as an image classification process, extracted features are input into a classification network, and a feature matching result is judged by calculating a cosine distance between double-branch features. According to the method, the SUES-200 data set is used for training and testing, and compared with other geographic positioning data sets, the data set emphasizes the characteristics of images at different heights, and the robustness of the model to different heights is proved. Compared with other geographic positioning methods based on deep learning, the method provided by the invention has the advantages of high matching precision and strong generalization ability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision, and in particular to a cross-view image matching method based on Swin Transformer. Background Art

[0002] Cross-view matching is one of the most important problems in computer vision and has a wide range of applications in image processing, navigation, remote sensing, and positioning. Satellites, airplanes, and drones are the main carriers for acquiring remote sensing images. Compared with the other two carriers, drones have the advantages of fast response speed, high image resolution, strong application expansion capabilities, and low operating costs, which makes them the main source of input images in the cross-view matching task. The standard cross-view matching task works as follows: given a query image taken at one view, the system aims to find the most relevant image in another view in a large-scale candidate image (gallery). Since the candidate images in the gallery are annotated with geotags, we can predict the location of the target location based on the retrieved geotags.

[0003] Traditional cross-view matching methods are based on hand-crafted feature descriptors such as SIFT, SURF, and ORB. However, these feature extraction methods are not robust and are susceptible to uncertainties such as illumination and occlusion, especially for high-altitude drones. False or missing matches often occur due to the large difference between the acquired image and the satellite view image. Since the release of the University-1652 dataset, deep learning methods have made great progress in the past few years. Cross-view image matching methods based on deep learning have the advantage of strong robustness. Summary of the invention

[0004] In order to overcome the shortcomings of the prior art, the present invention provides a cross-view image matching method based on Swin Transformer, which can provide higher matching accuracy and has strong generalization ability of the model, and also has good matching effect for infrared images.

[0005] The technical solution adopted by the present invention is: a cross-view image matching method based on Swin Transformer, comprising the following steps:

[0006] Step 1, divide the SUES-200 dataset into training set and test set according to height;

[0007] Step 2: Input the drone view image and satellite view image into the backbone network and use SwinTransformer for feature extraction;

[0008] Step 3, input the feature map into the classification network for training;

[0009] Step 4: Calculate the distance between each feature through the distance measurement algorithm to obtain the matching result. Determine whether the match is correct by comparing the output of the dual-branch network with the true label. Use the recall rate and average precision to evaluate the network model.

[0010] Furthermore, in step 1, the SUES-200 dataset is divided into a training set and a test set, with 120 designated locations used for training and 80 locations used as test data. Each location contains drone images at four altitudes of 150m, 200m, 250m, and 300m, and each altitude contains 50 drone images at different shooting angles and one satellite image.

[0011] In order to complete the two tasks of drone navigation and drone positioning, the test data includes query drone dataset, query satellite dataset, gallery drone dataset and gallery satellite dataset. Among them, the gallery dataset contains test data and adds training data as obfuscated data to increase the difficulty of matching.

[0012] Furthermore, in step 2, the drone view image and the satellite view image are input into the backbone network, and feature extraction is performed using Swin Transformer, which specifically includes the following steps:

[0013] First, the image is input into the Patch Partition module for block division, that is, each 4×4 adjacent pixels is a patch, and then flattened in the channel direction. The input is an RGB three-channel image, so each patch has 4×4=16 pixels, and each pixel has three values ​​of R, G, and B, so after flattening, it is 16×3=48. Therefore, after Patch Partition, the image shape changes from [H, W, 3] to [H / 4, W / 4, 48].

[0014] The linear embedding layer is used to perform a linear transformation on the channel data of each pixel, that is, the dimension of the vector is converted to a pre-set hyperparameter C. The setting of C value depends on the network type. The shape of the image is converted from [H / 4, W / 4, 48] to [H / 4, W / 4, C]. The input data [H / 4, W / 4] is straightened to become a sequence length of H / 4×W / 4=H×W / 16, and C becomes the vector dimension of each token.

[0015] Since the sequence length of [H×W / 16] patches is relatively long, the self-attention calculation given to the window is introduced. Each window is generally set to a sequence length of 7×7=49 patches. The [H / 4, W / 4, C] sequence is input to the Block of Stage 1, and the output is [H / 4, W / 4, C], ×2.

[0016] Construct a hierarchical transformer to extract multi-scale information, and pass the [H / 4, W / 4, C] output of the Block of Stage 1 into the Patch Merging module for a similar pooling downsampling operation. After the Patch Merging operation is executed, the output value is [H / 8, W / 8, 4C], simulating the channel depth doubling effect of the convolution model, and performing a 1×1 convolution to reduce 4C to 2C. Input the [H / 8, W / 8, 2C] sequence into the Block of Stage 2, and the output is [H / 8, W / 8, 2C], ×2.

[0017] The output of the Block of Stage3, [H / 8, W / 8, 2C], is passed to the Patch Merging module. After the PatchMerging operation, the output value is [H / 16, W / 16, 8C]. This simulates the channel depth doubling effect of the convolution model and performs a 1×1 convolution to reduce 8C to 4C. The sequence [H / 16, W / 16, 4C] is input to the Block of Stage3, and the output is [H / 16, W / 16, 4C], ×6.

[0018] The output of Block [H / 16, W / 16, 4C] of Stage4 is passed to the Patch Merging module. After the PatchMerging operation is performed, the output value is [H / 32, W / 32, 16C]. This simulates the channel depth doubling effect of the convolution model and performs a 1×1 convolution to reduce 16C to 8C. The sequence [H / 32, W / 32, 8C] is input to Block of Stage4 and the output is [H / 32, W / 32, 8C], ×2.

[0019] In the image classification task, in order to unify the feature size, a Layer Norm layer, a global pooling layer, and a fully connected layer are connected to obtain the output of the model.

[0020] Furthermore, in step 3, the feature map is input into the classification network for training. A shared weight fully connected layer is added after the dual-branch feature extraction network to unify the feature size. During the training process, an MLP block is added at the end of the branch, including a drop-out layer, a FC layer, and a softmax layer, and the matching process is regarded as a classification task. Each target position is regarded as a class to train the entire network. The cross entropy loss function is used as the loss function for the multi-classification task.

[0021] The cross entropy loss function is a commonly used loss function for classification tasks, and its goal is to minimize the gap between the probability distribution predicted by the model and the true distribution. The cross entropy loss function is often used in multi-classification problems, where the label of each sample can be represented as a vector in which only one element is 1 and the other elements are 0. For each sample, the cross entropy loss function calculates the negative logarithm of the predicted probability of the category with a true label of 1 as the loss. Therefore, if the model predicts the true label accurately, the cross entropy loss will be very small, otherwise it will be larger. By minimizing the cross entropy loss, the model is able to predict the category of each sample more accurately. Since the model training process is considered a multi-classification task, cross entropy is used as the loss function. is the logarithm of the ground truth y, is the probability that the model’s prediction is equal to the ground truth y.

[0022] Cross entropy loss function:

[0023] The two outputs of the two-branch network are compared with the true labels, so two loss values ​​will be obtained. s represents the loss of satellite view, L d represents the loss of the drone view, and the sum of the two is L total Optimize the entire network. The sum of the loss values ​​of the two outputs of the two-branch deep neural network: L total =L s +L d

[0024] Furthermore, in step 4, the distance between each feature is calculated by a distance measurement algorithm to obtain a matching result, and whether the match is correct is determined by comparing the output of the dual-branch network with the true label.

[0025] During the test, FC1 is first used to unify the feature map, and then FC1 and FC2 are used to calculate the distance between the feature maps respectively. By calculating the cosine distance between the two, the most similar feature vector set between the query image and the gallery image is found. A smaller cosine distance means that the feature set is less similar, and a larger cosine distance means that the pair of feature maps is more similar to each other. The network model is evaluated using recall and average precision. If the true matching image of the query image appears before the (K+1)th image in the ranking of the matching results, the value of Recall@K is set to 1, otherwise, it is set to 0. In the result analysis, K is set to 1, 5, 10, and 1% of the number of images in the gallery. AP is the area under the precision-recall curve. m is the number of true matching images of the query, and is the number of true matching images and false matching images before the true matching image in the match.

[0026] Recall:

[0027] Average Precision:

[0028] Visualize the matching results. For each target scene to be matched, select the ten most suitable candidate images. The correct matching results are outlined in yellow boxes, and the incorrect matching results are outlined in blue boxes.

[0029] Compared with the prior art, the beneficial effects of the present invention are: Swin Transformer is used as a feature extractor, and the cross-view image matching process is implemented by image classification. Compared with the previous method of using DNN network to extract features, the present invention has the advantages of high matching accuracy and strong model generalization ability.

[0030] The present invention will be further described below in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 This is a schematic diagram of cross-view image matching according to the present invention.

[0032] Figure 2 It is a schematic diagram of the network structure implementation process of the present invention.

[0033] Figure 3 This is the overall model architecture diagram of Swin Transformer.

[0034] Figure 4 This is a visualization effect diagram of the UAV positioning task in the present invention.

[0035] Figure 5 This is a visualization effect diagram of the UAV navigation task in the present invention.

[0036] Figure 6 This is a visualization diagram of the infrared UAV positioning task in the present invention.

[0037] Figure 7 This is a visualization diagram of the infrared UAV navigation mission in the present invention. DETAILED DESCRIPTION

[0038] In order to better understand the technical content of the present invention, specific embodiments are given and described as follows in conjunction with the accompanying drawings.

[0039] The present invention provides a cross-view image matching method based on Swin Transformer, comprising the following steps:

[0040] Step 1, divide the SUES-200 data set into a training set and a test set, with 120 designated locations used for training and 80 locations as test data. Each location contains drone images at four altitudes of 150m, 200m, 250m, and 300m, and each altitude contains 50 drone images at different shooting angles and one satellite image. In order to prove the feasibility of the present invention on infrared images, the data set is expanded with infrared images, and infrared drone images of three target buildings are added.

[0041] Figure 2 : is a schematic diagram of the overall process of implementing the method of the present invention. A dual-branch network structure with cross entropy loss is used to train the model. The feature map is extracted by the backbone network and the pooling layer. Then, the shared weight FC layer (FC1) unifies the feature dimension. Next, the feature map is fed into the classifier network for training. In addition, the cosine distance is used to calculate the similarity between the query image and the candidate images in the gallery for testing.

[0042] Step 2: Input the drone view image and satellite view image into the backbone network and use SwinTransformer for feature extraction.

[0043] Figure 3 This is the overall model architecture diagram of Swin Transformer.

[0044] Patch Partition module: First, the image is input into the Patch Partition module for block division, that is, each 4×4 adjacent pixels is a patch, and then flattened in the channel direction. The input is an RGB three-channel image, so each patch has 4×4=16 pixels, and each pixel has three values ​​of R, G, and B, so after flattening, it is 16×3=48. Therefore, after Patch Partition, the image shape changes from [H, W, 3] to [H / 4, W / 4, 48].

[0045] Linear Embedding layer: The linear transformation of the channel data of each pixel is performed through the Linear Embedding layer, that is, the dimension of the vector is converted into a pre-set hyperparameter C. The setting of C value depends on the network type. The shape of the image is converted from [H / 4, W / 4, 48] to [H / 4, W / 4, C]. The input data [H / 4, W / 4] is straightened to become a sequence length of H / 4×W / 4=H×W / 16, and C becomes the vector dimension of each token.

[0046] Since the sequence length of [H×W / 16] patches is relatively long, the self-attention calculation given to the window is introduced. Each window is generally set to a sequence length of 7×7=49 patches. The [H / 4, W / 4, C] sequence is input to the Block of Stage 1, and the output is [H / 4, W / 4, C], ×2.

[0047] Hierarchical transformer: Construct a hierarchical transformer to extract multi-scale information. Pass the output [H / 4, W / 4, C] of the Block of Stage 1 to the Patch Merging module for a similar pooling downsampling operation. After executing the PatchMerging operation, the output value is [H / 8, W / 8, 4C], simulating the channel depth doubling effect of the convolution model, and performing a 1×1 convolution to reduce 4C to 2C. Input the [H / 8, W / 8, 2C] sequence into the Block of Stage 2, and the output is [H / 8, W / 8, 2C], ×2.

[0048] The output of the Block of Stage3, [H / 8, W / 8, 2C], is passed to the Patch Merging module. After the PatchMerging operation, the output value is [H / 16, W / 16, 8C]. This simulates the channel depth doubling effect of the convolution model and performs a 1×1 convolution to reduce 8C to 4C. The sequence [H / 16, W / 16, 4C] is input to the Block of Stage3, and the output is [H / 16, W / 16, 4C], ×6.

[0049] The output of Block [H / 16, W / 16, 4C] of Stage4 is passed to the Patch Merging module. After the PatchMerging operation is performed, the output value is [H / 32, W / 32, 16C]. This simulates the channel depth doubling effect of the convolution model and performs a 1×1 convolution to reduce 16C to 8C. The sequence [H / 32, W / 32, 8C] is input to Block of Stage4 and the output is [H / 32, W / 32, 8C], ×2.

[0050] In the image classification task, in order to unify the feature size, a Layer Norm layer, a global pooling layer, and a fully connected layer are connected to obtain the output of the model.

[0051] In step 3, the feature map is input into the classification network for training. A shared weight fully connected layer is added after the dual-branch feature extraction network to unify the feature size. During the training process, an MLP block is added at the end of the branch, including a drop-out layer, a FC layer, and a softmax layer, and the matching process is regarded as a classification task. Each target position is regarded as a class to train the entire network. The cross entropy loss function is used as the loss function for multi-classification tasks.

[0052] Cross entropy loss function:

[0053] Step 4: Calculate the distance between each feature through the distance measurement algorithm to obtain the matching result, and judge whether the match is correct by comparing the output of the dual-branch network with the true label.

[0054] Visualize the matching results. For each target scene to be matched, select the ten most suitable candidate images. The correct matching results are outlined in yellow boxes, and the incorrect matching results are outlined in blue boxes.

[0055] Figure 4 This is a visualization effect diagram of the UAV positioning task in the present invention.

[0056] Figure 5 This is a visualization effect diagram of the UAV navigation task in the present invention.

[0057] Figure 6 This is a visualization diagram of the infrared UAV positioning task in the present invention.

[0058] Figure 7 This is a visualization diagram of the infrared UAV navigation mission in the present invention.

[0059] Although the present invention has been disclosed as above with preferred embodiments, it is not intended to limit the present invention. A person with ordinary knowledge in the technical field to which the present invention belongs may make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be determined by the definition of the claims.

Claims

1. A cross-view image matching method based on Swin Transformer, comprising the following steps: Step 1, divide the SUES-200 dataset into training set and test set according to height; Step 2: Input the drone view image and satellite view image into the backbone network and use Swin Transformer for feature extraction; Step 3, input the feature map into the classification network for training; Step 4: Calculate the distance between each feature through the distance measurement algorithm to obtain the matching result. Determine whether the match is correct by comparing the output of the dual-branch network with the true label. Use the recall rate and average precision to evaluate the network model.

2. The cross-view image matching method based on Swin Transformer according to claim 1, characterized in that: The specific process of step 1 is as follows: the SUES-200 dataset is divided into a training set and a test set, 120 designated locations are used for training, and 80 locations are used as test data. In order to complete the two tasks of drone navigation and drone positioning, the test data includes query drone dataset, query satellite dataset, gallery drone dataset and gallery satellite dataset. Among them, the gallery dataset contains test data and adds training data as obfuscation data to increase the difficulty of matching. In order to complete the two tasks of infrared drone navigation and drone positioning, the dataset is expanded to add infrared drone images of the target building.

3. The cross-view image matching method based on Swin Transformer according to claim 1, characterized in that: The specific process of step 2 is: Step 1: First, input the image into the Patch Partition module for block division, that is, each 4×4 adjacent pixels is a patch, and then flatten it in the channel direction. The input is an RGB three-channel image, so each patch has 4×4=16 pixels, and each pixel has three values ​​of R, G, and B, so after flattening, it is 16×3=48. Therefore, after Patch Partition, the image shape changes from [H, W, 3] to [H / 4, W / 4, 48]. Step 2: Use the Linear Embedding layer to perform a linear transformation on the channel data of each pixel from 48 to C. That is, the image shape is converted from [H / 4, W / 4, 48] to [H / 4, W / 4, C]. Step 3: Construct feature maps of different sizes through four stages. Except for Stage 1, which first passes through a LinearEmbedding layer, the remaining three stages all pass through a Patch Merging layer for downsampling. Next, two Swin Transformer Blocks with different structures are repeatedly stacked. The difference between the two structures is that one uses a W-MSA structure and the other uses a SW-MSA structure.

4. The cross-view image matching method based on Swin Transformer according to claim 1, characterized in that: The specific process of step 3 is as follows: add a shared weight fully connected layer after the dual-branch feature extraction network to unify the feature size. During the training process, add an MLP block at the end of the branch, including a drop-out layer, a FC layer, and a softmax layer, and treat the matching process as a classification task. Each target position is regarded as a class to train the entire network. The cross entropy loss function is used as the loss function for multi-classification tasks. Cross entropy loss function:

5. The cross-view image matching method based on Swin Transformer according to claim 1, characterized in that: The specific process of step 4 is as follows: During the test, FC1 is used to unify the feature map, and then the distance between the feature maps is calculated using FC1 and FC2 respectively. By calculating the cosine distance between the two, the most similar feature vector set between the query image and the gallery image is found. A smaller cosine distance means that the feature set is not very similar, and a larger cosine distance means that the pair of feature maps is more similar to each other. The network model is evaluated using recall and average precision: Recall: Average Precision:

Citation Information

Patent Citations

  • Cross-view-angle scene matching method for unmanned aerial vehicle image and satellite image

    CN115272719A

  • Self-attention-based method for detecting defective area of color-textured fabric

    WO2023070911A1

Cited By

  • Unmanned aerial vehicle visual geographic positioning method based on Transform and view distribution alignment

    CN120599507A