Image-text cross-modal Hash retrieval model training method based on discriminative generation sampling

Discriminative pseudo-embedding vectors are generated by a discriminative generative sampling method to solve the sparse embedding problem in cross-modal retrieval, improve the retrieval performance of hash learning, and are applicable to image-text cross-modal hash retrieval models.

CN120832432AActive Publication Date: 2025-10-24WEIFANG UNIVERSITY
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202511329456.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-17
Publication Date
2025-10-24
Estimated Expiration
2045-09-17

AI Technical Summary

Technical Problem

Existing cross-modal retrieval methods suffer from insufficient training samples in sparse regions of the embedding space, leading to sparse embedding problems that affect retrieval performance. Furthermore, they are limited by GPU memory, which restricts the number of samples per batch and affects sampling efficiency.

Method used

By using a discriminative generative sampling method, discriminative pseudo-embedding vectors are generated to expand the sample distribution in sparse regions, thereby improving the discriminative power and cross-modal alignment performance of hash learning. Data augmentation is performed using hash feature scaling and hash concept offset submodules.

Benefits of technology

It significantly increases the number of training samples, ensures the discriminativeness and semantic rationality of generated samples, improves the retrieval performance of hash learning, reduces computational overhead, and is compatible with various deep hashing frameworks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120832432A_ABST
    Figure CN120832432A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of information retrieval, in particular to an image-text cross-modal hash retrieval model training method based on discriminative generation sampling. Through Hash feature zooming and Hash concept offset, discriminative pseudo-embedding is directly generated in an embedding space, and the problem of insufficient training samples caused by sparse embedding areas is effectively solved; according to the generation mode, the number of the training samples is remarkably increased, more importantly, the discrimination and semantic rationality of the generated samples are guaranteed, and richer training signals are provided for hash learning. In addition, an existing network structure does not need to be changed, the calculation overhead is far lower than that of a traditional generative data enhancement method, the method can be seamlessly integrated into various deep hash frames, and different loss functions and sampling strategies are adapted.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of information retrieval, in particular to a training method of a picture-text cross-modal hash retrieval model based on discriminative generated sampling. BACKGROUND

[0002] Cross-modal retrieval aims at multimedia data such as images, texts, audio and video, and projects heterogeneous samples to appropriate positions in a joint embedding space according to semantics to achieve approximate nearest neighbor retrieval experience. Deep hash cross-modal retrieval limits the embedding space and embedding to Hamming space and hash code, greatly reduces storage cost and improves retrieval speed, and has more application scenario advantages. Like traditional hash methods, it projects heterogeneous data to a common Hamming space to realize multi-modal semantic alignment, and relies on a suitable loss function to train the embedding to be close to each other in space.

[0003] However, such methods rely on embedding quality, and embedding distribution with little or no contribution to training is discriminative, which may even cause the model to collapse. Sampling information-rich and stable embedding is crucial to promote embedding space training, and thus two paths are formed to design a sampling method that better fits the loss function and provide more discriminative embedding.

[0004] Sampling methods, as an important step in selecting samples, have received much attention. Although sampling methods for single batch embedding have made progress, the size of the single batch is greatly affected by physical devices due to GPU memory limitations. Smaller batches mean fewer sample quantities, which in turn affects the sampling effect. Moreover, the embedding within a single batch is prone to sparse embedding problems due to uneven distribution, forcing the sampling method to choose suboptimal candidates, reducing the discriminative ability of the embedding space and cross-modal alignment, leading to erosion of semantic distinguishability in sparse regions and expansion of modal gaps, affecting retrieval performance. In recent years, pseudo-embedding generation methods have attempted to break through the bottleneck, but they either introduce a large amount of training overhead or lack generality. SUMMARY

[0005] To solve at least one problem in the prior art, the present application provides a training method of a picture-text cross-modal hash retrieval model based on discriminative generated sampling.

[0006] The first aspect of the present application provides a training method of a picture-text cross-modal hash retrieval model based on discriminative generated sampling, which comprises the following steps: Obtain a labeled picture-text dataset, wherein the picture-text dataset comprises image samples and their labels and text samples and their labels; Extract the image features of the image samples and the text features of the text samples, respectively, and map them into image embedding vectors and text embedding vectors; Generate image pseudo-embedding vectors or text pseudo-embedding vectors according to high-activation features in the image embedding vectors or the text embedding vectors; The image pseudo-embedding vector and the text pseudo-embedding vector are used to train the image-text cross-modal hash retrieval model. The parameters of the image-text cross-modal hash retrieval model are updated according to the target loss.

[0007] In the present application, the discriminative pseudo-embedding is directly generated in the embedding space according to the high activation features in the image-text embedding vector, which can solve the problem of insufficient training samples caused by sparse embedding regions.

[0008] In some optional embodiments, the image features of the image samples and the text features of the text samples are extracted by the CLIP model respectively.

[0009] In some optional embodiments, the high activation features are the top dimension features with the maximum values in the image embedding vector or the text embedding vector, wherein is a positive integer.

[0010] In some optional embodiments, the generation of the image pseudo-embedding vector or the text pseudo-embedding vector according to the high activation features in the image embedding vector or the text embedding vector includes: establishing a frequency record matrix; identifying the top dimension features with the maximum values in the image embedding vector or the text embedding vector, and accumulating the count on the corresponding dimension of the category in the frequency record matrix; generating a binary mask for each category according to the frequency record matrix; randomly scaling the features in the identified image embedding vector or text embedding vector according to the binary mask to obtain the image pseudo-embedding vector or text pseudo-embedding vector.

[0011] In some optional embodiments, the image-text cross-modal hash retrieval model training method based on discriminative generation sampling further includes the following steps: For the image embedding vector or the text embedding vector with multiple hot labels, the label semantic difference vector and the embedding difference vector between the sample pairs are calculated; The effective embedding difference vectors are screened according to the constraint condition; The effective embedding difference vectors are normalized and multiplied by a scaling factor to obtain the image pseudo-embedding vector or the text pseudo-embedding vector.

[0012] In some optional embodiments, the constraint condition includes non-negative constraint, non-zero constraint and non-identity constraint.

[0013] In some optional embodiments, the target loss includes a distance-based loss, wherein the distance-based loss is calculated by the following formula: ; wherein, denotes the label relationship between samples and , and is 1 when , otherwise 0; denotes the distance between samples and ; and respectively denote the hyperparameters for controlling the loss margin requirement.

[0014] The second aspect of the present application provides a picture-text cross-modal hash retrieval method, which comprises the following steps: extracting image features of an image to be retrieved or text features of a text to be retrieved, and mapping them into image embedding vectors or text embedding vectors; inputting the image embedding vectors or text embedding vectors into a picture-text cross-modal hash retrieval model, and outputting retrieval results from the picture-text cross-modal hash retrieval model; wherein, the picture-text cross-modal hash retrieval model is obtained by the above-mentioned picture-text cross-modal hash retrieval model training method based on discriminative generative sampling.

[0015] The third aspect of the present application provides an electronic device comprising a memory and a processor, wherein the memory is used to store a computer program; the processor is used to execute the above-mentioned picture-text cross-modal hash retrieval model training method based on discriminative generative sampling according to the computer program.

[0016] The fourth aspect of the present application provides a computer readable storage medium, wherein the computer readable storage medium is used to store a computer program; the computer program realizes the above-mentioned picture-text cross-modal hash retrieval model training method based on discriminative generative sampling when executed by a processor.

[0017] The technical scheme of the embodiment of the present application has the following beneficial effects: by means of hash feature scaling and hash concept offset, discriminative pseudo-embedding is directly generated in the embedding space, effectively solving the problem of insufficient training samples caused by sparse embedding area; this generation method not only significantly increases the number of training samples, but more importantly, ensures the discriminativeness and semantic rationality of the generated samples, providing more abundant training signals for hash learning; in addition, without changing the existing network structure, the computational overhead is much lower than that of traditional generative data enhancement methods, and it can be seamlessly integrated into various deep hash frameworks and adapted to different loss functions and sampling strategies. BRIEF DESCRIPTION OF DRAWINGS

[0018] Figure 1 It is a network structure diagram of the picture-text cross-modal hash retrieval model in the embodiment of the present application.

[0019] Figure 2Figures of comparison results of training time and encoding time of different models in embodiments of the present application on MS COCO dataset in 32-bit, wherein (a) is the comparison of training time (unit: hours), (b) is the comparison of encoding time (unit: milliseconds).

[0020] Figure 3 Figures of mAP@all results of different models with or without DGS module on MIRFLICKR-25K dataset in embodiments of the present application, wherein (a) is the figure of mAP@all results of I2T task, (b) is the figure of mAP@all results of T2I task.

[0021] Figure 4 Figures of mAP@all results of models using different parameters on MS COCO dataset in embodiments of the present application, wherein (a) is the figure of mAP@all results of I2T task, (b) is the figure of mAP@all results of T2I task.

[0022] Figure 5 Figures of mAP@all results of models replacing DGS module with GAN and MIX respectively on MS COCO dataset in embodiments of the present application, wherein (a) is the figure of mAP@all results of I2T task, (b) is the figure of mAP@all results of T2I task.

[0023] Figure 6 Figures of mAP@all results of models trained using different sizes of training set on MS COCO dataset in 16-bit in embodiments of the present application, wherein (a) is the figure of mAP@all results of I2T task, (b) is the figure of mAP@all results of T2I task. DETAILED DESCRIPTION

[0024] The technical solutions in embodiments of the present application will be described clearly and completely below in conjunction with the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.

[0025] In hash learning, let and be the feature codes with length (hash bits) learned by hash functions and from the samples of a dataset, wherein and respectively represent the image modality and the text modality. These samples are marked with multi-hot codes of length . The purpose of hash learning is to make semantically similar samples behave similarly in feature space, i.e. their projection positions in the joint embedding space are similar, and vice versa. This learning method relies on the selection of sample pairs and . However, the number of feature codes is limited by the size of a single mini-batch , which means that all pair-wise relationships learned in a single session can only be generated among these samples. The sparse and inefficient relationship learning undermines the discriminability of the learned co-space.

[0026] To this end, the present application provides a cross-modal image-text hash retrieval model training method based on discriminative generative sampling. By introducing a discriminative generative sampling (DGS) mechanism, without changing the network structure, discriminative pseudo-embedding vectors are generated, the sample distribution in the sparse area is expanded, and the discriminability of hash learning and the cross-modal retrieval performance are improved. By generating discriminative pseudo-embedding vectors , and their corresponding generated labels , the number of feature codes is expanded to , and a more discriminative embedding space is obtained. The cross-modal image-text hash retrieval model trained can be used for cross-modal image-text hash retrieval, and superior retrieval performance can be achieved.

[0027] Specifically, the cross-modal image-text hash retrieval model (labeled as DDGSH) in the embodiment of the present application includes a feature extraction network and a discriminative generative sampling (DGS) module. In the discriminative generative sampling, data augmentation is performed through a hash feature scaling (HFS) submodule and a hash concept shift (HCS) submodule to generate discriminative pseudo-embedding vectors, making the embedding space denser and improving the discriminability of the hash code and the cross-modal alignment performance.

[0028] The feature extraction network can be a dual-stream architecture backbone network based on CLIP (ViT-B / 32). CLIP is a classic model for cross-modal learning and is currently the mainstay of cross-modal hash retrieval work. CLIP uses Vision Transformer and Transformer as image and text encoders, and each encoder contains 12 encoding blocks composed of multi-head self-attention and multi-layer perceptron. Image modality samples are processed via the Vision Transformer encoder, and text modality samples are processed via the Transformer encoder for feature extraction. The function of each layer is represented as follows:​​ ; ; ; ; in, and Represent the features of image modality and text modality respectively, and represent the intermediate vectors, Indicates the coding block number; and They represent multi-head self-attention and multi-layer perceptron respectively; Representation layer normalization. The input of the layer (i.e. Output of the layer and ), respectively through the multi-head self-attention layer and residual connection, and then through the multi-layer perceptron and residual connection to obtain the output of this layer and After 12 layers of image and text encoding blocks, the original semantics of the image and text are extracted into the final high-dimensional features. and Then, the hash layer is responsible for and Map to The signature code in the continuous embedding space of the bit hash code length and Since binary optimization is an extremely difficult problem in model training, continuous hash codes are used for the training features here, and then binarized to obtain the real hash codes during the model testing phase. In order to use a continuous relaxation strategy similar to binary optimization during training, the hash layer is introduced The activation function makes the hash layer output a continuous binary-like code. Similar to the two-stream architecture, the image features and text features are hashed at the same scale, as shown in the following formula: ; ; in, and Represent the weight parameters of the image hash layer and text hash layer respectively; and They represent the corresponding bias parameters respectively.

[0029] Due to the sparsity of the original embedding space, it is difficult to obtain a discriminative hash space by training only these real samples. Therefore, the embodiment of the present invention uses a discriminative generative sampling method, uses the embedding learned from real samples as the sampling anchor point, and uses two sub-modules, hash feature scaling and hash concept offset, to obtain a pseudo-embedding that is discriminative in itself without the need for additional models or training.

[0030] The hash feature scaling submodule aims to generate semantically enhanced or weakened variants by randomly scaling the highly activated and discriminative feature dimensions in a single embedding vector, thereby producing discriminative pseudo-embeddings around the original sample. First, a learnable frequency record matrix is ​​established. ,in represents the total number of categories, Represents the hash code length. The frequency record matrix is ​​initialized to a zero matrix. For each training sample and its label , identify the topmost dimensions (i.e. the most active features) and record the frequency matrix Corresponding category The frequency record matrix is The specific update rules are shown in the following formula. For simplicity, the following part directly uses Represents its embedding vector :

[0031] This formula is used to update the frequency recording matrix The middle category is , the characteristic digit is The number of high activations of the bit. Represents the dimension index, express Center front The set of dimension indices with the largest values. It is considered to be the most representative bit in the embedding vector. is 8.

[0032] Then, based on the updated frequency record matrix , generating a binary mask matrix for each category , identifies the discriminative feature dimension of the category. The binary mask is recorded by selecting the frequency matrix The highest frequency front The following formula is obtained by setting the first dimension to 1 and the rest to 0:

[0033] The formula is used to finally determine the feature bit number whether it is a high activation feature bit of the category . Among them, represents the feature dimension index set of the first maximum value of the category record. The final matrix records the index where the first high activation bit of each category is located.

[0034] For a given real embedding vector and its label , first determine the dimension that needs to be scaled according to its category mask ; then, a scaling factor vector is generated, as shown in the following formula: ; Among them, , represents a random vector uniformly sampled in each dimension; θ represents a control scaling range hyperparameter; 1 h represents a full 1 vector; and ⊙ represents element-wise multiplication. In an embodiment of the present application, θ = 0.1, that is, the features are randomly scaled in the range (0.9, 1.1). This operation only randomly scales the discriminative feature dimensions, and the non-discriminative dimensions remain unchanged, thereby generating new samples with discriminative while maintaining the main semantics of the samples.

[0035] After obtaining the scaling coefficient , the new embedding after random scaling is obtained by bit multiplication, as shown in the following formula: ; The newly obtained based on the key discriminative feature scaling of obtains a new pseudo embedding similar to the original embedding semantics, and the corresponding label is the same as the original embedding , also .

[0036] The hash concept offset sub-module synthesizes the pseudo embedding with discriminative ability through the semantic conversion between multiple embeddings. The hash concept offset sub-module operates through concept difference propagation to generate a pseudo embedding vector with semantic concept offset. For a batch of embeddings with multi-hot labels , the label semantic difference and embedding difference vector between sample pairs are calculated, as shown in the following formula: ; ; Among them, represents the two vectors and The difference, Indicates the corresponding label and interpolation.

[0037] To ensure that the generated transformation has clear semantic meaning, three constraints are imposed on the calculated difference pairs: (1) non-negative constraint, which ensures that the semantic transformation is addition rather than removal, that is, ; (2) Non-zero constraints ensure that there is a substantial semantic change, that is, ; (3) non-identity constraint, excluding the invalid situation of self-subtraction, that is, Here Represents the dimension in the vector. For valid difference pairs that meet the constraints, embed the vector difference Normalize and multiply by a controllable scaling factor , and finally generate a pseudo embedding vector representing a specific semantic transformation direction and its corresponding pseudo label, as shown in the following formula: ; ; This mechanism can effectively generate new sample points along the direction of semantic relationships in the embedding space, thereby enriching the semantic diversity of samples. in Corresponding to the anchor embedding Subtractive embedding , with zoom.

[0038] The effects of the Discriminative Generative Sampling (DGS) module of the embodiment of the present invention can be considered as: ; Here Represents all new samples generated by hash feature scaling or hash concept shift. By converting the generated pseudo embedding vector and its corresponding pseudo labels This is used to further train the hash layer, further improving the samples used in actual model training. Through the two submodules of hash feature scaling and hash concept shifting, it effectively provides discriminative pseudo-embeddings for hash retrieval training, making the learned cross-modal hash model more discriminative.

[0039] During the testing phase, use The function binarizes the feature code to obtain the hash code, as shown in the following formula: ; ; in, Represents a sign function that outputs 1 when the input is > 0, otherwise it outputs -1. Through this function, the continuous hash code 、 Convert to a true binary hash code 、 .

[0040] When performing cross-modal hash retrieval of images and texts, the query sample (image or text) is first input into the trained cross-modal hash retrieval model. Through the processing of the feature extraction network and the hash layer, the high-dimensional features of the query sample are converted into low-dimensional continuous binary-like codes. Then, the symbolic function is applied. This code is discretized to generate a final binary hash code. Similarity is measured by calculating the Hamming distance between the query sample's hash code and the hash codes of each sample in the target modality database. The Hamming distance is calculated using an XOR operation and bit counting. Ultimately, the retrieval results are returned as the samples closest to the query sample in Hamming space, completing the cross-modal similarity retrieval task.

[0041] To verify the effectiveness of the image-text cross-modal hash retrieval model (DDGSH) in this embodiment of the present invention, performance verification experiments were conducted on three public datasets: MIRFLICKR-25K, NUS-WIDE, and MS COCO. The model was compared with the current mainstream image-text cross-modal hash retrieval models: DSPH, TwDH, DNPH, DNpH, DHaPH, BiLGSEH, and DECH. In the experiment, the three datasets were repartitioned, each using 10,000 image-text pairs as the training set. In the model validation phase, 5,000 pairs were used as the query set, and the remaining image-text pairs served as the database set.

[0042] During the training phase, 256 pairs of samples were used per batch, and the best value from 100 training rounds was used as the training result. To comprehensively evaluate the retrieval performance of DDGSH, mAP@all (mean average precision) was used as the training metric. Tables 1-3 show the performance comparison results for the image-to-text (I2T) and text-to-image (T2I) tasks.

[0043] Table 1 mAP@all performance comparison results of different models on the MIRFLICKR-25K dataset

[0044] Table 2 Comparison of mAP@all performance of different models on the NUS-WIDE dataset

[0045] Table 3 mAP@all performance comparison results of different models on the MSCOCO dataset

[0046] The efficiency of the DDGSH is verified by intuitively verifying the time length (unit: hour, h) required for 100 rounds of training and the time length (unit: millisecond, ms) required for single inference encoding, and the results are as shown in Figure 2 Experiments prove that, compared with the complex algorithm implementation of the existing model, the DDGSH of the embodiment of the application realizes efficient hash retrieval through a simple and clear design idea.

[0047] In addition, in order to strictly evaluate the generalization of the DDGSH beyond a specific optimization configuration, three classical losses in pair-wise learning (contrastive loss, triplet loss, margin loss) and their most widely used sampling methods (uniform sampling (Uniform Sampling), semi-hard sampling (Semi-Hard Sampling) and distance-weighted sampling (Distance-Weighted Sampling)) are selected, decoupled experiments are performed, and the generalization of the proposed discriminative generative sampling (DGS) module is verified. As shown in Tables 4-6 (in the table, indicates that the DGS is used), the results show that no matter how the underlying optimization is designed, the discriminative generative sampling module of the embodiment of the application provides consistent performance improvement. This orthogonal experiment proves that the effectiveness of the module comes from its core ability to enhance discriminative embedding, rather than the synergistic effect with any specific loss sampling combination.

[0048] Table 4 Decoupling experiment results of DGS on MIRFLICKR-25K dataset

[0049] Table 5 Decoupling experiment results of DGS on NUS-WIDE dataset

[0050] Table 6 Decoupling experiment results of DGS on MSCOCO dataset

[0051] In order to further verify the generalization of the DGS module in producing effects not limited to pair-wise learning, the DGS module is added to the DHaPH and the DDBH, the DHaPH to which the DGS module is added is marked as DHaPH w / DGS, the DDBH to which the DGS module is added is marked as DDBH w / DGS, and experiments are respectively performed on the MIRFLICKR-25K dataset. The results are as shown in Figure 3As shown in the DHaPH and the DDBH, the discriminativeness of the learned hash codes is also emphasized, but the former uses a hierarchical proxy to obtain finer semantics, while the latter achieves this goal through boundary preservation and class proxy, indicating that the DGS module of the embodiment of the application has generalization.

[0052] In addition, the ablation effect of the Hash Feature Scaling (HFS) submodule and the Hash Concept Shift (HCS) submodule in the discriminative generative sampling module is verified, and the results are shown in Table 7 (in the table, indicates that the HFS submodule or the HCS submodule is used). The ablation experiment proves that the Hash Feature Scaling submodule and the Hash Concept Shift submodule can both independently enhance the discriminativeness of the hash space, and the effect is best when they are used jointly.

[0053] Table 7 Ablation experiment results of the Hash Feature Scaling submodule and the Hash Concept Shift submodule on the MIRFLICKR-25K dataset

[0054] Parameters in the Hash Feature Scaling submodule It is considered to be the number of bits that are most discriminative in the hash code, but this value may vary with the length of the hash code. For this, parameter experiments are performed on the MS COCO dataset, and the results are shown in Figure 4 As shown, the global optimum is located in the middle size, the top The ratio is moderate, and four local optima appear at the endpoints of the parameter. Specifically, although the optimal value specific to the dimension needs to be adjusted accurately, perturbation of about 8 bits can produce competitive results in all dimensions. Therefore, for simplicity, = 8 is more appropriate.

[0055] To verify the effectiveness achieved by the DGS module of the embodiment of the application in the generative class method, the DGS module is replaced by a generative adversarial network (GAN) and a mixed interpolation synthesis (MIX) for comparative experiments, and the results are shown in Figure 5 At the same time, in order to verify the effect of the DGS module on extreme scenarios, the training set size is reduced to 2500 pairs, 5000 pairs, and 7500 pairs, respectively, and the change in retrieval performance is observed, and the results are shown in Figure 6 The experiment proves that the DGS module can guarantee the discriminativeness and semantic reasonableness of the generated samples, and still maintains a relatively stable performance in the case of dealing with a decreasing number of real samples.

[0056] The above merely describes preferred embodiments of the present application, and is not intended to limit the present application in any form or in essence. It should be noted that those skilled in the art can make some improvements and supplements without departing from the method of the present application, and these improvements and supplements should also be considered as the protection scope of the present application. For those skilled in the art, some slight changes, modifications and equivalent changes made by using the disclosed technical content without departing from the spirit and scope of the present application are equivalent embodiments of the present application; meanwhile, any equivalent changes, modifications and evolution made according to the essential technology of the present application to the above embodiments are still within the scope of the technical solutions of the present application.

Claims

1. A method for training a cross-modal hashing retrieval model based on discriminative generative sampling, the method comprising: The following steps are involved: Obtain a labeled image and text dataset, where the image and text dataset includes image samples and their labels and text samples and their labels; Extract the image features of the image sample and the text features of the text sample respectively, and map them into image embedding vectors and text embedding vectors; Generate an image pseudo embedding vector or a text pseudo embedding vector based on high activation features in the image embedding vector or the text embedding vector; The image-text cross-modal hash retrieval model is trained using pseudo-embedding vectors for images and texts. Update the parameters of the image-text cross-modal hash retrieval model according to the target loss.

2. The method of claim 1, wherein, The CLIP model is used to extract the image features of image samples and the text features of text samples respectively.

3. The method of claim 1, wherein, The high activation features are the features of the top dimensions with the largest values in the image embedding vector or the text embedding vector, where is a positive integer.

4. The method of claim 1, wherein, Generating an image pseudo embedding vector or a text pseudo embedding vector according to high activation features in the image embedding vector or the text embedding vector comprises: Establish frequency recording matrix; The top dimension with the largest value in the image embedding vector or the text embedding vector is identified, and the corresponding category in the frequency recording matrix is accumulated and counted in the top dimension. Generate a binary mask for each category based on the frequency record matrix; The features in the recognition image embedding vector or text embedding vector are randomly scaled according to the binary mask to obtain an image pseudo embedding vector or a text pseudo embedding vector.

5. The method of claim 1, wherein, The image-text cross-modal hash retrieval model training method based on discriminative generative sampling also includes the following steps: For image embedding vectors or text embedding vectors with multi-hot labels, calculate the label semantic difference vector and embedding difference vector between sample pairs; Filter the effective embedding difference vector according to the constraints; The effective embedding difference vector is normalized and multiplied by a scaling factor to obtain the image pseudo embedding vector or text pseudo embedding vector.

6. The method of claim 5, wherein, The constraints include non-negativity constraints, non-zero constraints and non-identity constraints.

7. The method of claim 1, wherein, The target loss includes a loss based on spacing, wherein the loss based on spacing is calculated by the following formula: ; wherein, represents a label relation between samples and , which is 1 when , otherwise 0; represents a distance between samples and ; and respectively represent hyperparameters controlling the loss margin requirement.

8. A method for image-text cross-modal hash retrieval, characterized in that, The following steps are involved: Extracting image features of the image to be retrieved or text features of the text to be retrieved, and mapping them into image embedding vectors or text embedding vectors; Input the image embedding vector or text embedding vector into the image-text cross-modal hash retrieval model, and the image-text cross-modal hash retrieval model outputs the retrieval results; Among them, the image-text cross-modal hash retrieval model is obtained by the image-text cross-modal hash retrieval model training method based on discriminative generative sampling as described in any one of claims 1-7.

9. An electronic device, comprising: It includes a memory and a processor, wherein the memory is used to store a computer program; the processor is used to execute the image-text cross-modal hash retrieval model training method based on discriminative generation sampling as described in any one of claims 1-7 according to the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store a computer program; when the computer program is executed by a processor, it implements the image-text cross-modal hash retrieval model training method based on discriminative generative sampling as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Image-text cross-modal hash retrieval method based on large-batch training

    CN111209415A

  • Cross-modal retrieval method based on subspace adaptive spacing and storage medium

    CN114691986A

  • Feature fusion model processing method and device, sample retrieval method and device and computer equipment

    CN116522271A

  • Intensive embedding generation method and device based on anchor points and storage medium

    CN116680427A

  • Robust hash unpaired zero sample image-text cross-modal retrieval method

    CN116932783A