JPEG (Joint Photographic Experts Group) compressed image tampering positioning method based on self-supervised data enhancement strategy

By using a compression proxy network based on a self-supervised data augmentation strategy and a dual attention mechanism, JPEG compression operation is simulated and the attention mechanism of the tamper location network is enhanced, thus solving the problem of insufficient robustness of existing methods under JPEG compression and achieving high-precision image tamper location.

CN121661476APending Publication Date: 2026-03-13GUANGZHOU UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-24
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

Existing image tampering localization methods are not robust enough under JPEG compression interference, making it difficult to effectively capture tampering effects and characterize the statistical jump characteristics of tampering edges. Traditional data augmentation strategies may weaken or destroy tampering traces, increase the difficulty of model training, and reduce localization performance.

Method used

A JPEG compressed image tampering localization method based on self-supervised data augmentation strategy is adopted. A compression proxy network based on dual attention mechanism is designed to simulate JPEG compression operation, and multiple attention mechanisms are introduced into the tampering localization network to enhance the ability to focus on the features of the tampered area. Spatiotemporal feature extraction and localization are performed using a dual-domain multi-attention tampering localization network.

Benefits of technology

The model's robustness to JPEG compression and accuracy in tamper location have been improved, enabling it to better detect subtle forgery traces under complex forgery methods and achieve high-precision tamper location.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121661476A_ABST
    Figure CN121661476A_ABST
Patent Text Reader

Abstract

The invention discloses a JPEG (Joint Photographic Experts Group) compressed image tampering positioning method based on a self-supervised data enhancement strategy. The method comprises a compression proxy network based on a double-attention mechanism and a double-domain multi-attention tampering positioning network; wherein the compression proxy network based on the double attention mechanism is trained by utilizing self-supervised learning; and the double-domain multi-attention tampering positioning network is trained by using the tampered image after data enhancement. Aiming at the defect of the existing method in anti-JPEG compression robustness, a compression proxy network based on a double-attention mechanism is designed, a self-supervised learning normal form is used for training, and an improved JPEG proxy image with a universal JPEG compression characteristic is generated, so that data enhancement is realized; on the basis, an improved JPEG proxy image is used for training a double-domain multi-attention tampering positioning network, and the tampering positioning accuracy under JPEG compression interference is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of image processing, specifically relating to a method for locating tampering in JPEG compressed images based on a self-supervised data augmentation strategy. Background Technology

[0002] With the rapid development of image processing technology, image tampering techniques have also become increasingly sophisticated, posing a significant challenge to the authenticity of image content, especially in social media platforms and the field of electronic evidence. Currently, the mainstream method for locating image tampering is to utilize deep learning technology for pixel-level image classification. For example, convolutional neural networks (CNNs) can be used to automatically extract residual noise or boundary statistical transition features related to forgery effects from large-scale image data, thereby achieving high-precision tampering location.

[0003] In image tampering localization, data augmentation is an important means to improve the robustness of the model, such as common data augmentation strategies based on geometric transformation, color perturbation, and noise injection. To improve the robustness of the network model against JPEG compression, image tampering localization methods usually employ JPEG compression with random quality factors in data augmentation; or they utilize custom-designed multiple convolutional layers to simulate JPEG compression, thereby randomly compressing and interfering with uncompressed images.

[0004] Despite significant advancements in existing image tampering localization techniques, current deep neural network-based methods lack robustness against JPEG compression interference. In terms of network structure, existing image tampering localization networks struggle to effectively capture the tampering effects following JPEG compression and fail to adequately characterize the statistical transitions at tampering edges. Regarding data augmentation strategies, weak, localized tampering traces differ from the strong semantic signals identified in computer vision tasks; they are weak signals hidden within the image content. Complex image content presents strong noise interference in tampering localization tasks. Therefore, traditional general data augmentation strategies such as geometric transformations, noise injection, or color perturbations may weaken or even destroy the original tampering traces in image tampering localization, increasing model training difficulty and reducing tampering localization performance. Summary of the Invention

[0005] The main objective of this invention is to overcome the shortcomings and deficiencies of existing technologies and provide a JPEG compressed image tampering localization method based on a self-supervised data augmentation strategy. In terms of data augmentation strategy, a compression proxy network based on a dual attention mechanism is designed to simulate JPEG compression operations under different quality factors, thereby performing data augmentation on uncompressed training images. In the tampering localization network, multiple attention mechanisms are introduced to enhance the network model's ability to focus on the features of the tampered region, further improving the tampering localization accuracy.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for locating tampering in JPEG compressed images based on a self-supervised data augmentation strategy, comprising the following steps: A compression proxy network based on a dual attention mechanism is used to perform self-supervised learning on the training set to obtain an augmented dataset, including tampered images with JPEG compression characteristics under various quality factors; the compression proxy network based on the dual attention mechanism includes a convolutional block attention module and a context anchor attention module. A dual-domain multi-attention tampering localization network is used to extract spatiotemporal features from an augmented dataset, and to locate tampering edges and regions in the tampered image based on these features. The dual-domain multi-attention tampering localization network includes a dual-branch feature extraction module and a multi-attention localization module. The dual-branch feature extraction module includes a spatial domain branch and a frequency domain branch, and the multi-attention localization module includes a tampering region localization branch and a tampering edge detection branch.

[0007] As a preferred technical solution, the compressed proxy network based on the dual attention mechanism is an improved U-Net, which includes an encoder and a decoder; Each level of the encoder is configured with several cascaded 3×3 convolutional layers. After downsampling, each level of the encoder is connected to a convolutional block attention module and a pooling layer. The convolutional block attention module is fused with the feature maps output by each level of the convolutional layer through residual connections to obtain deep semantic features. Each level of the decoder is configured with several cascaded 3×3 convolutional layers and deconvolutional layers. The output of the deconvolutional layer is concatenated with the feature map of the corresponding size of the encoder. The concatenated feature map is connected to the context anchor attention module, and the decoder outputs the reconstructed image.

[0008] As a preferred technical solution, the convolutional block attention module includes a channel attention module and a spatial attention module. The channel attention module extracts channel feature representations through global average pooling and max pooling, obtains channel attention maps using a shared multilayer perceptron, and multiplies them channel by channel with the input feature map. The channel compressed feature map is obtained through a sigmoid activation function. The spatial attention module performs max pooling and average pooling on the channel compressed feature map, applies a 7×7 convolution after feature concatenation, and obtains a spatial attention map through a sigmoid activation function.

[0009] As a preferred technical solution, the context anchor attention module performs an average pooling operation with a kernel size of 7×7 on the input feature map, then compresses and transforms the channel dimension information through a 1×1 convolution, and then performs a 1×k convolution in the horizontal direction, a k×1 convolution in the vertical direction, and a 1×1 convolution, and finally obtains the attention map using the Sigmoid activation function.

[0010] As a preferred technical solution, the decoder is optimized by calculating the L1 loss between the reconstructed image and the real JPEG image.

[0011] As a preferred technical solution, the spatial branch and the frequency branch respectively acquire spatial features and frequency features, the spatial features and frequency features are concatenated along the channel dimension, and a fused feature is obtained through a convolutional layer; the spatial branch includes spatial convolution and several residual modules, the frequency branch includes frequency convolution and several residual modules, and the frequency convolution is a convolution operation based on Bayar constraints.

[0012] As a preferred technical solution, a residual module connected to spatial domain convolution or frequency domain convolution is used as a residual module with an ordinal number of 1. The residual module with an ordinal number includes two cascaded 3×3 convolutions and one 1×1 convolution. The cascaded 3×3 convolutions and the 1×1 convolution are connected in parallel with residuals. The residual module with an even ordinal number includes two cascaded 3×3 convolutions and is connected to the input feature residual of the residual module.

[0013] As a preferred technical solution, the forged region localization branch passes the spatiotemporal features through a spatial attention module, a channel attention module, a pixel attention module, and spatial pyramid pooling, and upsamples them to the same resolution as the original image through bilinear interpolation to obtain a fused feature map. The feature loss is calculated on the fused feature map, and the Softmax activation function of the channel dimension is used to obtain a forged region probability map. The feature loss is calculated using the smooth cross-entropy loss function for network training, as shown in the following formula: , in, Represents the smoothing factor. This indicates the corresponding true class in the model's prediction. y The predicted probability, Indicating the prediction of the model, the first C Predicted probability of class C It represents the total number of categories.

[0014] As a preferred technical solution, the fake edge detection branch includes a multi-attention module and spatial pyramid pooling. The spatiotemporal features are passed through the multi-head attention module and spatial pyramid pooling, and then upsampled to the same resolution as the original image through bilinear interpolation to obtain a fine edge prediction result. The edge loss is calculated on the edge prediction result to obtain a fake edge probability map. The calculation of the edge loss is performed by training the model using an edge loss function based on the Dice coefficient, as shown in the following formula: , in, and y i They represent the first i The model's predicted output value and the true label value at each pixel. This represents the smoothing factor.

[0015] As a preferred technical solution, the multi-head attention module includes multiple attention heads. The spatiotemporal features are processed through three sets of learnable linear transformations to obtain a query matrix, a key matrix, and a value matrix. The three matrices are divided into multiple subspaces along the feature dimensions. Each attention head calculates its attention weight in its corresponding subspace through dot product, scaling, and softmax activation function operations. The weight is then multiplied by the corresponding value matrix to obtain the attention head output. The outputs of all attention heads are concatenated and integrated through a linear transformation to obtain the multi-head attention module output.

[0016] Compared with the prior art, the present invention has the following advantages and beneficial effects: (1) The present invention exhibits strong robustness against JPEG compression. Existing image tampering localization methods typically employ JPEG compression with random quality factors or specific convolutional layers that simulate JPEG compression to improve JPEG compression robustness. This invention proposes a data augmentation strategy based on a compression proxy network, utilizing self-supervised learning to generate improved JPEG proxy images. This method constructs a compression proxy network based on a dual-attention mechanism that integrates CBAM and CAA to better simulate JPEG compression operations with random quality factors. This network takes an uncompressed image as input and generates an improved JPEG proxy image with general JPEG compression characteristics. Adding such images as data augmentation during network training improves the model's robustness against JPEG compression more effectively than using JPEG compressed images with specific quality factors.

[0017] (2) The accuracy of tamper location in this invention is high. Most existing tamper location networks use a single attention mechanism, which makes it difficult to extract highly discriminative forgery features when detecting complex forgery methods (such as a mixture of multiple tampering types, weak forgery traces, etc.). To improve the network model's ability to extract fine-grained forgery features, this invention introduces multiple complementary attention mechanisms, designing SAB, PAB, and CAB attention modules in the region feature extraction branch. Among them, SAB is used to enhance the model's attention to salient regions in the image, PAB improves the response to local forgery traces, and CAB strengthens the feature correlation between channels. Through the synergistic fusion of the three, the model can more comprehensively mine the discriminative features of the forgery region and achieve high-precision location of complex forgery regions. Attached Figure Description

[0018] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 This is a diagram of the compressed proxy network structure based on the dual attention mechanism in an embodiment of the present invention. Figure 2 This is a structural diagram of the CBAM attention module according to an embodiment of the present invention; Figure 3 This is a structural diagram of the channel attention module and the spatial attention module according to an embodiment of the present invention; Figure 4 This is a structural diagram of the CAA attention module according to an embodiment of the present invention; Figure 5 This is a diagram of the dual-domain multi-attention tampering localization network structure according to an embodiment of the present invention; Figure 6 This is a structural diagram of the SAB structure according to an embodiment of the present invention. Figure 7 This is a structural diagram of the CAB according to an embodiment of the present invention; Figure 8 This is a structural diagram of PAB according to an embodiment of the present invention; Figure 9 This is a structural diagram of the multi-head attention module according to an embodiment of the present invention; Figure 10 This is a schematic diagram of the model training phase in an embodiment of the present invention; Figure 11 This is a schematic diagram of the deployment phase of the implementation model of the present invention; Figure 12 This is a comparison diagram of the various methods implemented in this invention. Detailed Implementation

[0020] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present application without creative effort are within the scope of protection of the present application.

[0021] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a mutually exclusive, independent, or alternative embodiment. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments.

[0022] Please see Figure 1 This embodiment provides a method for locating JPEG compressed image tampering based on a self-supervised data augmentation strategy, including: training a compression proxy network based on a dual-attention mechanism using self-supervised learning to achieve a self-supervised data augmentation strategy; and training a dual-domain multi-attention tampering localization network using the data-augmented tampered image to improve the robustness of the network model against JPEG compression.

[0023] To implement a data augmentation strategy for image tampering localization and improve the robustness of the tampering localization network against JPEG compression, this embodiment designs a compression proxy network structure based on a dual attention mechanism, as follows: Figure 1 As shown, this network model improves upon the symmetric encoder-decoder structure of U-Net by adding context anchor attention modules in the encoder's convolutional block attention module and in the decoder, thereby generating an improved JPEG proxy image with general JPEG compression characteristics. This means the image incorporates JPEG compression features at various quality factors. The specific settings are as follows: (1) Encoder: The encoder consists of a five-layer structure. Each layer includes two cascaded convolutional layers (kernel size 3×3, stride 1) and a 2×2 max pooling layer (stride 2). To enhance the expressive power of the encoded features, a Convolutional Block Attention Module (CBAM) is introduced after each downsampling operation. This module effectively enhances the model's response to key regions by jointly modeling channel attention and spatial attention. The output of the CBAM module is fused with the feature maps output by each convolutional layer through residual connections, which preserves the information of the original features and enhances the attention to potential tampering regions. As the network deepens, the spatial resolution of the feature maps gradually decreases, while the number of channels increases layer by layer, so that the input image (size 256×256×3) is finally encoded into deep semantic features of size 16×16×256.

[0024] (2) Decoder: The decoder's structure is symmetrical to the encoder. Each layer contains a deconvolution layer (2×2 kernel size, stride 2) to double the spatial size of the feature map and concatenate it with the corresponding feature map from the encoder to preserve detail. Subsequently, a Context Anchor Attention (CAA) module is introduced to further model global context information, highlighting key features related to the tampered region and suppressing redundant content interference. The attention-enhanced feature map is then further fused through two convolutional layers. Finally, the decoder outputs a reconstructed image with the same spatial size as the input image. See again. Figure 1 On the right, the uncompressed tampered image input to the compressed proxy network and the generated improved JPEG proxy image are shown as follows: I and I 1 Using the standard JPEG compression algorithm... I Perform JPEG compression with a random quality factor to obtain a JPEG compressed image. I 2 Therefore, by minimizing I 1 and I 2 The network is trained using the L1 loss between the two methods.

[0025] (3) CBAM attention module: such as Figure 2 and Figure 3As shown, the CBAM attention module includes a channel attention module and a spatial attention module, aiming to enhance the expressive power of feature maps by jointly modeling attention mechanisms in both channel and spatial dimensions. This module first extracts channel feature representations through global average pooling and max pooling, generates channel attention maps using a shared multilayer perceptron, and multiplies them channel-by-channel with the input feature map to enhance the responses of key channels. Subsequently, in the spatial dimension, max pooling and average pooling are applied to the channel-compressed feature map, followed by a 7×7 convolution after feature concatenation. Finally, a spatial attention map is obtained through a sigmoid activation function, further enhancing salient regions. By cascading these two attention mechanisms, the CBAM attention module improves the network's ability to perceive key regions and important features with lower computational cost.

[0026] (4) CAA attention module: such as Figure 4 As shown, this module aims to model the contextual relationships between distant pixels in an image while enhancing the feature representation capabilities of local regions. First, the input feature map undergoes a 7×7 average pooling operation to aggregate local contextual information. Then, a 1×1 convolution compresses and transforms the channel dimension information. After passing through 1×k convolutions in the horizontal direction and k×1 convolutions in the vertical direction (where k defaults to 11), the effect of large-kernel convolution is simulated with lower computational cost by modeling contextual dependencies in the horizontal and vertical directions respectively. Next, after a 1×1 convolution to integrate the features, an attention map is generated using the sigmoid activation function. Finally, the attention map is multiplied element-wise with the input feature map to achieve weighted enhancement, resulting in output features containing rich contextual relationships.

[0027] To more effectively capture the spatial and residual information of tampering traces, a dual-domain multi-attention tampering localization network utilizes a dual-branch structure (including a spatial domain feature extraction branch and a frequency domain feature extraction branch), and then uses a multi-attention localization module to achieve tampering localization, such as... Figure 5 As shown.

[0028] (1) Dual-branch feature extraction module: First, two convolution operations, spatial convolution and frequency convolution (both using 5×5 convolution kernels), are used to extract the spatial and residual features of the image, respectively. Spatial convolution is a regular convolution operation, while frequency convolution is a convolution operation based on Bayar constraints. Then, the spatial and residual features are extracted layer by layer through eight residual modules (residual block_1 to residual block_8). The two branches do not share parameters; odd-numbered layers contain residual connections between two 3×3 convolutions and one 1×1 convolution, while even-numbered layers use two cascaded 3×3 convolutions. The extracted spatial and frequency features are concatenated along the channel dimension and then passed through a convolutional layer (1×1 convolution kernel) to obtain the fused feature F.

[0029] (2) Multi-Attention Localization Module: This module includes a fake edge detection branch and a fake region localization branch. The two branches extract the tampered region feature f and the tampered edge feature f_edge, respectively, and utilize the PAB (Pixel Attention Block), CAB (Channel Attention Block), SAB (Spatial Attention Block), and multi-head attention modules to suppress redundant features and extract more discriminative feature representations. In the fake edge detection branch, the edge feature f_edge is further input to the multi-head attention module to enhance edge artifact perception. Subsequently, it integrates multi-scale contextual information through the Spatial Pyramid Pooling (ASPP) module and upsamples to the same resolution as the original image through bilinear interpolation, outputting a refined edge prediction result used to calculate the edge loss. In the fake region localization branch, the region feature f passes through three attention modules: SAB, CAB, and PAB. The image is then input into the ASPP module to generate a fused feature map. This map is then upsampled to the same resolution as the original image using bilinear interpolation, and a channel-dimensional activation function (Softmax) is applied to generate a forgery probability map. This probability map provides richer information about forgery regions than a traditional binary map; a higher value indicates a greater likelihood that the corresponding region has been tampered with, serving as the final forgery localization result.

[0030] (3) Spatial Attention Module (SAB): such as Figure 6 As shown, to further improve the model's ability to locate significantly tampered regions in an image, SAB generates a two-dimensional attention map M∈R. H×W It compresses features into a two-dimensional space through operations such as Global Average Pooling (GAP) and Global Max Pooling (GMP). By modeling the feature maps in the spatial dimension, this module captures the correlations between different locations, thereby guiding the network to focus on more discriminative image regions. This design balances the extraction capabilities of local and global information, making it excellent at processing global image features.

[0031] (4) Channel Attention Module (CAB): such as Figure 7 As shown, to enhance the model's ability to discriminate between different feature channels, CAB aims to automatically learn and assign weights to different channels by modeling the contribution of each channel's features to the task, thereby highlighting key information and suppressing redundant interference. CAB introduces Global Average Pooling (GAP) to map the input three-dimensional features into a one-dimensional channel attention vector M∈R. CWhile significantly reducing computational overhead, CAB effectively integrates global contextual information. Unlike pixel attention modules, CAB focuses more on improving the selectivity of feature representation in the channel dimension, helping the network extract more representative channel information from multi-scale and multi-semantic features.

[0032] (5) Pixel Attention Module (PAB): such as Figure 8 As shown, PAB generates a 3D attention map M∈R H×W×C PAB preserves the full spatial resolution without using pooling or downsampling operations. Unlike channel attention and spatial attention mechanisms, which primarily focus on the overall structure of the feature map, PAB prioritizes the salience of each pixel location. This module learns pixel-level attention weight maps and dynamically adjusts the response intensity of each pixel in the feature map, thereby enhancing important regions and suppressing non-critical regions.

[0033] (6) Multi-Head Attention Module: such as Figure 9 As shown, the input to this module is the fused feature F. First, it undergoes three sets of learnable linear transformations to obtain query (Q), key (K), and value (V) matrices. Then, these matrices are evenly partitioned into multiple subspaces h (typically h = 8) along the feature dimension. Each attention head in its corresponding h calculates its attention weight through dot product, scaling, and the softmax activation function, and then multiplies it by the corresponding V matrix to obtain the output of that attention head. Different attention heads can capture diverse dependencies between features from their respective h. Finally, the outputs of all attention heads are concatenated and integrated through a linear transformation to obtain the module's output feature.

[0034] Next, since the number of real pixels in the tampered image is much greater than the number of tampered pixels, in order to prevent the model from overfitting to categories with a large number of samples, this invention uses a smooth cross-entropy loss function for network training in the fake region localization branch of the tampering localization network. The calculation formula is as follows: , in, This represents the smoothing factor (default value is 0.1). This indicates the corresponding true class in the model's prediction. y The predicted probability, Indicating the prediction of the model, the first C Predicted probability of class C This represents the total number of categories. By introducing label smoothing, the model maintains a certain confidence distribution across all categories, thereby mitigating the overfitting problem.

[0035] In the spoofing edge detection branch of the tampering localization network, in order to improve the model's prediction ability at spoofing edges and enhance the overall tampering localization performance, this invention utilizes an edge loss function based on the Dice coefficient for model training. The calculation formula is as follows: , Among them, among them, and y i They represent the first i The model's predicted output value and the true label value at each pixel. This represents the smoothing factor (default value is 1e-6), used to avoid numerical instability when the denominator is zero.

[0036] Regarding the model training phase, etc. Figure 10 As shown. First, a compressed proxy network based on a dual-attention mechanism is trained using the training set images. Then, this compressed proxy network is used to convert uncompressed images into improved JPEG proxy images. Finally, the proxy images are used as the training set for a dual-domain multi-attention tamper localization network. After the tamper localization network is trained, during the model deployment phase, as follows... Figure 11 As shown, this network model can locate tampering in images of any format.

[0037] like Figure 12 As shown, to better demonstrate the beneficial effects of this embodiment, it is built using the PyTorch deep learning framework, with the publicly available CASIAv2 tamper detection dataset as the training set. Training is performed on an NVIDIA GeForce RTX 3090, and testing is conducted on multiple public datasets, including six commonly used test datasets: IMD2020, DSO, Columbia, Coverage, NIST16, and Autosplice. Pixel-level prediction results are compared pixel-by-pixel with the true labels, and F1 scores are calculated to evaluate the model's performance on the test set. The method of this embodiment is compared with existing image tamper localization methods such as ReLoc, SSJT, MVSS, and PSCC. ReLoc is a recovery-assisted tamper localization framework. Its core idea is to enhance the weakened tamper traces through image restoration, and then the localization module detects the tampered region.

[0038] SSJT is a semi-supervised method for image tampering localization. This method first models the compression traces formed by different JPEG compression chains and designs a trace extractor to learn relevant features. Based on this, a self-supervised training strategy is employed to enhance the model's discriminative ability, thus achieving effective detection of local image forgeries without relying on a large amount of labeled data.

[0039] MVSS-Net is a multi-view feature learning network for image tampering forensics. Its core idea is to simultaneously utilize tamper boundary artifacts and noisy views as complementary cues to learn semantically independent and generalizable tamper features. To improve the model's robustness across different tampering types and datasets, MVSS-Net employs a multi-scale supervision strategy.

[0040] PSCC-Net is a progressive network for image tamper detection and localization. This method employs a dual-path structure, using a top-down path to extract local and global features, and a bottom-up path to generate multi-scale tamper masks step-by-step. The results of the previous stage are used as a condition to achieve a coarse-to-fine localization process.

[0041] Table 1 Comparison of Location Tampering Performance

[0042] Table 1 shows the F1 scores of different methods on the test set, ranging from 0 to 1, with closer to 1 indicating better model performance. The test results show that the method in this embodiment achieved the best average performance across all test sets (last column), and also achieved good performance on individual test sets. For example, it performed best on the IMD2020 dataset, which consists of JPEG compressed images, demonstrating good robustness against JPEG compression; it achieved the highest score of 0.723 on the DSO dataset, significantly outperforming other methods; it also showed good localization performance against complex splicing tampering on the Autosplice dataset; and it performed stably on the Columbia and Coverage datasets. Therefore, this embodiment demonstrates good generalization performance against various tampering types and good robustness against JPEG compression operations.

[0043] It should be noted that, for the sake of simplicity, the aforementioned method embodiments are all described as a series of actions. However, those skilled in the art should understand that the present invention is not limited to the described order of actions, because according to the present invention, some steps can be performed in other orders or simultaneously.

[0044] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0045] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A method for locating tampering in JPEG compressed images based on a self-supervised data augmentation strategy, characterized in that, Includes the following steps: A compression proxy network based on a dual attention mechanism is used to perform self-supervised learning on the training set to obtain an augmented dataset, including tampered images with JPEG compression characteristics under various quality factors; the compression proxy network based on the dual attention mechanism includes a convolutional block attention module and a context anchor attention module. A dual-domain multi-attention tampering localization network is used to extract spatiotemporal features from an augmented dataset, and to locate tampering edges and regions in the tampered image based on these features. The dual-domain multi-attention tampering localization network includes a dual-branch feature extraction module and a multi-attention localization module. The dual-branch feature extraction module includes a spatial domain branch and a frequency domain branch, and the multi-attention localization module includes a tampering region localization branch and a tampering edge detection branch.

2. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 1, characterized in that, The compressed proxy network based on the dual attention mechanism is an improved U-Net, which includes an encoder and a decoder; Each level of the encoder is configured with several cascaded 3×3 convolutional layers. After downsampling, each level of the encoder is connected to a convolutional block attention module and a pooling layer. The convolutional block attention module is fused with the feature maps output by each level of the convolutional layer through residual connections to obtain deep semantic features. Each level of the decoder is configured with several cascaded 3×3 convolutional layers and deconvolutional layers. The output of the deconvolutional layer is concatenated with the feature map of the corresponding size of the encoder. The concatenated feature map is connected to the context anchor attention module, and the decoder outputs the reconstructed image.

3. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 2, characterized in that, The convolutional block attention module includes a channel attention module and a spatial attention module. The channel attention module extracts channel feature representations through global average pooling and max pooling, obtains channel attention maps using a shared multilayer perceptron, and multiplies them channel by channel with the input feature map. The channel compressed feature map is obtained by passing the sigmoid activation function. The spatial attention module performs max pooling and average pooling on the channel compressed feature map, applies a 7×7 convolution after feature concatenation, and obtains a spatial attention map by passing the sigmoid activation function.

4. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 2, characterized in that, The context anchor attention module performs an average pooling operation with a kernel size of 7×7 on the input feature map, then compresses and transforms the channel dimension information through a 1×1 convolution, and then performs a 1×k convolution in the horizontal direction, a k×1 convolution in the vertical direction, and a 1×1 convolution, before using the Sigmoid activation function to obtain the attention map.

5. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 2, characterized in that, The decoder is optimized by calculating the L1 loss between the reconstructed image and the original JPEG image.

6. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 1, characterized in that, The spatial branch and the frequency branch respectively acquire spatial and frequency features. The spatial and frequency features are concatenated along the channel dimension and then fused through a convolutional layer to obtain the fused features. The spatial branch includes spatial convolution and several residual modules, and the frequency branch includes frequency convolution and several residual modules. The frequency convolution is a convolution operation based on Bayar constraints.

7. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 5, characterized in that, The residual module connected to the spatial domain convolution or the frequency domain convolution is used as the residual module with an ordinal number of 1. The residual module with an ordinal number includes two cascaded 3×3 convolutions and one 1×1 convolution. The cascaded 3×3 convolutions and the 1×1 convolution are connected in parallel residuals. The residual module with an even ordinal number includes two cascaded 3×3 convolutions and is connected to the input feature residual of the residual module.

8. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 1, characterized in that, The forged region localization branch passes the spatiotemporal features through a spatial attention module, a channel attention module, a pixel attention module, and spatial pyramid pooling. It then upsamples the spatiotemporal features to the same resolution as the original image using bilinear interpolation to obtain a fused feature map. The feature loss is calculated on the fused feature map, and the Softmax activation function of the channel dimension is used to obtain a forged region probability map. The feature loss is calculated using the smooth cross-entropy loss function for network training, as shown in the following formula: , in, Represents the smoothing factor. This indicates the corresponding true class in the model's prediction. y The predicted probability, Indicating the prediction of the model, the first C Predicted probability of class C It represents the total number of categories.

9. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 1, characterized in that, The forged edge detection branch includes a multi-attention module and spatial pyramid pooling. The spatiotemporal features are passed through the multi-head attention module and spatial pyramid pooling, and then upsampled to the same resolution as the original image through bilinear interpolation to obtain a fine edge prediction result. The edge loss is calculated on the edge prediction result to obtain a forged edge probability map. The calculation of the edge loss is performed by training the model using an edge loss function based on the Dice coefficient, as shown in the following formula: , in, and y i They represent the first i The model's predicted output value and the true label value at each pixel. This represents the smoothing factor.

10. The JPEG compressed image tampering localization method based on self-supervised data augmentation strategy according to claim 1, characterized in that, The multi-head attention module includes multiple attention heads. The spatiotemporal features are processed through three sets of learnable linear transformations to obtain a query matrix, a key matrix, and a value matrix. The three matrices are divided into multiple subspaces along the feature dimensions. Each attention head calculates its attention weight in its corresponding subspace through dot product, scaling, and softmax activation function operations. The weight is then multiplied by the corresponding value matrix to obtain the attention head output. The outputs of all attention heads are concatenated and integrated through a linear transformation to obtain the multi-head attention module output.