A multimodal consensus perception and momentum comparison-based image-text retrieval system and method thereof

By employing multimodal consensus perception and momentum comparison methods, the problems of fine-grained semantic interaction between modalities and insufficient negative samples in image and text retrieval are solved, achieving higher image and text retrieval accuracy and improving the model's ability to calculate semantic similarity between images and text.

CN118051630BActive Publication Date: 2026-11-24TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410207827.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-26
Publication Date
2026-11-24
Estimated Expiration
2044-02-26

AI Technical Summary

Technical Problem

Existing image-text retrieval methods based on visual semantic embedding lack fine-grained semantic interactions between modalities and use negative samples with insufficient difficulty, resulting in the model's inability to effectively capture fine-grained semantic relationships between different modalities and distinguish easily confused non-matching samples.

Method used

We introduce a multimodal consensus perception and momentum comparison approach. We mine consensus information through a multimodal consensus learning network and expand the negative sample space through a momentum comparison framework. We use graph convolutional networks and dynamic queues to mine more difficult negative samples in the global scope and combine a ternary loss function to optimize model training.

Benefits of technology

It improves the accuracy of image and text retrieval, better captures fine-grained semantic relationships between images and text, and effectively distinguishes non-matching samples, thus enhancing the model's performance in image and text retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118051630B_ABST
    Figure CN118051630B_ABST
Patent Text Reader

Abstract

This invention provides an image-text retrieval system and method based on multimodal consensus awareness and momentum comparison. The image-text retrieval system includes a multimodal consensus learning network and a multimodal momentum comparison framework. The multimodal momentum comparison framework consists of a feature encoding module and a multimodal consensus fusion module. The multimodal consensus learning network is used to mine multimodal consensus information from an external image-text database. The multimodal momentum comparison framework is used to expand the negative sample space to mine more difficult negative samples globally, thereby providing more valuable information for the learning of the image-text retrieval system. The feature encoding module is used to encode features for each input image-text pair to obtain initial representations of the image and text. The multimodal consensus fusion module is used to fuse the initial representations of the image and text with the corresponding multimodal consensus information to obtain global semantic representations of the image and text with consensus awareness. The multimodal momentum comparison framework uses a ternary loss as the objective function during the training of the image-text retrieval system to complete the image-text retrieval task. This invention can improve the accuracy of image-text retrieval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of cross-modal image and text retrieval and deep learning, specifically to an image and text retrieval method based on multimodal consensus perception and momentum comparison. Background Technology

[0002] With the popularization and rapid development of the internet, and the rise of social media platforms such as WeChat, Weibo, Baidu Tieba, Douyin, Twitter, and Facebook, people can more easily publish and disseminate information online, leading to an exponential increase in the scale of data on the internet. In the early days of the internet, information was primarily disseminated through text. However, with the booming development of network technology today, information on the internet has taken on richer forms of expression, such as text, images, audio, and video, collectively known as multimodal information. Images and text, as two of the most common information carriers, play important roles in information expression in the online world. However, on the other hand, the ever-increasing volume of text and image data on the internet has invisibly increased the cost for users to obtain information. Therefore, how to accurately and efficiently retrieve the content that users need from this data is a research topic of practical significance. For example, in search engines, users hope to retrieve corresponding images by entering text keywords; on e-commerce platforms, consumers hope to retrieve similar products based on uploaded product images, and so on.

[0003] Vision and language are two of the most fundamental ways humans perceive the real world. The initial inspiration for artificial intelligence was to endow machines with the ability to understand the world by simulating human behavior and perception. Cross-modal image-text retrieval is a fundamental task in the field of multimodal learning. Its goal is to retrieve text descriptions with the same or similar semantics as a given image from a text database, or to retrieve images associated with given text from an image database. The difficulty of this task lies in the fact that images and text are two completely different forms of information expression, with a huge "heterogeneous gap" between them: the information contained in images can be directly perceived by the human visual system, while text, as a carrier of natural language, requires complex processing and transformation by the brain before it can be understood by humans. Furthermore, in the computer world, the storage and representation of images and text are completely different, resulting in significant differences in the distribution of the two types of data. Therefore, the semantic similarity between images and text cannot be directly measured.

[0004] Visual Semantic Embedding (VSE), based on deep learning technology, is an image-text retrieval method that combines retrieval performance and query efficiency, effectively mitigating the aforementioned "heterogeneous gap" problem. This method aims to learn global semantic representations of images and text separately through an end-to-end neural network and map them into a joint embedding space, where the similarity score between images and text can be easily calculated. Image-text retrieval models based on VSE typically include three steps: First, a feature extractor extracts a set of visual features and textual features from the input raw image-text data; second, a feature aggregation function aggregates the visual and textual features obtained in the previous step into a global vector and maps it into the joint embedding space; finally, the similarity score between images and text is calculated in the joint embedding space.

[0005] In recent years, several image-text retrieval methods based on visual semantic embedding techniques have been proposed and have achieved certain results. However, these methods generally suffer from the following two drawbacks: First, they typically use two independent networks to learn global semantic representations of images and text separately. However, during this process, there is no interaction between the data from different modalities, resulting in the model's inability to capture fine-grained semantic relationships between fragments from different modalities. Second, these methods usually use hard negative samples mined from mini-batch training to calculate the final target loss. However, the hard negative samples obtained through this negative sample mining strategy are, in most cases, not globally hard negative samples across the entire dataset, thus limiting the model's ability to distinguish easily confused non-matching samples. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing image-text retrieval methods based on visual semantic embedding, such as the lack of fine-grained semantic interaction between modalities and insufficient use of difficult negative samples. This invention provides an image-text retrieval method based on multimodal consensus awareness and momentum comparison. This invention introduces external consensus knowledge from multiple modalities and fuses it with the initial embedding vectors of images and text obtained through visual semantic embedding methods. This yields a global semantic representation of images and text with multimodal consensus awareness, thereby achieving fine-grained semantic alignment between modalities. Furthermore, this invention introduces the concept of momentum comparison into the field of cross-modal image-text retrieval, improving the difficult negative sample mining strategies used in most image-text retrieval methods. It mines more difficult negative samples globally with lower computational and storage overhead, thus providing more valuable information for model learning.

[0007] The objective of this invention is achieved through the following technical solutions:

[0008] A text and image retrieval system based on multimodal consensus perception and momentum comparison, the system comprising a multimodal consensus learning network and a multimodal momentum comparison framework; the multimodal momentum comparison framework consists of a feature encoding module and a multimodal consensus fusion module; wherein:

[0009] The multimodal consensus learning network is used to mine multimodal consensus information from an external image-text database;

[0010] The multimodal momentum contrast framework is used to expand the scale of the negative sample space to uncover more difficult negative samples globally, thereby providing more valuable information for the learning of the image and text retrieval system; wherein:

[0011] The feature encoding module is used to perform feature encoding on each input image-text pair to obtain the initial representation of the image and text;

[0012] The multimodal consensus fusion module is used to fuse the initial representations of images and text with the corresponding multimodal consensus information to obtain a global semantic representation of images and text with consensus awareness.

[0013] The multimodal momentum comparison framework uses a ternary loss as the objective function during the training of the image and text retrieval system to complete the image and text retrieval task.

[0014] Furthermore, the multimodal consensus learning network is used to mine multimodal consensus information from an external image-text database, including:

[0015] Construct a first word frequency table based on the frequency of each word in the text database; select the word with the highest frequency from the first word frequency table. i Each word is treated as a text concept and instantiated using the GloVe algorithm to obtain its corresponding word embedding vector, denoted as . in,

[0016] A second term frequency table is constructed from the entity labels of all target regions detected in the image database. The n with the highest frequency is selected from the second table. j Each entity word is instantiated into a word embedding vector using the GloVe algorithm, denoted as . in,

[0017] The average of all region features in the image database predicted to be a certain entity label is used as the visual concept with the current entity semantics, and a set is used. To represent the visual concept corresponding to each entity label in set O, where,

[0018] To measure the similarity between concepts within the same modality, the association matrices for textual and visual concepts are calculated using the following formulas, denoted as A. t and A v ;

[0019]

[0020]

[0021] Graph convolutional networks are used to learn and infer deep semantic relationships between concept nodes in a single-modal graph. The computation process is shown in the following formula.

[0022] X * =LeakyReLU(A t (XW x W t +B t )

[0023] Y * =LeakyReLU(A v (YW y W v +B v )

[0024] Among them, matrix and The weight matrix is ​​used to map the embedding vectors in concept sets X and Y to a D-dimensional space. and For the parameters of the graph convolutional layer, the matrix and Let be the bias matrix; where: intra-modal semantically enhanced text concept representation and visual concept representation

[0025] Textual concept representation X with intramodal semantic enhancement * and visual concept representation Y * Merge them to construct a multimodal concept graph showing the potential connections between concepts of different modalities;

[0026] By merging the sets X and O The association matrix A corresponding to the multimodal concept map is obtained using the following formula. c ;

[0027]

[0028] Where: if c i ∈X, c j ∈O, and in any matching graph-text pair in the training set, c i None of the corresponding text words are related to 'c'.j If the corresponding region labels co-occur, then... Set to 0;

[0029] Multimodal consensus information on latent semantic relationships between cross-modal concepts is established through graph convolution operations with residual connections according to the following formula.

[0030] U * =LeakyReLU(A c (X * ||Y * W c +B c )+(X * ||Y * )

[0031] Among them, the weight matrix For the parameters of the graph convolutional layer, the matrix Let A be the bias matrix. c This is the row-normalized incidence matrix, where ·||· represents the join operation; It is a conceptual representation that contains rich semantic information.

[0032] Furthermore, the feature encoding module performs feature encoding on each input image-text pair to obtain the initial representation process of the image and text, including:

[0033] The image encoder: For an input image I, it uses an existing object detector to extract target-level features, obtaining r salient regions and their corresponding feature representations, denoted as V = {v1, v2, ..., v...} r},in, D v Dimensions representing regional features;

[0034] These regional features are aggregated into a global vector using a certain aggregation algorithm. The image I is used to represent the input image, where D is the dimension of the joint embedding space;

[0035] The network structure of the image momentum encoder is exactly the same as that of the image encoder;

[0036] The text encoder: For an input sentence T, it uses some existing text feature extractor to extract the embedding representation of each word in the sentence, denoted as E = {e1, e2, ..., e...} n},in, D t The dimension of word embedding;

[0037] These words are embedded and aggregated into a global vector using a certain aggregation algorithm. Used to represent the input sentence T;

[0038] The network structure of the text momentum encoder is exactly the same as that of the text encoder.

[0039] The multimodal consensus fusion module is used to fuse the initial representations of images and text with the corresponding multimodal consensus information to obtain a global semantic representation of images and text with consensus awareness; including:

[0040] The initial visual representation As a query vector, compute its sum set U * The attention score between each semantic concept in the set U is calculated, and then, using the attention score as a weight, the set U is... * The weighted summation of all vectors in the above calculation is shown in the following formula:

[0041]

[0042]

[0043] in, Given a learnable parameter matrix, v c That is, the current image representation Relevant external consensus;

[0044] The initial text representation As a query vector, compute its sum set U * The attention score between each semantic concept in the set U is calculated, and then, using the attention score as a weight, the set U is... * The weighted summation of all vectors in the above calculation is shown in the following formula:

[0045]

[0046]

[0047] in, Let e ​​be a learnable parameter matrix. c That is, the current text representation Relevant external consensus;

[0048] Global vectors of images and text aggregated through the GPO algorithm are fused with their associated external consensus to obtain a consensus-aware image representation v. * and text representation e * The calculation process is shown in the following formula;

[0049]

[0050] Here, μ is a hyperparameter used to adjust the proportion of two different types of representations during fusion.

[0051] Furthermore, the multimodal momentum contrast framework is used to expand the scale of the negative sample space to uncover more difficult negative samples globally, thereby providing more valuable information for the learning process of the image and text retrieval system, including:

[0052] Construct dynamic visual queues and dynamic text queues respectively for storing negative sample features;

[0053] The image momentum encoder feeds the output of each training batch into the dynamic vision queue according to the following formula;

[0054]

[0055] The text momentum encoder feeds the output of each training batch into the dynamic text queue according to the following formula:

[0056]

[0057] in, and Let m represent the network parameters of the image encoder, text encoder, image momentum encoder, and text momentum encoder, respectively, where m∈[0,1) is a momentum coefficient.

[0058] Furthermore, the multimodal momentum comparison framework completes the image and text retrieval task process by using a ternary loss as the objective function during the training of the image and text retrieval system, including:

[0059] Given a matching image-text pair (I,T) as input to a multimodal momentum contrast framework, the pair is passed through an image encoder, a text encoder, an image momentum encoder, and a text momentum encoder to obtain their respective outputs, denoted as v. * e * v′ and e′:

[0060] The bidirectional ternary loss function for mining hard negative samples in the same training batch is shown in the following formula:

[0061]

[0062] Where α is the interval factor, [x] + ≡max(0,x), S(·,·) are similarity functions, and the similarity score between image I and text T can be calculated using the following formula:

[0063]

[0064] in: and These are e mined from the current training batch. * and v * Difficult-to-bear samples;

[0065] Mining the representation v of image I from a dynamic queue on the text side * For the corresponding hard-to-fail samples, the loss is calculated using the following formula:

[0066]

[0067] in, These are hard-to-bear samples mined from the current dynamic text queue;

[0068] Mining the representation e of text T from a dynamic queue at the image end * For the corresponding hard-to-fail samples, the loss is calculated using the following formula:

[0069]

[0070] in, These are hard-to-bear samples mined from the current visual dynamic queue;

[0071] The target loss function used during the training of the multimodal momentum contrast framework is shown in the following formula:

[0072]

[0073] This invention can also be implemented using the following technical solutions:

[0074] A text and image retrieval method based on multimodal consensus perception and momentum comparison includes the following steps:

[0075] Multimodal consensus information is mined from an external image-text database using a multimodal consensus learning network; among which:

[0076] Construct a first word frequency table based on the frequency of each word in the text database; select the word with the highest frequency from the first word frequency table. i Each word is treated as a text concept and instantiated using the GloVe algorithm to obtain its corresponding word embedding vector, denoted as . in,

[0077] A second term frequency table is constructed from the entity labels of all target regions detected in the image database. The n with the highest frequency is selected from the second table. j Each entity word is instantiated into a word embedding vector using the GloVe algorithm, denoted as . in,

[0078] The average of all region features in the image database predicted to be a certain entity label is used as the visual concept with the current entity semantics, and a set is used. To represent the visual concept corresponding to each entity label in set O, where,

[0079] To measure the similarity between concepts within the same modality, the association matrices for textual and visual concepts are calculated using the following formulas, denoted as A. t and A v ;

[0080]

[0081]

[0082] Graph convolutional networks are used to learn and infer deep semantic relationships between concept nodes in a single-modal graph. The computation process is shown in the following formula.

[0083] X * =LeakyReLU(A t (XW x W t +B t )

[0084] Y * =LeakyReLU(A v (YW y W v +B v )

[0085] Among them, matrix and The weight matrix is ​​used to map the embedding vectors in concept sets X and Y to a D-dimensional space. and For the parameters of the graph convolutional layer, the matrix and Let be the bias matrix; where: intra-modal semantically enhanced text concept representation and visual concept representation

[0086] Textual concept representation X with intramodal semantic enhancement * and visual concept representation Y * Merge them to construct a multimodal concept graph showing the potential connections between concepts of different modalities;

[0087] By merging the sets X and O The association matrix A corresponding to the multimodal concept map is obtained using the following formula. c ;

[0088]

[0089] Where: if c i ∈X, c j ∈O, and in any matching graph-text pair in the training set, c i None of the corresponding text words are related to 'c'. j If the corresponding region labels co-occur, then... Set to 0;

[0090] Multimodal consensus information on latent semantic relationships between cross-modal concepts is established through graph convolution operations with residual connections according to the following formula.

[0091] U * =LeakyReLU(A c (X * ||Y * W c +B c )+(X * ||Y * )

[0092] Among them, the weight matrix For the parameters of the graph convolutional layer, the matrix Let A be the bias matrix. c This is the row-normalized incidence matrix, where ·||· represents the join operation; A conceptual representation that contains rich semantic information;

[0093] The feature encoding module performs feature encoding on each input image-text pair to obtain the initial representation of the image and text;

[0094] The initial representations of images and text are fused with corresponding multimodal consensus information through a multimodal consensus fusion module to obtain global semantic representations of images and text with consensus awareness; where:

[0095] The initial visual representation As a query vector, compute its sum set U * The attention score between each semantic concept in the set U is calculated, and then, using the attention score as a weight, the set U is... * The weighted summation of all vectors in the above calculation is shown in the following formula:

[0096]

[0097]

[0098] in, Given a learnable parameter matrix, vc That is, the current image representation Relevant external consensus;

[0099] The initial text representation As a query vector, compute its sum set U * The attention score between each semantic concept in the set U is calculated, and then, using the attention score as a weight, the set U is... * The weighted summation of all vectors in the above calculation is shown in the following formula:

[0100]

[0101]

[0102] in, Let e ​​be a learnable parameter matrix. c That is, the current text representation Relevant external consensus;

[0103] Global vectors of images and text aggregated through the GPO algorithm are fused with their associated external consensus to obtain a consensus-aware image representation v. * and text representation e * The calculation process is shown in the following formula;

[0104]

[0105] Where μ is a hyperparameter used to adjust the proportion of the two different types of representations during fusion;

[0106] The multimodal momentum contrast framework is used to expand the scale of the negative sample space to uncover more difficult negative samples globally, thereby providing more valuable information for the learning process of the image and text retrieval system. This includes:

[0107] Construct dynamic visual queues and dynamic text queues respectively for storing negative sample features;

[0108] The image momentum encoder feeds the output of each training batch into the dynamic vision queue according to the following formula;

[0109]

[0110] The text momentum encoder feeds the output of each training batch into the dynamic text queue according to the following formula:

[0111]

[0112] in, and Let m represent the network parameters of the image encoder, text encoder, image momentum encoder, and text momentum encoder, respectively, where m∈[0,1) is a momentum coefficient;

[0113] The image and text retrieval task is accomplished by using ternary loss as the objective function during the training of the image and text retrieval system. Further, the multimodal momentum comparison framework, by using ternary loss as the objective function during the training of the image and text retrieval system, accomplishes the image and text retrieval task through the following steps:

[0114] Given a matching image-text pair (I,T) as input to a multimodal momentum contrast framework, the pair is passed through an image encoder, a text encoder, an image momentum encoder, and a text momentum encoder to obtain their respective outputs, denoted as v. * e * v′ and e′:

[0115] The bidirectional ternary loss function for mining hard negative samples in the same training batch is shown in the following formula:

[0116]

[0117] Where α is the interval factor, [x] + ≡max(0,x), S(·,·) are similarity functions, and the similarity score between image I and text T can be calculated using the following formula:

[0118]

[0119] in: and These are e mined from the current training batch. * and v * Difficult-to-bear samples;

[0120] Mining the representation v of image I from a dynamic queue on the text side * For the corresponding hard-to-fail samples, the loss is calculated using the following formula:

[0121]

[0122] in, These are hard-to-bear samples mined from the current dynamic text queue;

[0123] Mining the representation e of text T from a dynamic queue at the image end * For the corresponding hard-to-fail samples, the loss is calculated using the following formula:

[0124]

[0125] in, These are hard-to-bear samples mined from the current visual dynamic queue;

[0126] The target loss function used during the training of the multimodal momentum contrast framework is shown in the following formula:

[0127]

[0128] Furthermore, the feature encoding module performs feature encoding on each input image-text pair to obtain the initial representation process of the image and text, including:

[0129] The image encoder: For an input image I, it uses an existing object detector to extract target-level features, obtaining r salient regions and their corresponding feature representations, denoted as V = {v1, v2, ..., v...} r},in, D v Dimensions representing regional features;

[0130] These regional features are aggregated into a global vector using a certain aggregation algorithm. The image I is used to represent the input image, where D is the dimension of the joint embedding space;

[0131] The network structure of the image momentum encoder is exactly the same as that of the image encoder;

[0132] The text encoder: For an input sentence T, it uses some existing text feature extractor to extract the embedding representation of each word in the sentence, denoted as E = {e1, e2, ..., e...} n},in, D t The dimension of word embedding;

[0133] These words are embedded and aggregated into a global vector using a certain aggregation algorithm. Used to represent the input sentence T;

[0134] The network structure of the text momentum encoder is exactly the same as that of the text encoder.

[0135] Beneficial effects

[0136] Compared with existing image and text retrieval methods based on visual semantic embedding, the present invention has the following advantages:

[0137] (1) This invention provides a novel and universal multimodal consensus learning network, which explicitly models fine-grained semantic relationships between image regions, text words, and image regions and text words. This makes up for the lack of cross-modal semantic interaction in traditional visual semantic embedding methods, thereby improving the accuracy of model retrieval.

[0138] (2) This invention provides a momentum comparison framework suitable for image and text retrieval. By constructing a dynamic queue to expand the scale of the negative sample space, the difficult negative samples required for model training can not only be obtained in the current training batch, but also mined in the corresponding dynamic queue, so as to obtain more difficult negative samples in the global scope, thereby helping the model to better distinguish those easily confused non-matching samples. Attached Figure Description

[0139] Figure 1 This is a model architecture diagram of the image and text retrieval method based on multimodal consensus perception and momentum comparison provided by the present invention.

[0140] Figure 2 Here are some examples of Top-5 results obtained by performing an image-to-text search task on the Flickr30K test set using a trained model.

[0141] Figure 3 Examples of Top-3 results obtained by performing a text-to-image search task on the Flickr30K test set using a trained model. Detailed Implementation

[0142] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. It should be understood that the embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0143] like Figure 1 As shown, the image and text retrieval method based on multimodal consensus perception and momentum comparison provided by the present invention comprises four parts: a feature encoding module, a multimodal consensus learning network, a multimodal consensus fusion module, and a multimodal momentum comparison framework.

[0144] 1. Feature Encoding Module

[0145] The feature encoding module is used to encode the features of each input image-text pair to obtain the initial representation of the image and text.

[0146] 1.1. Image Encoder

[0147] For an input image I, a Faster R-CNN model pre-trained on the Visual Genome dataset with a bottom-up attention mechanism is used to extract target-level features, resulting in r=36 salient regions and their corresponding feature representations, with each region's feature dimension being D. v =2048. Then, these region features are aggregated into a global vector representing image I using the GPO algorithm, and mapped to a joint embedding space of D=1024 dimensions. The network structure of the image momentum encoder is exactly the same as that of the image encoder.

[0148] 1.2. Text Encoder

[0149] For an input sentence T, a pre-trained standard BERT model (containing a 12-layer Transformer encoder, with 12 attention heads and 768 hidden units per layer, for a total of 110M parameters) is used as the text feature extractor to extract the embedding representation of each word in the sentence, with each word embedding vector having a dimension of D. t =768. Then, these word vectors are aggregated into a global vector representing sentence T using the GPO algorithm, and mapped to a joint embedding space of D=1024 dimensions. The network structure of the text momentum encoder is exactly the same as that of the text encoder.

[0150] The momentum encoder only plays a role during the training phase to generate strongly consistent image and text features; while during the inference phase, it only uses the global semantic representations of images and text extracted by the ordinary encoder to calculate image-text similarity and perform image-text retrieval tasks.

[0151] 2. Multimodal consensus learning network

[0152] Multimodal consensus learning networks are used to mine multimodal consensus knowledge from external image-text databases. This embodiment mines multimodal consensus from two public image-text databases, MSCOCO and Flickr30K. First, the frequency of each word in the text database is counted to form a word frequency table, and meaningless and rarely occurring words are removed. Then, the n words with the highest frequency are selected from the word frequency table according to the ratio of entity words:action words:attribute words of 7:2:1. i =300 words were used as text concepts and their corresponding word embedding vectors were instantiated using the GloVe algorithm. Similarly, entity labels of all target regions detected from the image database were also constructed into a word frequency table, from which the n most frequent words were selected. j=100 entity words are instantiated into corresponding word embedding vectors using the GloVe algorithm; then, the average of all region features predicted as a certain entity label in the image library is taken as the visual concept with the current entity semantics. When reasoning about deep semantic relationships between concepts on the concept graph using graph convolutional networks, the number of graph convolutional layers used in this embodiment is set to 1.

[0153] 3. Multimodal consensus fusion module

[0154] The multimodal consensus fusion module is used to fuse multimodal consensus knowledge with the initial image and text representations to obtain global semantic representations of images and text with consensus awareness. In this embodiment, the coefficient μ controlling the fusion ratio is set to 0.75 when fusing the initial representations of images and text with their corresponding external consensus representations.

[0155] 4. Multimodal momentum comparison framework

[0156] The multimodal momentum contrastive framework is used to expand the negative sample space to uncover more difficult negative samples globally, thereby providing more valuable information for model learning. This embodiment trains the model on two publicly available benchmark datasets, MSCOCO and Flickr30K. When training the model using the MSCOCO dataset, the capacity K of the dynamic queue is set to 4096; while when training the model using the Flickr30K dataset, the capacity K of the dynamic queue is set to 2048. In this embodiment, the momentum coefficient m is set to 0.999. In the final objective function, the margin factor α is set to 0.2.

[0157] This embodiment uses two publicly available benchmark datasets, Flickr30K and MSCOCO, as experimental materials. The Flickr30K dataset contains 31,000 images, each accompanied by 5 manually annotated text descriptions. This embodiment divides this dataset into three parts: a training set containing 29,000 images (and their corresponding text descriptions), a validation set containing 1,000 images, and a test set containing 1,000 images. The MSCOCO dataset contains 123,287 images, similarly, each accompanied by 5 different text descriptions. This embodiment divides this dataset into three parts: a training set containing 113,287 images, and two sets containing 5,000 images each.

[0158] The experimental environment for this embodiment is shown in Table 1.

[0159] Table 1 Experimental Environment

[0160]

[0161] This invention uses Recall@K (R@K for short) as an evaluation metric to assess the performance of a text and image retrieval method based on multimodal consensus perception and momentum comparison. Recall@K is defined as the percentage of correct results among the top K ranked retrieval results. The higher the value of this metric, the stronger the model's retrieval capability.

[0162] This embodiment compares the method provided by the present invention with 13 state-of-the-art works in the field of image and text retrieval, namely SCAN, BFAN, SAEM, CAAN, CVSE, VSRN, MMCA, IMRAM, GSMN, SGRAF, CAMERA, GPO, and DIME. The comparison results are shown in Tables 2 and 3. As can be seen from the tables, the image and text retrieval method based on multimodal consensus sensing and momentum comparison provided by the present invention has significant performance advantages.

[0163] Table 2 compares the performance of the method provided by this invention with other advanced works on the MSCOCO test set (bold indicates best performance).

[0164]

[0165]

[0166] Table 3 compares the performance of the method provided by this invention with other advanced works on the Flickr30K test set (bold indicates best performance).

[0167]

[0168] The above description is intended to illustrate the technical solution of the present invention and is not intended to limit the patent scope of the present invention. Any equivalent structural or procedural modifications made based on the description and drawings of the present invention, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A text and image retrieval system based on multimodal consensus perception and momentum comparison, characterized in that... The image and text retrieval system includes a multimodal consensus learning network and a multimodal momentum comparison framework; the multimodal momentum comparison framework consists of a feature encoding module and a multimodal consensus fusion module; wherein: The multimodal consensus learning network is used to mine multimodal consensus information from an external image-text database; The multimodal momentum contrast framework is used to expand the size of the negative sample space; wherein: Construct dynamic visual queues and dynamic text queues respectively for storing negative sample features; The image momentum encoder feeds the output of each training batch into the dynamic vision queue according to the following formula; The text momentum encoder feeds the output of each training batch into a dynamic text queue according to the following formula: in, , , and These represent the network parameters of the image encoder, text encoder, image momentum encoder, and text momentum encoder, respectively. It is a momentum coefficient, where t represents the input text and I represents the input image; The feature encoding module is used to perform feature encoding on each input image-text pair to obtain an initial image representation and an initial text representation; Image encoder: For an input image I, use an existing object detector to extract target-level features, obtaining r salient regions and their corresponding feature representations, denoted as rr. ,in, , Dimensions representing regional features; These regional features are aggregated into an initial image representation using a certain aggregation algorithm. , used to characterize the input image I, where, For the dimensions of the joint embedding space; The network structure of the image momentum encoder is exactly the same as that of the image encoder. Text encoder: Given a text, it uses some existing text feature extractor to extract the embedding representation of each word in the text, denoted as . ,in, , The dimension of word embedding; These word embeddings are aggregated into an initial text representation using a certain aggregation algorithm. , used to represent the input text t; The network structure of the text momentum encoder is exactly the same as that of the text encoder; The multimodal consensus fusion module is used to fuse the initial representations of images and text with the corresponding multimodal consensus information to obtain global semantic representations of images and text with consensus awareness. The multimodal momentum comparison framework uses a ternary loss as the objective function during the training of the image and text retrieval system to complete the image and text retrieval task.

2. The image and text retrieval system based on multimodal consensus perception and momentum comparison according to claim 1, characterized in that... The multimodal consensus learning network is used to mine multimodal consensus information from an external image-text database, including: Construct a first word frequency table based on the frequency of each word in the text database; select the most frequent words from the first word frequency table. Each word is treated as a text concept and instantiated using the GloVe algorithm to obtain its corresponding word embedding vector, denoted as . ,in, A second term frequency table is constructed from the entity labels of all target regions detected in the image database. The term with the highest frequency is then selected from the second term frequency table. Each entity word is instantiated into a word embedding vector using the GloVe algorithm, denoted as . ,in, ; The average of all region features in the image database predicted to be a certain entity label is used as the visual concept with the current entity semantics, and a set is used. To represent a set The visual concept corresponding to each entity label in the text, where, To measure the similarity between concepts within the same modality, the association matrices for textual and visual concepts are calculated using the following formulas, denoted as follows: and ; Graph convolutional networks are used to learn and infer deep semantic relationships between concept nodes in a unimodal graph. The computation process is shown in the following formula: Among them, matrix and Used to organize concept sets and The embedding vector in the middle is mapped to a 3D space, weight matrix and For the parameters of the graph convolutional layer, the matrix and Let be the bias matrix; where: intra-modal semantically enhanced text concept representation and visual concept representation ; Textual concept representation with intramodal semantic enhancement and visual concept representation Merge them to construct a multimodal concept graph of potential associations between concepts from different modalities; By merging sets and set gather Obtain the association matrix corresponding to the multimodal concept graph. Where: if , And in any matching image-text pair in the training set, The corresponding text words are not matched. If the corresponding region labels co-occur, then... Set to 0; Multimodal consensus information on latent semantic relationships between cross-modal concepts is established through graph convolutional layers with residual connections according to the following formula: Among them, the weight matrix For the parameters of the graph convolutional layer, the matrix Let A be the bias matrix. c’ The correlation matrix after row normalization. Indicates a connection operation; It is a set of semantic concept representations.

3. The image and text retrieval system based on multimodal consensus perception and momentum comparison according to claim 2, characterized in that, The multimodal consensus fusion module is used to fuse the initial image representation and the initial text representation with the corresponding multimodal consensus information to obtain a global semantic representation of the image and text with consensus awareness. include: Characterize the initial image As a query vector, calculate its sum set. The attention score between each semantic concept is calculated, and then, using the attention score as a weight, the set is... The weighted summation of all vectors in the above calculation is shown in the following formula: in, Given a learnable parameter matrix, That is, the initial image representation Relevant external consensus; The initial text representation As a query vector, calculate its sum set. The attention score between each semantic concept is calculated, and then, using the attention score as a weight, the set is... The weighted summation of all vectors in the above calculation is shown in the following formula: in, Given a learnable parameter matrix, That is, the initial text representation Relevant external consensus; Global vectors of images and text aggregated through the GPO algorithm are fused with their associated external consensus to obtain a consensus-aware image representation. and consensus-aware text representation The calculation process is shown in the following formula; in, It is a hyperparameter used to adjust the proportion of two different types of representations when they are fused.

4. The image and text retrieval system based on multimodal consensus perception and momentum comparison according to claim 3, characterized in that, The multimodal momentum comparison framework uses a ternary loss as the objective function during the training of the image and text retrieval system to complete the image and text retrieval task, including: Given a matching image-text pair (I,t) as input to the multimodal momentum contrast framework, it is fed into an image encoder, a text encoder, an image momentum encoder, and a text momentum encoder. The image encoder and text encoder fuse the global vectors of the image and text, aggregated using the GPO algorithm, with their associated external consensus to obtain a consensus-aware image representation. and consensus-aware text representation The image momentum encoder and text momentum encoder output v′ and e′. The bidirectional ternary loss function for mining hard negative samples in the same training batch is shown in the following formula: in, As the interval factor, Let be the similarity function, and the similarity score between image I and text t is calculated using the following formula: and These are mined from the current training batch. and Difficult-to-bear samples; Mining consensus-aware image representations of image I from a dynamic text queue For the corresponding hard-to-fail samples, the loss is calculated using the following formula: in, These are hard-to-bear samples mined from the current dynamic text queue; Mining consensus-aware text representations of text t in a dynamic visual queue For the corresponding hard-to-fail samples, the loss is calculated using the following formula: in, These are hard-to-bear samples mined from the current visual dynamic queue; The target loss function used during the training of the multimodal momentum contrast framework is shown in the following formula: 。 5. A text and image retrieval method using the system described in claim 1 to implement multimodal consensus perception and momentum comparison, characterized in that, Includes the following steps: Multimodal consensus information is mined from an external image-text database using a multimodal consensus learning network; among which: Construct a first word frequency table based on the frequency of each word in the text database; select the most frequent words from the first word frequency table. Each word is treated as a text concept and instantiated using the GloVe algorithm to obtain its corresponding word embedding vector, denoted as . ,in, A second term frequency table is constructed from the entity labels of all target regions detected in the image database. The term with the highest frequency is then selected from the second term frequency table. Each entity word is instantiated into a word embedding vector using the GloVe algorithm, denoted as . ,in, ; The average of all region features in the image database predicted to be a certain entity label is used as the visual concept with the current entity semantics, and a set is used. To represent a set The visual concept corresponding to each entity label in the text, where, To measure the similarity between concepts within the same modality, the association matrices for textual and visual concepts are calculated using the following formulas, denoted as follows: and ; Graph convolutional networks are used to learn and infer deep semantic relationships between concept nodes in a unimodal graph. The computation process is shown in the following formula: Among them, matrix and Used to organize concept sets and The embedding vector in the middle is mapped to a 3D space, weight matrix and For the parameters of the graph convolutional layer, the matrix and Let be the bias matrix; where: intra-modal semantically enhanced text concept representation and visual concept representation ; Textual concept representation with intramodal semantic enhancement and visual concept representation Merge them to construct a multimodal concept graph that reveals the potential connections between concepts of different modalities; By merging sets and set gather Obtain the association matrix corresponding to the multimodal concept graph. Where: if , And in any matching image-text pair in the training set, The corresponding text words are not matched. If the corresponding region labels co-occur, then... Set to 0; Multimodal consensus information on latent semantic relationships between cross-modal concepts is established through graph convolutional layers with residual connections according to the following formula. Among them, the weight matrix For the parameters of the graph convolutional layer, the matrix The bias matrix, The correlation matrix after row normalization. Indicates a connection operation; A set of semantic concept representations; The feature encoding module performs feature encoding on each input image-text pair to obtain the initial image representation and the initial text representation; The initial image and text representations are fused with corresponding multimodal consensus information through a multimodal consensus fusion module to obtain a global semantic representation of the image and text with consensus awareness; where: Characterize the initial image As a query vector, calculate its sum set. The attention score between each semantic concept is calculated, and then, using the attention score as a weight, the set is... The weighted summation of all vectors in the above calculation is shown in the following formula: in, Given a learnable parameter matrix, That is, the initial image representation Relevant external consensus; The initial text representation As a query vector, calculate its sum set. The attention score between each semantic concept is calculated, and then, using the attention score as a weight, the set is... The weighted summation of all vectors in the above calculation is shown in the following formula: in, Given a learnable parameter matrix, That is, the initial text representation Relevant external consensus; Global vectors of images and text aggregated through the GPO algorithm are fused with their associated external consensus to obtain a consensus-aware image representation. and consensus-aware text representation The calculation process is shown in the following formula; in, It is a hyperparameter used to adjust the proportion of two different types of representations when they are fused; The multimodal momentum contrast framework is used to expand the scale of the negative sample space to uncover more difficult negative samples globally, thereby providing more valuable information for the learning process of the image and text retrieval system. This includes: Construct dynamic visual queues and dynamic text queues respectively for storing negative sample features; The image momentum encoder feeds the output of each training batch into the dynamic vision queue according to the following formula; The text momentum encoder feeds the output of each training batch into the dynamic text queue according to the following formula: in, , , and These represent the network parameters of the image encoder, text encoder, image momentum encoder, and text momentum encoder, respectively. It is a momentum coefficient; The image and text retrieval task is accomplished by using ternary loss as the objective function during the training of the image and text retrieval system.