Method and system for mitigating relationship hallucination of multimodal large model based on relationship-aware visual augmentation
By constructing action relationship comparison samples and using attention masking, the illusion problem in action relationship understanding of multimodal large models was solved, achieving accurate understanding of action relationships and alleviating the illusion, thus improving the model's ability to understand action relationships.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TONGJI UNIV
- Filing Date
- 2026-05-11
- Publication Date
- 2026-06-09
AI Technical Summary
Existing multimodal large models are prone to hallucinations when understanding action relationships. Existing methods have difficulty accurately capturing key visual regions and the interaction relationships between objects, resulting in frequent hallucination phenomena in action relationship understanding tasks.
By constructing action relationship comparison samples, calculating action relationship sensitivity, filtering sensitive and non-sensitive attention heads, locating key visual regions and noisy regions, constructing enhancement and denoising masks, and adjusting attention distribution to enhance key regions and suppress noise interference.
It achieves precise mitigation of action relationship illusions, improves the model's understanding of action relationships, reduces illusion phenomena, and requires no additional training or modification of model parameters. It is computationally efficient and easy to transfer.
Smart Images

Figure CN122176807A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence multimodal model optimization technology, specifically relating to a relationship perception visual enhancement method and system for alleviating the illusion of action relationships in large multimodal models. Background Technology
[0002] With the rapid development of artificial intelligence technology, multimodal large models have made significant progress in tasks such as visual question answering, image description, and multimodal reasoning. These models typically achieve the understanding and generation of complex scenes by fusing visual and textual information, and have broad application prospects in fields such as intelligent interaction, autonomous driving, and security monitoring. However, in practical applications, multimodal large models still suffer from the problem of inconsistency between the output results and the actual visual content, i.e., the "illusion" phenomenon.
[0003] Existing methods for mitigating hallucination problems can be mainly divided into two categories: (1) Model training optimization-based methods: By fine-tuning the model or optimizing the data level, such as introducing preference alignment training or correcting the training data, the consistency between the model output and the visual content can be improved. However, these methods usually rely on a large amount of labeled data, resulting in high training costs and difficulty in rapid deployment in practical applications. (2) Inference stage control-based methods: Without changing the model parameters, the probability of hallucination can be reduced by adjusting the output probability distribution or intervening in the attention mechanism inside the model. These methods have advantages such as no training required and relatively simple implementation. However, existing work is mostly designed for object hallucination problems, focusing mainly on the judgment of whether the object exists, while paying insufficient attention to the modeling of complex interaction relationships between objects.
[0004] However, in real-world applications, multimodal large models not only need to identify target objects but also understand the action relationships between them, such as "riding" or "pushing." These action relationships involve interactions between multiple objects, and their representation relies on the accurate perception of key visual regions, placing higher demands on the model. Existing methods, lacking effective modeling of action-related visual information, struggle to accurately capture key action regions, thus remaining prone to illusions in action relationship understanding tasks.
[0005] To address the aforementioned issues, there is an urgent need to propose a method that can guide the model to focus on key visual regions related to actions and improve the model's ability to understand the interaction relationships between objects, so as to effectively alleviate the illusion of action relationships. Summary of the Invention
[0006] The purpose of this invention is to provide a multimodal large-model relationship illusion mitigation method and system based on relationship-aware visual enhancement, so as to solve the problems of insufficient modeling of action relationship illusion, inaccurate localization of key visual regions, and crude attention control methods in the prior art.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: A method for mitigating relational illusions in a multimodal large model based on relation-aware visual enhancement includes the following steps: constructing action relation contrast samples; obtaining original input pairs containing images and original text; semantically modifying the original text to change action semantics and generate contrast text; constructing contrast input pairs based on the images and contrast text; extracting attention distributions; inputting the original input pairs and contrast input pairs into the multimodal large model respectively; extracting the attention weight distribution of each attention head to visual words under original input conditions and contrast input conditions, as well as the attention score distribution before softmax normalization; calculating action relation sensitivity; calculating the action relation sensitivity of each attention head on a single sample based on the difference between the attention score distribution under the original input conditions and the attention weight distribution under the contrast input conditions. The process involves averaging the action relationship sensitivity of each attention head on an action relationship comparison dataset to obtain a final action relationship sensitivity score; filtering sensitive attention heads by selecting sensitive and non-sensitive attention heads based on their action relationship sensitivity scores; locating key visual regions and noise regions by locating key visual regions based on the attention scores of the sensitive attention heads and noise regions based on the attention scores of the non-sensitive attention heads; constructing attention modulation masks by building enhancement masks based on the key visual regions and denoising masks based on the noise regions, and generating a target mask based on the enhancement and denoising masks; and regulating the attention distribution by using the target mask to weight the attention scores during the inference process of the multimodal large model to enhance the attention weight of the key visual regions and suppress interference from the noise regions.
[0008] Preferably, the calculation of the action relationship sensitivity of each attention head uses the Frobenius norm to calculate the normalized difference between the attention weight distribution under the original input condition and the attention weight distribution under the contrast input condition.
[0009] Preferably, the process of filtering sensitive and insensitive attention heads involves sorting each attention head according to the action relationship sensitivity score, selecting the K attention heads with the highest action relationship sensitivity scores as sensitive attention heads, and selecting the K attention heads with the lowest action relationship sensitivity scores as insensitive attention heads.
[0010] Preferably, the key visual region is located by averaging the attention scores of the sensitive attention head before softmax normalization to obtain the average attention score of the sensitive attention head; the noise region is located by averaging the attention scores of the non-sensitive attention head before softmax normalization to obtain the average attention score of the non-sensitive attention head.
[0011] Preferably, the enhancement mask is constructed by selecting the visual words corresponding to the top m maximum values in the average attention score of the sensitive attention head, marking their positions as 1, and marking the remaining positions as 0, where m is equal to the product of the scaling factor α and the number of visual words, rounded down; the denoising mask is constructed by selecting the visual words corresponding to the top m maximum values in the average attention score of the non-sensitive attention head, marking their positions as 1, and marking the remaining positions as 0.
[0012] Preferably, the target mask is generated by performing element-wise multiplication on the element-wise complements of the enhancement mask and the denoising mask.
[0013] Preferably, the attention score is weighted before softmax normalization. The weighted attention score is equal to the original attention score plus the enhancement term weighted by the enhancement coefficient, where the enhancement term is the element-wise product of the absolute value of the original attention score and the target mask.
[0014] This invention also provides a multimodal large-scale model relationship illusion mitigation system based on relationship-aware visual enhancement, comprising: a contrast sample construction module for constructing action relationship contrast samples; an attention extraction module connected to the contrast sample construction module via a data connection for inputting the original input pairs and contrast input pairs into the multimodal large-scale model and extracting the attention weight distribution and attention score distribution of each attention head; a sensitivity calculation module connected to the attention extraction module via a data connection for calculating the action relationship sensitivity of each attention head; an attention head filtering module connected to the sensitivity calculation module via a data connection for filtering sensitive and non-sensitive attention heads; a region localization module connected to the attention head filtering module via a data connection for locating key visual regions and noisy regions; a mask construction module connected to the region localization module via a data connection for constructing an enhancement mask, a denoising mask, and a target mask; and an attention regulation module connected to the mask construction module via a data connection for weighting the attention scores using the target mask.
[0015] The beneficial effects of this invention are: (1) By constructing action relationship comparison samples and defining action relationship sensitivity index, it is possible to accurately identify attention heads that are sensitive to changes in action relationships. Compared with methods based on uncertainty or general attention patterns, the identification accuracy is higher, the regulation is more targeted, and non-critical attention heads are avoided from being misinterpreted. (2) Based on the location of key visual regions and noise regions by sensitive attention heads and non-sensitive attention heads respectively, a two-way control basis is provided. Compared with the method of only enhancing visual attention, the control is more precise by suppressing interference information through noise reduction masking. (3) The target mask is generated by fusing element-wise multiplication of the enhancement mask and the denoising mask, which can accurately enhance the action-related region and effectively suppress the noise region. Only one forward propagation is required, which improves the computational efficiency compared with the comparative decoding method. (4) Attention scores are weighted by target mask during the inference stage. No additional training or modification of model parameters is required. While maintaining the model’s language expression ability, it effectively alleviates the illusion of action relationship. The control method is simple and easy to transfer between different multimodal large models. It has strong versatility. Attached Figure Description
[0016] Figure 1 A framework diagram for mitigating relational illusions in multimodal large models based on relation-aware visual enhancement.
[0017] Figure 2 This is a flowchart of a multimodal large-scale model relationship illusion mitigation method based on relationship-aware visual enhancement.
[0018] Figure 3 A diagram illustrating object illusion and action relationship illusion.
[0019] Figure 4 This diagram illustrates the effectiveness of the present invention in discriminative tasks.
[0020] Figure 5 This is a diagram demonstrating the effect of the present invention on open-ended generation tasks. Detailed Implementation
[0021] The following will describe in detail the implementation of the present invention with reference to the accompanying drawings and embodiments, so as to fully understand how the present invention uses technical means to solve technical problems and achieve technical effects and to implement it accordingly.
[0022] like Figure 1As shown, the multimodal large model relationship illusion mitigation framework based on relationship-aware visual enhancement proposed in this invention consists of two core components: one is an action relationship-sensitive attention head recognition module, which is used to calculate action relationship sensitivity scores to identify attention heads that are crucial to action relationship reasoning; the other is a relationship-aware visual enhancement module, which uses the attention heads to enhance image regions related to actions during the reasoning process.
[0023] Example 1 like Figure 1 and Figure 2 As shown, this embodiment provides a method for mitigating relational illusion based on the LLaVA-1.5-7B multimodal large model. This method constructs action relation comparison samples and identifies sensitive attention heads, and regulates the distribution of attention in relational perception during the inference stage to alleviate action relational illusion.
[0024] I. System Configuration The hardware configuration used in this embodiment is as follows: operating system Ubuntu 22.04, processor Intel(R) Xeon(R) Platinum 8352V CPU @ 2.10GHz, memory 96GB, and GPU is NVIDIA A6000 48GB×1.
[0025] The software configuration used in this embodiment is: a multimodal large model LLaVA-1.5-7B, where the visual encoder is CLIP-ViT-L / 14, the large language model is Vicuna-7B, and the action word replacement tool is Qwen-7B. The large language model part of LLaVA-1.5-7B has 32 layers, each containing 32 attention heads, and the number of visual lexical units is... The value is 576.
[0026] II. Constructing and extracting attention distribution from action relationship comparison samples (Step S1) Step S1.1: Obtain the original dataset The dataset contains multiple pairs of original inputs, each consisting of an image I and its corresponding original text T.
[0027] Specifically, image-text pairs containing action relationships are selected from the MMRel dataset as the original input pairs.
[0028] Step S1.2: Replace the action words in the original text T to generate comparative texts with different action semantics. .
[0029] Specifically, the Qwen-7B model is invoked, with the original text T and the replacement instruction "Please replace the action words in the sentence with action words with different semantics" as input, to generate comparison text. For example, replacing the action word "ride" with "push" in "The woman in the picture is riding a bicycle" generates the contrasting text "The woman in the picture is pushing a bicycle".
[0030] Step S1.3: Based on image I, original text T, and comparison text Construct action relationship comparison samples Further, an action relationship comparison dataset containing 150 samples was constructed. .
[0031] Step S1.4: Compare the action relationships with the samples. Input into the LLaVA-1.5-7B multimodal large model.
[0032] Specifically, image I is encoded into a visual feature sequence using the visual encoder CLIP-ViT-L / 14. Where d is the feature embedding dimension, =576 represents the number of visual lexical units; the text is encoded into a text feature sequence by a word segmenter. ,in The number of text lexical units; the visual feature sequence With text feature sequences The sequences are concatenated to form a unified input sequence, which is then fed into the large language model Vicuna-7B to generate subsequent lexical units in an autoregressive manner.
[0033] Step S1.5: Extract the attention weight distribution of each attention head for each visual word in each layer of the Vicuna-7B part of LLaVA-1.5-7B.
[0034] Specifically, in the Vicuna-7B's... At the h-th attention head (h=1,2,...,32) in layer (l=1,2,...,32), the attention weight of the last generated word to all input words is extracted through a hook mechanism. ,in Extract The visual attention weight distribution is obtained by analyzing the parts corresponding to visual lexical units. Simultaneously, the attention score before softmax normalization is recorded. .
[0035] Step S1.6: Process the original input pairs respectively. and comparison input pairs The above processing yields the attention weight distribution under the original input conditions. and attention score And the distribution of attention weights under contrasting input conditions. and attention score distribution .
[0036] III. Calculate the Action Relationship Sensitivity (ARS) score (Step S2) Step S2.1: For the action relationship comparison dataset Each sample in Calculate the action-relationship sensitivity of the h-th attention head in the l-th layer. .
[0037] Specifically, the attention weight distribution under the original input conditions is calculated using the Frobenius norm. Attention weight distribution under contrasting input conditions The normalized difference between them is calculated using the following formula: in, The Frobenius norm, representing the overall difference between two attention distributions, is calculated as the square root of the sum of the squares of the elements of the matrix. Indicates the first Layer Sensitivity to the action of the head; Indicates the first under the original input condition Layer The attention weight distribution of each attention head corresponding to a visual word unit. Indicates the comparison of the first input condition Layer The attention weight distribution of each attention head corresponds to a visual word; the comparison input is obtained by replacing action words in the original input text, so that the comparison input and the original input differ in action semantics; Step S2.2: In the action relationship comparison dataset The ARS scores of the h-th attention head in the l-th layer are averaged across all 150 samples to obtain the final ARS score, which serves as the basis for subsequent attention head ranking and selection.
[0038] IV. Filtering Sensitive Attention Targets Based on ARS Scores (Step S3) Step S3.1: For the first Each of the 32 attention heads in the layer is sorted according to the ARS score calculated in step S2.
[0039] Step S3.2: Based on the sensitive attention head set The softmax pre-visual attention score for the corresponding attention head. The average attention score of the sensitive attention head is obtained by averaging: The highest ARS score (i.e., Top-K) Each attention head is defined as a sensitive attention head, and its corresponding set is denoted as . The lowest ARS score (i.e., Bottom-K) Each attention head is defined as a non-sensitive attention head, and its corresponding set is denoted as . ;in, This indicates the number of attention points selected.
[0040] Step S3.3: Similarly, based on the non-sensitive attention head set The softmax pre-visual attention score for the corresponding attention head. The average score of the non-sensitive attention head is obtained by averaging: in, Used to indicate the first Key visual areas in the layer that are related to action. Used to indicate the first Noise areas in the layer that are unrelated to the action relationship or are prone to interference.
[0041] V. Attention Mask Construction (Step S4) Step S4.1: Based on the average attention score of the sensitive attention head obtained in step S3. Average attention score of non-sensitive attention heads The key visual areas and noise areas are located respectively.
[0042] Step S4.2: Based on the key visual regions and noise regions located in Step S4.1, construct an enhancement mask. and denoising mask Set the scaling factor α = 0.05, and calculate m = = 0.05×576 =28, meaning the first 28 visual morphemes are selected.
[0043] Step S4.3: Average attention score on the sensitive attention head The visual word positions corresponding to the first m=28 maximum values are selected. Step S4.4: Similarly, the average attention score in the non-sensitive attention head. The visual word positions corresponding to the first m=28 maximum values are selected. Step S4.5: By enhancing the mask and denoising mask Perform element-wise operations to generate the target mask. .
[0044] Where ⊙ represents element-wise multiplication. The target mask The positions of visual morphemes that are both in key visual regions and not in noise regions are preserved for subsequent attention modulation.
[0045] in, and They represent in and The Middle The values of large elements; The definition is as follows: in, Represents the proportionality coefficient. Indicates the number of visual lexical units. Indicates according to proportion The number of selected visual lexical units; Enhancing the mask through the above methods. With denoising mask Used for selection and China ranked top Visual lexical units.
[0046] VI. Attention regulation based on target mask (step S5) Step S5.1: During the inference process of the LLaVA-1.5-7B multimodal large model, the target mask described in step S4 is introduced. Attention calculation is modulated to enhance the attention weights of the target visual region and suppress interference from noisy regions. Specifically, the attention score is weighted before softmax normalization in the attention calculation: in, Indicates the first Layer Attention score after attention enhancement Indicates the first Layer The original attention score of each attention head. This represents element-wise multiplication. Indicates the first The target mask of the layer. To enhance the coefficient, Represents the original attention score Take the absolute value of each element.
[0047] Step S5.2: By using the attention modulation method described above, the model’s attention to key visual regions related to actions is enhanced, while the interference of noisy regions is suppressed, thereby alleviating the illusion generation in the understanding of action relationships in multimodal large models.
[0048] VII. Performance Verification like Figure 3 As shown, this embodiment illustrates typical object illusion and action relationship illusion phenomena in multimodal large models. In the object illusion example, the model incorrectly identifies objects that are not present in the image, such as mistaking a bicycle for a motorcycle. In the action relationship illusion example, while the model can identify objects in the image, its understanding of the action relationships between objects is flawed, such as mistaking "pushing a cart" for "riding a bicycle." Existing methods for mitigating object illusion primarily optimize the object recognition level and are insufficient to effectively address the action relationship illusion problem. By employing the method of this invention, which modulates the model's attention distribution to enhance relationship perception, action relationship illusion can be effectively mitigated, resulting in generated images that better reflect the real-world image content.
[0049] like Figure 4 and Figure 5 The diagram illustrates the effectiveness of embodiments of this invention in discriminative and open-ended generative tasks. In discriminative tasks, given an image and a question, traditional large multimodal models are easily influenced by language priors or data biases, resulting in judgments inconsistent with the image content. In open-ended generative tasks, models tend to introduce behavioral or relational descriptions that do not reflect the actual content when describing images. By employing the method of this invention, a relation-aware attention control mechanism enhances key visual regions and suppresses interference from irrelevant regions, enabling the model to more accurately focus on semantically relevant visual information in different task scenarios, effectively reducing the illusion of action relationships in large multimodal models.
[0050] Example 2 This embodiment, based on Embodiment 1, further discloses the application of the method of the present invention on the InstructBLIP-7B multimodal large model.
[0051] InstructBLIP-7B employs the Q-Former architecture, which compresses visual features into 32 image terms through a query mechanism. =32), a significant reduction compared to the 576 visual lexical units in LLaVA-1.5. Due to the substantial reduction in the number of visual lexical units, the scaling factor α in step S6 needs to be adjusted accordingly.
[0052] In this embodiment, the scaling factor α = 0.5 is set, and m = 0.5×32 =16, meaning the first 16 visual terms are selected to construct the enhancement mask and denoising mask. The technical reason for this parameter setting is that after Q-Former compresses visual features into 32 terms, each term carries a larger amount of information, requiring a larger retention ratio to preserve sufficient action-related information. If α is too small (e.g., 0.05), only... 0.05×32 = One word unit is insufficient to fully cover the key areas of the action, resulting in poor control effect.
[0053] Based on the experimental results, the preferred ranges of the key parameters in the method of this invention are as follows: (1) The preferred range for the number of attention points K is 3-10, with the optimal value being 5; (2) The optimal range of the scaling factor α needs to be adjusted according to the model architecture: - For LLaVA series models (number of visual lexical units) =576): The preferred range of α is 0.01-0.1, and the optimal value is 0.05; - For the InstructBLIP series models (number of visual lexical units) =32): The preferred range of α is 0.4-0.6, and the optimal value is 0.5; - Technical reasons for parameter differences: There are significant differences in the number of visual terms in different model architectures. The LLaVA series models encode images into 576 visual terms, and the information distribution is relatively dispersed. Therefore, a small scaling factor α (such as 0.05) is needed to select enough key terms (about 28). The InstructBLIP series models use the Q-Former architecture to compress visual features into 32 terms. Each term carries more information, so a larger scaling factor α (such as 0.5) is needed to select enough terms (about 16) to retain action-related information. (3) The preferred range of the enhancement coefficient β is 0.5-1.5, and the optimal value is 1.0; (4) The preferred range for the number of layers L from which the attention distribution is extracted is the first 12-24 layers, which can be adjusted according to the number of layers in the specific model. Experiments show that the middle layers are most sensitive to changes in action relationships, so it is preferable to extract the attention distribution of the middle layers for regulation.
[0054] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the inventive concept of this application, and these all fall within the protection scope of this application.
Claims
1. A method for alleviating relational illusions in a multimodal large model based on relation-aware visual enhancement, characterized in that, Includes the following steps: S1: Constructing action relationship comparison samples, including: obtaining an original input pair containing an image and original text; semantically modifying the original text to change the action semantics, generating comparison text; constructing comparison input pairs based on the image and the comparison text; S2: Extracting attention distribution, including: inputting the original input pair and the contrast input pair into the multimodal large model respectively; extracting the attention weight distribution of each attention head to visual words under the original input condition and the contrast input condition, as well as the attention score distribution before softmax normalization in the multimodal large model; S3: Calculate the action relationship sensitivity, including: calculating the action relationship sensitivity of each attention head on a single sample based on the difference between the attention weight distribution under the original input conditions and the attention weight distribution under the comparison input conditions; averaging the action relationship sensitivity of each attention head on the action relationship comparison dataset to obtain the final action relationship sensitivity score. S4: Filtering sensitive attention heads, including: filtering sensitive attention heads and non-sensitive attention heads based on the sensitivity score of the action relationship; S5: Locating key visual regions and noise regions, including: locating key visual regions based on the attention score of the sensitive attention head; locating noise regions based on the attention score of the non-sensitive attention head; S6: Construct an attention modulation mask, including: constructing an enhancement mask based on the key visual region; constructing a denoising mask based on the noisy region; generating a target mask based on the enhancement mask and the denoising mask; S7: Adjusting attention distribution, including: during the inference process of the multimodal large model, using the target mask to weight the attention score to enhance the attention weight of the key visual region and suppress the interference of the noise region.
2. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The calculation of the action relationship sensitivity of each attention head includes: using the Frobenius norm to calculate the normalized difference between the attention weight distribution under the original input condition and the attention weight distribution under the contrast input condition. The calculation formula is: the action relationship sensitivity is equal to the Frobenius norm of the difference between the attention weight distribution under the original input condition and the attention weight distribution under the contrast input condition, divided by half of the sum of the Frobenius norms of the two attention weight distributions.
3. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The process of filtering sensitive and non-sensitive attention heads includes: sorting each attention head according to the action relationship sensitivity score, selecting the K attention heads with the highest action relationship sensitivity scores as sensitive attention heads, and selecting the K attention heads with the lowest action relationship sensitivity scores as non-sensitive attention heads, where K is a preset number of attention heads.
4. The method for alleviating multimodal large-model relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The process of locating the key visual region includes: averaging the attention scores of the sensitive attention head before softmax normalization to obtain an average attention score of the sensitive attention head, which is used to represent the key visual region; the process of locating the noise region includes: averaging the attention scores of the non-sensitive attention head before softmax normalization to obtain an average attention score of the non-sensitive attention head, which is used to represent the noise region.
5. The method for alleviating multimodal large-model relation illusion based on relation-aware visual enhancement according to claim 4, characterized in that, The construction of the enhancement mask includes: selecting the visual words corresponding to the top m maximum values in the average attention scores of the sensitive attention heads, marking their positions as 1, and marking the remaining positions as 0, to generate the enhancement mask; the construction of the denoising mask includes: selecting the visual words corresponding to the top m maximum values in the average attention scores of the non-sensitive attention heads, marking their positions as 1, and marking the remaining positions as 0, to generate the denoising mask; wherein, m is equal to the product of the scaling factor α and the number of visual words, rounded down, and α is the scaling factor.
6. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 5, characterized in that, The generation of the target mask includes: performing element-wise multiplication on the enhancement mask and the denoising mask, specifically: performing element-wise multiplication on the element-wise complement of the enhancement mask and the denoising mask to generate the target mask, wherein the element-wise complement of the denoising mask is obtained by changing 1 to 0 and 0 to 1 in the denoising mask.
7. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The weighting process for the attention score includes: before softmax normalization, weighting the attention score, the weighted attention score being equal to the original attention score plus an enhancement term weighted by the enhancement coefficient, wherein the enhancement term is the element-wise product of the absolute value of the original attention score and the target mask, and the enhancement coefficient is a positive number used to control the weighting strength.
8. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The semantic modification of the original text includes: identifying and replacing action words in the original text using natural language processing tools to generate comparative texts with different action semantics.
9. The method for alleviating multimodal large-scale relation illusion based on relation-aware visual enhancement according to claim 1, characterized in that, The extraction of attention weight distribution and attention score distribution of each attention head includes: extracting the attention weight distribution and attention score distribution of each attention head in at least one attention layer of the large language model part of the multimodal large model.
10. A multimodal large-model relation illusion mitigation system based on relation-aware visual enhancement, characterized in that, include: A comparison sample construction module is used to construct action relationship comparison samples. The comparison samples include original input pairs and comparison input pairs. The comparison input pairs are generated by semantically modifying the original text to change the action semantics. The attention extraction module is connected to the comparison sample construction module via data connection. It is used to input the original input pair and the comparison input pair into the multimodal large model respectively, and extract the attention weight distribution of each attention head to visual words under the original input condition and the comparison input condition, as well as the attention score distribution before softmax normalization. The sensitivity calculation module is connected to the attention extraction module via a data connection. It is used to calculate the action relationship sensitivity of each attention head based on the difference in the attention weight distribution, and to average the results on the action relationship comparison dataset to obtain the final action relationship sensitivity score. The attention head filtering module is connected to the sensitivity calculation module via a data connection, and is used to filter sensitive attention heads and non-sensitive attention heads based on the action relationship sensitivity score. The region localization module is connected to the attention head filtering module via a data connection, and is used to locate key visual regions based on the attention score of the sensitive attention head, and to locate noise regions based on the attention score of the non-sensitive attention head. The mask construction module is connected to the region positioning module via a data connection. It is used to construct an enhanced mask based on the key visual region, construct a denoised mask based on the noisy region, and generate a target mask based on the enhanced mask and the denoised mask. The attention control module is connected to the mask construction module via a data connection. During the inference process of the multimodal large model, the attention score is weighted using the target mask to enhance the attention weight of the key visual region and suppress the interference of the noise region. The attention control module is also used to control the attention distribution of multiple decoding layers during the inference process.