A method of attention-enhanced and adaptive frequency selection for spoofing localization

CN121937453BActive Publication Date: 2026-08-11ARTIFICIAL INTELLIGENCE INNOVATION RES INST OF ZHEJIANG UNIV OF TECH BINJIANG DISTRICT HANGZHOU
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-30
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

某些通过多频段感知与跨域交互来提升精度的方法,在面对多面部等复杂场景时仍存在局限性

Benefits of technology

[0040] This invention provides a forgery localization method based on attention enhancement and adaptive frequency selection. By introducing a multi-scale collaborative attention enhancement mechanism and optimizing the convolutional block attention architecture, it achieves precise enhancement of forgery-related features and dynamic suppression of redundant information, effectively improving the targeting and discriminative power of feature representation. The designed multi-scale context-aware convolutional unit, through the synergistic effect of heterogeneous convolutional kernels, can simultaneously capture local fine-grained features and global contextual information, thus adapting to the detection needs of forgery regions at different scales. The constructed adaptive frequency domain feature filtering mechanism, combined with discrete cosine transform and dynamic weight learning, can accurately capture implicit forgery traces in the frequency domain; simultaneously, the feature alignment strategy eliminates semantic bias and spatial misalignment in the multi-source feature fusion process. Ultimately, these improvements work together to significantly improve the accuracy of forgery localization and robustness to complex scenarios involving post-processing such as compression and blurring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121937453B_ABST
    Figure CN121937453B_ABST
Patent Text Reader

Abstract

This invention discloses a forgery localization method based on attention enhancement and adaptive frequency selection, belonging to the field of image forgery detection technology. This invention aims to solve the problems of inaccurate feature capture of forgery regions and insufficient utilization of multi-scale and frequency information in existing forgery localization techniques, resulting in poor localization accuracy and robustness. The solution includes: extracting multi-scale spatial features of the input image through an encoder; using an attention enhancement module to perform channel and spatial attention weighting on the multi-scale features to strengthen forgery-related features; employing an adaptive frequency selection module to perform discrete cosine transform and adaptive weight learning on the enhanced features, selecting effective frequency components and performing cross-domain fusion; finally, generating a localization mask for the forgery region based on the fused features. This invention can effectively improve the accuracy of locating forgery regions in images and its robustness in complex scenes, and is suitable for digital media forensics and content security review.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image forgery detection technology, and particularly relates to a forgery localization method based on attention enhancement and adaptive frequency selection. Background Technology

[0002] Forgery localization technology is a core supporting technology in the field of digital media security. It aims to accurately identify tampered or synthesized forged areas in images or videos, providing reliable technical support for critical scenarios such as media content review and network information security. With the rapid development of generative adversarial networks and intelligent image editing tools, the visual realism of forged content has greatly improved, and its methods have become increasingly multi-dimensional and complex. This presents serious challenges to forgery localization technology: on the one hand, the visual boundaries between forged and real areas are becoming increasingly blurred, making it difficult for traditional detection schemes relying on single spatial domain features to capture deep and subtle traces of tampering; on the other hand, common post-processing operations such as compression, blurring, and noise injection further conceal forgery clues, resulting in significantly insufficient generalization ability and robustness of existing methods in cross-scenario practical applications.

[0003] Existing forgery localization methods suffer from significant bottlenecks. Some solutions are limited to single-scale feature extraction in the spatial domain, failing to fully exploit the complementary value between multi-scale features and making it difficult to adapt to the detection needs of forged regions of different sizes. Other methods attempt cross-domain feature fusion, such as combining spatial RGB features with frequency domain features, but fail to deeply mine implicit forgery traces in the frequency domain and generally lack refined feature enhancement mechanisms, resulting in limited discriminative power in the final feature representation. Furthermore, during multi-source feature fusion, spatial misalignment and semantic deviations easily occur between features from different domains or scales, further restricting the improvement of localization accuracy. For example, related technologies employ fixed-pattern or fixed-scale feature fusion strategies, failing to dynamically select effective features based on specific image content and forgery techniques, resulting in poor adaptability to complex and ever-changing forgery scenarios.

[0004] Specifically, existing deep learning-based methods mostly focus on single-domain feature extraction or fixed-scale feature fusion, failing to fully utilize the complementarity of multi-scale image information. Some methods that improve accuracy through multi-band perception and cross-domain interaction still have limitations when facing complex scenes such as multiple faces. Their fixed-scale fusion strategies cannot simultaneously and effectively capture the differences in traces left by different forgery techniques, such as splicing and generation, at multiple scales. Furthermore, because they rely on pure convolutional architectures to process frequency domain features, they lack the ability to model long-distance semantic relationships, leading to an imbalance between global and local feature modeling, making it difficult to distinguish global structural contradictions between forged and real regions. Solving these problems is difficult because it requires designing a collaborative mechanism that can adaptively strengthen key features, accurately filter multi-dimensional information, and maintain feature alignment. This would improve sensitivity to subtle forgery traces while ensuring stable model performance under post-processing interference. Summary of the Invention

[0005] To address the aforementioned technical problems, this invention proposes a fake localization method with attention enhancement and adaptive frequency selection, thereby resolving the issues present in the prior art.

[0006] In a first aspect, to achieve the above objectives, the present invention provides a spoofing localization method with attention enhancement and adaptive frequency selection, comprising the following steps:

[0007] Get the input RGB image;

[0008] Multi-scale spatial features of the image are extracted using an encoder;

[0009] Attention enhancement processing is performed on the multi-scale spatial features to strengthen the feature responses associated with the forged region, thereby obtaining attention-enhanced features;

[0010] An adaptive frequency selection process is performed on the attention enhancement features to filter and enhance effective frequency components, thereby obtaining fused features;

[0011] A location mask for the forged region is generated based on the fusion features.

[0012] Optionally, the process of performing attention enhancement processing on the multi-scale spatial features includes:

[0013] For each scale of spatial features, channel attention weighting and spatial attention weighting are applied separately.

[0014] The weighted features are residually linked with the original spatial features at the corresponding scale.

[0015] Scale alignment and fusion are performed on the residual concatenation features at all scales to output a unified attention-enhanced feature.

[0016] Optionally, the process of performing adaptive frequency selection processing on the attention enhancement features includes:

[0017] The attention-enhancing features are input into parallel multi-scale convolutional branches to extract local detail features and contextual features, which are then stacked.

[0018] Perform a discrete cosine transform on the stacked features to map the spatial domain features to the frequency domain and obtain full-spectrum features;

[0019] Generate an adaptive frequency weight map corresponding to the full-spectrum features;

[0020] The full-spectrum features are weighted using the weighted graph, and the weighted result is fused with the stacked features using residual fusion to obtain fused features.

[0021] Optionally, the process of generating an adaptive frequency weight map corresponding to the full-spectrum features includes:

[0022] Perform one-dimensional convolution on the full-spectrum features to aggregate channel information;

[0023] The aggregated features are then subjected to batch normalization and Sigmoid activation function operations in sequence to generate the frequency weight map.

[0024] Optionally, the process of generating a location mask for the forged region based on the fusion features includes:

[0025] The fused features are input into the localization module, which outputs the predicted probability that each pixel belongs to the fake region.

[0026] By combining the predicted probabilities with the true labels, a composite loss function is used to optimize the model parameters.

[0027] Optionally, the composite loss function is formed by adding the Dice loss function and the Focal loss function.

[0028] Secondly, the present invention also provides a spoofing localization system with attention enhancement and adaptive frequency selection, for implementing a spoofing localization method with attention enhancement and adaptive frequency selection, the system comprising:

[0029] The feature extraction module is used to acquire the input RGB image and extract multi-scale spatial features;

[0030] An attention enhancement module, connected to the feature extraction module, is used to enhance the multi-scale spatial features to strengthen forgery-related features;

[0031] The frequency selection module, connected to the attention enhancement module, is used to filter and fuse the frequency components of the enhanced features.

[0032] The positioning output module, connected to the frequency selection module, is used to generate a positioning mask for the fake region based on the fusion features.

[0033] Thirdly, the present invention also provides a computer terminal device, comprising:

[0034] One or more processors;

[0035] A memory, coupled to the processor, for storing one or more programs;

[0036] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the attention enhancement and adaptive frequency selection fake localization method in the first aspect described above.

[0037] Fourthly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, it implements the steps of the attention enhancement and adaptive frequency selection spoofing localization method in the first aspect described above.

[0038] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the attention enhancement and adaptive frequency selection spoofing localization method described in the first aspect above.

[0039] Compared with the prior art, the present invention has the following advantages and technical effects:

[0040] This invention provides a forgery localization method based on attention enhancement and adaptive frequency selection. By introducing a multi-scale collaborative attention enhancement mechanism and optimizing the convolutional block attention architecture, it achieves precise enhancement of forgery-related features and dynamic suppression of redundant information, effectively improving the targeting and discriminative power of feature representation. The designed multi-scale context-aware convolutional unit, through the synergistic effect of heterogeneous convolutional kernels, can simultaneously capture local fine-grained features and global contextual information, thus adapting to the detection needs of forgery regions at different scales. The constructed adaptive frequency domain feature filtering mechanism, combined with discrete cosine transform and dynamic weight learning, can accurately capture implicit forgery traces in the frequency domain; simultaneously, the feature alignment strategy eliminates semantic bias and spatial misalignment in the multi-source feature fusion process. Ultimately, these improvements work together to significantly improve the accuracy of forgery localization and robustness to complex scenarios involving post-processing such as compression and blurring. Attached Figure Description

[0041] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0042] Figure 1 This is a schematic diagram of the overall architecture of the image forgery localization method according to an embodiment of the present invention;

[0043] Figure 2 This is a schematic diagram of the learnable attention enhancement module according to an embodiment of the present invention;

[0044] Figure 3 This is a flowchart of the adaptive frequency selection module in an embodiment of the present invention. Detailed Implementation

[0045] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0046] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0047] Example 1

[0048] like Figure 1 As shown, this embodiment provides a spoofing localization method with attention enhancement and adaptive frequency selection, including:

[0049] Get the input RGB image;

[0050] Multi-scale spatial features of the image are extracted using an encoder;

[0051] Attention enhancement processing is performed on the multi-scale spatial features to strengthen the feature responses associated with the forged region, thereby obtaining attention-enhanced features;

[0052] An adaptive frequency selection process is performed on the attention enhancement features to filter and enhance effective frequency components, thereby obtaining fused features;

[0053] A location mask for the forged region is generated based on the fusion features.

[0054] Figure 1 The model structure diagram shown illustrates an image forgery localization method. Starting with the input RGB image, the encoder first extracts multi-scale image features, then the attention enhancement module focuses on key features highly correlated with the forgery region, filtering out irrelevant and redundant information; subsequently, the adaptive frequency selection module selectively selects the frequency components most effective for forgery trace detection, enhancing the discriminative power of the features; finally, the localization module generates a predicted mask for the tampered region.

[0055] This paper proposes an image forgery localization method based on a progressive processing approach of "feature extraction-attention enhancement-frequency optimization-precise localization," aiming to address the problems of inaccurate feature capture of forged regions and low efficiency in multi-dimensional information fusion in existing technologies. This method fully integrates the semantic, spatial, and frequency information of the image through multi-scale feature extraction by the encoder, key feature focusing by the attention enhancement module, effective information filtering by adaptive frequency selection, and precise prediction by the localization module. It deeply captures subtle patterns in the tampered region, achieving efficient and precise localization of the forged area.

[0056] As shown in the model structure diagram, the method is divided into four core modules:

[0057] 1. Encoder module: Performs multi-scale feature extraction on the input RGB image, providing basic features with rich spatial and semantic information for subsequent processing, ensuring the comprehensiveness and hierarchy of features.

[0058] 2. Learnable Attention Enhancement Module: Based on the attention mechanism, the features output by the encoder are weighted and enhanced, highlighting key features related to the forgery region and suppressing irrelevant background information, so as to achieve accurate focus on forgery features and improve the discriminativeness of features.

[0059] 3. Adaptive Frequency Selection Module: Based on the different contributions of different frequency components in the image to forgery detection, it adaptively selects and enhances effective frequency components, filters out invalid or interfering frequency information, further optimizes the effectiveness of features, and enables the model to better capture the detailed patterns of forged regions.

[0060] 4. Localization Module: Based on the fusion features processed by the preceding modules, a prediction mask for the tampered area is generated, enabling accurate localization of the forged area in the image and outputting intuitive and accurate results of the forged area.

[0061] As one implementation method in this embodiment, the process of performing attention enhancement processing on the multi-scale spatial features includes:

[0062] For each scale of spatial features, channel attention weighting and spatial attention weighting are applied separately.

[0063] The weighted features are residually linked with the original spatial features at the corresponding scale.

[0064] Scale alignment and fusion are performed on the residual concatenation features at all scales to output a unified attention-enhanced feature.

[0065] The image forgery localization method proposed in this invention uses ResNet as the core encoder and constructs a progressive processing framework of "multi-scale feature extraction - learnable attention enhancement - precise localization," aiming to solve the problems of insufficient capture of key features of forged regions and localization accuracy being affected by background interference in existing technologies. Among them, the learnable attention enhancement module is the core hub connecting the encoder feature output and the subsequent localization module, undertaking the core role of "feature selection - key enhancement - multi-scale fusion."

[0066] Specifically, the encoder first extracts four basic features at different scales from the input RGB image. These features cover multi-dimensional information at 1 / 4, 1 / 8, 1 / 8, and 1 / 8 scales of the original image, including spatial structure, texture details, and high-level semantic context, providing a comprehensive and hierarchical feature foundation for subsequent attention enhancement. The core value of the learnable attention enhancement module lies in addressing issues such as background redundancy and low recognition of forged features in the multi-scale features extracted by ResNet. It uses a branched attention mechanism to precisely "filter" features at each scale, highlighting key features strongly correlated with forged regions while suppressing irrelevant background information. Then, through feature alignment and deep fusion, it integrates the effective information after multi-scale attention enhancement to generate more discriminative and targeted enhanced features. This provides strong feature support for the final localization module to generate a high-precision tamper mask, significantly improving the model's ability to identify and locate forged traces in complex scenes.

[0067] Reference Figure 2 Learnable attention enhancement module Figure 2 The specific structure of the learnable attention enhancement module is demonstrated. Multi-scale features F1 to F4 from the encoder are fed into four identical processing branches in parallel. Within each branch, the input features first pass through a convolutional block attention module, which computes channel attention weights and spatial attention weights in parallel. These weights are then combined to weight the original input features. The weighted features are then added to the original input features via residual connections. Subsequently, each branch undergoes scale alignment through a unit consisting of convolutional layers and batch normalization layers. Finally, the aligned features from all branches are fused through element-wise multiplication and residual accumulation, then processed by a 3x3 convolutional layer and a ReLU activation function to output the final attention-enhanced features. The specific implementation flow is as follows:

[0068] 1. Multi-scale feature input:

[0069] Input: The input features are derived from the multi-scale feature output of the encoder (ResNet), which extracts the feature information of the input RGB image step by step through a four-layer core convolution and pooling structure.

[0070] Output: Feature maps at four scales are output in total. These correspond to 1 / 4, 1 / 8, 1 / 8, and 1 / 8 of the original input image resolution, respectively.

[0071] 2. Enhanced multi-branch attention:

[0072] The module adopts a parallel design of "one scale, one branch," with four branches having completely identical structures. Each branch performs targeted enhancement on the features of its corresponding scale. The specific steps are as follows:

[0073] Step 1: Two-Dimensional Attention Weight Generation. Each branch has a built-in CBAM (Convolutional Block Attention Module), which generates a feature-specific weight map through two-dimensional modeling: "Channel Attention (CA) + Spatial Attention (SA)".

[0074] Channel attention branch: for input features Perform global average pooling (GAP) and global max pooling (GMP) to obtain global channel information. general The two are concatenated and then input into a two-layer fully connected network, where 1 and These represent the fully connected mappings of the first and second layers, respectively. Represents the linear rectified activation function, after... Activate and generate channel weight vectors:

[0075]

[0076] This is used to quantify the importance of each channel for counterfeit detection, strengthen key channels, and suppress redundant channels.

[0077] Spatial attention branch: channel-weighted features Perform average pooling and max pooling along the channel dimension, and concatenate them to obtain a 2-channel feature map. A spatial weight map is generated by compressing the dimension through 1×1 convolution and then activating it with Sigmoid. Accurately locate the spatial position of the forged area and improve the feature response of the area.

[0078] Step 2: First, multiply the two-dimensional weights element by element:

[0079]

[0080] The final attention weight map is obtained; then it is compared with the original input features of the current branch. Perform element-wise weighted summation, where... This represents the element-wise multiplication operation:

[0081]

[0082] Key feature enhancement is implemented; finally, residual connections are introduced:

[0083]

[0084] in, This represents an element-wise multiplication operation that preserves the basic information of the original features while incorporating key attention enhancement patterns, thus avoiding information loss during feature enhancement.

[0085] Step 3: Feature Alignment Processing: Due to the differences in resolution between features at different scales, in order to ensure the effectiveness of subsequent fusion, each branch adjusts the spatial scale consistency through CB(Conv+BactchNorm) after residual fusion, and the output features are uniformly adjusted to the intermediate scale to obtain aligned features.

[0086] 3. Multi-branch feature fusion stage:

[0087] Fusion Strategy: The four aligned attention-enhanced features are fed into the fusion module, and a combination of "element-wise multiplication + residual accumulation" is adopted for fusion. First, the four feature maps are multiplied element-wise to amplify the common key information in the features at each scale. Then, the multiplication result is residually connected with the element-wise accumulation result of the four feature maps to integrate the unique and effective information at each scale and avoid information loss during the feature fusion process.

[0088] Output: After fusion, the feature context is further integrated through a 3×3 convolution layer, and then nonlinearity is introduced through the ReLU activation function. The final output is an attention-enhanced feature map with dimension C and a resolution of 1 / 8 of the original image. This feature map not only preserves the hierarchical information of multi-scale features, but also highlights the key patterns of the forged region through an attention mechanism, providing highly discriminative and targeted feature input for the mask generation of the subsequent localization module.

[0089] As one implementation method in this embodiment, the process of performing adaptive frequency selection processing on the attention enhancement feature includes:

[0090] The attention-enhancing features are input into parallel multi-scale convolutional branches to extract local detail features and contextual features, which are then stacked.

[0091] Perform a discrete cosine transform on the stacked features to map the spatial domain features to the frequency domain and obtain full-spectrum features;

[0092] Generate an adaptive frequency weight map corresponding to the full-spectrum features;

[0093] The full-spectrum features are weighted using the weighted graph, and the weighted result is fused with the stacked features using residual fusion to obtain fused features.

[0094] As one implementation method in this embodiment, the process of generating an adaptive frequency weight map corresponding to the full-spectrum features includes:

[0095] Perform one-dimensional convolution on the full-spectrum features to aggregate channel information;

[0096] The aggregated features are then subjected to batch normalization and Sigmoid activation function operations in sequence to generate the frequency weight map.

[0097] Specifically, the adaptive frequency selection module, as a key step in the image forgery localization process, optimizes features from the frequency dimension for the attention-enhanced feature map, addressing the problems of insufficient utilization of multi-frequency information in the forgery region and strong interference from different frequency components in existing technologies. The overall process follows the main thread of "multi-scale convolutional feature extraction - discrete cosine transform (DCT) - frequency weight learning - feature enhancement." By adaptively selecting the frequency components of the feature map, it strengthens the frequency information strongly correlated with forgery traces and suppresses interfering frequency components, providing more discriminative frequency domain feature support for the final localization module.

[0098] Reference Figure 3 Adaptive frequency selection module Figure 3 The processing flow of the adaptive frequency selection module is demonstrated. The attention-enhancing features are split into two parts, each input to one of two parallel convolutional branches: one branch uses a 3x3 convolution, GeLU activation function, and 1x1 convolution; the other branch uses a 5x5 convolution, GeLU activation function, and 1x1 convolution. The output features of the two branches are stacked to obtain features that fuse multi-scale information. These features are then convolved with a fixed discrete cosine transform kernel to transform them into the frequency domain, obtaining full-spectrum features. The full-spectrum features are then passed through a lightweight weight prediction network, which sequentially includes 1x1 convolutions, batch normalization layers, and a sigmoid activation function to generate an adaptive frequency weight map. This weight map is used to weight the full-spectrum features, which are then residually fused with the previously stacked multi-scale features to output the optimized features. The specific implementation flow is as follows:

[0099] 1. Multi-scale convolution feature extraction stage:

[0100] Let the input feature map be The module first performs channel splitting, dividing the input channel into two parallel branches:

[0101] Branch 1: Local detail features are extracted using 3×3 convolution, then non-linearity is introduced using the GeLU activation function, and finally the number of channels is compressed using 1×1 convolution to output the feature map. :

[0102]

[0103] Branch 2: Extract contextual features with a larger receptive field through 5×5 convolution, then introduce non-linearity through the GeLU activation function, and finally compress the number of channels through 1×1 convolution to output the feature map. :

[0104]

[0105] right and The stacking operation is performed to obtain a feature map that fuses multi-scale convolutional information. .

[0106] 2. Discrete Cosine Transform:

[0107] Based on the mathematical properties of DCT, the module adopts non-trainable fixed kernel convolution. This achieves the conversion from the spatial domain to the frequency domain, avoiding the repetitive floating-point operations of traditional DCT, while covering the entire spectrum information:

[0108] DCT Basis Functions and Fixed Kernel Design: The basis functions of a two-dimensional DCT are defined as follows:

[0109]

[0110] in , Spatial domain coordinates, , These are frequency domain coordinates. Based on this basis function, a fixed convolution kernel is pre-calculated and generated. freq represents the number of frequency components, which matches the feature map size, and is determined by this fixed kernel. and Performing convolution operations is equivalent to channel-by-channel 2D DCT transformation.

[0111] Full-spectrum feature generation: implement The operation maps spatial domain features to the frequency domain, generating full-spectrum features. This feature covers the entire frequency band from low to high frequencies: low-frequency components correspond to the global structure of the feature, mid-frequency components correspond to the local structural transitions, and high-frequency components correspond to detailed textures and abrupt changes. Global Average Pooling (GAP), widely used in traditional attention modules, is essentially the lowest frequency component of DCT. Special case. Substituting this into its DCT transform formula:

[0112]

[0113] It is evident that GAP only captures single low-frequency information, while this module... By extracting full-spectrum features, the frequency band limitations of traditional spatial attention are overcome, achieving more comprehensive frequency information coverage.

[0114] 3. Adaptive frequency weight learning stage:

[0115] To accurately filter effective frequency components related to forgery identification, a lightweight weighted prediction network is designed. Learning frequency weighting graph Channel information interaction: First, through 1×1 convolution pairs Channel-dimensional information is aggregated to strengthen the correlation between channels of different frequencies, while maintaining the feature map size. The feature distribution is standardized using a BatchNorm layer to improve the stability of weight learning; subsequently, a Sigmoid activation function is applied. Map the output to the [0,1] interval to generate a frequency weight map. BN stands for BatchNorm layer.

[0116]

[0117] 4. Frequency enhancement and cross-domain feature fusion output stage:

[0118] Effective frequencies are enhanced through weighted optimization, and the optimized frequency features are mapped back to the spatial domain and fused with the original input features to generate the final enhanced features: Frequency component weighted enhancement: The frequency weight map is then used to enhance the effective frequencies. With full spectrum characteristics Performing element-wise multiplication means:

[0119]

[0120] This operation significantly enhances the feature response of high-weight effective frequencies by assigning weights, while suppressing low-weight interfering frequencies, thus focusing the features on the frequency information related to forgery.

[0121] 5. Residual Cross-Domain Fusion: To avoid losing fundamental information about the original spatial features during frequency domain optimization, residual connections are introduced to... Features of the original input module To merge, that is:

[0122]

[0123] This feature map combines the structural integrity of the spatial domain with the full-spectrum discriminativeness of the frequency domain. It retains the key spatial features highlighted by the preceding attention module, and enhances the multi-band information corresponding to subtle forgery traces through full-spectrum extraction and adaptive filtering. It effectively suppresses background redundancy and noise interference, providing more robust and discriminative feature inputs for the subsequent localization module to generate a high-precision tamper mask.

[0124] As one implementation method in this embodiment, the process of generating a location mask for the forged region based on the fusion features includes:

[0125] The fused features are input into the localization module, which outputs the predicted probability that each pixel belongs to the fake region.

[0126] By combining the predicted probabilities with the true labels, a composite loss function is used to optimize the model parameters.

[0127] As one implementation method in this embodiment, the composite loss function is formed by adding the Dice loss function and the Focal loss function.

[0128] Specifically, positioning is performed based on the positioning module, and the detailed process includes:

[0129] Loss function: By combining Dice loss and Focal loss, the imbalance between positive and negative samples in semantic segmentation tasks is addressed, while improving the model's ability to learn from difficult samples. Dice loss is used to improve the intersection-over-union (IoU) ratio of segmented regions, while Focal loss enhances the model's attention to tampered regions (positive samples), ensuring that the model can accurately locate tampered regions even in complex scenes.

[0130] Input: Predicted label Represents the predicted probability of each pixel, and the true label. This represents the true label of each pixel in the sample image (0 indicates an unaltered region, 1 indicates an altered region), and its shape is similar to... same.

[0131] Processing: Dice loss is commonly used in semantic segmentation tasks to optimize the intersection-union ratio (IUU) between the predicted mask and the ground truth mask. It is defined as follows:

[0132]

[0133] Where and are the predicted label and the ground truth label for each pixel in the sample image, respectively. This represents the summation over all pixels. Dice loss improves segmentation accuracy by minimizing the difference between the predicted and the true mask.

[0134] Focal loss calculation: To address the imbalance in the distribution of positive and negative samples, Focal loss is used to enhance the model's ability to learn from difficult samples (such as tampered regions). It is defined as follows:

[0135]

[0136] in, and These are hyperparameters used to adjust the weights of the loss. Controlling the balance between positive and negative samples, This makes the model focus more on difficult samples. Focal loss enhances the model's ability to detect tampered regions by reducing the weight of easily classified samples. The total loss function is:

[0137]

[0138] Based on this, the present invention provides a forgery localization method with attention enhancement and adaptive frequency selection. By introducing a multi-scale collaborative attention enhancement mechanism and optimizing the design of the convolutional block attention architecture, it achieves precise enhancement of forgery-related features and dynamic suppression of redundant information, effectively improving the targeting and discriminative power of feature representation. The designed multi-scale context-aware convolutional unit, through the synergistic effect of heterogeneous convolutional kernels, can simultaneously capture local fine-grained features and global contextual information, thereby adapting to the detection requirements of forgery regions at different scales. The constructed adaptive frequency domain feature filtering mechanism, combined with discrete cosine transform and dynamic weight learning, can accurately capture implicit forgery traces in the frequency domain; at the same time, the feature alignment strategy eliminates semantic bias and spatial misalignment in the multi-source feature fusion process. Ultimately, these improvements work together to significantly improve the accuracy of forgery localization and robustness to complex scenarios involving compression, blurring, and other post-processing.

[0139] Example 2

[0140] In this embodiment, a computer terminal device is provided, including:

[0141] One or more processors;

[0142] A memory, coupled to the processor, for storing one or more programs;

[0143] When the one or more programs are executed by the one or more processors, the one or more processors implement the steps of the above-described attention enhancement and adaptive frequency selection spoofing localization method.

[0144] In this embodiment, a computer-readable storage medium is also provided, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps of the above-described attention enhancement and adaptive frequency selection spoofing localization method.

[0145] In this embodiment, an electronic device is also provided, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the steps of the above-described attention enhancement and adaptive frequency selection spoofing localization method.

[0146] In this embodiment, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the above-described spoofing localization method with attention enhancement and adaptive frequency selection.

[0147] The aforementioned program can run on a processor or be stored in memory (or a computer-readable medium). Computer-readable media includes both permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random-access memory (SRAM), dynamic random-access memory (DRAM), other types of random-access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.

[0148] These computer programs may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes can be implemented by different modules for different steps.

[0149] This embodiment provides such an apparatus or system. The system, referred to as an attention-enhanced and adaptive frequency-selective spoofing localization system, includes:

[0150] The feature extraction module is used to acquire the input RGB image and extract multi-scale spatial features;

[0151] An attention enhancement module, connected to the feature extraction module, is used to enhance the multi-scale spatial features to strengthen forgery-related features;

[0152] The frequency selection module, connected to the attention enhancement module, is used to filter and fuse the frequency components of the enhanced features.

[0153] The positioning output module, connected to the frequency selection module, is used to generate a positioning mask for the fake region based on the fusion features.

[0154] As one implementation method in this embodiment, the attention enhancement module includes:

[0155] A multi-branch attention unit is used to perform channel attention weighting and spatial attention weighting on spatial features at each scale respectively;

[0156] The residual fusion unit, connected to the multi-branch attention unit, is used to perform residual connections between the weighted features and the original features;

[0157] The feature alignment and aggregation unit, connected to the residual fusion unit, is used to perform scale alignment and fusion on features at all scales, and output a unified attention-enhanced feature.

[0158] As one implementation method in this embodiment, the frequency selection module includes:

[0159] Multi-scale convolutional units are used to extract local detail features and contextual features through parallel convolutional branches and stack them.

[0160] A frequency domain transformation unit, connected to the multi-scale convolution unit, is used to perform a discrete cosine transform on the stacked features to obtain full-spectrum features;

[0161] A weight learning unit, connected to the frequency domain transformation unit, is used to generate an adaptive frequency weight map;

[0162] The frequency domain enhancement and fusion unit connects the weight learning unit and the multi-scale convolution unit, and is used to weight the full-spectrum features using the weight map and perform residual fusion of the result with the stacked features.

[0163] As one implementation method in this embodiment, the weight learning unit includes:

[0164] The channel aggregation subunit is used to perform one-dimensional convolution on the full-spectrum features to aggregate channel information.

[0165] The weight generation subunit, connected to the channel aggregation subunit, is used to sequentially perform batch normalization and Sigmoid activation function operations to generate a frequency weight map.

[0166] As one implementation method in this embodiment, the positioning output module includes:

[0167] A mask prediction unit is used to convert the fused features into a predicted probability that each pixel belongs to a fake region.

[0168] The loss calculation and optimization unit, connected to the mask prediction unit, is used to combine the predicted probability and the real label, calculate the loss and optimize the system parameters through a composite loss function.

[0169] As one implementation method in this embodiment, the composite loss function used in the loss calculation and optimization unit is composed of the Dice loss function and the Focal loss function.

[0170] The system or apparatus is used to implement the functions of the methods in the above embodiments. Each module in the system or apparatus corresponds to each step in the method, as has been described in the method and will not be repeated here.

[0171] The above implementation method solves the problem of fake localization in attention enhancement and adaptive frequency selection in related technologies, thereby ensuring that the problems existing in the prior art are resolved.

[0172] The above are merely preferred embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A spoofing localization method with attention enhancement and adaptive frequency selection, characterized in that, Includes the following steps: Get the input RGB image; Multi-scale spatial features of the image are extracted using an encoder; Attention enhancement processing is performed on the multi-scale spatial features to strengthen the feature responses associated with the forged region, thereby obtaining attention-enhanced features; An adaptive frequency selection process is performed on the attention enhancement features to filter and enhance effective frequency components, thereby obtaining fused features; The process of performing adaptive frequency selection processing on the attention-enhancing features includes: The attention-enhancing features are input into parallel multi-scale convolutional branches to extract local detail features and contextual features, which are then stacked. The input feature map is divided into two parallel branches. The first branch extracts local detail features through a 3x3 convolution, then introduces non-linearity through the GeLU activation function, and finally compresses the number of channels through a 1×1 convolution to output the feature map. : ; The second branch extracts contextual features through a 5x5 convolution, then introduces non-linearity using the GeLU activation function, and finally compresses the number of channels through a 1×1 convolution to output the feature map. : ; The outputs of the two branches are stacked to obtain the stacked features. Perform a discrete cosine transform on the stacked features to map the spatial domain features to the frequency domain and obtain full-spectrum features; The discrete cosine transform is implemented through non-trainable fixed-kernel convolution, and its basis function is defined as: ; Performing convolution operations using a fixed kernel convolution and stacked features is equivalent to a channel-wise 2D DCT transformation. Generate an adaptive frequency weight map corresponding to the full-spectrum features; The full-spectrum features are weighted using the weight map, and the weighted result is fused with the stacked features using residual fusion to obtain the fused features; The process of generating an adaptive frequency weight map corresponding to the full-spectrum features includes: Perform one-dimensional convolution on the full-spectrum features to aggregate channel information; Batch standardization and Sigmoid activation function operations are sequentially performed on the aggregated features to generate the frequency weight map; A location mask for the forged region is generated based on the fusion features; The process of generating a location mask for the forged region based on the fusion features includes: The fused features are input into the localization module, which outputs the predicted probability that each pixel belongs to the fake region. By combining the predicted probabilities with the true labels, a composite loss function is used to optimize the model parameters; The composite loss function is formed by adding the Dice loss function and the Focal loss function; Input: Predicted label Represents the predicted probability of each pixel, and the true label. This represents the true label for each pixel in the sample image; Processing: Dice loss is commonly used in semantic segmentation tasks to optimize the intersection-union ratio (IUU) between the predicted and ground truth masks. ; in, This represents summing over all pixels; Focal loss calculation: ; in, and These are hyperparameters used to adjust the weights of the loss. Controlling the balance between positive and negative samples, To make the model focus more on difficult samples, the overall loss function is: 。 2. The method according to claim 1, characterized in that, The process of performing attention enhancement processing on the multi-scale spatial features includes: For each scale of spatial features, channel attention weighting and spatial attention weighting are applied separately. The weighted features are residually linked with the original spatial features at the corresponding scale. Scale alignment and fusion are performed on residual concatenation features at all scales to output unified attention-enhanced features.

3. A fake localization system with attention enhancement and adaptive frequency selection, characterized in that, The system for implementing the method according to any one of claims 1-2 comprises: The feature extraction module is used to acquire the input RGB image and extract multi-scale spatial features; An attention enhancement module, connected to the feature extraction module, is used to enhance the multi-scale spatial features to strengthen forgery-related features; The frequency selection module, connected to the attention enhancement module, is used to filter and fuse the frequency components of the enhanced features. The positioning output module, connected to the frequency selection module, is used to generate a positioning mask for the fake region based on the fusion features.

4. A computer terminal device, characterized in that, include: One or more processors; A memory, coupled to the processor, for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors perform the steps of the method as described in any one of claims 1-2.

5. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1-2.

6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-2.

Citation Information

Patent Citations

  • Attention mechanism driven digital image tampering detection system

    CN121280863A