Adaptive attention landmark building image retrieval method, system, device and medium

By adopting the adaptive attention method of Transformer structure in landmark building image retrieval, multiple local self-attention modules and local diversity regularization terms are used to solve the problems of viewing angle changes, lighting changes and occlusion in landmark building image retrieval, achieving high-precision image retrieval and reducing labor costs.

CN114579793BActive Publication Date: 2025-03-28XI'AN UNIVERSITY OF ARCHITECTURE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210332981.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-31
Publication Date
2025-03-28
Estimated Expiration
2042-03-31

AI Technical Summary

Technical Problem

The prior art is difficult to effectively deal with the phenomenon of viewing angle changes, lighting changes and occlusion in the image retrieval of landmark buildings, resulting in large appearance differences of the same landmark building, and there are many similar style buildings in the urbanization process, resulting in low differences between classes and high differences within classes, and unsatisfactory search results.

Method used

The adaptive attention landmark building image retrieval method is adopted with the Transformer structure. By designing multiple local self-attention modules and local diversity regularization terms, the ability to extract significant local information is improved, the dependence on a large amount of tag information is reduced, and labor costs are reduced.

Benefits of technology

It realizes accurate retrieval of landmark building images, improves matching accuracy, reduces the dependence of manual annotation, and promotes practical application deployment in natural scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579793B_ABST
    Figure CN114579793B_ABST
Patent Text Reader

Abstract

The present invention discloses an adaptive attention landmark building image retrieval method, system, device and medium, which collects landmark building image data in natural scenes and constructs a training data set T r With the test data set T e ; Construct an adaptive attention landmark image retrieval network using Transformer, including the Transformer image retrieval backbone network, multiple local self-attention modules and local diversity regularization terms; construct a total loss function through feature adaptive positioning function, triple loss function and classification function, and use the training dataset T of landmark retrieval r Train the landmark building image retrieval network to obtain the landmark building image retrieval model; use the test data set T e The landmark building image retrieval model is input to obtain the landmark building image retrieval result. The present invention improves the ability to extract significant local information in landmark buildings, realizes accurate retrieval of landmark building images, reduces dependence on a large amount of label information, reduces labor costs, and improves the matching accuracy of landmark images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of image retrieval methods, and specifically belongs to an adaptive attention landmark building image retrieval method, system, device and medium. Background Art

[0002] The rapid development of multimedia technology and computer industry has made the expression of information more and more diverse. As a kind of data, images account for an increasingly large proportion in people's lives. How to use computers to automatically process images and effectively distinguish images has become a hot topic in the field of image processing. Landmark building images are an important part of urban image data. The landmark building image retrieval task aims to find the same target image as the user input target from the image library, which has great application value in the fields of intelligent tourism recommendation system and modern urban construction. However, when the existing image retrieval technology is actually applied to the modern information retrieval system, the retrieval effect is not ideal. The reason is that landmark images in natural scenes have perspective changes, lighting changes, occlusion and other phenomena, which make the same landmark building have large appearance differences. At the same time, the accelerated urbanization process has led to the emergence of a large number of buildings of similar styles in the process of urban construction, resulting in high similarity between buildings of different categories, making the landmark building images have low inter-class differences and high intra-class differences.

[0003] To solve the above problems, some researchers have proposed methods based on global descriptors, but such methods do not have the ability to perceive differences in local details. For this reason, some researchers have designed methods to obtain significant local features with strong representativeness, but while relying on details, they also need to rely on a large amount of manually labeled information, resulting in low timeliness and poor applicability of the model. Summary of the invention

[0004] In order to solve the problems existing in the prior art, the present invention provides an adaptive attention landmark building image retrieval method, system, device and medium using Transformer, which improves the ability of the landmark building feature extraction network to extract significant local information in landmark buildings, realizes accurate retrieval of landmark building images, reduces dependence on a large amount of label information, reduces labor costs, improves the matching accuracy of landmark images, and is more conducive to the practical application deployment in intelligent tourism recommendation systems and modern urban construction.

[0005] To achieve the above purpose, the present invention provides the following technical solution: an adaptive attention landmark building image retrieval method, the specific steps are as follows:

[0006] S1 collects image data of landmark buildings in natural scenes and constructs a training dataset T for landmark building retrieval r With the test data set T e ;

[0007] S2 constructs an adaptive attention landmark image retrieval network using Transformer, including the Transformer image retrieval backbone network, multiple local self-attention modules, and local diversity regularization terms;

[0008] S3 constructs a total loss function through feature adaptive positioning function, triple loss function and classification function, calculates the loss value, and uses the training data set T for landmark building retrieval r Train the landmark building image retrieval network to obtain a landmark building image retrieval model;

[0009] S4 will test the data set T e Input the landmark building image retrieval model to obtain the landmark building image retrieval results.

[0010] Furthermore, in step S2, the Transformer image retrieval backbone network consists of 11 Transformer layers. The input image uses the Transformer self-attention activation module and the linear layer separated by the nonlinear activation function GELU to construct the initial feature space, generating a global feature map and N initial local feature maps.

[0011] Furthermore, in step S2, the Transformer image retrieval backbone network is connected to a multi-local self-attention module, which is composed of three LS branch networks with independent weights, each of which is composed of a normalization layer, a ReLu layer, a global average pooling layer and a softmax function.

[0012] Further, in step S2, 1) the initial local feature map Send to three independently weighted LS branch networks, each LS branch network maps the initial local feature output of the Transformer encoding layer Perform normalization operation in the channel direction, which is specifically expressed as formula (1):

[0013]

[0014] Where: h i is the annotation sequence of the initial local feature map, y is the normalized initial local feature map, and i is the training data set T r The image in .

[0015] 2) The normalized initial local feature map y passes through the ReLu layer and obtains the spatial attention weight α through the softmax activation function i vector, further calculate α i and annotation sequence h iThe weighted sum of The specific formula is as shown in formula (2):

[0016]

[0017] Where M represents the number of LS branches, and M can be 1, 2, or 3.

[0018] 3) Mapping of salient local features Use average pooling to obtain a high-dimensional local feature vector

[0019] Furthermore, in step S2, the local diversity regularization term is used to make the three most discriminative significant local feature maps Note that the training set T r Chinese landmark building image I i The most significant difference semantic information in is used to obtain the feature adaptive positioning function:

[0020]

[0021] in,[·] T represents matrix transpose, ⊙ represents matrix multiplication, I represents the unit matrix, ‖·‖ 2 Indicates the norm of the matrix, i is the training data set T r The image in .

[0022] Furthermore, in step S3, the specific form of the total loss function is:

[0023]

[0024] Among them, the feature adaptive positioning function is obtained by the local diversity regularization term, which is specifically

[0025]

[0026] in,[·] T represents matrix transpose, ⊙ represents matrix multiplication, I represents the unit matrix, ‖·‖ 2 It means to find the norm of the matrix. is the salient local feature map of the three LS branch networks, i is the training data set T r Images in;

[0027] Constructing triplet loss function For high-dimensional local feature vectors Any high-dimensional local feature vector in The discrimination of is enhanced, specifically:

[0028]

[0029] in, The high-dimensional local feature vectors representing the source sample, negative sample and positive sample of the triplet, and Represent the Euclidean distance of positive sample pairs and negative sample pairs respectively, m represents the threshold of triple loss; k represents three high-dimensional local feature vectors Any one of; i is the training data set T r Images in;

[0030] In any high-dimensional local feature vector Finally, we design a batch normalization layer, a linear layer, and a softmax layer to obtain the classification loss function, which is:

[0031]

[0032]

[0033] In the formula, is the training data set T r The correct probability distribution of sample i in the prediction is p i Predict the correct probability for each sample, N represents the total number of possible situations, represents the classification loss, BN(·) represents the normalization layer, and W represents the linear layer.

[0034] Furthermore, in step S4, the landmark building test data set T e Input the landmark building image retrieval model to obtain multiple high-dimensional local feature vectors of the landmark building Concatenate them to get joint local features The similarity is calculated by the cosine distance function, and the search results are sorted and output according to the similarity. The cosine distance function is specifically:

[0035]

[0036]

[0037] In the formula, j represents the test data set T e The image in ,|||| represents the modulus, · represents the dot product; j 1 、j 2 Represent the test data set T e Any two non-repeating images in Indicates j 1 、j 2 The joint local features corresponding to the images.

[0038] The present invention also provides an adaptive attention landmark building image retrieval system, comprising:

[0039] The data collection module is used to collect image data of landmark buildings in natural scenes and construct a training dataset T for landmark building retrieval. r With the test data set T e ;

[0040] A network building module for constructing an adaptive attention landmark image retrieval network using Transformer;

[0041] The network training module is used to construct the total loss function, calculate the loss value, and use the training dataset T retrieved from the landmark building r Train the landmark building image retrieval network to obtain a landmark building image retrieval model;

[0042] The retrieval module is used to retrieve the test dataset T e Input the landmark building image retrieval model to obtain the landmark building image retrieval results.

[0043] The present invention also provides a computer device, which includes a computer, a server or other terminal device with computing functions, and the device includes a processor and a memory connected by a bus, wherein the memory stores a program, and the program is configured to be executed by the processor, and the program includes a method for executing an adaptive attention landmark building image retrieval method in any one of claims 1-7.

[0044] The present invention also provides a computer storage medium, in which a computer program is stored. The program is executed by a processor. When the processor executes the computer program, the above-mentioned adaptive attention landmark building image retrieval method is implemented.

[0045] Compared with the prior art, the present invention has at least the following beneficial effects:

[0046] The present invention discloses an adaptive attention landmark building image retrieval method. The network body adopts a Transformer structure. By designing multiple local self-attention modules, adaptive positioning of multiple significant features in the image is achieved. At the same time, a local diversity regularization term is proposed to limit the convergence of the algorithm so that the similarity between significant local features is minimized, thereby obtaining multiple non-intersecting significant areas. The landmark building image retrieval method of the present invention solves the problems of difficulty in extracting significant local detail features of landmark buildings and loss of semantic information due to occlusion of landmark building images, reduces the loss of manpower and material resources caused by manual annotation, improves the retrieval accuracy of landmark building images, and promotes practical application deployment in natural scenes.

[0047] In the present invention, a local feature self-attention module is composed of a normalization layer, a ReLu layer, a global average pooling layer and a softmax function, through which the initial local feature map is introduced. Used to describe the saliency information in the image, and then map the initial local feature Encode into feature space, obtain detailed description perception, and calculate spatial attention weight α i Vector, mapping the significant local features with high weight in the image Perform initial positioning in feature space and design MLSN to capture multiple significant local feature maps in parallel This improves the problem of insufficient local information perception of existing methods and improves the landmark building retrieval network's ability to retrieve landmark buildings in natural scenes.

[0048] The feature adaptive localization function operation designed in the present invention constitutes a local diversity regularization term, which limits the convergence of the adaptive attention landmark building image retrieval network so that the multiple significant local feature maps obtained are The similarity between the two is minimized, so that multiple non-intersecting salient areas are obtained, making the previously obtained spatial attention weight α i Redistribution improves the diversity of spatial positions and avoids re-checking and missing of significant local information. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flow chart for the implementation of the present invention;

[0050] Figure 2 This is a network structure diagram of the present invention;

[0051] Figure 3 Schematic diagram of multiple local self-attention modules;

[0052] Figure 4 A schematic diagram of the search results of the landmark building dataset Oxford by the search method of the present invention;

[0053] Figure 5 This is a visualization diagram of some of the search results of the method of the present invention. DETAILED DESCRIPTION

[0054] The present invention will be further described below in conjunction with the accompanying drawings and specific embodiments.

[0055] like Figure 1 As shown, the present invention provides an adaptive attention landmark building image retrieval method using Transformer, and the specific steps are as follows:

[0056] 1. Construct landmark building retrieval training dataset T rWith the test data set T e , unify the size of the building image, and set the T r Perform image preprocessing operations. The specific steps include:

[0057] Obtain a considerable number of landmark images from multiple sources, and then use manual annotation methods to annotate different images of each landmark building in the landmark image into the same class, and assign each class an independent number. Repeat the above steps multiple times to construct a landmark image retrieval dataset. After the construction is completed, the data in the dataset is divided into a training dataset T according to a ratio of 7:3. r With the test data set T e , used for training the network and testing the network respectively.

[0058] Preferably, the preprocessing includes: during training, r All landmark building images in the dataset are randomly flipped up and down, left and right, and then the image preprocessing operations are performed. Then the image size is uniformly scaled to a fixed size of 256×256 and normalized.

[0059] 2. Construct an adaptive attention landmark image retrieval network using Transformer, such as Figure 2 As shown, the specific steps include:

[0060] The network mainly consists of three parts: ① The Transformer image retrieval backbone network consists of 11 Transformer layers. The input image uses the Transformer self-attention activation module and the linear layer separated by the nonlinear activation function GELU to construct the initial feature space, generating a global feature map and N initial local feature maps ②Multiple local self-attention modules are connected after Transformer to adaptively locate significant local features in the image and enhance the ability of the adaptive attention landmark image retrieval network using Transformer to focus on significant local information; ③A local diversity regularization term is designed to limit the convergence of the adaptive attention landmark image retrieval network, so that the similarities between the multiple significant features obtained are minimized, and the spatial attention obtained previously is redistributed to improve the diversity of spatial positions.

[0061] The global feature map plays a role in assisting network training and is fed into the triplet loss and classification function in subsequent networks to train the network.

[0062] 3. Implementation of the Multi-Local Self-Attention Module (MLSN), such as Figure 3 As shown, the specific steps include:

[0063] MLSN consists of three LS branches, each of which consists of a normalization layer, a ReLu layer, a global average pooling layer and a softmax function.

[0064] First, the preprocessed retrieval training dataset T r The image with a height of H and a width of W is encoded through 11 layers of Transformer to obtain a global feature map and N initial local feature maps.

[0065] Then the initial local feature map Three independently weighted LS branch networks in the multi-local self-attention module after being fed into the Transformer backbone network. Each LS branch maps the initial local feature output of the Transformer encoding layer. Perform normalization operation in the channel direction, which is specifically expressed as formula (1):

[0066]

[0067] Where: h i is the annotation sequence of the initial local feature map, and y is the normalized initial local feature map.

[0068] Next, the normalized initial local feature map y passes through the ReLu layer and the softmax activation function to obtain the spatial attention weight α i vector, further calculate α i and annotation sequence h i The weighted sum of The specific formula is as shown in formula (2):

[0069]

[0070] Where M represents the number of LS branches, Depends on the annotation sequence (h 1 ,h 2 ,…h N ), each annotation h i While focusing on the i-th information of the input sequence, it also includes the global information of the entire input sequence.

[0071] Since there are three LS branches in MLSN, each branch can generate a significant local feature map Mapping salient local features Use average pooling to obtain a high-dimensional local feature vector Where M is 1, 2, or 3, and the significant local feature map Can be defined as High-dimensional local feature vector Can be defined as

[0072] 4. Execution of the local diversity regularization term. The specific steps include:

[0073] First, a feature adaptive localization function is designed to make the three most discriminative Note that the training set T r Chinese landmark building image I i The most significant difference semantic information in the feature adaptive positioning function can be expressed as follows:

[0074]

[0075] in,[·] T represents matrix transpose, ⊙ represents matrix multiplication, I represents the unit matrix, ‖·‖ 2 It means to find the norm of a matrix.

[0076] 5. Loss calculation, the specific steps include:

[0077] The loss function consists of feature adaptive positioning function, triple loss function and classification loss function. Specifically,

[0078] Construction of triplet loss function:

[0079] To further enhance the high-dimensional local feature vector Any high-dimensional local feature vector in The discriminability of Close the distance between the Anchor (a sample randomly selected from the training data set) and the Positive (a sample belonging to the same class as the Anchor), and push away the distance from the Negative (a sample of a different class from the Anchor):

[0080]

[0081] in, The high-dimensional local feature vectors representing the source sample, negative sample and positive sample of the triplet, and Represent the Euclidean distances of positive sample pairs and negative sample pairs respectively, and m represents the threshold of triple loss;

[0082] A is the anchor representation itself, N is negative, representing samples of different classes from A, P is positive, representing samples of the same class as A, K is any one of the most significant feature branches 1, 2, and 3, and F is a high-dimensional local feature vector.

[0083] Construction of classification loss function:

[0084] Then any high-dimensional local eigenvector Finally, we design a batch normalization layer, a linear layer and a softmax layer to calculate the classification loss, which can be expressed as formula (5) and formula (6):

[0085]

[0086]

[0087] In the formula, is the training data set T r The correct probability distribution of sample i in the prediction is p i Predict the correct probability for each sample, N represents the total number of possible situations, represents the classification loss, BN(·) represents the normalization layer, and W represents the linear layer.

[0088] Therefore, as shown in formula (7), the specific form of the final total loss function is:

[0089]

[0090] 6. Landmark building retrieval network, the specific steps include:

[0091] 6.1 First, perform network training. The landmark building training dataset T obtained in step 1 r The images in the image are grouped into triplets and input into the adaptive attention landmark image retrieval network according to a certain batch size. After determining the total loss according to step 5, the adaptive attention landmark image retrieval network is trained using the Adam adaptive gradient descent algorithm to obtain the landmark image retrieval model.

[0092] 6.2 Then test the trained landmark image retrieval model and use the landmark test dataset T obtained in step 1 e Obtain the high-dimensional local feature vector of the landmark building through step 3 right Splicing is performed to obtain joint local features, joint local features It is used to represent an input image. For different landmark images, the similarity is calculated by the cosine distance function. The closest cosine value is close to 1, and the least similar cosine value is close to 0. Finally, the output results are sorted according to the similarity to complete the retrieval of landmark images. The calculation of cosine similarity and cosine distance are shown in formula (8) and formula (9) respectively.

[0093]

[0094]

[0095] In the formula, j represents the test data set T e The image in j, |||| represents the modulus, and · represents the dot product. 1 、j 2 Represent the test data set T e Any two non-repeating images in Indicates j 1 、j 2 The joint local features corresponding to the images.

[0096] Working principle of the present invention:

[0097] Step 1: Collect image data of landmark buildings in natural scenes and construct a training dataset T for landmark building retrieval r With the test data set T e Used to train and test the network designed by the present invention.

[0098] Step 2: Construct an adaptive attention landmark image retrieval network using Transformer. The adaptive attention landmark image retrieval network includes the Transformer image retrieval backbone network, multiple local self-attention modules, and local diversity regularization terms. Specifically:

[0099] 2.1, the initial feature space is constructed using the self-attention activation module of the Transformer encoding layer and the linear layer separated by the nonlinear activation function GELU to obtain a global feature map and N initial local feature maps

[0100] 2.2, MLSN module execution, through the initial local feature map Execute the specified normalization layer, ReLu layer, softmax function, and global average pooling layer operations to generate significant local feature maps Mapping of salient local features with high weights in images Perform initial positioning in feature space and capture multiple salient local features in parallel.

[0101] 2.3, Implementation of local diversity regularization, design of feature adaptive localization function, so that the three most discriminative local attention maps among the salient local features Focus on the landmark building images I i The most significant different semantic information in .

[0102] Step 3: Loss calculation: The loss value is calculated through the feature adaptive positioning function, triple loss function and classification function, and the gradient descent algorithm is used to train the landmark building image retrieval network to obtain the optimal weight parameters of the landmark building image retrieval network and obtain the landmark building image retrieval model.

[0103] Step 4: Set the landmark building test dataset T e Input the landmark building image retrieval model, obtain multiple significant local features of the landmark building, and splice them to obtain the joint local feature C j , the similarity is calculated by the cosine distance function, and the sorting results are output according to the similarity to complete the retrieval of landmark building images.

[0104] The present invention also provides an adaptive attention landmark building image retrieval system using Transformer, comprising:

[0105] The data collection module is used to collect image data of landmark buildings in natural scenes and construct a training dataset T for landmark building retrieval. r With the test data set T e ;

[0106] A network building module for constructing an adaptive attention landmark image retrieval network using Transformer;

[0107] The network training module is used to construct the total loss function, calculate the loss value, and use the training dataset T retrieved from the landmark building r Train the landmark building image retrieval network to obtain the optimal weight parameters of the landmark building image retrieval network and obtain the landmark building image retrieval model;

[0108] The retrieval module is used to retrieve the test dataset T e Input the landmark building image retrieval model to obtain the landmark building image retrieval results.

[0109] The present invention also provides a computer device, which includes a computer, a server or other terminal device with computing functions, and the device includes a processor and a memory connected through a bus, wherein the memory stores a program, and the program is configured to be executed by the processor, and the program includes a method for executing the above-mentioned adaptive attention landmark building image retrieval method using Transformer.

[0110] The present invention also provides a computer storage medium, in which a computer program is stored. The program is executed by a processor. When the processor executes the computer program, the above-mentioned adaptive attention landmark building image retrieval method using Transformer is implemented.

[0111] Figure 4 is the search result of the method of the present invention in the landmark building dataset Oxford5k. Figure 4 The first column represents the query image, and the 2nd to 6th images in each row represent the query results. Figure 4 It can be found that the method of the present invention has a good detection effect when there is a change in viewing angle, a change in illumination, etc. According to the query results, it can be found that the matching accuracy of the method of the present invention is high.

[0112] Figure 5 The method of the present invention is based on the collected training data set T t The first column shows the original images of the collected data, the second column shows the network output results when the Transformer encoding layer is used, and the third column shows the network visualization image when the method of the present invention is used. Compared with the results in the second column, it can be found that the method of the present invention simply focuses on global information instead of calculating all features, which can reduce the calculation cost, and on this basis can extract significant local detail features in the network, thereby improving the retrieval accuracy of landmark building images.

[0113] The detection performance of the method of the present invention and other excellent methods on the Oxford5k dataset is compared, and the results are shown in Table 1:

[0114] Table 1 shows the CMC (Cumulative Match Characteristic) results of the method of the present invention and the existing excellent methods on the Oxford5k dataset:

[0115] method Mean average precision (mAP) IsoMap 77.9% SiaMAC+QE* 82.9% IME 83.5% DELF+FT+ATT 83.8% Method of the present invention 84.8%

[0116] It can be seen from Table 1 that, compared with other advanced algorithms, the method of the present invention has further improved the landmark image matching performance, which is 1% higher than the mAP of the DELF+FT+ATT method, which once again proves the effectiveness of the method of the present invention.

Claims

1. An adaptive attention landmark building image retrieval method, characterized in that: The specific steps are as follows: S1 collects image data of landmark buildings in natural scenes and constructs a training dataset T for landmark building retrieval r With the test data set T e ; S2 constructs an adaptive attention landmark image retrieval network using Transformer, including the Transformer image retrieval backbone network, multiple local self-attention modules, and local diversity regularization terms; S3 constructs a total loss function through feature adaptive positioning function, triple loss function and classification function, calculates the loss value, and uses the training data set T for landmark building retrieval r Train the landmark building image retrieval network to obtain a landmark building image retrieval model; S4 will test the data set T e Input the landmark building image retrieval model to obtain the landmark building image retrieval results; In step S2, the Transformer image retrieval backbone network consists of 11 Transformer layers. The input image uses the Transformer self-attention activation module and the linear layer separated by the nonlinear activation function GELU to construct the initial feature space, generating a global feature map and N initial local feature maps f i N ; In step S2, the Transformer image retrieval backbone network is connected to a multi-local self-attention module, which consists of three LS branch networks with independent weights, where each LS branch consists of a normalization layer, a ReLu layer, a global average pooling layer, and a softmax function; In step S2, 1) the initial local feature map f i N It is fed into three LS branch networks with independent weights. Each LS branch network outputs the initial local feature map f of the Transformer encoding layer. i N The normalization operation is performed in the channel direction, which is specifically expressed as formula (1): y=LN(h1,h2,…h N ),h i =f i N (1) Where: h i is the annotation sequence of the initial local feature map, y is the normalized initial local feature map, and i is the training data set T r Images in; 2) The normalized initial local feature map y passes through the ReLu layer and obtains the spatial attention weight α through the softmax activation function i vector, further calculate α i and annotation sequence h i The weighted sum of The specific formula is as shown in formula (2): In the formula, M represents the number of LS branches, and M is 1, 2, or 3; 3) Mapping of salient local features Use average pooling to obtain a high-dimensional local feature vector In step S2, the local diversity regularization term is used to make the three most discriminative salient local feature maps Note that the training set T r Chinese landmark building image I i The most significant difference semantic information in is used to obtain the feature adaptive positioning function: in,[·] T represents matrix transpose, ⊙ represents matrix multiplication, I represents the unit matrix, ‖·‖ 2 Indicates the norm of the matrix, i is the training data set T r The image in .

2. The adaptive attention landmark building image retrieval method according to claim 1, characterized in that: In step S3, the specific form of the total loss function is: Among them, the feature adaptive positioning function is obtained by the local diversity regularization term, which is specifically in,[·] T represents matrix transpose, ⊙ represents matrix multiplication, I represents the unit matrix, ‖·‖ 2 It means to find the norm of the matrix. is the salient local feature map of the three LS branch networks, i is the training data set T r Images in; Constructing triplet loss function For high-dimensional local feature vectors Any high-dimensional local feature vector in The discrimination of is enhanced, specifically: in, The high-dimensional local feature vectors representing the source sample, negative sample and positive sample of the triplet, and Represent the Euclidean distance of positive sample pairs and negative sample pairs respectively, m represents the threshold of triple loss; k represents three high-dimensional local feature vectors Any one of; i is the training data set T r Images in; In any high-dimensional local feature vector Finally, a batch normalization layer, a linear layer and a softmax layer are designed to obtain the classification loss function, which is: In the formula, is the training data set T r The correct probability distribution of sample i in the prediction is p i Predict the correct probability for each sample, N represents the total number of possible situations, represents the classification loss, BN(·) represents the normalization layer, and W represents the linear layer.

3. The adaptive attention landmark building image retrieval method according to claim 1, characterized in that: In step S4, the landmark building test dataset T e Input the landmark building image retrieval model to obtain multiple high-dimensional local feature vectors of the landmark building Concatenate them to get joint local features The similarity is calculated by the cosine distance function, and the search results are sorted and output according to the similarity. The specific cosine distance function is: In the formula, j represents the test data set T e The image in, |||| represents the modulus, · represents the dot product; j1, j2 represent the test data set T e Any two non-repeating images in Represents the joint local features corresponding to the j1 and j2 images respectively.

4. An adaptive attention landmark image retrieval system, characterized in that: The system executes an adaptive attention landmark building image retrieval method according to any one of claims 1 to 3, and the system comprises: The data collection module is used to collect image data of landmark buildings in natural scenes and construct a training dataset T for landmark building retrieval. r With the test data set T e ; A network building module for constructing an adaptive attention landmark image retrieval network using Transformer; The network training module is used to construct the total loss function, calculate the loss value, and use the training dataset T retrieved from the landmark building r Train the landmark building image retrieval network to obtain a landmark building image retrieval model; The retrieval module is used to retrieve the test dataset T e Input the landmark building image retrieval model to obtain the landmark building image retrieval results.

5. A computer device, characterized in that: The computer device includes a computer, a server or other terminal device with computing functions, and the device includes a processor and a memory connected by a bus, wherein the memory stores a program, and the program is configured to be executed by the processor, and the program includes a method for executing an adaptive attention landmark building image retrieval method in any one of claims 1-3.

6. A computer storage medium, characterized in that: The computer storage medium stores a computer program, and the program is executed by a processor. When the processor executes the computer program, an adaptive attention landmark building image retrieval method as described in any one of claims 1 to 3 is implemented.

Citation Information

Patent Citations

  • Remote sensing image retrieval method and device based on residual attention

    CN113220915A

  • Local feature alignment pedestrian re-identification method based on deep learning

    CN113221625A