A cross-modal image-text retrieval model training method and system

Generating samples through self-enhancement and self-challenge strategies improves the sample difficulty and diversity of the cross-modal image and text retrieval model, solves the problem of insufficient sample quality in the existing technology, and significantly improves model performance and retrieval effects.

CN115391578BActive Publication Date: 2024-10-15BEIJING QIANTU FANGYUAN SOFTWARE TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210925063.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-03
Publication Date
2024-10-15
Estimated Expiration
2042-08-03

AI Technical Summary

Technical Problem

In the existing technology, the difficulty and diversity of samples during the training process of the cross-modal image and text retrieval model are insufficient, resulting in poor model performance and the inability to fully utilize the training data information.

Method used

The self-enhancement strategy is used to generate enhanced negative samples and the self-challenge strategy is used to generate challenge samples. The sample features are combined to improve sample difficulty and diversity, and the triplet loss function is used to optimize model training.

Benefits of technology

It improves the performance of the model for image and text retrieval, enhances the model's ability to capture image and text similarities, avoids local minimum traps, and obtains more accurate and robust retrieval results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115391578B_ABST
    Figure CN115391578B_ABST
Patent Text Reader

Abstract

The present invention provides a sample generation method for a cross-modal image-text retrieval model, which is used for processing a training set of the cross-modal image-text retrieval model, wherein the training set includes a plurality of image-text sample pairs consisting of image samples and text samples, the image samples and text samples that match each other are positive samples, and the image samples and text samples that do not match each other are negative samples. The method uses each sample in the training set as an anchor sample, obtains positive samples and negative samples of the anchor sample from the training set, and combines the obtained positive samples and negative samples with the anchor sample to form an original triplet, and performs the following steps on the original triplet: S1, according to the features of the positive samples and negative samples in the original triplet, obtain their respective corresponding activation features and residual features; S2, combine the residual features of the positive sample and the activation features of the negative sample to generate an enhanced negative sample, and replace the negative sample in the original triplet with the enhanced negative sample to generate an enhanced triplet.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of multimedia, and in particular, to a graphic and text retrieval technology in the field of multimedia, and more particularly, to a method and system based on a cross-modal graphic and text retrieval model training. Background Art

[0002] Model retrieval based on machine learning is a common retrieval technology, which is divided into single-modal retrieval and cross-modal retrieval. Among them, single-modal retrieval refers to retrieval in the same modality, such as text search and image search. Given a query text, the retrieval model can be used to search for matching texts. Similarly, given a query image, the retrieval model can be used to search for matching images. Cross-modal retrieval is represented by image-text retrieval. Due to the rapid growth of multimodal data (text, voice, image and video), the retrieval system has higher requirements. Single-modal retrieval of text search and image search can no longer meet the needs of users. Therefore, the research on image-text retrieval has important application value and research significance. Image-text retrieval is a commonly used technology in the multimedia field. The goal of image-text retrieval is to measure the visual semantic similarity between images and texts. It is a basic research direction in the multimodal field. For example, given a query image, the image-text retrieval system can retrieve texts with relevant content, or given a query text, the image-text retrieval model can retrieve images with relevant content.

[0003] As we all know, effective model training must be achieved if image-text retrieval models are to be widely used in actual production. Sample quality during training is one of the main bottlenecks of model training. Sample quality can usually be defined from two aspects: sample difficulty and sample diversity. Sample difficulty refers to the degree of similarity between negative samples and anchor samples in the implicit contrast space in contrastive learning (for example, if a sample is a negative sample and its similarity to the sample used for the query is very large, then this sample is a difficult negative sample). The greater the difficulty of the negative sample, the more information it can provide in training. In order to increase the difficulty of negative samples in training, many studies have used the strategy of difficult negative sample mining, selecting the negative samples most similar to the anchor samples from a small batch as difficult negative samples for training. However, due to the limitation of the number of samples in a small batch during training, the quality of the difficult negative samples selected from the small batch is not good. Sample diversity refers to the diversity of positive and negative samples in training, which can usually be achieved through data augmentation. However, there is no method to synergistically improve sample difficulty and diversity at this stage. Therefore, for a cross-modal image and text retrieval system, how to improve the difficulty and diversity of samples and make full use of the information of training data to train a cross-modal image and text retrieval model with better performance during the training process is an urgent problem to be solved. Summary of the invention

[0004] Therefore, the object of the present invention is to overcome the defects of the above-mentioned prior art and provide a sample generation method that can provide sample difficulty and sample diversity and a model training method based thereon.

[0005] According to a first aspect of the present invention, a sample generation method for a cross-modal image-text retrieval model is provided, which is used for processing a training set of the cross-modal image-text retrieval model, wherein the training set includes a plurality of image-text sample pairs consisting of image samples and text samples, image samples and text samples that match each other are positive samples, and image samples and text samples that do not match each other are negative samples. The method uses each sample in the training set as an anchor sample, obtains positive samples and negative samples of the anchor sample from the training set, and combines the obtained positive samples and negative samples with the anchor sample to form an original triplet, and performs the following steps on the original triplet: S1, according to the features of the positive samples and negative samples in the original triplet, obtain their respective corresponding activation features and residual features; S2, combine the residual features of the positive sample and the activation features of the negative sample to generate an enhanced negative sample, and replace the negative sample in the original triplet with the enhanced negative sample to generate an enhanced triplet.

[0006] Preferably, the method further includes: S3, generating a challenge positive sample with the remaining features of the positive sample, generating a challenge negative sample with the remaining features of the negative sample, and replacing the positive sample and the negative sample in the original triplet with the challenge positive sample and the challenge negative sample to generate a challenge triplet.

[0007] In some embodiments of the present invention, the method includes: obtaining a positive sample and a most difficult negative sample of an anchor sample from a training set, and combining the obtained positive sample and the most difficult negative sample with the anchor sample to form an original triplet. The most difficult negative sample of the anchor sample is a negative sample in the training set that has the highest cosine similarity with the anchor sample.

[0008] Preferably, in step S1: when the anchor sample is a text sample, a pre-trained image feature extraction network is used to extract the text features of the corresponding positive sample and negative sample, and the corresponding activation features and residual features are obtained according to the text features of the positive sample and negative sample; when the anchor sample is an image sample, a pre-trained text feature extraction network is used to extract the activation features and residual features of the corresponding positive sample and negative sample. Preferably, the pre-trained image feature extraction network is Faster R-CNN. Preferably, the pre-trained text feature extraction network is BERT.

[0009] In some embodiments of the present invention, by calculating the gradient of sample features, features with a gradient modulus greater than a preset threshold are classified as activated features, and features with a gradient modulus less than or equal to the preset threshold are classified as residual features.

[0010] According to a second aspect of the present invention, a cross-modal image-text retrieval model training method is provided, the method comprising: T1, obtaining an original data set, wherein the original data set includes a plurality of image-text sample pairs consisting of image samples and text samples; T2, dividing the data set into a plurality of batches according to a preset batch size, and sequentially using a batch of image-text sample pairs as a training set to perform multiple rounds of iterative training on the cross-modal image-text retrieval model until convergence, wherein in each round of training, the samples in the training set are processed using the method described in the first aspect of the present invention, and the cross-modal image-text retrieval model is trained with a set consisting of enhanced triples and / or challenge triples corresponding to all samples.

[0011] Preferably, the preset batch size is 128, and 128 image-text sample pairs are randomly sampled from the original data set each time to obtain a batch of image-text sample pairs.

[0012] Preferably, the triple loss is:

[0013] l total = l SE +L SC

[0014] Among them, L SE represents the triplet loss corresponding to the enhanced triplet, L SC represents the triplet loss corresponding to the challenge triplet;

[0015]

[0016] Where D represents the original dataset, (x, t) represents the image-text sample pair in the original dataset, and t syn represents the enhanced negative sample corresponding to the image sample x, x syn Represents the enhanced negative sample corresponding to the text sample t.

[0017]

[0018] Where D represents the original dataset, (x, t) represents the image-text sample pair in the original dataset, and t′ pos represents the challenge positive sample corresponding to the image sample x, t′ neg represents the challenge negative sample corresponding to the image sample x, x′ pos represents the challenge positive sample corresponding to the text sample t, x′ neg Represents the challenge negative sample corresponding to the text sample t.

[0019] According to a third aspect of the present invention, a cross-modal image-text retrieval system is provided, the system comprising a cross-modal image-text retrieval model trained by the method described in the second aspect of the present invention.

[0020] Compared with the prior art, the advantages of the present invention are: the training method in the present invention does not require additional training parameters, is suitable for existing cross-modal image-text retrieval models, and the training method of the present invention can be applied to existing image-text retrieval models to help them obtain better retrieval performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The embodiments of the present invention are further described below with reference to the accompanying drawings, in which:

[0022] Figure 1 It is a schematic diagram of the basic principle of the image and text retrieval system under the prior art;

[0023] Figure 2 This is a schematic diagram of the principle of image target detection;

[0024] Figure 3 Schematic diagram of the working principle of a graph-text retrieval model according to an embodiment of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail by specific embodiments below. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.

[0026] As described in the background technology, the training bottleneck of the cross-modal image and text retrieval model under the existing technology is mainly the sample quality, and the sample quality involves two aspects: sample difficulty and sample diversity. In this regard, the present invention proposes a solution to solve the problem of insufficient sample difficulty through a self-enhancement strategy and to solve the problem of insufficient sample diversity through a self-challenge strategy.

[0027] In order to better understand the present invention, the training process of the cross-modal image-text retrieval model in the prior art is first introduced. The basic structure of the image-text retrieval model is as follows: Figure 1 As shown, in the prior art, a given data set (denoted by D) is used to train the image-text retrieval model, where the given data set Includes matching image samples (x i ∈X, X is the image dataset for retrieval) and text samples (t i ∈T, T is the text dataset for retrieval). During the training process, for each image, an image feature extraction network is used (the image feature extraction network generally uses an object detection network, such as the pre-trained object detection network Faster R-CNN, Fast R-CNN, R-CNN, etc.) to extract a series of features of the focus area. For each text, a pre-trained text feature extraction network (such as BERT, RoBERT, etc.) is used to extract text features. Figure 2 As shown in Figure 1, for an image, the target detection network first finds common image blocks such as objects and attributes (framed in the figure), and the less meaningful areas in the image are ignored. is the feature of the nth region in the image, is the feature set of all the focus areas of the image. Usually, each image has 36 focus areas, that is, N = 36. For each text, it is encoded as a string of word embeddings where ψ m is the embedding of the mth word, and M is the total number of words in the text. The regional features of the image and the word embedding of the text are respectively aggregated by the aggregation function f v (·) and f t (·) Aggregate to obtain the overall feature vector corresponding to the image and text ( Figure 1 where correspond to image features and text features respectively)

[0028]

[0029]

[0030] Finally, the image and the text are similarly measured (cosine distance, Euclidean distance, etc. can be used for measurement). According to one embodiment of the present invention, cosine distance is used for calculation, wherein the similarity between the image and the text can be expressed as:

[0031]

[0032] Cross-modal image and text retrieval tasks are usually trained using metric learning methods. Simply put, the training is performed with the optimization goal of making the positive samples more similar and the negative samples less similar. The most commonly used loss function is triple loss, that is, the model is trained with triples as the basic unit input:

[0033]

[0034] where γ is a hyperparameter and [a] + ≡max(0,a), indicating a function that takes a larger value between parameter a and 0. [a] in the subsequent embodiments + The function of the form is the same function, which will not be repeated. (x, t) is a positive sample pair of image text, and are all negative sample pairs, usually and It is sampled in small batches, and the corresponding triples are or in It means taking the image sample as the anchor sample and obtaining the corresponding triple consisting of the positive sample text and the negative sample text. Similarly, It means that the text sample is used as the anchor sample to obtain the corresponding triple consisting of the positive sample image and the negative sample image. In cross-modal image-text retrieval, the image sample and text sample that match each other are positive samples of each other, the text sample that does not match the image sample is the negative sample of the image, and the image sample that does not match the text sample is the negative sample of the text. Under the prior art, the negative samples in the triple are sampled in each batch. It should be noted that due to the large scale of the data set, it is impossible to input all the data into the model for training at one time during the training process. Therefore, batch training is often used in the model training process. The data of each batch is randomly sampled from the original data set according to the batch size. After the model is trained, the data of a batch is discarded and sampled again from the original data set for the next training. In the image-text retrieval model training process, the negative samples of the triple are sampled from the data corresponding to the batch. In a batch, for each matching image-text sample pair, they are positive samples of each other, and the remaining text samples in the batch are negative samples of the image samples. Similarly, the remaining image samples in the batch are negative samples of the text. Since the batches are small, the sample difficulty and sample diversity cannot be guaranteed. Even if the most difficult negative sample is sampled in the batch (that is, in each batch, the negative sample corresponding to the sampled anchor sample is the most similar to the anchor sample), it cannot be guaranteed that the negative sample is a good difficult negative sample. In addition, the sample diversity problem is not considered during the training process under the existing technology, which makes the trained image and text retrieval model poor and unable to break through the bottleneck.

[0035] In view of the problems in the prior art, the present invention proposes a method of generating samples for each batch during the training process to solve the problems of poor quality of hard negative samples and insufficient sample diversity. The inventors found in their research that the degree of attention paid by the model to the input features can be reflected by the size of the reversed gradient. For example, taking the text retrieval image as an example (i.e., the anchor sample is a text sample), when the loss function uses the triple loss, the gradients of the positive and negative samples corresponding to the text sample are:

[0036]

[0037]

[0038] Among them, grad represents the function of finding the gradient, that is, finding the gradient of the eigenvector, φ n Represents the feature vector of the positive sample, grad(φ n ,f v ) represents the gradient of the positive sample, represents the feature vector of negative samples, represents the gradient of negative samples, It represents the symbol for finding the gradient, L is the loss function, L t→i represents the loss of the i-th feature of the text sample t as the anchor sample.

[0039] Using a preset threshold ∈, according to the size of the gradient modulus (according to the previous embodiment, the gradient of each feature is a vector, the modulus of the gradient is the modulus of the gradient vector, and the mode of obtaining the vector is a technology known to those skilled in the art, which will not be described in detail in the present invention), multiple features of an image sample can be divided into activated features A and residual features R in the following manner:

[0040]

[0041]

[0042] If the gradient modulus is greater than the threshold, it means that the model pays attention to this feature, so it is an activated feature; on the contrary, if it is less than the threshold, it means that the model tends to ignore this feature, so it is a residual feature.

[0043] For a triplet with a text sample as the anchor sample, the activation feature A of the positive sample corresponding to the text sample can be obtained pos and the remaining features R pos , activation feature A corresponding to the negative sample neg and the remaining features R neg ; Similarly, the activation features and residual features corresponding to the positive samples and negative samples in the triplet with the image sample as the anchor sample are not elaborated here.

[0044] In order to increase the difficulty of negative samples in the training process, the present invention proposes to use a self-enhancement strategy to generate difficult negative samples. Specifically, the features (activated features) in the sample that are concerned by the model approximately determine whether the sample is a positive sample or a negative sample. The self-enhancement strategy of the present invention is to combine the activated features in the negative sample with the remaining features in the positive sample to generate a new sample. Based on the self-enhancement strategy, the generated sample obtained with the text sample as the anchor sample is:

[0045] x syn =R pos ∪A neg

[0046] Among them, R pos Represents the remaining features of the positive sample with the text sample as the anchor sample, A neg represents the activation features corresponding to the negative samples with text samples as anchor samples, x syn Table 2 shows the enhanced negative samples using text samples as anchor samples.

[0047] Similarly, the image sample can be used as the anchor sample and the generated sample can be obtained based on the self-enhancement strategy, with t syn express:

[0048] t syn =R' pos ∪A' neg

[0049] Among them, R' pos Represents the remaining features of the positive sample with the image sample as the anchor sample, A' neg Represents the activation features corresponding to the negative samples with the image samples as anchor samples.

[0050] Since the generated sample contains the activation features of the negative sample, it can still be considered a negative sample. At the same time, the generated sample contains the remaining features of the positive sample, so that the overall features of the generated sample are closer to the anchor sample than the originally sampled negative sample, that is, the generated sample is more difficult than the original negative sample. For the convenience of description, in this embodiment, the generated sample obtained based on the self-enhancement strategy is called an enhanced negative sample, and the enhanced negative sample replaces the triplet corresponding to the original negative sample to obtain a new triplet for training the model, and the triplet loss is used as the optimization target:

[0051]

[0052] In addition, since the retrieval model tends to focus on some dominant features during the training process and eventually falls into a local minimum, this will cause the model to only focus on a small amount of significant semantic association information during the inference stage and ignore other implicit associations. In order to avoid this problem, allowing the model to capture more diverse semantic association information can avoid falling into the local minimum and improve model performance. According to an embodiment of the present invention, a self-challenge strategy is proposed, that is, the activated features in the positive and negative samples are discarded and samples are generated with the remaining features. The generated samples obtained based on the above self-challenge strategy with the text sample as the anchor sample are:

[0053] x′ pos =R pos

[0054] x′ neg =R neg

[0055] Among them, x′ pos represents the sample generated based on the remaining features of the positive sample when the text sample is used as the anchor sample, R pos represents the remaining features of the positive sample when the text sample is used as the anchor sample, x′ neg represents the sample generated based on the residual features of the negative sample when the text sample is used as the anchor sample, R negRepresents the remaining features of negative samples when the text samples are used as anchor samples.

[0056] Similarly, based on the self-challenge strategy, we can obtain the generated samples with image samples as anchor samples, respectively. p ' os and t′ neg express:

[0057] t p ' os =R' pos

[0058] t′ neg =R' neg

[0059] Among them, t p ' os Represents the sample generated based on the remaining features of the positive sample when the image sample is used as the anchor sample, R' pos Represents the remaining features of the positive sample when the image sample is used as the anchor sample, t′ neg Represents the sample generated based on the residual features of the negative sample when the image sample is used as the anchor sample, R' neg Represents the remaining features of negative samples when the image samples are used as anchor samples.

[0060] The self-challenge strategy discards the activated features in the positive and negative samples to obtain new generated samples. For the convenience of description, in this embodiment, the generated samples obtained based on the self-challenge strategy are respectively referred to as challenge positive samples and challenge negative samples, and the challenge positive samples and challenge negative samples are used to replace the corresponding triplets of the original positive and negative samples to obtain new triplets for training the model. By discarding the activated features in the positive and negative samples, the model is forced to mine features other than the dominant features, thereby discovering previously ignored related information. Through self-challenging, the trained model relies on more comprehensive associations to calculate similarities, thereby obtaining more accurate and robust retrieval results. Like the self-enhancement strategy, the self-challenge strategy also uses the form of triple loss as the optimization target:

[0061]

[0062] In the overall training process of the image-text retrieval model, adaptive estimation (Adam) is used for optimization, and the total loss function is:

[0063] l total = l SE +L SC

[0064] In summary, if Figure 3As shown, the scheme of training the image-text retrieval model based on the self-enhancement and self-challenge strategy to generate samples can be summarized as training the image-text retrieval model in the following manner for each batch of data:

[0065] Take each text sample or image text in the current batch as an anchor sample, and combine the anchor sample with its corresponding positive sample and the hardest negative sample in the current batch to form the original triplet corresponding to the anchor sample:

[0066] Based on gradient-guided feature selection, the activated features and residual features of the positive and negative samples in each triplet are obtained respectively. Based on the self-enhancement strategy, the residual features of the positive samples and the activated features of the negative samples are combined to generate an enhanced negative sample and the enhanced negative sample is used to replace the negative sample in the original triplet corresponding to the current anchor sample to form the enhanced triplet corresponding to the current anchor sample; and based on the self-challenge strategy, the residual features of the positive samples form the challenge positive samples, and the residual features of the negative samples form the challenge negative samples, and the challenge positive samples and the challenge negative samples are used to replace the positive samples and negative samples in the original triplet corresponding to the current anchor sample to form the challenge triplet corresponding to the current anchor sample;

[0067] The cross-modal image-text retrieval model is trained with a set of enhanced triples and challenge triples corresponding to all samples, and the model parameters are updated using triplet loss. The training method in the present invention does not require additional training parameters and is applicable to existing cross-modal image-text retrieval models. The training method of the present invention can be applied to existing image-text retrieval models to help them obtain better retrieval performance.

[0068] In order to verify the effect of the present invention, the inventors applied the samples generated by the method of the present invention to the training of the existing image-text retrieval systems VSE++, VSRN, and VSE∞ on the MSCOCO dataset and the Flickr30K dataset, and compared the obtained retrieval model with the performance of these systems before the method of the present invention was applied. The RSUM indicator was used to measure the performance, where RSUM is the sum of R@K (top-k recall rate). The verification results are shown in Table 1:

[0069] Table 1

[0070]

[0071] It can be seen from Table 1 that the performance of the image-text retrieval model after applying the present invention is significantly improved.

[0072] It should be noted that although the above describes the various steps in a specific order, it does not mean that the various steps must be executed in the above specific order. In fact, some of these steps can be executed concurrently or even in a different order as long as the required functions can be achieved.

[0073] The present invention may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present invention.

[0074] Computer readable storage medium can be a tangible device that holds and stores instructions used by an instruction execution device. Computer readable storage medium can include, for example, but is not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (non-exhaustive list) of computer readable storage medium include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, for example, a punch card or a protruding structure in a groove on which instructions are stored, and any suitable combination thereof.

[0075] The embodiments of the present invention have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A sample generation method for a cross-modal image-text retrieval model, used for processing a training set of the cross-modal image-text retrieval model, wherein: The training set includes a plurality of image-text sample pairs consisting of image samples and text samples, the image samples and text samples that match each other are positive samples, and the image samples and text samples that do not match each other are negative samples. The method is characterized in that each sample in the training set is used as an anchor sample, the positive sample and the negative sample of the anchor sample are obtained from the training set, and the obtained positive sample and negative sample are combined with the anchor sample to form an original triplet, and the following steps are performed on the original triplet: S1. According to the features of the positive and negative samples in the original triplet, the corresponding activation features and residual features are obtained; S2. Combining the remaining features of the positive sample and the activated features of the negative sample to generate an enhanced negative sample, and replacing the negative sample in the original triplet with the enhanced negative sample to generate an enhanced triplet; wherein, by calculating the gradient of the sample features, the features whose gradient modulus is greater than a preset threshold are classified as activated features, and the features whose gradient modulus is less than or equal to the preset threshold are classified as residual features.

2. The method according to claim 1, characterized in that The method further comprises: S3, generate challenge positive samples with the remaining features of the positive samples, generate challenge negative samples with the remaining features of the negative samples, and replace the positive samples and negative samples in the original triples with the challenge positive samples and challenge negative samples to generate challenge triplets.

3. The method according to claim 1, characterized in that: The method comprises: obtaining positive samples and the most difficult negative samples of anchor point samples from a training set, and forming an original triplet with the obtained positive samples and the most difficult negative samples and the anchor point samples.

4. The method according to claim 3, characterized in that The most difficult negative sample of the anchor sample is a negative sample in the training set that has the highest cosine similarity with the anchor sample.

5. The method according to claim 1, characterized in that In step S1: When the anchor sample is a text sample, a pre-trained image feature extraction network is used to extract the text features of the corresponding positive sample and negative sample, and the corresponding activation features and residual features are obtained according to the text features of the positive sample and negative sample. When the anchor sample is an image sample, a pre-trained text feature extraction network is used to extract the activation features and residual features of the corresponding positive and negative samples respectively.

6. The method according to claim 5, characterized in that The pre-trained image feature extraction network is FasterR-CNN.

7. The method according to claim 5, characterized in that The pre-trained text feature extraction network is BERT.

8. A cross-modal image-text retrieval model training method, characterized in that: The method comprises: T1. Obtain an original data set, wherein the original data set includes a plurality of image-text sample pairs consisting of image samples and text samples; T2. Divide the data set into multiple batches according to a preset batch size, and perform multiple rounds of iterative training on the cross-modal image-text retrieval model using the image-text sample pairs of one batch as the training set until convergence, wherein in each round of training, the samples in the training set are processed using the method described in any one of claims 1-7, and the cross-modal image-text retrieval model is trained with a set of enhanced triples and / or challenge triples corresponding to all samples.

9. The method according to claim 8, characterized in that The preset batch size is 128, and 128 image-text sample pairs are randomly sampled from the original data set each time to obtain a batch of image-text sample pairs.

10. The method according to claim 8, characterized in that The triplet loss is: L total =L SE +L SC Among them, L SE represents the triplet loss corresponding to the enhanced triplet, L SC represents the triplet loss corresponding to the challenge triplet; Where D represents the original dataset, (x, t) represents the image-text sample pair in the original dataset, and t syn represents the enhanced negative sample corresponding to the image sample x, x syn Represents the enhanced negative sample corresponding to the text sample t; Where D represents the original dataset, (x, t) represents the image-text sample pair in the original dataset, and t′ pos represents the challenge positive sample corresponding to the image sample x, t′ neg represents the challenge negative sample corresponding to the image sample x, x′ pos represents the challenge positive sample corresponding to the text sample t, x′ neg Represents the challenge negative sample corresponding to the text sample t.

11. A cross-modal image-text retrieval system, characterized in that: The system includes a cross-modal image-text retrieval model trained using the method described in any one of claims 8 to 10.

12. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and the computer program can be executed by a processor to implement the steps of any method described in claims 1-7, 8-10.

13. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the steps of the method as described in any one of claims 1-7, 8-10.