Multi-modal cross-domain image-text mutual search method and device

Through the multi-modal cross-domain image and text mutual search method, feature extraction and concept recognition technology are used to solve the problems of cross-modal domain migration and unknown concept learning, improve the accuracy and efficiency of the image and text mutual search model, and achieve Adapt and align across domains.

CN118535761AInactive Publication Date: 2024-08-23UNIV OF SCI & TECH BEIJING
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410563552.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-08
Publication Date
2024-08-23
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has a large offset in the cross-modal field, and the accuracy and efficiency of image-text mutual search are poor. Especially when the target field contains unknown concepts, the model is difficult to adapt and learn.

Method used

Using a multi-modal cross-domain image and text mutual search method, by obtaining data from the source domain and the target domain, using the feature extraction module, sorting perceptron, concept classifier and domain judger, the image and text mutual search model is trained to identify and Learn unknown concepts in the target domain, generate target domain samples and other samples, and optimize the model to adapt to cross-domain differences.

Benefits of technology

Effectively adapt the source domain model to the target domain, identify and learn unknown concepts, improve the accuracy and efficiency of the image-text mutual search model, achieve alignment of the source and target domains, and promote cross-domain adaptation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535761A
    Figure CN118535761A
Patent Text Reader

Abstract

The invention relates to the technical field of multi-modal learning and cross-domain adaptation, in particular to a multi-modal cross-domain image-text mutual search method and device, and the method comprises the steps: determining source image feature data, corresponding source language feature data, target image feature data or target language feature data; determining a target domain image containing an unknown concept and other images according to the target image feature data, a sorting perceptron, a concept classifier and a domain judging device; generating a target domain sample and other samples according to the target domain image, the source language feature data and the target language feature data; and according to the source domain data, the target domain data, the target domain sample and other samples, training a to-be-trained image-text mutual search model to obtain a trained image-text mutual search model, and performing image-text search according to the trained image-text mutual search model. By adopting the method and the device, cross-domain adaptation can be promoted, and the accuracy and the efficiency of image-text mutual search are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multimodal learning and cross-domain adaptation technology, and in particular to a method and device for image-text mutual search based on multimodal cross-domain. Background Art

[0002] The world is made up of multimodal data, such as images, videos, music, and books. With the increase of multimodal data on social media and the Internet, multimodal learning has received more and more attention, and multimodal image-text search has also been widely demanded. Although many methods have made great progress in cross-modal learning in recent years, most of them assume that the training and test data are in the same domain. Such an assumption leads to unstable performance of the model in reality.

[0003] There are differences in style or wording in the visual-linguistic multimodal data in the source domain and the target domain. The main problem is cross-modal domain shift. Most current domain adaptation methods focus on single-modal problems and lack the ability to solve cross-modal domain shift. On the other hand, in the open world, the model faces unknown concepts, including: the target domain contains concepts that do not appear in the source domain, and unknown concepts cannot be learned from the source domain, which exacerbates cross-modal domain shift and leads to poor accuracy and efficiency of image-text search. Summary of the invention

[0004] In order to solve the technical problems of large cross-modal domain deviation and poor accuracy and efficiency of image-text mutual search in the prior art, the embodiment of the present invention provides a method and device for image-text mutual search based on multi-modal cross-domain. The technical solution is as follows:

[0005] On the one hand, a method for image-text mutual search based on multimodal cross-domain is provided, the method is implemented by a device for image-text mutual search based on multimodal cross-domain, and the method includes:

[0006] S1. Obtain source domain data, target domain data, and a to-be-trained image-text mutual search model; wherein the source domain data includes a plurality of image-text pairs, each image-text pair includes source image data and corresponding source language data; and the target domain data includes a plurality of target image data or target language data;

[0007] The image-text mutual search model includes a feature extraction module, a sorting sensor, a concept classifier and a domain judge;

[0008] S2, determining source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and determining target image feature data or target language feature data based on the feature extraction module and the target domain data;

[0009] S3, training a ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function;

[0010] S4, according to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge, the target image feature data is divided into target domain images containing unknown concepts and other images not containing unknown concepts;

[0011] S5, generating a target domain sample according to the target domain image, the source language feature data and the target language feature data, and generating other samples according to other images and the source language feature data; wherein each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes an other image and a corresponding pseudo language feature;

[0012] S6. Training the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model;

[0013] S7. Obtain unimodal data to be searched, input the data to be searched into a trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

[0014] On the other hand, a multimodal cross-domain image-text mutual search device is provided, and the device is applied to a multimodal cross-domain image-text mutual search method, and the device includes:

[0015] An acquisition module is used to acquire source domain data, target domain data, and a to-be-trained image-text mutual search model; wherein the source domain data includes a plurality of image-text pairs, each image-text pair includes source image data and corresponding source language data; and the target domain data includes a plurality of target image data or target language data;

[0016] The image-text mutual search model includes a feature extraction module, a sorting sensor, a concept classifier and a domain judge;

[0017] A determination module, configured to determine source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and to determine target image feature data or target language feature data based on the feature extraction module and the target domain data;

[0018] A first training module, used for training a ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function;

[0019] A screening module, for classifying the target image feature data into target domain images containing unknown concepts and other images not containing unknown concepts according to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge;

[0020] A generation module, used to generate a target domain sample according to the target domain image, the source language feature data and the target language feature data, and to generate other samples according to other images and the source language feature data; wherein each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes another image and a corresponding pseudo language feature;

[0021] The second training module is used to train the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model;

[0022] The search module is used to obtain unimodal data to be searched, input the data to be searched into a trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

[0023] On the other hand, a multimodal and cross-domain image-text mutual search device is provided, and the multimodal and cross-domain image-text mutual search device comprises: a processor; a memory, and the memory stores computer-readable instructions. When the computer-readable instructions are executed by the processor, any one of the above-mentioned multimodal and cross-domain image-text mutual search methods is implemented.

[0024] On the other hand, a computer-readable storage medium is provided, in which at least one instruction is stored. The at least one instruction is loaded and executed by a processor to implement any one of the above-mentioned multi-modal and cross-domain image-text mutual search methods.

[0025] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0026] By proposing a multimodal cross-domain image-text mutual search method, the multimodal model of the source domain can be effectively adapted to the target domain, and the unknown concepts in the sample can be identified. Then, the unknown concepts in the target domain can be actively learned, and the source domain and the target domain can be effectively aligned. In addition, active learning and cross-domain adaptation are jointly optimized so that the new information actively learned can promote cross-domain adaptation, and the accuracy and efficiency of the image-text mutual search model trained by this method are greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0028] Figure 1 It is a flow chart of a method for image-text mutual search based on multi-modal cross-domain provided by an embodiment of the present invention;

[0029] Figure 2 It is a block diagram of a multi-modal cross-domain image-text mutual search device provided by an embodiment of the present invention;

[0030] Figure 3 It is a structural schematic diagram of a multi-modal and cross-domain image-text mutual search device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0031] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0032] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0033] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0034] In the embodiments of the present invention, sometimes the subscripts such as W 1 It may be written in non-subscript form such as W1. When the difference is not emphasized, the meaning is the same.

[0035] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0036] The embodiment of the present invention provides a method for image-text mutual search based on multimodal cross-domain, which can be implemented by a device for image-text mutual search based on multimodal cross-domain, and the device for image-text mutual search based on multimodal cross-domain can be a terminal or a server. Figure 1 The flowchart of the method for multimodal cross-domain image-text mutual search is shown in the figure. The processing flow of the method may include the following steps:

[0037] S1. Obtain source domain data, target domain data, and the image-text search model to be trained.

[0038] The source domain data includes a plurality of image-text pairs, each of which includes source image data and corresponding source language data; the target domain data includes a plurality of target image data or target language data.

[0039] Among them, the image-text mutual search model includes a feature extraction module, a ranking perceptron, a concept classifier and a domain judge. The ranking perceptron can score the task difficulty of the sample, which can be represented by R and is composed of an MLP of 768 →512 →ReLU →1; the concept classifier is used for semantic alignment, which can be represented by C, and is composed of a layer of full connection and Softmax, with a structure of 768 →512 →softmax; the domain judge is used to perform domain alignment based on the features and the ranking scores output by R, which can be represented by D, and is composed of an MLP with a structure of 769 → 512 → ReLU → 512 → ReLU → 1 → sigmoid.

[0040] S2. Determine source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and determine target image feature data or target language feature data based on the feature extraction module and the target domain data.

[0041] Optionally, the feature extraction module may include a visual feature extractor, a language feature extractor, and a fully connected layer, the visual feature extractor is a ResNet network, and the language feature extractor is an MPNet-base network. Based on this structure, the specific processing of S2 may include the following steps S21-S23:

[0042] S21. Perform feature extraction on the image data of the source domain data through the ResNet network of the visual feature extractor, input the feature extracted data into the fully connected layer, and obtain 768-dimensional source image feature data; perform feature extraction on the language feature data of the source domain data through the MPNet-base network of the language feature extractor, input the feature extracted data into the fully connected layer, and obtain 768-dimensional source language feature data.

[0043] S22. Perform feature extraction on the image data of the target domain data through the ResNet network of the visual feature extractor, input the feature-extracted data into the fully connected layer, and obtain 768-dimensional target image feature data. Perform feature extraction on the language feature data of the target domain data through the MPNet-base network of the language feature extractor, input the feature-extracted data into the fully connected layer, and obtain 768-dimensional target language feature data.

[0044] In a feasible implementation, the source domain and target areas Every image of , using a visual feature extractor Extract its visual features and for each text Using a language feature extractor Extract its language features. Visual features can be extracted through ResNet, and then mapped to a 768-dimensional vector through a fully connected layer. Language features can be extracted through the MPNet-base model, and then mapped to a 768-dimensional vector through a fully connected layer.

[0045] S23. Optimize the source image feature data and the corresponding source language feature data according to the ternary loss function to obtain positive sample pairs and negative sample pairs.

[0046] In a feasible implementation, a ternary loss function TL is used to optimize the source image feature data and the corresponding source language feature data, so that the corresponding image and text features are closer, otherwise they are farther away. Considering the extracted visual features v and language features t, the positive sample pair can be obtained. And negative sample pairs , as shown in the following formula (1):

[0047]

[0048] (1)

[0049] in, represents the cosine distance between visual and textual features in the joint embedding space, is the amplitude (set as a hyperparameter), Representation function The feature extractor minimizes Learning tasks.

[0050] S3. Training the ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function.

[0051] In one feasible implementation, the source domain data is used to train a ranking perceptron R, which is used to score the task difficulty of the sample and output a ranking score r. In order to measure the difficulty of the sample, the goal of R is to predict the loss of the multimodal task. In the text-image search example, R is based on the unimodal data. predict , sorting score , x represents image data, is the Sigmoid function. Due to the task loss of the sample It is continuously updated during training, so the present invention uses relative ranking loss to train R. In a batch of data and its real task loss L are randomly divided into two pairs, and we get ,in . R input And output , relative ranking loss is defined as:

[0052]

[0053] The loss function of R in the embodiment of the present invention is defined as:

[0054] (2)

[0055] in is the predicted task loss, Is the source domain data The true loss pairs for regrouping the current batch of data in . is the loss function of R. is the indicator function, when hour , otherwise 0.

[0056] It should be noted that in the process of training the model, training data will be selected multiple times in the data set for iterative training, and the current batch data means the training data selected in the current iteration.

[0057] S4. According to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge, the target image feature data is divided into target domain images containing unknown concepts and other images not containing unknown concepts.

[0058] Optionally, the specific processing process of S4 may include the following steps S41-S45:

[0059] S41, inputting the target image feature data into the trained ranking perceptron to obtain a ranking score of the target image feature data.

[0060] In a feasible implementation manner, referring to the above description of S3, the calculation method of the ranking score r is: , x represents image data, is the Sigmoid function.

[0061] S42: Input the target image feature data and the ranking score into the domain judgement device to obtain the domain judgment result.

[0062] S43. The target image feature data is input into a concept classifier to obtain a concept classification result.

[0063] S44. Determine the uncertainty score of the target image feature data according to the domain judgment result and the concept classification result.

[0064] In one possible implementation, the uncertainty score can be expressed as It is defined as:

[0065]

[0066] S45. Compare the preset uncertainty score threshold with the uncertainty score of the target image feature data. If the uncertainty score of the target image feature data is less than the uncertainty score threshold, the target image feature data is determined to be a target domain image containing an unknown concept. Otherwise, the target image feature data is determined to be other images that do not contain an unknown concept.

[0067] In one possible implementation, you can use represents the uncertainty score threshold, when When Contains unknown concepts, that is, the target image feature data contains unknown concepts, and it is determined as a target domain image; when , it means that x does not contain unknown concepts, that is, the target image feature data does not contain unknown concepts, and it is determined to be other images.

[0068] S5. Generate a target domain sample according to the target domain image, the source language feature data and the target language feature data, and generate other samples according to other images and the source language feature data.

[0069] Each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes an other image and a corresponding pseudo language feature.

[0070] Optionally, the specific processing step S5 may include the following steps S51-S53:

[0071] S51. Generate a mixed language feature data set according to source language feature data and target language feature data.

[0072] S52, calculating the similarity between the target domain image and the language feature data in the mixed language feature data set, determining the language feature data with the greatest similarity as the pseudo language feature of the target domain image, and forming the target domain image and the corresponding pseudo language feature into a target domain sample.

[0073] S53, calculating similarity between other images and the language feature data in the source language feature data, determining the language feature data with the greatest similarity as the pseudo language feature of the other images, and combining the other images and the corresponding pseudo language features into other samples.

[0074] In one feasible implementation, select The lowest target samples are queried and annotated, and visual language data of new target domains are added to At the beginning of training In order to make full use of the supervision information of the target domain, the visual features closest to or Assigned as a pseudo-language feature to form a pseudo dataset First use Uncertainty scores and thresholds Will The images in are divided into two types of samples: samples containing unknown concepts and other samples, the former with uncertainty scores less than the threshold. For the former, For the latter, we select pseudo-text features from the language features in These two parts of pseudo data constitute the data .

[0075] S6. The image-text mutual search model to be trained is trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model.

[0076] Optionally, the specific processing process of S6 may include the following steps:

[0077] S61. Pre-train the image-text mutual search model to be trained based on the source domain data, the target domain data, the target domain samples and other samples.

[0078] Through pre-training, the model can reduce the deviation across modal domains and identify unknown concepts. Optionally, the pre-training operation of S61 can be as follows:

[0079] The image-text search model to be trained is pre-trained based on the source domain data, target domain data, target domain samples and the pre-training loss function shown in the following formula (3):

[0080] (3)

[0081] in, Represents the pre-training loss function.

[0082] The following introduces each loss function in the above formula (3) according to the execution process:

[0083] S611, using the ternary loss function TL to optimize the source image feature data and the corresponding source language feature data, the corresponding loss function The calculation formula can refer to the above step S2 and formula (1);

[0084] S612, use the source domain data to train the sorting perceptron R, its operation process and loss function Refer to the above step S3 and formula (2);

[0085] S613: Use concept classifier C to perform semantic alignment. In the embodiment of the present invention, in order to use training data for multiple iterations of training, a pre-trained language model can be used to extract language features in the source domain and cluster them into M clusters, where M=512. Then, the cluster label set The source concept tag set is regarded as the source concept tag set, and the visual language features in the source domain are assigned concept tags according to the cluster labels of their language features. For the single-modal samples in the target domain (the visual modality in this embodiment), the present invention uses the ranking-aware uncertainty scores calculated by D and C to identify the target domain samples containing unknown concepts. For samples containing only known concepts, the cross entropy function is used for optimization as follows:

[0086] (4)

[0087] Where z is The source domain concept labels obtained through pre-clustering, refers to the cross entropy function, represents the source image feature dataset, Represents the source language feature dataset.

[0088] S614. In order to prevent C from being overconfident, samples containing unknown concepts are used to constrain C:

[0089] (5);

[0090] in, Represents the target domain sample set containing unknown concepts.

[0091] S615, adversarially train the domain judge D to align the feature space of the source domain and the target domain. The feature extractor tries its best to deceive the domain judge D, while the domain judge D tries its best to distinguish whether the feature is from the source domain or the target domain. In order to make full use of multimodal information, the domain judge D needs to distinguish multimodal information. represents the loss function for training the domain judgement according to the source domain feature data and the target image feature data. The loss function can be calculated as follows (6):

[0092] (6)

[0093] in Represents the source domain Visual and language data, Represents the target domain data, The ranking score output by R. and The ranking scores are given by Input R to get r and features are concatenated into a 769-dimensional vector and then input into D.

[0094] S62. Jointly optimize the pre-trained image-text mutual search model based on the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model.

[0095] Optionally, the joint optimization execution process of S62 is as follows:

[0096] According to the source domain data, target domain data, target domain samples and the following formula (7), the pre-trained image-text mutual search model is jointly optimized to obtain the trained image-text mutual search model:

[0097] (7)

[0098] in, represents the overall loss function, represents the pre-training loss function, and its calculation formula can refer to the above formula (3);

[0099] represents the loss function for training the domain judger based on the target domain samples, source domain data, and target domain data. Its specific calculation formula can be as follows (8):

[0100] (8)

[0101] represents the loss function for training the concept classifier based on other samples. Its specific calculation formula can be as follows (9):

[0102] (9)

[0103] represents the loss function for training the concept classifier based on the target domain samples. Its specific calculation formula can be as follows (10):

[0104] (10)

[0105] It represents the loss function for optimizing the target image feature data and the target language feature data in the target domain sample. Its specific calculation formula can be as follows (11):

[0106] (11)

[0107] It represents the loss function for optimizing the pseudo language features and pseudo image features in the target domain samples. Its specific calculation formula can be as follows (12):

[0108] (12)

[0109] represents the loss function for training the sorting perceptron based on the target domain samples. Its specific calculation formula can be as follows (13):

[0110]

[0111] (13).

[0112] It should be noted that the process recorded in the above steps S1-S6 is only a training process. In the actual training process, multiple cycles of iterative training will be involved. For example, each time a fixed number of target domain samples are selected from the target domain data for standardization and training. Each training can refer to the operations of the above steps S1-S6, and the present invention will not go into details here.

[0113] S7. Obtain unimodal data to be searched, input the data to be searched into the trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

[0114] In a feasible implementation, after obtaining a trained image-text mutual search model, the model can be used. The specific use process can be: obtain unimodal data to be searched, which can be text data, and the user wants to search for the image corresponding to the text, or the data to be searched can be an image, and the user wants to search for the text corresponding to the image. Input the data to be searched into the trained image-text mutual search model, and the model will output the search results corresponding to the data to be searched.

[0115] The embodiment of the present invention proposes a method for image-text mutual search based on multimodal cross-domain, which can effectively adapt the multimodal model of the source domain to the target domain, can identify unknown concepts in samples, and then actively learn the unknown concepts in the target domain, can effectively align the source domain and the target domain, and jointly optimize the active learning and cross-domain adaptation so that the new information actively learned can promote cross-domain adaptation, so that the accuracy and efficiency of the image-text mutual search model trained by this method are greatly improved.

[0116] Figure 2 is a block diagram of a device for image-text mutual search based on multimodal cross-domain according to an exemplary embodiment, and the device is used for a method for image-text mutual search based on multimodal cross-domain. Figure 2 , the device comprises:

[0117] The acquisition module 210 is used to acquire source domain data, target domain data, and a to-be-trained image-text mutual search model; wherein the source domain data includes a plurality of image-text pairs, each image-text pair includes source image data and corresponding source language data; and the target domain data includes a plurality of target image data or target language data;

[0118] The image-text mutual search model includes a feature extraction module, a sorting sensor, a concept classifier and a domain judge;

[0119] A determination module 220, configured to determine source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and to determine target image feature data or target language feature data based on the feature extraction module and the target domain data;

[0120] A first training module 230, for training a ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function;

[0121] A screening module 240, for classifying the target image feature data into target domain images containing unknown concepts and other images not containing unknown concepts according to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge;

[0122] A generating module 250, configured to generate a target domain sample according to the target domain image, the source language feature data and the target language feature data, and to generate other samples according to other images and the source language feature data; wherein each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes an other image and a corresponding pseudo language feature;

[0123] The second training module 260 is used to train the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model;

[0124] The search module 270 is used to obtain single-modal data to be searched, input the data to be searched into the trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

[0125] Optionally, the feature extraction module includes a visual feature extractor, a language feature extractor and a fully connected layer, the visual feature extractor is a ResNet network, and the language feature extractor is an MPNet-base network;

[0126] The determination module 220 is used to:

[0127] S21, performing feature extraction on the image data of the source domain data through the ResNet network of the visual feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional source image feature data; performing feature extraction on the language feature data of the source domain data through the MPNet-base network of the language feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional source language feature data;

[0128] S22, performing feature extraction on the image data of the target domain data through the ResNet network of the visual feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional target image feature data; performing feature extraction on the language feature data of the target domain data through the MPNet-base network of the language feature extractor, and inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional target language feature data;

[0129] S23. Optimize the source image feature data and the corresponding source language feature data according to the ternary loss function to obtain positive sample pairs and negative sample pairs.

[0130] Optionally, the screening module 240 is used to:

[0131] S41, inputting the target image feature data into the trained ranking perceptron to obtain a ranking score of the target image feature data;

[0132] S42, inputting the target image feature data and the ranking score into a domain judge to obtain a domain judgment result;

[0133] S43, inputting the target image feature data into a concept classifier to obtain a concept classification result;

[0134] S44, determining an uncertainty score of the target image feature data according to the domain judgment result and the concept classification result;

[0135] S45. Compare a preset uncertainty score threshold with the uncertainty score of the target image feature data; if the uncertainty score of the target image feature data is less than the uncertainty score threshold, determine the target image feature data as a target domain image containing an unknown concept; otherwise, determine the target image feature data as other images that do not contain an unknown concept.

[0136] Optionally, the generating module 250 is used to:

[0137] S51, generating a mixed language feature data set according to the source language feature data and the target language feature data;

[0138] S52, calculating the similarity between the target domain image and the language feature data in the mixed language feature data set, determining the language feature data with the greatest similarity as the pseudo language feature of the target domain image, and forming the target domain image and the corresponding pseudo language feature into a target domain sample;

[0139] S53, calculating similarity between the other images and the language feature data in the source language feature data, determining the language feature data with the greatest similarity as the pseudo language feature of the other images, and combining the other images and the corresponding pseudo language features into other samples.

[0140] Optionally, the second training module 260 is used to:

[0141] S61, pre-training the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples;

[0142] S62. Jointly optimize the pre-trained image-text mutual search model based on the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model.

[0143] Optionally, the second training module 260 is used to:

[0144] The image-text search model to be trained is pre-trained based on the source domain data, target domain data, target domain samples and the pre-training loss function shown in the following formula (1):

[0145] (1)

[0146] Among them, the represents the pre-training loss function, represents a ternary loss function that optimizes the source image feature data and the corresponding source language feature data, represents the cross entropy loss function for optimizing the image-text search model to be trained based on other samples. represents the relative ranking loss function for training the sorting perceptron based on the source image feature data and the source language feature data, represents the loss function for training the concept classifier based on the target domain samples, Represents the loss function for training the domain judger based on the source domain feature data and the target image feature data.

[0147] Optionally, the second training module 260 is used to:

[0148] According to the source domain data, target domain data, target domain samples and the following formula (2), the pre-trained image-text mutual search model is jointly optimized to obtain the trained image-text mutual search model:

[0149] (2)

[0150] in, represents the overall loss function, represents the pre-training loss function, represents the loss function for training the domain judge according to the target domain samples, source domain data, and target domain data, represents the loss function for training the concept classifier based on other samples, represents the loss function for training the concept classifier based on the target domain samples, represents the loss function for optimizing the target image feature data and the target language feature data in the target domain sample, represents the loss function for optimizing the pseudo language features and pseudo image features in the target domain samples, represents the loss function for training the ranking perceptron based on target domain samples.

[0151] The embodiment of the present invention proposes a method for image-text mutual search based on multimodal cross-domain, which can effectively adapt the multimodal model of the source domain to the target domain, can identify unknown concepts in samples, and then actively learn the unknown concepts in the target domain, can effectively align the source domain and the target domain, and jointly optimize the active learning and cross-domain adaptation so that the new information actively learned can promote cross-domain adaptation, so that the accuracy and efficiency of the image-text mutual search model trained by this method are greatly improved.

[0152] Figure 3 is a schematic diagram of a structure of a multi-modal cross-domain image-text mutual search device provided by an embodiment of the present invention, such as Figure 3 As shown, the multimodal cross-domain image-text search device may include the above Figure 2 The illustrated apparatus for image-text mutual search based on multimodal cross-domains. Optionally, the apparatus for image-text mutual search based on multimodal cross-domains 310 may include a first processor 2001 .

[0153] Optionally, the multimodal and cross-domain image and text mutual search device 310 may further include a memory 2002 and a transceiver 2003 .

[0154] The first processor 2001, the memory 2002 and the transceiver 2003 may be connected via a communication bus.

[0155] Combine the following Figure 3 The components of the multi-modal cross-domain image-text search device 310 are specifically introduced:

[0156] The first processor 2001 is the control center of the multi-modal cross-domain text-image search device 310, which can be a processor or a general term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as one or more microprocessors (digital signal processors, DSPs), or one or more field programmable gate arrays (FPGAs).

[0157] Optionally, the first processor 2001 can execute various functions of the multi-modal cross-domain image-text mutual search device 310 by running or executing a software program stored in the memory 2002 and calling data stored in the memory 2002 .

[0158] In a specific implementation, as an embodiment, the first processor 2001 may include one or more CPUs, such as Figure 3 CPU0 and CPU1 are shown in FIG.

[0159] In a specific implementation, as an embodiment, the multi-modal cross-domain image-text mutual search device 310 may also include multiple processors, such as Figure 3The first processor 2001 and the second processor 2004 are shown in FIG. Each of these processors may be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). The processor here may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).

[0160] The memory 2002 is used to store the software program for executing the solution of the present invention, and is controlled to be executed by the first processor 2001. The specific implementation method can refer to the above method embodiment, which will not be repeated here.

[0161] Optionally, the memory 2002 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001, or may exist independently, and may be connected to the computer through an interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0162] The transceiver 2003 is used to communicate with a network device or a terminal device.

[0163] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 3 The receiver is used to implement a receiving function, and the transmitter is used to implement a sending function.

[0164] Optionally, the transceiver 2003 may be integrated with the first processor 2001, or may exist independently, and communicate with the first processor 2001 through the interface circuit ( Figure 3 (not shown) is coupled to the first processor 2001, which is not specifically limited in this embodiment of the present invention.

[0165] It should be noted that Figure 3 The structure of the multimodal cross-domain image-text mutual search device 310 shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0166] In addition, the technical effects of the multimodal and cross-domain image-text mutual search device 310 can refer to the technical effects of the multimodal and cross-domain image-text mutual search method described in the above method embodiment, which will not be repeated here.

[0167] It should be understood that the first processor 2001 in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0168] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0169] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0170] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0171] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0172] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0173] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0174] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0175] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0176] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0177] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0178] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

[0179] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A multi-modal cross-domain image-text mutual search method, characterized in that: The method comprises: S1. Obtain source domain data, target domain data, and a to-be-trained image-text mutual search model; wherein the source domain data includes a plurality of image-text pairs, each image-text pair includes source image data and corresponding source language data; and the target domain data includes a plurality of target image data or target language data; The image-text mutual search model includes a feature extraction module, a sorting sensor, a concept classifier and a domain judge; S2, determining source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and determining target image feature data or target language feature data based on the feature extraction module and the target domain data; S3, training a ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function; S4, according to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge, the target image feature data is divided into target domain images containing unknown concepts and other images not containing unknown concepts; S5, generating a target domain sample according to the target domain image, the source language feature data and the target language feature data, and generating other samples according to other images and the source language feature data; wherein each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes an other image and a corresponding pseudo language feature; S6. Training the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model; S7. Obtain unimodal data to be searched, input the data to be searched into a trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

2. The method for searching images and texts based on multimodal cross-domains according to claim 1, characterized in that: The feature extraction module includes a visual feature extractor, a language feature extractor and a fully connected layer, the visual feature extractor is a ResNet network, and the language feature extractor is an MPNet-base network; The step S2 of determining source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and determining target image feature data or target language feature data based on the feature extraction module and the target domain data, includes: S21, performing feature extraction on the image data of the source domain data through the ResNet network of the visual feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional source image feature data; performing feature extraction on the language feature data of the source domain data through the MPNet-base network of the language feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional source language feature data; S22, performing feature extraction on the image data of the target domain data through the ResNet network of the visual feature extractor, inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional target image feature data; performing feature extraction on the language feature data of the target domain data through the MPNet-base network of the language feature extractor, and inputting the feature-extracted data into a fully connected layer, and obtaining 768-dimensional target language feature data; S23. Optimize the source image feature data and the corresponding source language feature data according to the ternary loss function to obtain positive sample pairs and negative sample pairs.

3. The method for searching images and texts based on multimodal cross-domains according to claim 2 is characterized in that: The step S4 divides the target image feature data into target domain images containing unknown concepts and other images not containing unknown concepts according to the target image feature data, the trained ranking perceptron, the concept classifier, and the domain judger, including: S41, inputting the target image feature data into the trained ranking perceptron to obtain a ranking score of the target image feature data; S42, inputting the target image feature data and the ranking score into a domain judge to obtain a domain judgment result; S43, inputting the target image feature data into a concept classifier to obtain a concept classification result; S44, determining an uncertainty score of the target image feature data according to the domain judgment result and the concept classification result; S45. Compare a preset uncertainty score threshold with the uncertainty score of the target image feature data; if the uncertainty score of the target image feature data is less than the uncertainty score threshold, determine the target image feature data as a target domain image containing an unknown concept; otherwise, determine the target image feature data as other images that do not contain an unknown concept.

4. The method for searching images and texts based on multimodal cross-domains according to claim 3 is characterized in that: The step S5 generates a target domain sample according to the target domain image, the source language feature data and the target language feature data, and generates other samples according to other images and the source language feature data, including: S51, generating a mixed language feature data set according to the source language feature data and the target language feature data; S52, calculating the similarity between the target domain image and the language feature data in the mixed language feature data set, determining the language feature data with the greatest similarity as the pseudo language feature of the target domain image, and forming the target domain image and the corresponding pseudo language feature into a target domain sample; S53, calculating similarity between the other images and the language feature data in the source language feature data, determining the language feature data with the greatest similarity as the pseudo language feature of the other images, and combining the other images and the corresponding pseudo language features into other samples.

5. The method for searching images and texts based on multimodal cross-domains according to claim 4 is characterized in that: The step S6 trains the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model, including: S61, pre-training the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples; S62. Jointly optimize the pre-trained image-text mutual search model based on the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model.

6. The method for searching images and texts based on multimodal cross-domains according to claim 5, characterized in that: The step S61 pre-trains the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples, including: The image-text search model to be trained is pre-trained based on the source domain data, target domain data, target domain samples and the pre-training loss function shown in the following formula (1): (1) Among them, the represents the pre-training loss function, represents a ternary loss function that optimizes the source image feature data and the corresponding source language feature data, represents the cross entropy loss function for optimizing the image-text search model to be trained based on other samples. represents the relative ranking loss function for training the sorting perceptron based on the source image feature data and the source language feature data, represents the loss function for training the concept classifier based on the target domain samples, Represents the loss function for training the domain judger based on the source domain feature data and the target image feature data.

7. The method for searching images and texts based on multimodal cross-domains according to claim 5, characterized in that: The step S62 performs joint optimization on the pre-trained image-text mutual search model according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model, including: According to the source domain data, target domain data, target domain samples and the following formula (2), the pre-trained image-text mutual search model is jointly optimized to obtain the trained image-text mutual search model: (2) in, represents the overall loss function, represents the pre-training loss function, represents the loss function for training the domain judge based on the target domain samples, source domain data, and target domain data, represents the loss function for training the concept classifier based on other samples, represents the loss function for training the concept classifier based on the target domain samples, represents the loss function for optimizing the target image feature data and the target language feature data in the target domain sample, represents the loss function for optimizing the pseudo language features and pseudo image features in the target domain samples, represents the loss function for training the ranking perceptron based on target domain samples.

8. A multimodal cross-domain image-text mutual search device, the multimodal cross-domain image-text mutual search device is used to implement the multimodal cross-domain image-text mutual search method according to any one of claims 1 to 7, characterized in that: The device comprises: An acquisition module is used to acquire source domain data, target domain data, and a to-be-trained image-text mutual search model; wherein the source domain data includes a plurality of image-text pairs, each image-text pair includes source image data and corresponding source language data; and the target domain data includes a plurality of target image data or target language data; The image-text mutual search model includes a feature extraction module, a sorting sensor, a concept classifier and a domain judge; A determination module, configured to determine source image feature data and corresponding source language feature data based on the feature extraction module and the image-text pair of the source domain data, and to determine target image feature data or target language feature data based on the feature extraction module and the target domain data; A first training module, used for training a ranking perceptron based on the source image feature data, the source language feature data and the relative ranking loss function; A screening module, for classifying the target image feature data into target domain images containing unknown concepts and other images not containing unknown concepts according to the target image feature data, the trained ranking perceptron, the concept classifier and the domain judge; A generation module, used to generate a target domain sample according to the target domain image, the source language feature data and the target language feature data, and to generate other samples according to other images and the source language feature data; wherein each target domain sample includes a target domain image and a corresponding pseudo language feature, and each other sample includes another image and a corresponding pseudo language feature; The second training module is used to train the image-text mutual search model to be trained according to the source domain data, the target domain data, the target domain samples and other samples to obtain a trained image-text mutual search model; The search module is used to obtain unimodal data to be searched, input the data to be searched into a trained image-text mutual search model, and obtain search results corresponding to the data to be searched.

9. A multi-modal cross-domain image and text search device, characterized in that: The multi-modal cross-domain image-text mutual search device includes: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Cross-working-condition fault diagnosis method based on open set joint transfer learning

    CN112784872A

  • Unsupervised pedestrian re-identification method based on camera distribution difference alignment constraint

    CN113065409A

  • Cross-domain sentiment classification method based on comparative learning

    CN116049406A

  • Information classification method, multimedia resource pushing method and device

    CN117115602A