A method and system for locating image forgery based on multi-source heterogeneous information
By integrating semantic reasoning from a large language model with traditional signal analysis, a semantic saliency guidance map is generated and bidirectional cross-attention processing is performed. This solves the problem that existing methods cannot simultaneously perceive low-level physical anomalies and high-level semantic consistency, and achieves high-precision localization of forged images and cross-dataset generalization.
Patent Information
- Application Number
- CN202611292329.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-25
- Publication Date
- 2026-11-17
AI Technical Summary
Existing image forgery localization methods cannot simultaneously perceive low-level physical anomalies and understand high-level semantic consistency, resulting in the inability to effectively identify forged images that are perfectly processed at the pixel level, and their generalization ability across datasets is insufficient.
By deeply integrating the semantic reasoning capabilities of large-scale language models with the physical detection capabilities of traditional signal analysis, GPT-4o is used for semantic anomaly reasoning, and position-aware modulation is performed using the CLIP visual language model to generate a semantic saliency guide map. The precise conversion from semantic judgment to pixel localization is achieved through parallel branching and bidirectional cross-attention modules.
It achieves high-precision detection of complex content-aware forgeries, improves the generalization ability across datasets, can identify forged images that existing methods cannot identify, and maintains excellent performance under JPEG compression and social media transmission conditions.
Smart Images

Figure CN123118731A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of digital image forensics and computer vision technology, and in particular to an image forgery localization method and system based on multi-source heterogeneous information guidance. Background Technology
[0002] Image forgery localization aims to accurately locate tampered areas in digital images, and has significant application value in fields such as judicial evidence collection and news censorship. With the rapid development of image editing and generation technologies, forgery methods are becoming increasingly diverse, ranging from simple splicing and copying to content-aware removal and AI-generated image implantation, making detection increasingly difficult.
[0003] Existing methods are mainly divided into two categories: traditional methods based on signal analysis and methods based on deep learning. Traditional methods locate forged regions by detecting statistical anomalies left by tampering at the pixel level, focusing on clues such as inconsistent noise distribution, differences in compression characteristics, and discontinuous edges. Their limitations lie not only in focusing solely on pixel-level physical anomalies but also in lacking the ability to understand the semantic content of the image. When the forged image is perfectly processed at the pixel level, or after post-processing operations such as JPEG compression or social media transmission, these methods often fail.
[0004] Deep learning-based methods automatically extract tampering traces using convolutional neural networks or Transformer architectures. Some methods further integrate multi-source information such as noise residual maps, edge maps, and frequency domain features to enhance detection capabilities. However, these methods are essentially still based on pattern recognition of signal anomalies and cannot determine whether the image content is plausible. For example, forged images like "underwater aircraft" can achieve perfect consistency in noise and compression characteristics at the pixel level, but the content itself violates physical principles, and existing methods cannot label such semantic absurdity. This type of "content-aware forgery," which introduces global semantic inconsistencies while preserving local statistical data, is a bottleneck that existing methods struggle to overcome. Furthermore, existing methods lack cross-dataset generalization ability and are prone to overfitting on specific datasets.
[0005] Large-scale language models, exemplified by GPT-4o, excel in visual understanding and reasoning, capable of identifying semantic inconsistencies such as whether shadows are aligned with light sources and whether objects obey gravity. Current research has begun to incorporate them into image forgery detection, but key limitations remain: large language models can only output textual descriptions, lacking the spatial precision required for pixel-level localization; visual language models have coarse-grained cross-modal alignment, making it difficult to meet fine-grained localization needs; and there is a lack of effective mechanisms to transform abstract semantic reasoning into spatially precise guidance signals.
[0006] Therefore, how to bridge the advanced semantic reasoning capabilities of large language models with the fine-grained visual analysis capabilities of traditional forensic methods, and achieve a precise transformation from semantic judgment to pixel localization while maintaining a keen perception of physical traces, is a technical problem that urgently needs to be solved in this field. Summary of the Invention
[0007] To address the technical shortcomings of existing image forgery localization methods that cannot simultaneously detect low-level physical anomalies and understand high-level semantic consistency, this invention provides an image forgery localization method and system guided by multi-source heterogeneous information. By deeply integrating the semantic reasoning capabilities of large-scale language models with the physical detection capabilities of traditional signal analysis, it achieves a precise transformation from "semantic judgment" to "pixel localization," significantly improving the detection accuracy and robustness against complex content-aware forgeries.
[0008] The first aspect of this invention provides an image forgery localization method based on multi-source heterogeneous information guidance, comprising: Step S1: Obtain the RGB image to be detected; extract noise residuals from the RGB image to generate a noise pattern map; perform semantic anomaly reasoning and visual localization processing on the RGB image to generate a semantic saliency guidance map; Step S2: Convert the RGB image, the noise pattern map, and the semantic saliency guide map into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space, respectively; extract multi-scale pyramid features through the first feature extraction branch and the second feature extraction branch set in parallel. Wherein, the visual token is a first feature sequence obtained by embedding a patched RGB image, and the noise token is a second feature sequence obtained by embedding a patched noise pattern map. The semantic saliency token is a third feature sequence obtained by embedding the semantic saliency guide graph after patching; Step S3: The multi-scale pyramid features output by the first feature extraction branch and the second feature extraction branch are refined through a hierarchical multi-scale interaction module. Features of different receptive fields are extracted through multiple parallel branches and gated fusion is performed to output the multi-scale features of the two branches. Step S4: The two-branch multi-scale features output in step S3 are symmetrically interacted and mutually enhanced at multiple scales through a bidirectional cross-attention module to realize bidirectional information flow of semantic hypothesis verification of noisy patterns and semantic prior guidance of physical interpretation, and output the enhanced features after modality alignment. Step S5: Based on the enhanced features output in step S4, generate tampered region mask and edge mask simultaneously using dual prediction heads, and output the fake location result.
[0009] Furthermore, the process of generating the semantic saliency guidance map in step S1 is as follows: The large language model GPT-4o is used in conjunction with preset prompt words to perform semantic anomaly reasoning on the RGB image. The analysis is carried out from two dimensions: semantic rationality and physical consistency. The output is a structured prediction result containing object description and spatial location label. Using a pre-trained CLIP ViT-B / 16 model, the model parameters are frozen, and the cross-modal similarity between the image patch embedding of the RGB image and the text embedding output by the large language model is calculated to generate a spatial attention map. A continuous location mask is constructed based on the spatial location labels, and the spatial attention map is modulated to obtain the semantic saliency guidance map.
[0010] Furthermore, in step S2, the RGB image, noise pattern map, and semantic saliency guidance map are patch-marked through an overlapping patch-based embedding layer. The overlapping patch-based embedding layer uses an overlapping patch embedding operation with a kernel size of 7 and a stride of 4 to segment the input into overlapping patches and project them onto the feature vector. The noise pattern image is a single-channel grayscale image, which is expanded into a three-channel image before patching to match the input format of the RGB image. Both the first and second feature extraction branches employ the SegFormer encoder architecture, extracting pyramid features through four encoding stages; among which, The first feature extraction branch takes the visual token and the noise token as inputs, and modulates the visual feature learning by using the noise token as an auxiliary guide through an improved attention mechanism in the first encoding stage, and the guide is injected only in the first encoding stage. The second feature extraction branch takes the visual token and the semantic saliency token as inputs. In the first encoding stage, the semantic saliency token is used as an auxiliary guide to modulate visual feature learning through an improved attention mechanism, and the guide is injected only in the first encoding stage.
[0011] Furthermore, the improved attention mechanism is implemented as follows: The query features are generated by element-wise addition and fusion of the query features of the bootstrap token and the query features of the visual token. Key projection and value projection are calculated only from visual tokens; An asymmetric attention computation structure is formed to achieve guided rather than dominant feature learning.
[0012] Furthermore, the specific implementation of the hierarchical multi-scale interaction module in step S3 is as follows: It receives features from the current layer and upsampled information from deeper layers as the basis for fusion. Features from different receptive fields are extracted through three parallel branches: the first branch uses 1×1 convolution to extract global context features, the second branch uses 3×3 depthwise separable convolution to extract local detail features, and the third branch uses 5×5 depthwise separable convolution to extract local detail features. The outputs of the three branches are adjusted and merged through a progressive multiplication gating mechanism; For non-top-level features, skip connections are integrated with shallow-level features to improve spatial accuracy; The three hierarchical multi-scale interactive wheels are cascaded to progressively restore spatial resolution, outputting the multi-scale features of the two branches and aligning them to a unified dimension.
[0013] Furthermore, the specific implementation of the bidirectional cross-attention module in step S4 is as follows: At each scale level, feature preparation is performed using location-aware features, which are converted from spatial format to sequence format and learnable location embeddings are added to preserve spatial information. The first cross-attention branch uses the output features of the first feature extraction branch as the query and the output features of the second feature extraction branch as the key and value to calculate cross-attention. The second cross-attention branch uses the output features of the second feature extraction branch as the query and the output features of the first feature extraction branch as the key and value to calculate cross-attention. The outputs of the two branches are fused by element-wise addition after residual connection, layer normalization and feedforward network; Multi-scale information is merged through cross-layer residual connections; Spatial refinement is achieved through a convolutional block attention module.
[0014] A second aspect of the present invention provides an image forgery localization system guided by multi-source heterogeneous information, comprising: The semantic saliency guide map generation module is configured to perform semantic anomaly reasoning and visual localization processing on the RGB image to be detected, and generate a semantic saliency guide map. The noise pattern extraction module is configured to extract noise residuals from the RGB image and generate a noise pattern map. The multi-source embedding module is configured to convert the RGB image, the noise pattern map, and the semantic saliency guide map into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space, respectively. The dual-branch feature extraction subnet is configured to extract multi-scale pyramid features through a first feature extraction branch and a second feature extraction branch set in parallel. The first feature extraction branch takes the visual token and the noise token as inputs, and uses the noise token as an auxiliary guide to modulate the visual feature learning in the first encoding stage. The second feature extraction branch takes the visual token and the semantic saliency token as inputs, and uses the semantic saliency token as an auxiliary guide to modulate the visual feature learning in the first encoding stage. The hierarchical multi-scale interaction module is configured to refine the multi-scale pyramid features output by the dual-branch feature extraction subnet, extract features of different receptive fields through multiple parallel branches and perform gated fusion. The bidirectional cross-attention module is configured to perform symmetrical interaction and mutual enhancement of the two branches' features at multiple scales, realizing bidirectional information flow of verifying semantic hypotheses through noise patterns and guiding physical interpretations through semantic priors. The dual prediction head module is configured to simultaneously generate tampered region masks and edge masks based on modality-aligned features, and output fake localization results.
[0015] Furthermore, the semantic saliency guidance graph generation module includes: The semantic anomaly reasoning unit is configured to analyze the RGB image from two dimensions of semantic rationality and physical consistency by combining GPT-4o with preset prompt words, and output a structured prediction result containing object description and spatial location label; The visual language localization unit is configured to use a pre-trained CLIP ViT-B / 16 model to calculate cross-modal similarity between image patch embeddings and text embeddings, and generate a spatial attention map. The location-aware modulation unit is configured to modulate the spatial attention map by constructing a continuous location mask based on the spatial location label, thereby generating the semantic saliency guidance map.
[0016] Furthermore, the multi-source embedding module uses an overlapping patch embedding operation with a kernel size of 7 and a step size of 4 to segment the input into overlapping patches and project them onto the feature vector; The dual-branch feature extraction subnet adopts the SegFormer encoder architecture and extracts pyramid features through four encoding stages. In the dual-branch feature extraction subnet, the improved attention mechanism adopts an asymmetric structure: the query features are generated by fusing the query features of the guiding token and the query features of the visual token element-wise, and the key projection and value projection are calculated only from the visual token, thus achieving guided but not dominant feature learning.
[0017] Furthermore, the hierarchical multi-scale interaction module includes a 1×1 convolutional branch, a 3×3 depthwise separable convolutional branch, and a 5×5 depthwise separable convolutional branch. The outputs of the three branches are fused through a progressive multiplication gating mechanism and integrate skip connections of shallow features. The bidirectional cross-attention module includes a first cross-attention branch and a second cross-attention branch. The outputs of the two branches are fused through residual connection, layer normalization, feedforward network and element-level addition. Multi-scale information is then merged through cross-layer residual connection and spatially refined through convolutional block attention module. The dual prediction head module includes a tamper mask prediction head and an edge mask prediction head, and applies supervision signals at multiple scales to optimize positioning accuracy.
[0018] Compared with the prior art, the present invention has the following beneficial effects: (1) It realizes deep cross-modal fusion of semantic reasoning of large-scale language models and traditional signal analysis, filling the gap in semantic forensics technology. Existing methods cannot determine whether the content of an image is reasonable, and they completely fail when faced with pixel-perfect forgeries such as "underwater aircraft". This invention uses a pipeline for generating saliency maps for forensics, uses GPT-4o for semantic anomaly reasoning and combines it with position-aware visual localization, and for the first time transforms abstract cognitive judgment into pixel-level precise localization signals. It can detect complex content-aware forgeries that cannot be identified by existing methods and introduce global semantic inconsistencies while retaining local statistical data.
[0019] (2) An asymmetric early fusion mechanism that "guides but does not dominate" is designed to significantly improve cross-dataset generalization ability. Existing multimodal fusion methods use feature concatenation or sequential fusion, which can easily lead to model overfitting. In this invention, the guiding token only participates in query feature generation, key and value projection are calculated only from the visual token, and the guiding signal is injected only in the first encoding stage. This design allows the guide to indicate the learning direction but not dominate the feature representation, preventing excessive dependence on external priors, and achieving stable and excellent generalization performance on 11 benchmark datasets.
[0020] (3) A symmetrical bidirectional cross-attention mechanism is proposed to achieve closed-loop mutual reinforcement of physical and semantic evidence. Existing multimodal fusion is mostly unidirectional or static fusion. This invention achieves symmetrical interaction between noise features and semantic features at multiple scales through a bidirectional cross-attention module. Signal anomalies verify semantic hypotheses, and cognitive priors guide physical interpretation, enabling the two modalities to mutually correct and reinforce each other, and the final judgment is more reliable than any single modality.
[0021] (4) Construct a progressive refinement link from coarse-grained semantics to fine-grained pixels to achieve end-to-end high-precision positioning. This invention transforms text descriptions into accurate heatmaps through three steps: "semantic reasoning - visual positioning - position modulation". Spatial resolution is gradually restored through hierarchical multi-scale interaction. Finally, the dual prediction heads simultaneously output the tampered region mask and edge mask, realizing complete information transmission from global semantic judgment to local boundary positioning.
[0022] (5) No training is required for specific forgery types; it possesses zero-shot generalization ability and excellent robustness. The forensic saliency map generation pipeline utilizes GPT-4o general commonsense reasoning and CLIP cross-modal alignment capabilities, allowing for plug-and-play operation without fine-tuning. It maintains excellent performance under conditions of JPEG compression, size scaling, Gaussian blur, noise, and transmission through social media platforms such as Facebook and WeChat, significantly outperforming existing methods and demonstrating reliability for practical deployment.
[0023] (6) Significant performance improvements are achieved on 11 authoritative benchmark datasets. Experiments show that the present invention significantly outperforms state-of-the-art methods in F1, IoU, AUC, and MCC metrics, especially in complex scenarios requiring semantic reasoning such as DSO, DEF-12k, and IMD2020. Training on only a single dataset outperforms LLM methods such as ForgeryGPT and FakeShield, which use extensive multi-domain data, verifying the efficiency of the collaborative reasoning and signal analysis paradigm. Attached Figure Description
[0024] Figure 1 This is a flowchart of the steps of an image forgery localization method guided by multi-source heterogeneous information.
[0025] Figure 2 This is a diagram of the overall architecture of a multi-source heterogeneous information guidance system.
[0026] Figure 3 A framework for generating saliency maps for evidence collection that combines large language model reasoning and visual localization.
[0027] Figure 4 This is a diagram of the architecture of a bidirectional cross-attention module operating at three scale levels.
[0028] Figure 5 To assess the localization performance of the Columbia tampered dataset and the DSO tampered dataset on four social media platforms under different post-processing pipelines.
[0029] Figure 6 The normalized mean absolute error (NMAE) is given for evidence-gathering clues under two degradation scenarios (noise-based vs. saliency-based); where (a) is the direct post-processing combination and (b) is the social media dissemination + ordered post-processing combination.
[0030] Figure 7 This diagram illustrates the qualitative and quantitative analysis of the significance and noise map of evidence collection under hybrid platform transmission and post-processing. Detailed Implementation
[0031] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0032] like Figure 1 As shown, the first aspect of the present invention provides a flowchart of a method for locating image forgery based on multi-source heterogeneous information, the specific steps of which include: Step S1: Obtain the RGB image to be detected; extract noise residuals from the RGB image to generate a noise pattern map; perform semantic anomaly reasoning and visual localization processing on the RGB image to generate a semantic saliency guidance map; Step S2: Convert the RGB image, the noise pattern map, and the semantic saliency guide map into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space, respectively; extract multi-scale pyramid features through the first feature extraction branch and the second feature extraction branch set in parallel. Wherein, the visual token is a first feature sequence obtained after patching and embedding an RGB image, the noise token is a second feature sequence obtained after patching and embedding a noise pattern map, and the semantic saliency token is a third feature sequence obtained after patching and embedding a semantic saliency guide map; Step S3: The multi-scale pyramid features output by the first feature extraction branch and the second feature extraction branch are refined through a hierarchical multi-scale interaction module. Features of different receptive fields are extracted through multiple parallel branches and gated fusion is performed to output the multi-scale features of the two branches. Step S4: The two-branch multi-scale features output in step S3 are symmetrically interacted and mutually enhanced at multiple scales through a bidirectional cross-attention module to realize bidirectional information flow of semantic hypothesis verification of noisy patterns and semantic prior guidance of physical interpretation, and output the enhanced features after modality alignment. Step S5: Based on the enhanced features output in step S4, generate tampered region mask and edge mask simultaneously using dual prediction heads, and output the fake location result.
[0033] In one specific embodiment of the present invention, the overall system architecture is as follows: Figure 2 As shown.
[0034] like Figure 2 As shown, the multi-source heterogeneous information guidance framework proposed in this invention includes the following four main components: a multi-source embedding module, a dual-branch feature extraction subnetwork (including a hierarchical multi-scale interaction module), a bidirectional cross-attention module, and a dual prediction head module.
[0035] In the specific implementation process, the RGB image to be detected is first input into the system. The system simultaneously performs two processing paths: the first is to extract noise residuals from the RGB image to generate a noise pattern map; the second is to generate a pipeline through the evidence saliency map (such as...). Figure 3 As shown, a semantic saliency guidance map is generated. The noise pattern map and the semantic saliency guidance map provide complementary guidance information from the physical and cognitive dimensions, respectively, and together with the original RGB image, they constitute a multi-source heterogeneous input.
[0036] The three input sources (RGB image, noise pattern map, and semantic saliency guide map) are then fed into the multi-source embedding module, which transforms them into a token sequence in a unified feature space through an embedding layer based on overlapping patches.
[0037] The transformed visual token and noise token form the input to the first feature extraction branch (noise-guided flow), while the visual token and semantic saliency token form the input to the second feature extraction branch (semantic-guided flow). Both branches employ the same SegFormer encoder architecture to extract multi-scale pyramid features from the RGB image under the modulation of the guiding signal.
[0038] The multi-scale pyramid features output from the two branches are aligned in dimension by the channel adjustment layer and then enter the hierarchical multi-scale interaction module for feature refinement. Features from different receptive fields are extracted through three parallel branches and then gated fusion is performed.
[0039] The refined two-branch features interact symmetrically and reinforce each other across three scales through a bidirectional cross-attention module, enabling bidirectional verification of physical and semantic evidence.
[0040] Finally, the enhanced features after modality alignment are fed into the dual prediction head, which simultaneously generates tampered region masks and edge masks, and applies supervision signals at multiple scales to optimize localization accuracy.
[0041] In one specific embodiment of the present invention, the noise pattern map is generated as follows: The RGB image is processed using a high-pass filter or a noise extraction network such as Noiseprint++ to extract the noise residuals of each region, forming a single-channel noise pattern map. Since the present invention employs a dual-branch parallel processing architecture, to ensure consistency in the input format of the two branches, the single-channel noise pattern map is copied and expanded into a three-channel model to match the input format of the RGB image.
[0042] In one specific embodiment of the present invention, in step S1, the RGB image undergoes semantic anomaly inference and visual localization processing to generate a semantic saliency guidance map. For example... Figure 3 As shown, the generation of the semantic saliency guidance map is accomplished through the evidence saliency map generation pipeline. This pipeline utilizes the GPT-4o large language model for semantic anomaly reasoning and the CLIP visual language model for visual localization and position-aware modulation to generate a spatially accurate cognitive prior map, as detailed below: ① Semantic anomaly reasoning RGB images are input into the GPT-4o large language model and analyzed using carefully designed prompts. The prompts guide the model to reason along two dimensions: semantic plausibility and physical consistency. Regarding semantic plausibility, the model detects the presence of unnatural objects, impossible biological configurations, and contextual anomalies in the image. Specifically, the model judges whether objects in the image conform to common sense and contextual logic; for example, the presence of a polar bear in a tropical savanna is a semantic anomaly. Regarding physical consistency, the model detects consistency in lighting direction, shadow consistency, reflection pattern consistency, perspective geometry consistency, and object proportions. Specifically, the model judges whether physical elements in the image conform to physical laws; for example, a light source on the left while the shadow is cast to the right front is a physical inconsistency.
[0043] The model outputs structured prediction results, including object descriptions and spatial location labels. The spatial location labels are selected from 15 predefined categories: top left, top center, top right, left center, center, right center, bottom left, bottom center, bottom right, top, bottom, left, right, and center. This structured output format transforms the free text reasoning of the large language model into machine-parsable discrete labels, facilitating processing by subsequent modules.
[0044] ② Visual language localization without training A pre-trained CLIP ViT-B / 16 model was used, with model parameters frozen. Cross-modal similarity was calculated between the image patch embeddings of RGB images and the text embeddings output by GPT-4o. The CLIP model includes an image encoder and a text encoder. The image encoder segments the input image into several patches and generates an image patch embedding sequence through Transformer encoding. The text encoder generates a text embedding vector from the input text through Transformer encoding. For each image patch, the cosine similarity between its embedding vector and the text embedding vector output by GPT-4o was calculated. A higher similarity value indicates that the patch is more relevant to the spatial location described by the text. The similarity scores of each patch were arranged according to spatial location, generating a dimension H. m ×W m The spatial attention map. In this spatial attention map, the highlighted areas represent the image regions that best match the spatial location described by GPT-4o.
[0045] ③ Position-aware response modulation A continuous location mask is constructed based on spatial location labels, and the spatial attention map is modulated to highlight semantically questionable but spatially coherent regions.
[0046] The method for generating a continuous position mask is as follows: First, define a binary region mapping R based on spatial division. p R p In the context of the spatial location label p, pixels belonging to the region corresponding to the label p have a value of 1, while the rest have a value of 0; then, the distance from each pixel (i, j) to the nearest target region (R) is calculated. p The Euclidean distance d(i,j) of the pixels with a value of 1 is calculated; finally, a continuous position mask Mp is generated by applying a Gaussian decay function, as shown in the formula: (1) (2) In the formula, β=0.6 represents the base weight, meaning that even pixels far from the target area retain a base response of 0.6; σ=min(H m W m The ) / 4 control of the decay rate determines the speed at which the mask decays from the center of the target region outwards. This Gaussian decay function ensures a smooth transition of the location mask from the center to the edge of the target region, rather than a binary hard boundary.
[0047] The generated position mask M p The spatial attention map generated by CLIP is multiplied element-wise to obtain the final forensic saliency map. This forensic saliency map is a heatmap of the same size as the input image, with highlighted areas representing semantically questionable but spatially coherent regions, serving as cognitive prior guidance signals for subsequent feature extraction subnetworks.
[0048] In one specific embodiment of the present invention, after the multi-source images (RGB image, noise pattern map, and semantic saliency guide map) are embedded in step S2, multi-scale pyramid features are extracted through a set dual-branch feature extraction subnetwork. The dual-branch feature extraction subnetwork set in this invention includes a first feature extraction branch (noise guide flow) and a second feature extraction branch (semantic guide flow) set in parallel. The two branches have identical architectures, both employing the SegFormer encoder architecture, and extracting pyramid features through four encoding stages. The multi-source image embedding and dual-branch early fusion process is as follows: ① Multi-source image embedding This invention employs an overlapping patch embedding layer with a kernel size of 7 and a stride of 4 for patch embedding. The input is segmented into overlapping patches and projected onto a C1=64-dimensional feature vector. In this invention, the kernel size of 7 is greater than the stride of 4, resulting in overlapping regions between adjacent patches. Compared to non-overlapping embedding, this overlapping patch embedding preserves more local contextual information, which is beneficial for maintaining feature continuity and spatial consistency.
[0049] For noise-guided streams, the noise pattern map is a single-channel grayscale image, which is expanded to three channels to match the RGB input format before patch tokenization. Both the RGB image and the expanded noise map are embedded through overlapping patch layers to generate visual tokens E. v ∈R^(B×N1×C1) and noise token E n ∈R^(B×N1×C1), where B represents the batch size, N1 represents the number of patches, and C1=64 represents the embedding dimension. Both token sequences are layer normalized before entering the first Transformer block.
[0050] For semantically guided flow, the RGB image and the forensic saliency map are respectively embedded through the same overlapping patch layer to generate the visual token E. v ∈R^(B×N1×C1) and semantic saliency token E s ∈R^(B×N1×C1), and layer normalization is also performed before entering the Transformer block.
[0051] ② Early fusion of attention In the first encoding stage, the improved attention mechanism accepts both visual tokens and guiding tokens (noise tokens or semantic saliency tokens) as input. Query generation combines the projections of visual and guiding tokens through element-wise addition, with key and value projections computed only from the visual tokens. This asymmetric design allows the guiding signal to modulate attention computation by influencing the query, but since the keys and values come only from the visual tokens, the guiding signal directs attention computation without dominating the feature representation.
[0052] Both branches undergo four encoding stages, with the spatial resolution gradually halved in each stage (from 1 / 4 of the original image to 1 / 32), while the number of channels gradually increases. No further auxiliary guidance signals are injected in stages 2 through 4. This design ensures that the guidance signal only indicates the learning direction in the initial stage of feature extraction; subsequent stages allow the network to autonomously abstract features, effectively preventing the model from over-relying on external priors.
[0053] In one specific embodiment of the present invention, the multi-scale pyramid features output by the first feature extraction branch and the second feature extraction branch in step S3 are refined through a hierarchical multi-scale interaction module, as follows: After four stages of encoding, both the noise-guided flow and the semantic-guided flow obtain four-layer pyramid features, with each layer having a resolution of 1 / 4, 1 / 8, 1 / 16, and 1 / 32 of the original image, respectively. The two flows apply channel adjustment layers to unify the feature dimensions at the pyramid level, and then enter the Hierarchical Multi-Scale Interaction (HMSI) module for progressive spatial resolution restoration.
[0054] The HMSI module receives features from the current layer and upsampled information from deeper layers to form a fusion basis. Three parallel branches process this fusion basis using different receptive fields: a 1×1 convolutional branch extracts global contextual features, a 3×3 depthwise separable convolutional branch extracts medium-range local detail features, and a 5×5 depthwise separable convolutional branch extracts even larger-range local detail features. Depthwise separable convolution decomposes standard convolution into two steps: depthwise convolution and pointwise convolution. Compared to standard convolution, this reduces the number of parameters by approximately 1 / 8, maintaining computational efficiency while expanding the receptive field.
[0055] The outputs of the three branches are fused using a progressive multiplication gating mechanism. Specifically, the features of each of the three branches are used to generate gating weights through a sigmoid activation function. These gating weights are then multiplied element-wise with the features of the corresponding branch, and finally, the three weighted features are summed. For non-top-level features, skip connections from shallower features are integrated into the gating result to improve spatial accuracy. Skip connections adjust the channel count of features from the corresponding layer in the encoder stage using 1×1 convolutions, and then add them element-wise to the gating fusion result to supplement high-resolution spatial detail information. The final convolutional layer produces a refined output for each layer stage. This framework cascades three HMSI rounds, progressively restoring the feature resolution from 1 / 32 to 1 / 4, and generating multi-scale features from two streams, ultimately aligning them to a unified dimension to prepare for subsequent bidirectional cross-attention interactions.
[0056] The above-mentioned hierarchical multi-scale interactive design of the present invention ensures high sensitivity to tamper artifacts characterized by different scales and shapes: large-area stitching requires a global field of view provided by low-resolution features, while small-area repair requires fine details preserved by high-resolution features. HMSI takes into account the detection needs of different scales through multi-branch and multi-round cascading.
[0057] In one specific embodiment of the present invention, the refined two-branch multi-scale features in step S4 undergo symmetrical interaction and mutual enhancement at multiple scales through a bidirectional cross-attention module, realizing bidirectional information flow between noise pattern verification of semantic hypotheses and semantic prior guidance of physical interpretation, such as... Figure 4As shown, the bidirectional cross-attention module (BCA module) operates and refines at three scale levels. These three scales correspond to the feature layer levels of the HSMI module's one-stage three-fold fusion, two-stage two-fold fusion, and three-stage one-fold fusion, respectively, ensuring that both global semantics and local details can participate in the interaction. The specific process is as follows: ① Preparation of location-aware features At each scale level i, features are derived from the spatial format [B, C]. i H i W i Convert ] to sequence format [B, N i C i ], where N i =H i ×W i Indicates the sequence length. Learnable positional embeddings are added to preserve spatial information. Let... and These represent the input features from the noise stream and the saliency stream, respectively. The location-encoded features are calculated as follows: (3) (4) In the formula, and These are learnable parameters initialized using a truncated normal distribution. Each spatial location corresponds to a unique location embedding vector, enabling the model to distinguish tokens from different locations and infer location-related tampering patterns.
[0058] ② Pay attention to calculations for symmetrical intersections. The first cross-attention branch enables noise features to query salient features, with queries, keys, and values derived through linear transformations.
[0059] For a multi-head cross-attention with h heads, the projection is reshaped to [B, h, N]. i C i The format is / h], and attention is calculated independently for each header. The attention score is calculated as follows: (5) In the formula, the scaling factor Used to stabilize gradients and prevent the dot product value from becoming too large.
[0060] The second cross-attention branch symmetrically processes the noise features of the query saliency features. This bidirectional design allows noise patterns to guide semantic understanding (first branch), while semantic priors verify noise anomalies (second branch), forming a closed loop where physical and semantic evidence mutually verify each other.
[0061] ③ Feedforward networks and spatial augmentation Following cross-attention, a location-based feedforward network (MLP) with GELU activation performs a non-linear transformation on the two branches. GELU activation is smoother than ReLU and retains more information flow. Residual connections and layer normalization are applied after each sub-layer, forming a standard Transformer residual structure. Branch fusion is achieved through element-wise addition. Cross-layer residual connections merge multi-scale information through bilinear interpolation when there are resolution differences, facilitating gradient flow and depth supervision. Sequential features are then converted to a spatial format and refined using a Convolutional Block Attention Module (CBAM). CBAM sequentially performs channel attention (determining which feature channels are more important) and spatial attention (determining which spatial locations are more important), further enhancing the discriminative power of features through two attention recalibrations.
[0062] In a specific embodiment of the present invention, the dual prediction heads are as follows: The dual prediction head consists of a tampering mask prediction head and an edge mask prediction head. Both prediction heads use convolutional layers to decode the alignment features output by the bidirectional cross-attention module. Specifically, the tampering mask prediction head receives the alignment features output by the BCA (Bio-Awareness Module), gradually restores the spatial resolution to the input image size through a series of upsampling and convolutional operations, and finally outputs the probability that each pixel is a tampered region through a sigmoid activation function, generating a tampered region mask. The edge mask prediction head adopts the same architecture, but the supervision signal is the edge of the tampered region. The edge mask is obtained by extracting the boundary from the ground truth mask and is used to assist the model in focusing on the boundary of the tampered region.
[0063] In a specific embodiment of the present invention, the model training and training configuration are as follows: During training, the multi-scale supervision signals include: calculating binary cross-entropy and IoU loss for the bidirectional cross-attention output and the tampered mask prediction head output at three scales, calculating binary cross-entropy and IoU loss for the edge mask prediction head output, and the total loss function is the weighted sum of the losses at each scale.
[0064] Datasets: Training uses the CASIAv2+ dataset, which contains 5123 manipulated images with pixel-level ground truth annotations; validation uses the CASIAv1+ dataset, which contains 920 manipulated images for hyperparameter tuning and model selection.
[0065] The evaluation involved 11 different benchmark datasets: Columbia, IFC, CASIAv1+, WildWeb, COVER, NIST16, DSO, Korus, In-the-Wild, DEF-12k, and IMD2020, covering a wide range of forensic scenarios from simple splicing and copying to complex content-aware removal and enhancement.
[0066] Implementation Environment: Implemented using PyTorch library and NVIDIA GeForce RTX 3090 GPU. The network was trained using the SGD optimizer with an initial learning rate of 0.001, momentum of 0.9, and weight decay of 0.0005. A total of 64 effective batch sizes were achieved using 4 batch sizes combined with 16 steps of gradient accumulation to simulate large-batch training under limited GPU memory. The learning rate was reduced by a factor of 10 at epochs 100 and 120 to promote stable model convergence. All input images were resized to a uniform 512×512 pixels. Data augmentation was limited to random horizontal flipping.
[0067] Evaluation metrics: F1 score, IoU, AUC, and MCC were used as the main evaluation metrics. F1, IoU, and MCC were calculated on binary masks obtained at a prediction threshold of 0.5, while AUC was evaluated on continuous prediction maps without a threshold. In addition, normalized mean absolute error (NMAE) was used to evaluate the spatial distance between ground truth and forensic clues.
[0068] A second aspect of the present invention provides an image forgery localization system guided by multi-source heterogeneous information, comprising the following modules: The semantic saliency guidance map generation module includes a semantic anomaly inference unit, a visual language localization unit, and a position-aware modulation unit. The semantic anomaly inference unit is configured to analyze the RGB image from two dimensions—semantic rationality and physical consistency—using GPT-4o combined with preset prompts, and output a structured prediction result containing object descriptions and spatial location labels. The visual language localization unit is configured to use a pre-trained CLIP ViT-B / 16 model to calculate the cross-modal similarity between image patch embeddings and text embeddings, generating a spatial attention map. The position-aware modulation unit is configured to construct a continuous position mask based on the spatial location labels to modulate the spatial attention map, generating the semantic saliency guidance map.
[0069] Noise Pattern Extraction Module: Configured to extract noise residuals from RGB images and generate noise pattern maps. This module can use pre-trained noise extraction networks such as Noiseprint++ to expand the single-channel noise residual map into a three-channel map.
[0070] The multi-source embedding module is configured to patch and tokenize the RGB image, noise pattern map, and semantic saliency guide map through an overlapping patch embedding layer with a kernel size of 7 and a stride of 4, respectively, converting them into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space. The dimensions of the three token sequences are all [B, N1, C1], where C1=64.
[0071] The dual-branch feature extraction subnetwork is configured to extract multi-scale pyramid features through a first feature extraction branch and a second feature extraction branch set in parallel. The first feature extraction branch takes visual tokens and noise tokens as input. In the first encoding stage, an improved attention mechanism is used to element-wise add and fuse the query features of the noise tokens and the query features of the visual tokens. Key projection and value projection are calculated only from the visual tokens. The second feature extraction branch takes visual tokens and semantic saliency tokens as input and uses the same mechanism. Both branches employ the SegFormer encoder architecture and extract pyramid features through four encoding stages.
[0072] The hierarchical multi-scale interaction module is configured to refine the multi-scale pyramid features output by the dual-branch feature extraction subnetwork, including a 1×1 convolutional branch, a 3×3 depthwise separable convolutional branch, and a 5×5 depthwise separable convolutional branch. The outputs of the three branches are fused through a progressive multiplication gating mechanism and integrated with the skip connections of shallow features.
[0073] The bidirectional cross-attention module is configured to perform symmetrical interaction and mutual enhancement of features from two branches across multiple scales. It includes a first cross-attention branch and a second cross-attention branch: the first cross-attention branch uses the output features of the first feature extraction branch as the query and the output features of the second feature extraction branch as the key and value; the second cross-attention branch uses the output features of the second feature extraction branch as the query and the output features of the first feature extraction branch as the key and value. The module also includes a positional encoding unit, a feedforward network, cross-layer residual connections, and a convolutional block attention module enhancement unit.
[0074] Dual prediction head module: Configured to generate tamper region mask and edge mask based on the alignment features output by the bidirectional cross attention module, and apply supervision signals at multiple scales to output fake localization results.
[0075] The modules are connected sequentially to form a complete processing chain from the input image to the localization result. The entire system can be trained in an end-to-end manner, where the gradients of each module are jointly optimized through backpropagation, or in a staged training strategy, where the feature extraction subnet and prediction head are trained first, and then all modules are fine-tuned jointly.
[0076] Example 1 Cross-dataset evaluation experiments To verify the generalization ability of the present invention under different data distributions and forgery scenarios, this embodiment conducted a comprehensive cross-dataset evaluation on 11 benchmark datasets.
[0077] Experimental setup: The CASIAv2+ dataset (5123 tampered images) was used for training, and the CASIAv1+ dataset (920 images) was used for validation and hyperparameter tuning. Testing was conducted on 11 datasets: Columbia, IFC, CASIAv1+, WildWeb, COVER, NIST16, DSO, Korus, In-the-Wild, DEF-12k, and IMD2020, covering a wide range of forgery types from simple stitching and copy-paste to complex content-aware removal and enhancement. Comparison methods included 8 architecture-driven methods (FCN, U-Net, RRU-Net, ViT-B, Swin-ViT, PSCC-Net, PIM, and Detective SAM) and 11 multi-view forensics methods (MFCN, ManTraNet, HPFCN, H-LSTM, SPAN, MVSS-Net++, TruFor, CAT-Net, EVP, ForgeryGPT, and FakeShield). Test results are shown in Tables 1, 2, and 3.
[0078] Table 1. Pixel-level tamper localization performance across datasets: F1 score and IoU (%) Table 2. Pixel-level tamper localization performance across datasets: AUC and MCC (%) Table 3. Image-level tamper localization performance (F1@0.5) across datasets. Note: Best results are indicated in bold, and second-best results are indicated by underscores. * indicates a dataset that includes both real and manipulated images.
[0079] Table 1 presents the F1 scores and IoU results of each method on 11 datasets. As shown in Table 1, the F1 score of this invention is best on 8 of the 11 datasets, and second best on NIST16 and Columbia; the IoU is best on 5 datasets and second best on 4 datasets. Compared with PIM, this invention achieves significant improvements on datasets requiring semantic reasoning (such as DSO and DEF-12k), validating the effectiveness of integrating large language model priors into forgery detection. Compared with TruFor, although TruFor employs a complex training-based multi-source fusion strategy, this invention still achieves better performance on 9 of the 11 datasets. Architecture-driven methods (such as Swin-ViT and Detective SAM) exhibit large performance fluctuations on different datasets, indicating that relying solely on architectural innovation without explicit forensic modeling is insufficient to address diverse forgery types.
[0080] Table 2 presents the AUC and MCC metrics for each method across 11 datasets. The AUC of this invention is best on 5 datasets, and second best on DEF-12k and IMD2020; the MCC is best on 7 of the 11 datasets, with particularly significant improvements on challenging scenarios such as IMD2020, DEF-12k, Korus, and WildWeb. Compared to PIM, the MCC of this invention outperforms most datasets, indicating that the probability prediction output of this invention provides a more reliable confidence estimate for spoofing localization. Compared to TruFor, this invention achieves comparable or better AUC on 8 datasets, and significantly better MCC on datasets requiring semantic understanding.
[0081] Table 3 presents the image-level F1 scores of each method on multiple benchmark datasets. This invention achieves 100% F1 scores on both the NIST16 and In-the-Wild datasets, and significantly outperforms its best existing competitor (PIM) on the IMD2020 dataset. The synergistic integration of semantic reasoning and physical signal analysis effectively reduces false positives in complex forensic scenarios.
[0082] Example 2 Competitive assessment of methods based on large language models This embodiment compares the localization performance of the present invention with contemporary forensic methods based on large language models (ForgeryGPT and FakeShield). As shown in Table 4, ForgeryGPT and FakeShield are trained on a wide range of multi-domain datasets, including Fantastic Reality and DeepFake, while the present invention is trained only on a single CASIAv2+ dataset.
[0083] Table 4. Cross-dataset performance comparison of evidence location methods based on large language models under different pre-trained data (%) As shown in Table 4, on the CASIAv1+ dataset, this invention achieved an F1 score of 64.4% and an IoU of 54.0%, outperforming the two comparative architectures based on large language models. On the Korus dataset, this invention achieved the highest F1 score of 28.1%, while ForgeryGPT and FakeShield achieved 25.8% and 20.0%, respectively. Although FakeShield achieved higher metrics on the IMD2020 dataset, this invention achieved a higher F1 score on the Columbia benchmark while maintaining the second-best overall performance. These results validate that the collaborative reasoning and signal analysis paradigm proposed in this invention can learn robust forensic features from limited training data, outperforming large language model methods that rely on large-scale multi-domain data in both data efficiency and detection accuracy.
[0084] Example 3 Robustness assessment To verify the robustness of this invention in practical applications, this embodiment simulates image distortion caused by online social network (OSN) transmission. Test images were transmitted via four mainstream social media platforms: Facebook, WeChat, Weibo, and WhatsApp, and then input into each model for forgery localization. As shown in Table 5, this invention consistently outperforms state-of-the-art methods such as TruFor, PIM, and Detective SAM on all test platforms.
[0085] Table 5. Performance comparison of different methods on various datasets for online social network (OSN) transmission (%) As shown in Table 5, the F1 score of this invention remains above 62% on almost all platforms on the CASIAv1+ dataset, while the comparison model shows a significant performance decline. The synergistic integration of cognitive priors and physical signal cues enables the model to effectively distinguish between real content and tampered areas even under low-quality transmission conditions.
[0086] Robustness in complex degradation scenarios: such as Figure 5 As shown, this embodiment further evaluates a complex real-world scenario involving social media transmission and sequential post-processing degradation.
[0087] Experiments evaluated model performance on the Columbia and DSO datasets under four different pipelines, combining JPEG compression, resizing, and different orders of Gaussian blur and noise. Our invention significantly outperforms the current state-of-the-art baseline on the Columbia dataset using the NJRB pipeline. On the DSO dataset, our invention maintains an excellent F1 score, while competing methods such as PIM and TruFor exhibit significant performance degradation under the same conditions. This consistent performance lead across all degradation stages demonstrates that the synergistic integration of semantic reasoning and physical signal cues effectively resists information loss during multi-stage processing.
[0088] This embodiment evaluates the reliability of derived forensic clues by calculating the normalized mean absolute error (NMAE) between the forensic map and the ground truth under different degradation scenarios.
[0089] like Figure 6 As shown in (a), under the direct post-processing combination, the NMAE values of noise-based cues on the Columbia dataset range from 0.516 to 0.573, while the saliency-based map maintains higher consistency, with NMAE values between 0.400 and 0.414. Figure 6 As shown in (b), in more complex scenarios combining social media propagation with sequential degradation, saliency-based cues consistently exhibit lower error values, indicating stronger stability of semantic reasoning even with significant information loss. For example, the NMAE of saliency maps on the DSO dataset remains around 0.43 across various transmission pipelines such as Facebook and WhatsApp.
[0090] Figure 7 The quantitative results were supplemented by visual evidence and semantic output generated by GPT-4o. Under hybrid degradation pipelines such as Facebook-JRBN and WhatsApp-NJRB, saliency maps demonstrated superior spatial alignment in DSO samples, accurately locating tampered regions. Under extremely severe degradation pipelines (such as Weibo-BNJR), saliency alignment deteriorated, occasionally leading to semantic misinterpretations. These observations suggest that combining physical signal analysis with cognitive reasoning provides a reliable and interpretable foundation for forensic investigations in diverse, uncontrolled real-world scenarios.
[0091] Example 4 Ablation Research To verify the independent contribution of each key component in the framework of this invention, a systematic ablation experiment was conducted in this embodiment. As shown in Table 6, the performance changes of each variant were evaluated on 11 benchmark datasets by removing or replacing specific components one by one.
[0092] Table 6 shows the mean F1 score and AUC results (%) for ablation variants across 11 challenging datasets. As shown in Table 6: Variant V1 (noise-guided): Removing the noise-guided feature extraction subnet resulted in a 4.5% and 3.7% decrease in average F1 and AUC, respectively, validating that the physical evidence derived from Noiseprint++ provides crucial supplementary information for semantic reasoning.
[0093] Variant V2 (without saliency guidance): The subnet with saliency guidance removed exhibits a smaller performance decrease (2.5% decrease in F1 and 3.3% decrease in AUC), indicating that although semantic priors improve detection accuracy, the framework maintains reasonable performance through noise-based evidence in the absence of cognitive guidance.
[0094] Variant V3 (without the HMSI module): Removing the hierarchical multi-scale interaction module resulted in a 3.7% decrease in the F1 score. Compared to the sharp drop in F1, the decrease in AUC was relatively moderate (0.9%), indicating that hierarchical multi-scale interaction is crucial for accurate boundary localization, rather than just coarse detection confidence. This suggests that features at different resolutions learn domain alignment in isolation, lacking coordinated inference, ultimately compromising the framework's ability to maintain global semantic consistency and local detail consistency.
[0095] Variant V4 (BCA replaced with CBAM): Replacing the bidirectional cross-attention module with the CBAM module for multimodal fusion resulted in a 2.1% decrease in F1 and a 2.7% decrease in AUC. This significant decrease validates that the symmetric cross-attention mechanism enables the mutual reinforcement between noise and semantic features to be far superior to simple channel and spatial attention mechanisms, which cannot model complex cross-modal dependencies.
[0096] Variant V5 (without edge head supervision): Removing edge head supervision resulted in the largest AUC degradation (5.7%) across all ablation methods. This indicates that without edge guidance, rich multimodal features cannot be translated into accurate tampered boundaries, and consequently, cross-domain alignment of boundary-related features is also affected.
[0097] The complete model in this embodiment: This embodiment uses the complete model, which achieves the best performance with an F1 score of 39.9% and an AUC of 76.8% in tests and evaluations on 11 benchmark datasets.
[0098] The above ablation experiments systematically verified the necessity of each key component in this invention: noise guidance provides physical constraints, saliency guidance provides semantic structure, HMSI ensures multi-scale feature coordination, BCA enables cross-modal mutual enhancement, and edge supervision guarantees boundary localization accuracy. These five components work together to achieve the superior forgery localization performance of this invention.
[0099] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.
Claims
1. An image forgery localization method based on multi-source heterogeneous information guidance, characterized in that, include: Step S1: Obtain the RGB image to be detected; Noise residuals are extracted from the RGB image to generate a noise pattern map; The RGB image is subjected to semantic anomaly reasoning and visual localization processing to generate a semantic saliency guide map; Step S2: Convert the RGB image, the noise pattern map, and the semantic saliency guide map into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space, respectively; Multi-scale pyramid features are extracted by using the first and second feature extraction branches set in parallel. Step S3: The multi-scale pyramid features output by the first feature extraction branch and the second feature extraction branch are refined through a hierarchical multi-scale interaction module. Features of different receptive fields are extracted through multiple parallel branches and gated fusion is performed to output the multi-scale features of the two branches. Step S4: The two-branch multi-scale features output in step S3 are symmetrically interacted and mutually enhanced at multiple scales through a bidirectional cross-attention module to realize bidirectional information flow of semantic hypothesis verification of noisy patterns and semantic prior guidance of physical interpretation, and output the enhanced features after modality alignment. Step S5: Based on the enhanced features output in step S4, generate tampered region mask and edge mask simultaneously using dual prediction heads, and output the fake location result.
2. The method of claim 1, wherein, The process of generating the semantic saliency guidance map in step S1 is as follows: The large language model GPT-4o is used in conjunction with preset prompt words to perform semantic anomaly reasoning on the RGB image. The analysis is carried out from two dimensions: semantic rationality and physical consistency. The output is a structured prediction result containing object description and spatial location label. Using a pre-trained CLIP ViT-B / 16 model, the model parameters are frozen, and the cross-modal similarity between the image patch embedding of the RGB image and the text embedding output by the large language model is calculated to generate a spatial attention map. A continuous location mask is constructed based on the spatial location labels, and the spatial attention map is modulated to obtain the semantic saliency guidance map.
3. The method of claim 1, wherein, In step S2, the RGB image, noise pattern map, and semantic saliency guidance map are patch-marked through an overlapping patch-based embedding layer. The overlapping patch-based embedding layer uses an overlapping patch embedding operation with a kernel size of 7 and a stride of 4 to segment the input into overlapping patches and project them onto the feature vector. The noise pattern image is a single-channel grayscale image, which is expanded into a three-channel image before patching to match the input format of the RGB image. Both the first and second feature extraction branches employ the SegFormer encoder architecture, extracting pyramid features through four encoding stages; among which, The first feature extraction branch takes the visual token and the noise token as inputs, and modulates the visual feature learning by using the noise token as an auxiliary guide through an improved attention mechanism in the first encoding stage, and the guide is injected only in the first encoding stage. The second feature extraction branch takes the visual token and the semantic saliency token as inputs. In the first encoding stage, the semantic saliency token is used as an auxiliary guide to modulate visual feature learning through an improved attention mechanism, and the guide is injected only in the first encoding stage.
4. The method according to claim 3, characterized in that, The improved attention mechanism is implemented as follows: The query features are generated by element-wise addition and fusion of the query features of the bootstrap token and the query features of the visual token. Key projection and value projection are calculated only from visual tokens; An asymmetric attention computation structure is formed to achieve guided rather than dominant feature learning.
5. The method according to claim 1, characterized in that, The specific implementation method of the hierarchical multi-scale interaction module in step S3 is as follows: It receives features from the current layer and upsampled information from deeper layers as the basis for fusion. Features from different receptive fields are extracted through three parallel branches: the first branch uses 1×1 convolution to extract global context features, the second branch uses 3×3 depthwise separable convolution to extract local detail features, and the third branch uses 5×5 depthwise separable convolution to extract local detail features. The outputs of the three branches are adjusted and merged through a progressive multiplication gating mechanism; For non-top-level features, skip connections are integrated with shallow-level features to improve spatial accuracy; The three hierarchical multi-scale interactive wheels are cascaded to progressively restore spatial resolution, outputting the multi-scale features of the two branches and aligning them to a unified dimension.
6. The method according to claim 1, characterized in that, The specific implementation method of the bidirectional cross-attention module in step S4 is as follows: At each scale level, feature preparation is performed using location-aware features, which are converted from spatial format to sequence format and learnable location embeddings are added to preserve spatial information. The first cross-attention branch uses the output features of the first feature extraction branch as the query and the output features of the second feature extraction branch as the key and value to calculate cross-attention. The second cross-attention branch uses the output features of the second feature extraction branch as the query and the output features of the first feature extraction branch as the key and value to calculate cross-attention. The outputs of the two branches are fused by element-wise addition after residual connection, layer normalization and feedforward network; Multi-scale information is merged through cross-layer residual connections; Spatial refinement is achieved through a convolutional block attention module.
7. An image forgery localization system based on multi-source heterogeneous information guidance, characterized in that, include: The semantic saliency guide map generation module is configured to perform semantic anomaly reasoning and visual localization processing on the RGB image to be detected, and generate a semantic saliency guide map. The noise pattern extraction module is configured to extract noise residuals from the RGB image and generate a noise pattern map. The multi-source embedding module is configured to convert the RGB image, the noise pattern map, and the semantic saliency guide map into visual tokens, noise tokens, and semantic saliency tokens in a unified feature space, respectively. A dual-branch feature extraction subnetwork is configured to extract multi-scale pyramid features through a first feature extraction branch and a second feature extraction branch set in parallel. The first feature extraction branch takes the visual token and the noise token as input, and uses the noise token as an auxiliary guide to modulate the learning of visual features in the first encoding stage; The second feature extraction branch takes the visual token and the semantic saliency token as input, and uses the semantic saliency token as an auxiliary guide to modulate visual feature learning in the first encoding stage; The hierarchical multi-scale interaction module is configured to refine the multi-scale pyramid features output by the dual-branch feature extraction subnet, extract features of different receptive fields through multiple parallel branches and perform gated fusion. The bidirectional cross-attention module is configured to perform symmetrical interaction and mutual enhancement of the two branches' features at multiple scales, realizing bidirectional information flow of verifying semantic hypotheses through noise patterns and guiding physical interpretations through semantic priors. The dual prediction head module is configured to simultaneously generate tampered region masks and edge masks based on modality-aligned features, and output fake localization results.
8. The system according to claim 7, characterized in that, The semantic saliency guidance graph generation module includes: The semantic anomaly reasoning unit is configured to analyze the RGB image from two dimensions of semantic rationality and physical consistency by combining GPT-4o with preset prompt words, and output a structured prediction result containing object description and spatial location label; The visual language localization unit is configured to use a pre-trained CLIP ViT-B / 16 model to calculate cross-modal similarity between image patch embeddings and text embeddings, and generate a spatial attention map. The location-aware modulation unit is configured to modulate the spatial attention map by constructing a continuous location mask based on the spatial location label, thereby generating the semantic saliency guidance map.
9. The system according to claim 7, characterized in that, The multi-source embedding module uses an overlapping patch embedding operation with a kernel size of 7 and a step size of 4 to segment the input into overlapping patches and project them onto the feature vector. The dual-branch feature extraction subnet adopts the SegFormer encoder architecture and extracts pyramid features through four encoding stages. In the dual-branch feature extraction subnet, the improved attention mechanism adopts an asymmetric structure: the query features are generated by fusing the query features of the guiding token and the query features of the visual token element-wise, and the key projection and value projection are calculated only from the visual token, thus achieving guided but not dominant feature learning.
10. The system according to claim 7, characterized in that: The hierarchical multi-scale interaction module includes a 1×1 convolutional branch, a 3×3 depthwise separable convolutional branch, and a 5×5 depthwise separable convolutional branch. The outputs of the three branches are fused through a progressive multiplication gating mechanism and integrate skip connections of shallow features. The bidirectional cross-attention module includes a first cross-attention branch and a second cross-attention branch. The outputs of the two branches are fused through residual connection, layer normalization, feedforward network and element-level addition. Multi-scale information is then merged through cross-layer residual connection and spatially refined through convolutional block attention module. The dual prediction head module includes a tamper mask prediction head and an edge mask prediction head, and applies supervision signals at multiple scales to optimize positioning accuracy.
