Multi-source remote sensing visual question answering method and system based on text information guidance
Through a multi-source remote sensing visual question and answer method guided by text information, using multi-head cross-attention and self-attention mechanisms for feature fusion, it solves the problem of insufficient information from a single optical sensor, improves the accuracy of remote sensing visual question and answer, and realizes optical remote sensing Complementary fusion of features of images and SAR images.
Patent Information
- Application Number
- CN202410919970.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing remote sensing visual question answering methods are limited by the lack of information from a single optical sensor, resulting in low answer accuracy in complex remote sensing scenarios.
A multi-source remote sensing visual question and answer method based on text information guidance is used to extract and enhance features of RGB images, SAR images and question texts, use the QGF model for feature fusion, and combine multi-head cross-attention and self-attention mechanisms to realize optical remote sensing. The features of images and SAR images are complementary and fused to improve the accuracy of answers.
It improves the answer accuracy of remote sensing visual question and answer tasks, makes full use of the correlation and complementarity of different modalities, deeply mines regional features related to the question in the image, and enhances the discriminative feature fusion of optical remote sensing images and SAR images.
Smart Images

Figure CN118469022B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the fields of computer vision and natural language processing, and in particular to a multi-source remote sensing visual question answering method and system based on text information guidance. Background Art
[0002] The visual question answering task aims to enable computer systems to understand images and answer questions related to the image content. It is an intersection of computer vision and natural language processing. Visual question answering models usually have strong multimodal understanding capabilities. They take images and natural language questions related to the image content as input and output natural language answers. Research on visual question answering can effectively improve the naturalness and efficiency of human-computer interaction, help the visually impaired better understand the surrounding environment, enable computer systems to deeply understand the image content (including entities, scenes and their relationships in the image), and promote progress in cross-modal learning, multimodal learning and other directions.
[0003] The remote sensing image visual question answering task is the application and extension of the visual question answering task on remote sensing images. Remote sensing images are images of the earth's surface obtained by remote sensing technology. These images can capture various important features of the earth's surface, including terrain, land cover, vegetation, water bodies, etc., and can be widely used in resource management, environmental monitoring, urban planning, disaster response, resource exploration and other aspects. Compared with images in natural scenes, images in remote sensing scenes often contain richer ground object information, greater multi-scale differences and more complex entity relationships. Therefore, the visual question answering method cannot be simply applied to remote sensing scenes, and targeted designs are often required. Remote sensing image visual question answering is to achieve intelligent interpretation of remote sensing images by asking questions in natural language. It can effectively improve the efficiency of remote sensing interpretation, reduce the labor cost of remote sensing interpretation, reduce the technical threshold of remote sensing interpretation, and strongly promote the intelligent application of remote sensing images. Therefore, the visual question answering (RSVQA) technology for remote sensing images has great research significance and application value.
[0004] Unlike natural scene images, remote sensing images often have more complex ground information and greater scale differences, which brings a lot of challenges to remote sensing image visual question answering tasks. In order to meet the above challenges, researchers have proposed various methods to deeply mine multi-scale features and their spatial location information in optical remote sensing images, such as scale-guided fusion, image-based prompt generation, and multimodal feature learning. Although these methods have made some progress, in order to explore comprehensive and accurate visual question answering in complex remote sensing scenes, the limitations of optical sensor imaging cannot be ignored. Existing algorithms are still limited by the limitations of a single sensor scene information volume, resolution, and spectrum, and it is difficult to meet the needs in complex environments. For example, a method, device, electronic device, and storage medium for attention visual question answering disclosed in Chinese Patent Publication No. CN117173715A uses a single optical sensor to obtain images, and its effect on remote sensing visual question answering is limited by the lack of information from a single optical sensor. Summary of the invention
[0005] The technical problem to be solved by the present invention is that the effect of the existing remote sensing visual question answering method on remote sensing visual question answering is limited by problems such as the lack of information from a single optical sensor, resulting in low accuracy in answering remote sensing visual question answering tasks.
[0006] The present invention solves the above technical problems by the following technical means: a multi-source remote sensing visual question answering method based on text information guidance, comprising the following steps:
[0007] Step 1: Extract features of RGB image, SAR image and input question respectively to obtain RGB features, SAR features and original text features;
[0008] Step 2: The original text features and RGB features are input into the first feature enhancement model to obtain RGB enhanced features, and the original text features and SAR features are input into the second feature enhancement model to obtain SAR enhanced features;
[0009] Step 3: RGB enhanced features, SAR enhanced features and original text features are input into the QGF model to obtain fusion features;
[0010] Step 4: Input the fused features and the original text features into the first decoder to obtain the image features of the fused text features, input the original text features and the fused features into the second decoder to obtain the text features of the fused image features, take the average of the text features of the fused image features and the image features of the fused text features in one dimension and then concatenate them, and then pass through an FFN network and softmax operation to obtain the final predicted answer to the remote sensing visual question answering task.
[0011] Furthermore, the step 1 comprises:
[0012] The CLIP image encoder is used to extract features from RGB images and SAR images to obtain RGB features and SAR features respectively; then the CLIP text encoder is used to extract features from the input question to obtain the original text features.
[0013] Furthermore, the first feature enhancement model and the second feature enhancement model in the step 2 have the same structure. The first feature enhancement model includes a KRS module, a first MCA module and a second MCA module connected in sequence. The KRS module and the first MCA module both receive original text features, the KRS module and the second MCA module both receive RGB features, and the second MCA module outputs RGB enhanced features.
[0014] Furthermore, the processing process of the first feature enhancement model is:
[0015] The KRS module receives the RGB features and the original text features and outputs the block features of the problem to the first MCA module;
[0016] The first MCA module uses the original text features as the query vector Q, the block features of the question as the key vector K and the value vector V, performs a multi-head cross attention operation, and obtains the text features of the fused block features;
[0017] The second MCA module uses RGB features as the query vector Q and the text features of the fused block features as the key vector K and value vector V, and performs a multi-head cross-attention operation to obtain RGB enhanced features.
[0018] Furthermore, the processing process of the KRS module in the first feature enhancement model is:
[0019] Regional feature acquisition: The RGB features are evenly divided into N regions, each region contains M blocks, and the features of each region are represented by the mean of the features of all the blocks contained in the region;
[0020] Region feature selection: Take the average of the original text features in 1 dimension to obtain the overall representation of the question. The overall representation of the question is used as the query vector Q, and the features of the N regions are used as the key vector K. Attention calculations are performed on each region to obtain the attention score S. The attention scores S are sorted from large to small, and the top k regions with the highest attention scores S are selected. The indexes of these top k regions in the RGB features are returned as the region indexes.
[0021] Convert regional features to block features: According to the correspondence between each region and block and the regional index, the index of the block corresponding to the Topk regions in the RGB feature is obtained as the block index;
[0022] Output block features: According to the block index, obtain the features corresponding to these blocks, that is, the block features that the problem focuses on.
[0023] Furthermore, the processing process of the QGF model in step 3 is:
[0024] The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module, and multi-head self-attention operations are performed on each of them. Then, the original text features after the multi-head self-attention operation are averaged in 1 dimension to obtain the global representation of the entire text;
[0025] The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S. sar and attention rgb , and divide the attention sar and attention rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
[0026] Furthermore, the model adopted by the multi-head cross-attention operation, attention calculation and multi-head self-attention operation is a scaled dot product model.
[0027] Furthermore, in step 4, the first decoder and the second decoder have the same structure, and the processing process of the first decoder is:
[0028] The image fusion features and the original text features are input into the first decoder. The image fusion features are first subjected to a layer normalization operation, and then input into the fourth MSA module for a multi-head self-attention operation. They are used as the query vector Q of the third MCA module, and the original text features are used as the key vector K and value vector V of the third MCA module for a multi-head cross-attention operation. Then, they are subjected to a layer normalization operation and a MLP network to obtain the image features of the fused text features.
[0029] The present invention also provides a multi-source remote sensing visual question answering system based on text information guidance, comprising:
[0030] The feature extraction module is used to extract features from the RGB image, SAR image and input question respectively to obtain RGB features, SAR features and original text features;
[0031] A feature enhancement module, which is used to input the original text features and RGB features into a first feature enhancement model to obtain RGB enhanced features, and to input the original text features and SAR features into a second feature enhancement model to obtain SAR enhanced features;
[0032] Complementary fusion module, which is used to input RGB enhanced features, SAR enhanced features and original text features into the QGF model to obtain image fusion features;
[0033] The inference decoding module is used to input the image fusion features and the original text features into the first decoder to obtain the image features of the fused text features, and input the original text features and the image fusion features into the second decoder to obtain the text features of the fused image features. The text features of the fused image features and the image features of the fused text features are averaged in one dimension and then concatenated. The final predicted answer to the remote sensing visual question answering task is obtained through an FFN network and softmax operation.
[0034] Furthermore, the feature extraction module is also used for:
[0035] The CLIP image encoder is used to extract features from RGB images and SAR images to obtain RGB features and SAR features respectively; then the CLIP text encoder is used to extract features from the input question to obtain the original text features.
[0036] Furthermore, the first feature enhancement model and the second feature enhancement model in the feature enhancement module have the same structure, the first feature enhancement model includes a KRS module, a first MCA module and a second MCA module connected in sequence, the KRS module and the first MCA module both receive original text features, the KRS module and the second MCA module both receive RGB features, and the second MCA module outputs RGB enhanced features.
[0037] Furthermore, the processing process of the first feature enhancement model is:
[0038] The KRS module receives the RGB features and the original text features and outputs the block features of the problem to the first MCA module;
[0039] The first MCA module uses the original text features as the query vector Q, the block features of the question as the key vector K and the value vector V, performs a multi-head cross attention operation, and obtains the text features of the fused block features;
[0040] The second MCA module uses RGB features as the query vector Q and the text features of the fused block features as the key vector K and value vector V, and performs a multi-head cross-attention operation to obtain RGB enhanced features.
[0041] Furthermore, the processing process of the KRS module in the first feature enhancement model is:
[0042] Regional feature acquisition: The RGB features are evenly divided into N regions, each region contains M blocks, and the features of each region are represented by the mean of the features of all the blocks contained in the region;
[0043] Region feature selection: Take the average of the original text features in 1 dimension to obtain the overall representation of the question. The overall representation of the question is used as the query vector Q, and the features of the N regions are used as the key vector K. Attention calculations are performed on each region to obtain the attention score S. The attention scores S are sorted from large to small, and the top k regions with the highest attention scores S are selected. The indexes of these top k regions in the RGB features are returned as the region indexes.
[0044] Convert regional features to block features: According to the correspondence between each region and block and the regional index, the index of the block corresponding to the Topk regions in the RGB feature is obtained as the block index;
[0045] Output block features: According to the block index, obtain the features corresponding to these blocks, that is, the block features that the problem focuses on.
[0046] Furthermore, the processing process of the QGF model in the complementary fusion module is:
[0047] The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module, and multi-head self-attention operations are performed on each of them. Then, the original text features after the multi-head self-attention operation are averaged in 1 dimension to obtain the global representation of the entire text;
[0048] The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S. sar and attention rgb , and divide the attention sar and attention rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
[0049] Furthermore, the model adopted by the multi-head cross-attention operation, attention calculation and multi-head self-attention operation is a scaled dot product model.
[0050] Furthermore, the first decoder and the second decoder in the inference decoding module have the same structure, and the processing process of the first decoder is:
[0051] The image fusion features and the original text features are input into the first decoder. The image fusion features are first subjected to a layer normalization operation, and then input into the fourth MSA module for a multi-head self-attention operation. They are used as the query vector Q of the third MCA module, and the original text features are used as the key vector K and value vector V of the third MCA module for a multi-head cross-attention operation. Then, they are subjected to a layer normalization operation and a MLP network to obtain the image features of the fused text features.
[0052] The advantages of the present invention are:
[0053] (1) The input of the present invention is RGB image, SAR image and question text. The key contents of RGB image and SAR image, namely RGB features and SAR features, are enhanced and highlighted respectively by using the question text, namely the original text features. Then, the QGF model is used to guide the complementary fusion of the advantageous features corresponding to the RGB enhanced features and SAR enhanced features. The correlation and complementarity of different modalities are fully utilized to realize the complementary fusion of the discriminative features of the optical remote sensing image and the SAR image, extract and fuse the features in the optical image and the SAR image, so as to guide the remote sensing visual question answering task and improve the accuracy of the answer.
[0054] (2) The present invention designs a first feature enhancement model and a second feature enhancement model to enhance the features of optical images (RGB images) and SAR images from coarse to fine. Specifically, two multi-head cross-attention operations are used on the optical image and SAR image respectively to enhance their features with high relevance to the text. In order to preliminarily search for key areas of the image, the attention mechanism is used to embed the block features of the problem into the image; relying on the feature enhancement capability of the multi-head cross-attention mechanism, the text is first embedded in the enhanced image features (that is, the text features of the fused block features are obtained) to achieve coarse and fine granularity text feature expression; then the enhanced text features are embedded in the original image features (that is, the RGB enhanced features are obtained based on the text features of the fused block features) to obtain fine-grained image representation. Multiple attention operations can deeply mine the regional features related to the problem in the image.
[0055] (3) The present invention also designs a QGF model to find the relative advantages of each feature based on the correlation between the question features and the corresponding areas of the optical image and the SAR image, so as to achieve complementary fusion and improve the accuracy of answering remote sensing visual question answering tasks. First, the attention mechanism is used to obtain the text-guided image attention matrix (i.e., the weight matrix W sar and the weight matrix W rgb). Then, the weighted dot product is used to guide the fusion of optical images and SAR images to integrate the complementary information of the two modalities. Finally, the fused image features and text features are averaged in 1 dimension and then added together, and then passed through an FFN network and softmax operation to obtain the final predicted answer for the remote sensing visual question answering task. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 A schematic diagram of the question-answering process structure of the multi-source remote sensing visual question-answering method based on text information guidance disclosed in an embodiment of the present invention;
[0057] Figure 2 It is a structural schematic diagram of the first feature enhancement model in the multi-source remote sensing visual question answering method based on text information guidance disclosed in an embodiment of the present invention;
[0058] Figure 3 A schematic diagram of the structure of a QGF model in a multi-source remote sensing visual question answering method based on text information guidance disclosed in an embodiment of the present invention;
[0059] Figure 4 It is a structural schematic diagram of the MSA module in the multi-source remote sensing visual question answering method based on text information guidance disclosed in an embodiment of the present invention;
[0060] Figure 5 This is a schematic diagram of the structure of the first decoder in the multi-source remote sensing visual question answering method based on text information guidance disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0062] Example 1
[0063] like Figure 1 As shown, the present invention provides a multi-source remote sensing visual question answering method based on text information guidance, comprising the following steps:
[0064] S1. Use CLIP image encoder to extract features from RGB images and SAR images respectively to obtain RGB features and SAR features respectively; then use CLIP text encoder to extract features from the input question to obtain original text features; both SAR images and RGB images use CLIP image encoder to further narrow the difference between the two modalities, which is conducive to multi-modal fusion. Among them, CLIP image encoder and CLIP text encoder are both CLIP models. The CLIP model is pre-trained for image-text comparison learning on 400 million paired image-text pairs, which can effectively shorten the distance between semantically similar images and texts in the feature space. The CLIP model is an existing technology and is pre-trained. For details of the CLIP model, please refer to the document "Y. Bazi, MMA Rahhal, ML Mekhalfi, MAA Zuair and F. Melgani, "Bi-Modal Transformer-Based Approach for Visual Question Answering in Remote Sensing Imagery," in IEEE Transactions on Geoscience and Remote Sensing, vol. 60, pp.1-11, 2022, Art no. 4708011, doi: 10.1109 / TGRS.2022.3192460.".
[0065] S2, the original text features and RGB features are input into the first feature enhancement model to obtain RGB enhanced features, and the original text features and SAR features are input into the second feature enhancement model to obtain SAR enhanced features; Figure 1 REM is the feature enhancement model. This embodiment uses two feature enhancement models with the same structure. In order to distinguish them, they are described as the first feature enhancement model and the second feature enhancement model. Figure 2 As shown in the figure, since the first feature enhancement model and the second feature enhancement model have the same structure, the two only differ in input and output data. The second feature enhancement model only needs to Figure 2 The RGB features in are replaced by SAR features, and the RGB enhanced features are replaced by SAR enhanced features. The following only introduces the first feature enhancement model, and the second feature enhancement model is not described in detail.
[0066] Continue reading Figure 2The first feature enhancement model includes a KRS module, a first MCA module and a second MCA module connected in sequence, the KRS module and the first MCA module both receive original text features, the KRS module and the second MCA module both receive RGB features, and the second MCA module outputs RGB enhanced features. The processing process of the first feature enhancement model is:
[0067] The KRS module receives the RGB features and the original text features and outputs the block features of the problem to the first MCA module;
[0068] The first MCA module uses the original text features as the query vector Q, the block features of the question as the key vector K and the value vector V, performs a multi-head cross-attention operation, obtains the text features of the fused block features, and achieves preliminary feature enhancement.
[0069] After the initial feature enhancement, the second MCA module uses RGB features as the query vector Q and the text features of the fused block features as the key vector K and value vector V to perform a multi-head cross-attention operation to obtain RGB enhanced features and achieve the second feature enhancement. Through the two attention mechanisms, the problem representation that focuses on the information of the key areas of the image can be integrated into the optical image and SAR image respectively, thereby achieving the focusing and enhancement of the key features of the two.
[0070] As a further improvement, the processing process of the KRS module in the first feature enhancement model is:
[0071] Regional feature acquisition: The RGB features are evenly divided into N regions, each region contains M blocks, and the features of each region are represented by the mean of the features of all the blocks contained in the region;
[0072] Region feature selection: Take the average of the original text features in 1 dimension to obtain the overall representation of the question. The overall representation of the question is used as the query vector Q, and the features of the N regions are used as the key vector K. Attention calculations are performed on each region to obtain the attention score S. The attention scores S are sorted from large to small, and the top k regions with the highest attention scores S are selected. The indexes of these top k regions in the RGB features are returned as the region indexes.
[0073] Convert regional features to block features: According to the correspondence between each region and block and the regional index, the index of the block corresponding to the Topk regions in the RGB feature is obtained as the block index;
[0074] Output block features: According to the block index, obtain the features corresponding to these blocks, that is, the block features that the problem focuses on.
[0075] The models used in the multi-head cross attention operation, attention calculation and multi-head self-attention operation involved in this embodiment include additive model, dot product model, scaled dot product model, bilinear model, etc. This embodiment preferably uses the scaled dot product model. The formula of the scaled dot product model is:
[0076]
[0077] in, Represents the result of the scaled dot product model calculation, represents the dimension of the query vector, Represents a transpose operation.
[0078] Since the regional feature selection uses the overall representation of the problem as the query vector Q and the features of N regions as the key vector K, the attention calculation is performed to obtain the attention score S. This process is equivalent to the scaling dot product model omitting the value vector V. Therefore, the formula for attention calculation in the regional feature selection process is:
[0079] .
[0080] S3, RGB enhancement features, SAR enhancement features and original text features are all input into the QGF model to obtain image fusion features; wherein the QGF model is an important improvement of the present invention, which finds the relative advantage features of each according to the correlation between the problem features and the corresponding areas of the RGB image and the SAR image, thereby performing complementary fusion. Figure 3 As shown, the processing process of the QGF model is:
[0081] The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module, and multi-head self-attention operations are performed respectively. Then, the original text features after the multi-head self-attention operation are averaged in 1 dimension to obtain the global representation of the entire text; the structures of the first to third MSA modules are exactly the same, such as Figure 4 As shown, the MSA module includes eight independent self-attention heads operating in parallel, and each head uses the scaled dot product similarity between Q, K and V to calculate different attention scores. The calculation method of the attention score is the same as the scaled dot product model formula above. The results calculated by each attention head are spliced on the -1 dimension and then passed through a fully connected network to obtain the result. The query vector Q, key vector K and value vector V of the MSA module come from the same feature. For example, when the first MSA module performs a multi-head self-attention operation, the query vector Q, key vector K and value vector V come from the RGB enhanced feature.
[0082] The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S. sar and attention rgb The calculation method of attention calculation is the same as the above attention calculation formula, that is, the global representation of the entire text is used as the query vector Q, and the RGB enhanced features after the multi-head self-attention operation are used as the key vector K to obtain the attention score S sar , the global representation of the entire text is used as the query vector Q, and the SAR enhanced features after the multi-head self-attention operation are used as the key vector K to obtain the attention score S rgb , and divide the attention sar and attention rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
[0083] S4, the image fusion features and the original text features are input into the first decoder to obtain the image features of the fused text features, the original text features and the image fusion features are input into the second decoder to obtain the text features of the fused image features, the text features of the fused image features and the image features of the fused text features are averaged in 1 dimension and then concatenated, and then a FFN network and softmax operation are performed to obtain the final predicted answer to the remote sensing visual question answering task. The first decoder and the second decoder have the same structure, such as Figure 5 As shown in FIG. 1 , the processing process of the first decoder is as follows: the image fusion feature and the original text feature are input into the first decoder, the image fusion feature is first subjected to a layer normalization operation, and then input into the fourth MSA module for a multi-head self-attention operation, and then used as the query vector Q of the third MCA module, the original text feature is used as the key vector K and the value vector V of the third MCA module for a multi-head cross-attention operation, and then subjected to a layer normalization operation and the MLP network to obtain the image feature of the fused text feature. The layer normalization operation is the LayerNorm operation. The LayerNorm operation is Figure 5The fourth MSA module has the same structure as the first to third MSA modules mentioned above, and will not be described here. The first MCA module, the second MCA module, and the third MCA module perform multi-head cross attention operations in the same way as the MSA module performs multi-head self-attention operations, except that the input query vector Q, key vector K, and value vector V are different. The query vector Q, key vector K, and value vector V of the MSA module come from the same feature, and the query vector Q, key vector K, and value vector V input by the first MCA module, the second MCA module, and the third MCA module come from different features. The first MCA module, the second MCA module, and the third MCA module perform multi-head cross attention operations in which each attention head uses the scaled dot product similarity between Q, K, and V to calculate different attention scores. The calculation method of the attention score is the same as the scaled dot product model formula above. The results calculated by each attention head are spliced in the -1 dimension, and then passed through a fully connected network to obtain the result.
[0084] The text features of the fused image features and the image features of the fused text features are respectively averaged in one dimension and then concatenated, and then a FFN network and a softmax operation are performed to obtain the final predicted answer to the remote sensing visual question answering task. The relevant formula is expressed as follows:
[0085]
[0086] in, represents the answer of the remote sensing visual question answering task for the i-th input image to the final prediction, represents the text features fused with image features, Represents image features fused with text features, It represents the global average pooling operation, and FC represents the FC layer, which is a type of FFN network structure.
[0087] It should be noted that the above steps S1 to S4 are only Figure 1 The execution process of the entire model architecture is described in the text. In practical applications, the model architecture should be trained before it is put into use. The present invention trains the entire model architecture by optimizing the standard cross entropy loss in batches on the training set. It mainly adjusts the parameters and weights of each module in the entire model architecture, calculates the total loss, and stops training when the total loss is the smallest to obtain the optimal architecture. The total loss on the training set is shown below:
[0088]
[0089] in, represents the true value result of the visual question answering of the i-th input image pair, express , is the number of input image pairs.
[0090] Through the above technical scheme, the input of the present invention is RGB image, SAR image and question text. The key contents of RGB image and SAR image, namely RGB features and SAR features, are enhanced and highlighted respectively by using the question text, namely the original text features. Then, the QGF model is used to guide the complementary fusion of the advantageous features corresponding to the RGB enhanced features and SAR enhanced features. The correlation and complementarity of different modalities are fully utilized to realize the complementary fusion of the discriminative features of the optical remote sensing image and the SAR image, and the features in the optical image and the SAR image are extracted and fused to guide the remote sensing visual question answering task and improve the accuracy of the answer.
[0091] Example 2
[0092] Based on Example 1, Example 2 of the present invention further provides a multi-source remote sensing visual question answering system based on text information guidance, including:
[0093] The feature extraction module is used to extract features from the RGB image, SAR image and input question respectively to obtain RGB features, SAR features and original text features;
[0094] A feature enhancement module, which is used to input the original text features and RGB features into a first feature enhancement model to obtain RGB enhanced features, and to input the original text features and SAR features into a second feature enhancement model to obtain SAR enhanced features;
[0095] Complementary fusion module, which is used to input RGB enhanced features, SAR enhanced features and original text features into the QGF model to obtain image fusion features;
[0096] The inference decoding module is used to input the image fusion features and the original text features into the first decoder to obtain the image features of the fused text features, and input the original text features and the image fusion features into the second decoder to obtain the text features of the fused image features. The text features of the fused image features and the image features of the fused text features are averaged in one dimension and then concatenated. The final predicted answer to the remote sensing visual question answering task is obtained through an FFN network and softmax operation.
[0097] Specifically, the feature extraction module is also used for:
[0098] The CLIP image encoder is used to extract features from RGB images and SAR images to obtain RGB features and SAR features respectively; then the CLIP text encoder is used to extract features from the input question to obtain the original text features.
[0099] Specifically, the first feature enhancement model and the second feature enhancement model in the feature enhancement module have the same structure. The first feature enhancement model includes a KRS module, a first MCA module and a second MCA module connected in sequence. The KRS module and the first MCA module both receive original text features, the KRS module and the second MCA module both receive RGB features, and the second MCA module outputs RGB enhanced features.
[0100] More specifically, the processing process of the first feature enhancement model is:
[0101] The KRS module receives the RGB features and the original text features and outputs the block features of the problem to the first MCA module;
[0102] The first MCA module uses the original text features as the query vector Q, the block features of the question as the key vector K and the value vector V, performs a multi-head cross attention operation, and obtains the text features of the fused block features;
[0103] The second MCA module uses RGB features as the query vector Q and the text features of the fused block features as the key vector K and value vector V, and performs a multi-head cross-attention operation to obtain RGB enhanced features.
[0104] More specifically, the processing process of the KRS module in the first feature enhancement model is:
[0105] Regional feature acquisition: The RGB features are evenly divided into N regions, each region contains M blocks, and the features of each region are represented by the mean of the features of all the blocks contained in the region;
[0106] Region feature selection: Take the average of the original text features in 1 dimension to obtain the overall representation of the question. The overall representation of the question is used as the query vector Q, and the features of the N regions are used as the key vector K. Attention calculations are performed on each region to obtain the attention score S. The attention scores S are sorted from large to small, and the top k regions with the highest attention scores S are selected. The indexes of these top k regions in the RGB features are returned as the region indexes.
[0107] Convert regional features to block features: According to the correspondence between each region and block and the regional index, the index of the block corresponding to the Topk regions in the RGB feature is obtained as the block index;
[0108] Output block features: According to the block index, obtain the features corresponding to these blocks, that is, the block features that the problem focuses on.
[0109] More specifically, the processing process of the QGF model in the complementary fusion module is:
[0110] The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module, and multi-head self-attention operations are performed on each of them. Then, the original text features after the multi-head self-attention operation are averaged in 1 dimension to obtain the global representation of the entire text;
[0111] The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S. sar and attention rgb , and divide the attention sar and attention rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
[0112] More specifically, the model used for the multi-head cross-attention operation, attention calculation and multi-head self-attention operation is a scaled dot product model.
[0113] More specifically, the first decoder and the second decoder in the inference decoding module have the same structure, and the processing process of the first decoder is:
[0114] The image fusion features and the original text features are input into the first decoder. The image fusion features are first subjected to a layer normalization operation and then input into the fourth MSA module for a multi-head self-attention operation. They are used as the query vector Q of the third MCA module. The original text features are used as the key vector K and value vector V of the third MCA module for a multi-head cross-attention operation. Then, they are subjected to a layer normalization operation and a MLP network to obtain the image features of the fused text features.
[0115] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A multi-source remote sensing visual question answering method based on text information guidance, characterized by: The following steps are involved: Step 1: Extract features of RGB image, SAR image and input question respectively to obtain RGB features, SAR features and original text features; Step 2: The original text features and RGB features are input into the first feature enhancement model to obtain RGB enhanced features, and the original text features and SAR features are input into the second feature enhancement model to obtain SAR enhanced features; Step 3: RGB enhanced features, SAR enhanced features, and original text features are input into the QGF model to obtain image fusion features; Step 4: Input the image fusion features and the original text features into the first decoder to obtain the image features of the fused text features. Input the original text features and the image fusion features into the second decoder to obtain the text features of the fused image features. The text features of the fused image features and the image features of the fused text features are averaged in one dimension and then concatenated. The final predicted answer for the remote sensing visual question answering task is obtained after passing through an FFN network and a softmax operation. The processing process of the QGF model in step 3 is: The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module. Multi-head self-attention operations are performed on each of them. Then, the original text features after the multi-head self-attention operation are averaged in one dimension to obtain a global representation of the entire text. The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S sar and attention points rgb , and divide attention into S sar and attention points rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
2. The multi-source remote sensing visual question answering method based on text information guidance according to claim 1 is characterized in that: The step one comprises: The CLIP image encoder is used to extract features from RGB images and SAR images respectively to obtain RGB features and SAR features respectively; then the CLIP text encoder is used to extract features from the input question to obtain the original text features.
3. The multi-source remote sensing visual question answering method based on text information guidance according to claim 1 is characterized in that: In step 2, the first feature enhancement model and the second feature enhancement model have the same structure. The first feature enhancement model includes a KRS module, a first MCA module, and a second MCA module connected in sequence. The KRS module and the first MCA module both receive original text features, the KRS module and the second MCA module both receive RGB features, and the second MCA module outputs RGB enhanced features. The KRS module receives RGB features and original text features and outputs block features of interest to the first MCA module.
4. The multi-source remote sensing visual question answering method based on text information guidance according to claim 3 is characterized in that: The processing process of the first feature enhancement model is: The first MCA module uses the original text features as the query vector Q, the block features of the question as the key vector K and the value vector V, and performs a multi-head cross attention operation to obtain the text features of the fused block features; The second MCA module uses RGB features as the query vector Q and the text features of the fused block features as the key vector K and value vector V, and performs a multi-head cross attention operation to obtain RGB enhanced features.
5. The multi-source remote sensing visual question answering method based on text information guidance according to claim 4 is characterized in that: The processing process of the KRS module in the first feature enhancement model is: Regional feature acquisition: The RGB features are evenly divided into N regions, each region contains M blocks, and the features of each region are represented by the mean of the features of all blocks contained in the region; Region feature selection: Take the mean of the original text features in one dimension to obtain the overall representation of the question. The overall representation of the question is used as the query vector Q, and the features of the N regions are used as the key vector K. Attention calculations are performed on each region to obtain the attention score S. The attention scores S are sorted from large to small, and the top k regions with the highest attention scores S are selected. The indexes of these top k regions in the RGB features are returned as the region indexes. Convert regional features to block features: According to the correspondence between each region and block and the region index, the index of the block corresponding to the top k regions in the RGB feature is obtained as the block index; Output block features: According to the block index, obtain the features corresponding to these blocks, that is, the block features that the problem focuses on.
6. The multi-source remote sensing visual question answering method based on text information guidance according to claim 5 is characterized in that: The model used for the multi-head cross-attention operation, attention calculation, and multi-head self-attention operation is the scaled dot product model.
7. The multi-source remote sensing visual question answering method based on text information guidance according to claim 5 is characterized in that: In step 4, the first decoder and the second decoder have the same structure, and the processing process of the first decoder is as follows: The image fusion features and the original text features are input into the first decoder. The image fusion features are first subjected to a layer normalization operation and then input into the fourth MSA module for a multi-head self-attention operation. They are used as the query vector Q of the third MCA module, and the original text features are used as the key vector K and value vector V of the third MCA module for a multi-head cross-attention operation. Then, they undergo a layer normalization operation and pass through the MLP network to obtain the image features of the fused text features.
8. A multi-source remote sensing visual question answering system based on text information guidance, characterized by: include: The feature extraction module is used to extract features from RGB images, SAR images and input questions respectively to obtain RGB features, SAR features and original text features; A feature enhancement module, which is used to input the original text features and RGB features into a first feature enhancement model to obtain RGB enhanced features, and input the original text features and SAR features into a second feature enhancement model to obtain SAR enhanced features; Complementary fusion module, which is used to input RGB enhanced features, SAR enhanced features and original text features into the QGF model to obtain image fusion features; The inference decoding module is used to input the image fusion features and the original text features into the first decoder to obtain the image features of the fused text features, and then input the original text features and the image fusion features into the second decoder to obtain the text features of the fused image features. The text features of the fused image features and the image features of the fused text features are averaged in one dimension and then concatenated. The final predicted answer for the remote sensing visual question answering task is obtained after passing through an FFN network and a softmax operation. The processing process of the complementary fusion module is as follows: The RGB enhanced features are input into the first MSA module, the SAR enhanced features are input into the second MSA module, and the original text features are input into the third MSA module. Multi-head self-attention operations are performed on each of them. Then, the original text features after the multi-head self-attention operation are averaged in one dimension to obtain a global representation of the entire text. The global representation of the entire text is used to calculate the attention of the RGB enhanced features and SAR enhanced features after the multi-head self-attention operation to obtain the attention score S sar and attention points rgb , and divide attention into S sar and attention points rgb Perform softmax calculation on the scores of all corresponding positions to obtain the weight matrix W sar and the weight matrix W rgb , using the weight matrix W sar Multiply with RGB enhanced features, weight matrix W rgb Perform dot multiplication with the SAR enhanced feature, and then add the two dot product results to obtain the final image fusion feature.
9. The multi-source remote sensing visual question answering system based on text information guidance according to claim 8, characterized in that: The feature extraction module is also used to: The CLIP image encoder is used to extract features from RGB images and SAR images respectively to obtain RGB features and SAR features respectively; then the CLIP text encoder is used to extract features from the input question to obtain the original text features.
Citation Information
Patent Citations
Attention visual question-answering method and device, electronic equipment and storage medium
CN117173715A
Visual question-answering method and device, and medium
CN113780486A
Visual question and answer method optimized by using position information
CN114818739A
Visual question and answer model training method and device, question and answer method, medium and equipment
CN114972944A
Target object recognition method, object recognition model training method, target object processing method and information processing method
CN117809121A
