A semantic debiasing attack method for vision-language pre-trained models

By constructing text and image searchable spaces, destroying semantic alignment relationships, and utilizing multi-guided modal interaction and data enhancement technology, we solve the problem of insufficient transferability of visual-language pre-training models in adversarial attacks, and achieve efficient adversarial attacks. attack effect.

CN118332328BActive Publication Date: 2024-10-11UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410248953.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-05
Publication Date
2024-10-11
Estimated Expiration
2044-03-05

AI Technical Summary

Technical Problem

Existing visual-language pre-training models suffer from insufficient transferability and biased destruction of semantic alignment relationships in adversarial attacks. Especially in black-box environments, existing methods fail to fully utilize the potential of multi-modal data and data enhancement. influence.

Method used

A semantic debiasing attack method based on debiased modal interaction is proposed. By constructing a text searchable space and an image searchable space, generating adversarial text and images, destroying semantic alignment relationships, and utilizing multi-guided modal interaction and data enhancement technology , improve the migration of adversarial attacks.

Benefits of technology

It effectively destroys the semantic alignment relationship, improves the adversarial attack transferability of the visual-language pre-training model, significantly improves the success rate and transferability of the attack, optimizes the modal interaction process, and enhances the effectiveness of the attack.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118332328B_ABST
    Figure CN118332328B_ABST
Patent Text Reader

Abstract

The present invention discloses a semantic debiasing attack method for visual-language pre-training models. Based on the concept of debiasing modal interaction, the original data is used to establish the criteria for important judgment and direction of adversarial attack, and guide the process of generating adversarial samples for the opposite modality. First, the importance score of each word is calculated and sorted, and the first N words are selected as replacement words, and replaced with any member c of the candidate word set C to construct a text searchable space ∈ t , then in the text searchable space ∈ t Find the text that meets the conditions as the adversarial text t′, replace the member c position in the adversarial text t′ with the mask [MASK], and search in the image searchable space [i‑∈ i ,i+∈ i ] search, obtain the image that meets the conditions as the adversarial image i′, and finally use the adversarial image i′ and adversarial text t′ to conduct adversarial attacks on the visual-language pre-training model. The present invention accurately destroys the semantic alignment relationship during the attack process and improves the transferability of adversarial attacks on the visual-language pre-training model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of adversarial attacks, and more specifically, relates to a semantic debiasing attack method for a vision-language pre-training model. Background Art

[0002] The emerging synergy between vision and language, combined with advances in pre-trained models, has given rise to the development of vision-language pre-trained models. While vision-language pre-trained models have achieved impressive results in a wide range of tasks, recent studies have revealed their fragility in the face of robustness challenges. Therefore, robustness research on vision-language pre-trained models is crucial to maintaining the security of their applications.

[0003] There are multiple challenges in the field of deep learning robustness. These challenges include defending against adversarial attacks, addressing the long-tail data distribution problem, handling out-of-distribution samples, and mitigating performance degradation caused by noisy inputs. For adversarial attacks, the threat mainly comes from perturbations of the input, which may undermine the integrity of the pre-trained model. Recent studies have revealed that vision-language pre-trained models similar to deep neural networks are vulnerable to adversarial examples.

[0004] Collaborative multimodal adversarial attacks pioneered the exploration of multimodal adversarial robustness challenges within the framework of vision-language pre-trained models, emphasizing that the vulnerability of the embedding representation level is more prevalent when moving from unimodal classification tasks to multimodal non-classification tasks. This approach advocates a unified strategy where adversarial perturbations from different modalities work together to attack vision-language pre-trained models instead of targeting a single modality. Collaborative multimodal adversarial attacks show good white-box attack results on fused vision-language pre-trained models and aligned vision-language pre-trained models, but fall short in black-box settings that are closer to practical applications. At the same time, the collaborative multimodal adversarial attack approach emphasizes that adversarial attacks against vision-language pre-trained models should target embedding representations rather than downstream task labels, laying the foundation for attacks on vision-language pre-trained models. Collaborative multimodal adversarial attacks mainly fall short in simple text-image relations and modality interaction strategies, which leads to limited transferability and underutilized potential in white-box attack settings.

[0005] Given that collaborative multimodal adversarial attacks are insufficient in black-box settings that are closer to real-world applications, the ensemble-level guided attack method proposes an attack strategy that is inspired by the complex many-to-many correlation observations within multimodal data and introduces an attack that leverages iterative multimodal guidance to enhance the attack effect while maintaining ensemble-level alignment. The ensemble-level guided attack method improves the transferability of the attack and further increases the success rate of white-box attacks by introducing iterative text-image interactions and alignment-preserving enhancements.

[0006] Although both of the above methods claim that they effectively improve the effectiveness of adversarial attacks on vision-language pre-trained models by leveraging multimodal data and unique properties of the task. However, our detailed analysis of these methods and their experimental results shows that the existing research is still somewhat rudimentary. These two methods have not yet explored in depth the key elements that have a significant impact on effectiveness and transferability. Our analysis of the collection-level guided attack method and observations of the reproduction experiments reveal the following two issues:

[0007] 1. The iterative modal interaction constructed by introducing auxiliary adversarial samples in the attack process will lead to reduced transferability of the attack. Research on multimodal tasks mainly focuses on building and integrating cross-modal semantic alignment into embedded representations. The matching relationship between images and texts is complex and imperfect. Based on this, the embedding representation contains not only semantic alignment relationships, but also non-semantic alignment relationships for building matching links. Therefore, the attackable aspects in the visual-language pre-trained model cover a mixture of these two alignment relationships. Considering the semantic commonality between different visual-language pre-trained models derived from the original data, attacking the semantic alignment relationship in the embedded representation is the key to achieving effective transferability. The iterative modal interaction in the existing methods introduces auxiliary adversarial samples, which ultimately leads to the biased destruction of the semantic alignment relationship affected by the method. Figure 1 Results of single-modal attack experiments on the ensemble-level guided attack approach are presented, further emphasizing the point that iterative modal interaction fails to positively affect the transferability of the attack.

[0008] 2. The enhancement method for preserving alignment relationships proposed in the set-level guided attack provides limited help in terms of the richness of modal interaction diversity, and does not deeply explore the impact of data enhancement on the transferability of attacks on visual-language pre-trained models. Current research on unimodal adversarial attacks shows that data enhancement is a key method to improve the transferability of attacks by expanding image-text pairings using separate data enhancements for each modality, but it does not explore the impact of multimodal data enhancement on the effectiveness of attacking visual-language pre-trained models. In addition, the text enhancement method used only selects more text corresponding to the image from the dataset to make the data distribution more similar to the training data used by the model, and the improvement is only achieved by narrowing the gap between the test data and the original model training data. This does not demonstrate the beneficial role of text data enhancement in enhancing the transferability of attacks, but only shows that image data enhancement can improve the transferability of attacks, such as Figure 1 shown. Summary of the invention

[0009] The purpose of the present invention is to overcome the deficiencies of the prior art and provide a semantic debiasing attack method for a vision-language pre-training model, so as to accurately destroy the semantic alignment relationship during the attack and improve the transferability of adversarial attacks on the vision-language pre-training model.

[0010] To achieve the above-mentioned object of the invention, the present invention provides a semantic debiasing attack method for a vision-language pre-training model, which is characterized by comprising the following steps:

[0011] (1) Constructing a text searchable space

[0012] For a given image-text pair (i, t) from a multimodal dataset D, f I (i) means that the image encoder E takes image i as input. I The generated image representation, f T (t) means that the text encoder E takes the text t as input. T Generate the resulting text representation;

[0013] Represent the text as t = [w0, ..., w j , …], calculate the importance score of each word

[0014]

[0015] Among them, t\w j =[w0,…,w j-1 , [MASK], w j+1 , …], which means replacing the jth word w with mask [MASK] j After the text, f T (t\w j ) means text t\w j As input, the text encoder E T The generated text representation, d(t\w j ) means to do text t\w j Derivation;

[0016] According to the text t\w j Importance score For word w j Rank from highest to lowest, select the first N words as replacement words, denoted as w s1 , w s2 , ..., w sN ;

[0017] Replace word w with the snth word in text t sn Replace it with any member c of the candidate word set C to get text t sn =[w0, ..., wsn-1 ,c,w sn+1 , …], all text t sn , n = 1, 2, ..., N constitutes a text searchable space ∈ t ;

[0018] (2) Generate adversarial text t′ and adversarial image i′

[0019] The adversarial text t′ generation process is:

[0020]

[0021] Among them, f T (t sn ) indicates that the text t sn As input, the text encoder E T The generated text representation, || || represents the modulus, · is the dot product, that is, in the text searchable space ∈ t Search for all text sn , n = 1, 2, ..., N, satisfying:

[0022]

[0023] Maximum text t sn is the adversarial text t′, and the corresponding replacement word is denoted by w s , s is the sequence number of the replacement word in the adversarial text t′;

[0024] The generation process of adversarial image i′ is:

[0025]

[0026] Among them, t\w s =[w0,…,w s-1 , [MASK], w s+1 , …], which means replacing the sth word w with mask [MASK] s The text after ∈ i represents the maximum perturbation allowed for image i, f T (t\w s ) means text t\w s As input, the text encoder E T The resulting text representation is:

[0027] That is, in the image searchable space [i-∈ i , i+∈ i ]Search all images * ,satisfy:

[0028]

[0029] The largest image i * is the adversarial image i′;

[0030] (3) Use adversarial image i′ and adversarial text t′ to conduct adversarial attacks on the vision-language pre-trained model.

[0031] The object of the present invention is achieved in that:

[0032] Given that semantic alignment has a significant impact on adversarial attacks on visual-language pre-trained models, especially in terms of transferability. This paper proposes a semantic debiasing attack method for visual-language pre-trained models based on the concept of debiasing modal interaction. The original data is used to establish important judgments and standards for the direction of adversarial attacks, guiding the process of generating adversarial samples for the opposite modality. First, the importance score of each word is calculated and sorted, and the top N words are selected as replacement words, and replaced with any member c of the candidate word set C to construct a text searchable space ∈ t , then in the text searchable space ∈ t Find the text that meets the conditions as the adversarial text t′, replace the member c position in the adversarial text t′ with the mask [MASK], and search in the image searchable space [i-∈ i , i+∈ i ] Search and obtain an image that meets the conditions as the adversarial image i′. Finally, the adversarial image i′ and adversarial text t′ are used to conduct adversarial attacks on the visual-language pre-trained model. The adversarial text t′ is designed to diverge from the original image i in terms of their embedded representation. When generating adversarial images, the most vulnerable important words in the text are blurred. This method effectively reduces the semantic alignment shift that occurs when replacing words in text-based attacks. The generated adversarial image is similar to the one with the masked element t\w in the embedding space. s The original text is obviously different from the original text, which destroys the unbiased semantic alignment relationship in a simple way, thereby generating adversarial sample pairs with high transferability, namely adversarial image i′ and adversarial text t′, which accurately destroys the semantic alignment relationship in the attack process and improves the transferability of adversarial attacks on visual language pre-training models. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 This is a result diagram of a single-modal attack experiment using a collection-level guided attack method;

[0034] Figure 2 A flowchart of a specific implementation of the semantic debiasing attack method for a vision-language pre-training model of the present invention. DETAILED DESCRIPTION

[0035] The specific implementation of the present invention is described below in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when the detailed description of known functions and designs may dilute the main content of the present invention, these descriptions will be omitted here.

[0036] In view of the limitations of the set-level guided attack method, in this embodiment, the present invention proposes a semantic debiasing attack method (SDA) and a further improved semantic debiasing attack method based on multi-guided modal interaction (SDA-MGMI) to solve the adversarial attack problem against the visual language pre-training model. Among them, the semantic debiasing attack method (SDA) constitutes a baseline and deeply studies the subtleties of semantic alignment. The semantic debiasing attack method solves the problem of biased semantic alignment relationship by constructing modal interaction using original data instead of adversarial data. In order to more effectively attack semantic alignment rather than non-semantic redundant alignment, the present invention further proposes a semantic debiasing attack method based on multi-guided modal interaction (SDA-MGMI), which enhances the loss function and optimization process in the semantic debiasing attack method. First, a negative sample function is integrated to direct the adversarial attack to a more semantically relevant dimension. Secondly, modal interaction is enhanced by introducing a multidimensional momentum method based on features and gradients. The addition of momentum strategy effectively alleviates the bias inherent in the iterative method, allowing precise targeting of semantic alignment while deepening modal interaction, thereby improving attack performance. Through these two improvements, the semantic debiasing attack based on multi-guided modal interaction (SDA-MGMI) of the present invention can further improve the transferability of adversarial attacks on vision-language pre-trained models. Considering the beneficial effect of data augmentation on attack transferability, the effectiveness of the present invention is further enhanced from the perspectives of unimodal and multimodal data augmentation.

[0037] Both the semantic debiasing attack method (SDA) and the further improved semantic debiasing attack method based on multi-guided modal interaction (SDA-MGMI) are carefully designed to accurately destroy the semantic alignment relationship during the attack process through in-depth analysis of various improvements to improve the transferability of adversarial attacks on vision-language pre-trained models. The following describes the two attack methods in detail, first introducing the key symbols, then the SDA method in detail, and then the SDA-MGMI is introduced in depth to further enhance the transferability of adversarial attacks.

[0038] 1. Key symbols

[0039] In this embodiment, EI represents an image encoder, E T Denotes a text encoder. Given an image-text pair (i, t) from a multimodal dataset D, f I (i) Take image i as input to generate image representation r i, f T (t) Generate text representation r using text t as input t Based on ∈ i : The maximum perturbation allowed for the image, ∈ t : The maximum number of words that can be changed in a text builds a searchable space of adversarial images and text.

[0040] 2. Semantic Debiasing Attack (SDA)

[0041] As analyzed in the previous article, the semantic alignment relationship has a significant impact on adversarial attacks on vision-language pre-trained models, especially in terms of transferability. After a detailed analysis of existing methods, this paper proposes a semantic debiasing attack (SDA) based on the concept of debiasing modal interaction. Specifically, SDA uses raw data to establish criteria for important judgments and directions of adversarial attacks, guiding the process of generating adversarial samples for the opposite modality.

[0042] Specifically, in this embodiment, if Figure 1 As shown, the semantic debiasing attack method for the vision-language pre-training model of the present invention comprises the following steps:

[0043] Step S1: Constructing a text searchable space

[0044] The present invention starts by identifying words in the sequence that significantly affect the final output KL divergence between the image and text representations. For a given image-text pair (f, t) from a multimodal dataset D, f I (i) means that the image encoder E takes image i as input. I The generated image representation, f T (t) means that the text encoder E takes the text t as input. T Generate the resulting textual representation.

[0045] Represent the text as t = [w0, ..., w j , …], calculate the importance score of each word

[0046]

[0047] Among them, t\w j =[w0,…,w j-1 , [MASK], w j+1 , …], which means replacing the jth word w with mask [MASK] j After the text, f T (t\w j ) means text t\w j As input, the text encoder E TThe generated text representation, d(t\w j ) means to do text t\w j Derivative.

[0048] According to the text t\w j Importance score For word w j Rank from highest to lowest, select the first N words as replacement words, denoted as w s1 , w s2 , ..., w sN .

[0049] Replace word w with the snth word in text t sn Replace it with any member c of the candidate word set C to get text t sn =[w0,…,w sn-1 ,c,w sn+1 , …], all text t sn , n = 1, 2, ..., N constitutes a text searchable space ∈ t .

[0050] Step S2: Generate adversarial text t′ and adversarial image i′

[0051] The adversarial text t′ aims to diverge from the original image i in terms of their embedding representations. Therefore, the adversarial text t′ generation process can be expressed as:

[0052]

[0053] Among them, f T (t sn ) indicates that the text t sn As input, the text encoder E T The generated text representation, || || represents the modulus, · is the dot product, that is, in the text searchable space ∈ t Search for all text sn , n = 1, 2, ..., N, satisfying:

[0054]

[0055] Maximum text t sn is the adversarial text t′, and the corresponding replacement word is denoted by w s , s is the sequence number of the replacement word in the adversarial text t′.

[0056] When generating adversarial images, the present invention blurs the most vulnerable important words in the text. This method effectively reduces the semantic alignment shift that occurs when replacing words in text-based attacks. Therefore, the adversarial image i′ generation process can be expressed as:

[0057]

[0058] Among them, t\w s =[w0,…,w s-1 , [MASK], w s+1 , …], which means replacing the sth word w with mask [MASK] s The text after ∈ i represents the maximum perturbation allowed for image i, f T (t\w s ) means text t\w s As input, the text encoder E T The resulting text representation is:

[0059] That is, in the image searchable space [i-∈ i , i+∈ i ]Search all images * ,satisfy:

[0060]

[0061] The largest image i * is the adversarial image i′.

[0062] The adversarial image i′ generated in this way is similar to the one with masked element t\w in the embedding space. s The original text of is obviously different, destroying the unbiased semantic alignment relationship in a simple way, thus producing adversarial example pairs with high transferability.

[0063] Step S3: Counterattack

[0064] Conduct adversarial attacks on the vision-language pre-trained model using adversarial images i′ and adversarial text t′.

[0065] 3. Semantic Debiasing Attack Based on Multi-Guided Modal Interaction (SDA-MGMI)

[0066] In order to more accurately destroy the semantically aligned relationship rather than the non-semantic redundant relationship, when attacking the matched representation, in this embodiment, the present invention improves the loss function and the optimization process, and introduces the negative sample function and the multi-dimensional momentum strategy into the present invention, which is called semantic debiasing attack with multi-guided modal interaction (SDA-MGMI).

[0067] Considering the importance of negative samples in measuring semantic similarity, a negative sample function is introduced in this embodiment. When training the VLP model, non-matching negative samples of images and texts are used to enhance semantic differences, which significantly improves the accuracy of image-text matching. On the contrary, when attacking the VLP model, the use of negative samples can enrich the semantic information during modal interaction, thereby guiding adversarial attacks more towards semantically relevant directions.

[0068] In SDA-MGMI, every sample in the same batch that does not match a specific sample is considered to constitute a negative pair. Since the number of negative pairs is significantly larger than that of positive pairs, we balance their influence by averaging the contribution of each group of negative pairs, so that the impact of positive and negative samples on the loss calculation is balanced. The adversarial text t′ generation process can be rewritten as:

[0069]

[0070] The adversarial image i′ generation process can be rewritten as:

[0071]

[0072] In the SDA method, in order to maintain the unbiased nature of the target semantic alignment relationship, we only use the original data to construct the modal interaction. Therefore, the attack process involves only one instance of modal interaction, which greatly limits the depth and effectiveness of modal interaction in facilitating the attack. Directly adopting an iterative strategy to enhance modal interaction will lead to the forgetting of the semantic alignment relationship. This is because the multimodal image-text pairs will change in each iteration, resulting in changes in the representation. These changes can prevent the accurate reflection of the semantic alignment relationship.

[0073] To address this issue, a multi-dimensional momentum method is introduced in SDA-MGMI, combining representation and gradient to enhance modal interaction. First, we apply representation momentum to ensure that each iteration takes into account the knowledge of previous iterations. This approach ensures that the semantic alignment relationship is accurately and comprehensively broken during modal interaction. In addition, considering the limited contribution of image-side attacks to transferability, we integrate a visual-language pre-trained model based on the gradient momentum attack strategy of the momentum attack method into our method. This enhancement helps optimize image-side attacks and prevent potential bias in the attack direction. The representation momentum can be expressed as:

[0074]

[0075]

[0076] Among them, the number of iterations m∈[1, 2, 3, …], λ i and λ tis the scale parameter, i′ m is the adversarial image of the mth iteration, t′ m \w s Replace the sth word w with mask [MASK] for the adversarial text of the mth iteration s The text after i(1) =f I (i), i′1=i′, t′1=t′. This can be achieved by rewriting the process of generating the adversarial text t′ and the process of generating the adversarial image i′. I (i) / f T (t\w s ) is replaced by r i(m+1) / r t(m+1) To optimize the attack method. That is, the adversarial text t′ of the m+1th iteration m+1 It is expressed as:

[0077]

[0078] Adversarial image i′ at the m+1th iteration m+1 It is expressed as:

[0079]

[0080] When the number of iterations reaches the set number, the adversarial image i′ is obtained m+1 , adversarial text t′ m+1 The adversarial image i′ and adversarial text t′ in step S3 are used to conduct adversarial attacks on the vision-language pre-trained model.

[0081] In this example, with these two improvements, our attack method SDA-MGMI can more accurately destroy the semantic alignment relationship. This leads to a significant improvement in the transferability of adversarial attacks against vision-language pre-trained models.

[0082] Experimental verification

[0083] In order to verify the effectiveness of the SDA and SDA-MGMI methods proposed in this paper, we first compared and analyzed the effects of the SDA and SDA-MGMI methods with three existing multimodal pre-trained model adversarial attack methods. Then, we conducted additional evaluations to more comprehensively evaluate our method. Consistent with the set-level guided attack method, our experiments are based on two multimodal datasets, Flickr30K and MSCOCO. Flickr30K contains 31,783 images, each with five associated captions, while MSCOCO contains 123,287 images, each with approximately five captions. We use Karpathy's dataset partitioning method for experimental evaluation. Our experiments are mainly based on multimodal matching tasks, which are consistent with the set-level guided attack. The experimental results on the gray background represent the results of the proposed method.

[0084] The experimental results of the present invention on Flickr30K are shown in Table 1.

[0085]

[0086] Table 1

[0087] As can be seen from Table 1, in most attack scenarios, SDA-MGMI in the present invention outperforms existing methods. It achieves the highest degree of adversarial attack transferability to multimodal pre-trained models on all selected attack models. Since this patent uses techniques to enhance modal interactions and avoid overfitting in the direction of optimization, these operations may affect the white-box performance of the method. However, they significantly enhance the transferability of the attack. For example, when ALBEF is used as the source network on Flickr30K, the white-box performance of SDA-MGMI in the present invention is only slightly lower than that of SGA. At the same time, compared with the collection-level guided attack method, SDA-MGMI improves the transferability of $14.85% / 11.11%$, $6.74% / 6.65%$ and $9.90% / 7.43%$ in text retrieval / image retrieval tasks in TCL, CLIP ViT and CLIP CNN The experimental results demonstrate the effectiveness of the multiple improvements introduced by the SDA-MGMI method proposed in this paper.

[0088] Meanwhile, in Table 1, the results of SDA show that it can achieve better performance than the ensemble-level guided attack method in some settings. However, since SDA does not use data augmentation, the comparison in Table 1 is not completely fair. In order to make a more fair comparison between SDA and SGA, we introduce three sub-methods: SGA \IA , represents the set-level guided attack method without image data augmentation; SGA OR, represents the set-level guided attack method with original semantic alignment relations; and SDA IA , represents the SDA with image data augmentation added in the set-level guided attack method. This will help us to further study the impact of semantic alignment relationship destruction based on modal interaction on attack transferability. The experimental results using the ALBEF model as the source model are shown in Table 2.

[0089]

[0090] Table 2

[0091] As can be seen from Table 2, SDA including data enhancement IA In CLIP ViT and CLIP CNN However, on TCL, SDA IA The performance of is not as good as the other two, which can be attributed to the high similarity between the ALBEF model and the TCL model. Specifically, the transferability between ALBEF and TCL is highly dependent on the degree of modal interaction. Since our SDA interaction is relatively simple, it performs poorly in this case. SGA \IA , which does not include data augmentation, has similar comparison results with SDA. It is worth noting that we enhance the set-level guided attack method by destroying the original semantic alignment relationship, thus obtaining SGA OR Its improved performance on SGA further verifies the effectiveness of debiasing semantic alignment relationships based on modal interaction destruction.

[0092] In our evaluation of the method on MSCOCO, we follow the setting in previous work. The results obtained with ALBEF as the target model are shown in Table 3.

[0093]

[0094] Table 3

[0095] In Table 3, we test the results of three different black-box models. Given that MSCOCO contains more samples than Flickr30K, the experimental results are more stable and better reflect the real situation.

[0096] Compared with SGA, SDA-MGMI has a ViT and CLIP CNN When used as a source model, it improves the transferability of text retrieval / image retrieval tasks by about $8.96% / 6.49%$, $9.41% / 8.44%$, and $10.55% / 10.95%$. The results from MSCOCO confirm that SDA-MGMI is equally effective on datasets containing more data.

[0097] Although the above describes the illustrative specific embodiments of the present invention to facilitate those skilled in the art to understand the present invention, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A semantic debiasing attack method for a vision-language pre-trained model, characterized in that: The following steps are involved: (1) Constructing a text searchable space For a given image-text pair (i, t) from a multimodal dataset D, f I (i) means that the image encoder E takes image i as input. I The generated image representation, f T (t) means that the text encoder E takes the text t as input. T Generate the resulting text representation; Represent the text as t = [w0, ..., w j , …], calculate the importance score of each word Among them, t\w j =[w0,…,w j-1 , [MASK], w j+1 , …], which means replacing the jth word w with mask [MASK] j After the text, f T (t\w j ) means text t\w j As input, text encoder E T The generated text representation, d(t\w j ) means to do text t\w j Derivation; According to the text t\w j Importance score For word w j Rank from highest to lowest, select the first N words as replacement words, denoted as w s1 , w s2 , ..., w sN ; Replace word w with the snth word in text t sn Replace it with any member c of the candidate word set C to get text t sn =[w0,…,w sn-1 ,c,w sn+1 , …], all text t sn , n = 1, 2, ..., N constitutes a text searchable space ∈ t ; (2) Generate adversarial text t′ and adversarial image i′ The adversarial text t′ generation process is: Among them, f T (t sn ) indicates that the text t sn As input, text encoder E T The generated text representation, || || represents the modulus, · is the dot product, that is, in the text searchable space ∈ t Search for all text sn , n = 1, 2, ..., N, satisfying: Maximum text t sn is the adversarial text t′, and the corresponding replacement word is denoted by w s , s is the sequence number of the replacement word in the adversarial text t′; The generation process of adversarial image i′ is: Among them, t\w s =[w0,…,w s-1 , [MASK], w s+1 , …], which means replacing the sth word w with mask [MASK] s The text after ∈ i represents the maximum perturbation allowed for image i, f T (t\w s ) means text t\w s As input, the text encoder E T The resulting text representation is: That is, in the image searchable space [i-∈ i , i+∈ i ]Search all images * ,satisfy: The largest image i * is the adversarial image i′; (3) Use adversarial image i′ and adversarial text t′ to conduct adversarial attacks on the vision-language pre-trained model.

2. The semantic debiasing attack method for a vision-language pre-training model according to claim 1, characterized in that: Iterate the adversarial image i′ and adversarial text t′ obtained in step (2) to obtain the adversarial text t′ of the m+1th iteration m+1 It is expressed as: Adversarial image i′ at the m+1th iteration m+1 It is expressed as: Where, represents the momentum r i(m+1) 、r t(m+1) for: Among them, the number of iterations m∈[1, 2, 3, …], λ i and λ t is the scale parameter, i′ m is the adversarial image of the mth iteration, t′ m \w s Replace the sth word w with mask [MASK] for the adversarial text of the mth iteration s The text after i(1) =f I (i), i′1=i′, t′1=t′; When the number of iterations reaches the set number, the adversarial image i′ is obtained m+1 , adversarial text t′ m+1 As the adversarial image i′ and adversarial text t′ in step (3).