Method for detecting document tampering based on dynamic nuclear fusion and adaptive gradient modulation

By combining visual and frequency domain features with dynamic kernel fusion and adaptive gradient modulation, this method solves the problems of single feature extraction and class imbalance in existing document tampering detection, and achieves high-precision detection of document tampering.

CN121999502BActive Publication Date: 2026-07-24TIANJIN UNIVERSITY OF TECHNOLOGY +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN UNIVERSITY OF TECHNOLOGY
Filing Date
2026-04-10
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

Existing document tampering detection methods rely on single-feature extraction, making it difficult to capture JPEG compression artifacts and high-frequency noise at tampering edges. Multi-scale feature fusion is ineffective, traditional loss functions are biased towards background areas, and class imbalance leads to insufficient detection accuracy.

Method used

A method based on dynamic kernel fusion and adaptive gradient modulation is adopted. Multi-scale visual features are extracted through ConvNeXt V2-Base backbone network and cross-domain feature calibration module. Combined with frequency domain adaptive feature decoder and adaptive gradient cosine loss function, the method can accurately capture frequency features and solve class imbalance.

Benefits of technology

It improves the accuracy and robustness of document tampering detection, effectively captures compression artifacts and frequency anomalies, and adapts to document tampering detection needs of different types and complexities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121999502B_ABST
    Figure CN121999502B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of based on dynamic nuclear fusion and adaptive gradient modulation document tampering detection method, belong to digital forensics and computer vision technical field.It includes the following steps: obtaining the RGB image of the document to be detected, constructs the feature encoder containing double-branch feature extraction and feature update module, with ConvNeXt V2-Base as backbone, fusion visual and frequency domain features are combined with cross-domain feature calibration module, and optimized multi-scale feature is obtained by learnable wavelet decomposition;Frequency domain adaptive feature decoder is then constructed, dynamic nuclear fusion is completed by Fourier band grouping weight, kernel element accurate modulation and space-band dynamic matching, and tampering prediction map is output;Adaptive gradient cosine loss, cross-entropy loss and lovasz loss are used during training Joint optimization.The present application can accurately capture the frequency anomaly and subtle traces of document tampering, effectively alleviate the class imbalance problem, and has high detection accuracy and robustness under different compression scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of digital forensics and computer vision technology, specifically relating to a document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation. Background Technology

[0002] With the rapid development of digital technology, the digital storage and transmission of documents are becoming increasingly widespread. However, document tampering techniques are also evolving, with tampering methods becoming more covert, such as text replacement, content erasure, copy-paste, and seal forgery, seriously threatening information security and social trust. Document tampering detection, as one of the core technologies of digital forensics, aims to accurately identify and locate tampered areas in documents, providing technical support for verifying the authenticity of information.

[0003] Existing document tampering detection methods suffer from the following shortcomings: feature extraction is singular, relying heavily on visual features and ignoring frequency domain anomaly clues, making it difficult to capture subtle differences such as JPEG compression artifacts and inconsistencies in high-frequency noise at tampering edges; multi-scale feature fusion is ineffective, and traditional convolutional networks, limited by spatial invariance, cannot effectively perceive local frequency abrupt changes in strongly structured components such as text and tables; and the loss function design is unreasonable, as the document tampering area typically accounts for only 1%-5% of the image, and class imbalance causes traditional loss functions (such as cross-entropy and Dice loss) to favor the background area, resulting in insufficient ability to capture subtle tampering traces.

[0004] Therefore, there is an urgent need for a document tampering detection method that can integrate multi-domain features, accurately capture frequency anomalies, and adapt to class imbalance, thereby improving detection accuracy and robustness. Summary of the Invention

[0005] To achieve the above objectives, the present invention employs the following technical solution: This invention provides a document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation, comprising the following steps: S1. Obtain the RGB image of the document to be detected; S2. Construct a feature encoder, including a dual-branch feature extraction module and a feature update module; the dual-branch feature extraction module includes a ConvNeXt V2-Base backbone network and a cross-domain feature calibration module; the feature update module includes a preprocessing unit, a frequency component separation unit, a frequency component enhancement unit, a cross-scale fusion unit, and a final feature optimization unit; RGB image The initial multi-scale visual feature set is obtained by processing the data through the ConvNeXt V2-Base backbone network and the cross-domain feature calibration module. and calibration fusion features ;in, These represent the first visual feature, the second visual feature, the third visual feature, and the fourth visual feature, respectively. The resolution of the first visual feature is... The resolution of the second visual feature is The resolution of the third visual feature is The resolution of the fourth visual feature is H Representing RGB images respectively Height and width; calibration fusion features Replace the initial multi-scale visual feature set Second visual features To obtain an updated multi-scale visual feature set The feature update module processes the updated multi-scale visual feature set using a learnable wavelet decomposition operator to obtain an optimized multi-scale feature set. ; S3. Construct a frequency domain adaptive feature decoder. The frequency domain adaptive feature decoder is designed for document structure features and frequency anomaly characteristics, and completes deep feature fusion through a dynamic kernel fusion mechanism. The frequency domain adaptive feature decoder includes a multi-scale feature unified mapping unit and a frequency domain adaptive convolution module; Feature fusion is achieved through a frequency domain adaptive convolution module, enabling accurate capture of frequency features. The frequency domain adaptive convolution module includes a Fourier band grouping weight (FBGW) submodule, a kernel element precise modulation (KEPM) submodule, and a spatial-frequency band dynamic matching (SFM) submodule. The optimized multi-scale feature set The final output prediction map is generated after processing by the frequency domain adaptive feature decoder. ; S4. During training, adaptive gradient cosine loss, cross-entropy loss and Lovars loss are used to jointly optimize the model parameters.

[0006] Furthermore, the cross-domain feature calibration module mentioned in step S2 specifically includes: RGB image Convert to YCbCr color space, perform Discrete Cosine Transform (DCT) on the Y channel to extract frequency features. ; frequency characteristics With second visual features The first splicing feature is obtained by concatenating the data along the channel dimension. ; For the first splicing feature Global average pooling is performed on each channel to compress the spatial pixel value of each channel into a single channel statistical value, generating a channel feature vector. The channel feature vector After processing by the weight generator, the channel weights are obtained. The weight generator includes a fully connected layer and a sigmoid activation function; the fully connected layer includes a dimensionality-reduced fully connected layer and a dimensionality-increasing fully connected layer. Channel weights With the first splicing feature Perform element-wise multiplication along the channel dimension to generate channel-weighted features. ; Features after channel weighting Perform global max pooling along the channel dimension to obtain the max pooled feature map. ; Features after channel weighting Perform global average pooling along the channel dimension to obtain the average pooled feature map. Max pooling feature map and average pooling feature map By concatenating along the channel dimension, the second concatenation feature is obtained. The second splicing feature The dimensionality is reduced to 1 channel by a 1×1 convolutional layer, and then processed by a sigmoid activation function to obtain the spatial weights. Spatial weights Features after channel weighting Perform element-wise multiplication along the spatial dimension to generate channel-space dual-weighted features. If there are signs of tampering such as inconsistent fonts or broken edges in a certain spatial location, its weight is close to 1, and the feature is strengthened; if it is a normal character or background, the weight is close to 0, and the feature is weakened. The channel-space dual weighting feature After processing with a 1×1 convolutional layer, a batch normalization layer, and a ReLU activation function, the number of channels is adjusted to obtain enhanced frequency domain features. The enhanced frequency domain features After processing by a zero-initialized convolutional layer, it is combined with second visual features. Element-by-element addition and fusion are performed to obtain the calibration fusion characteristics. .

[0007] Furthermore, the preprocessing unit in step S2 specifically comprises: updating the multi-scale visual feature set. After passing through a 1×1 convolutional layer to standardize the number of channels and initially suppress noise, ensuring consistency in feature extraction by subsequent convolutional kernels, a standardized feature set is output. .

[0008] Furthermore, the frequency component separation unit in step S2 specifically comprises: the standardized feature set After the features in the data are processed by mean aggregation convolution kernels and difference sensing convolution kernels, they are then subjected to an average downsampling operation with a stride of 2 to generate low-frequency component features. High-frequency component characteristics , correspond .

[0009] Furthermore, the frequency component enhancement unit in step S2 specifically involves: to further enhance the effective information in the separated frequency components and suppress redundant interference, enhancing the characteristics of the low-frequency components. High-frequency component characteristics The adaptive enhancement process was executed separately to obtain the low-frequency enhancement component. and high frequency enhancement components The operation process includes: The low-frequency component characteristics After performing dimensionality regularization and nonlinear mapping using lightweight feature processing blocks to enhance feature representation capabilities, channel attention and spatial attention mechanisms are introduced sequentially. Channel attention strengthens the response to key frequency dimensions for tamper detection by modeling the importance of different frequency channels; spatial attention focuses on potential tampering regions and suppresses invalid information in the background. The processing results after introducing channel attention and spatial attention mechanisms are then combined with low-frequency component features. Perform the Hadamard product operation to obtain the low-frequency enhancement component. Similarly, high-frequency component characteristics After the above process, the high-frequency enhancement component is obtained. .

[0010] Furthermore, the cross-scale fusion unit in step S2 specifically involves: using guided feature aggregation and window linear modeling to process the low-frequency enhancement component set. and high frequency enhancement component set The process involves precise alignment and fusion of cross-scale features to obtain the fused low-frequency component. and fusion of high-frequency components ; Taking the high-frequency enhanced component set as an example, the specific process of the window linear modeling and the guided feature aggregation is as follows: Window linear modeling: High frequency enhancement component set The features in the data are sorted by scale as follows: First scale features Second-scale features Third-scale features and fourth-scale features ; First-scale features at the largest scale Based on this, the second-scale features Third-scale features and fourth-scale features Upsampled to the first scale feature respectively The spatial dimensions are used to obtain the second preliminary alignment feature. Third preliminary alignment features and the fourth preliminary alignment feature First-scale features Without any processing, the spatial dimensions remain unchanged, and this is denoted as the first preliminary alignment feature. ; the first preliminary alignment feature Second preliminary alignment features Third preliminary alignment features and the fourth preliminary alignment feature Divide the window into sections; for each window, learn the scaling parameters. With offset parameter The formula is expressed as: ,in, Indicates the first Preliminary alignment features are the features aligned to a single window, k=1,2,3,4; No. The features under a single window corresponding to the initial alignment features; w represents a single window; This represents the scaling parameters for a single window; This represents the offset parameter for a single window; the scaling parameter for a single window. With offset parameter Adaptive learning is used to learn the differences between the mean and variance of features within a window. For example, if a window has been tampered with... It will increase to enhance the ability to manipulate differences. It will be adjusted to match. Grayscale distribution; all windows By concatenating the features into a complete feature set, we obtain the aligned feature set. ; Guided feature aggregation: First scale feature After processing with a 1×1 convolutional layer and a sigmoid activation function, a guided weight map is generated. For each alignment feature Scale weights are generated by assigning weights based on their scale contribution. Based on guided weight graph Scale weight Alignment features Generate fused high-frequency components The formula is expressed as follows: , in, This indicates element-wise multiplication; Similarly, the fused low-frequency components are obtained. .

[0011] Furthermore, the final feature optimization unit in step S2 is specifically: First visual features It is the feature with the highest spatial resolution and richest high-frequency details among the original multi-scale features (corresponding to local characters and edges in the document), and the fused high-frequency components. (Enhancing subtle tampering clues) Fusion can further improve the detection accuracy of small-scale tampering. Fourth visual feature It is the feature with the lowest spatial resolution and the most significant global structure among the original multi-scale features (corresponding to the overall document layout), and the fused low-frequency component. (Optimizing global structural information) integration can improve the ability to judge global structural anomalies caused by tampering; High-frequency components are fused through bilinear interpolation upsampling. Upsampling to the first visual feature The spatial dimensions are consistent, and then the upsampled fused high-frequency components are combined with the first visual features. The concatenation is performed along the channel dimension to obtain the third concatenated feature; the third concatenated feature is input into a convolutional layer with a kernel size of 1×1 to generate high-frequency dominant features. ; The low-frequency components are fused by bilinear interpolation upsampling. Upsampling to fourth visual features The spatial dimensions are consistent, and then the upsampled fused low-frequency components are combined with the fourth visual features. The features are concatenated along the channel dimension to obtain the fourth concatenated feature; this fourth concatenated feature is input into a convolutional layer with a kernel size of 1×1 to generate a low-frequency dominant feature. ; Finally, the optimized multi-scale feature set is obtained. , , .

[0012] Furthermore, the multi-scale feature unification mapping unit in step S3 specifically involves: optimizing the multi-scale feature set through a lightweight MLP module. The features in the image are mapped to a unified embedding dimension, upsampled to the same spatial resolution, and then concatenated along the channel dimension to obtain the fifth concatenated feature. .

[0013] Furthermore, the frequency-domain adaptive convolution module mentioned in step S3 specifically comprises: Fourier Band Grouping Weight (FBGW) submodule: Given input, fixed initial parameters and weights ; Fix initial parameter weights Reconstructed into a Fourier domain spectral coefficient matrix ; Fourier domain spectral coefficient matrix By Fourier index of norm Sort from low to high and divide evenly. disjoint parameter sets It covers all frequency features of the document, including extremely low frequency (paper background color), low frequency (text grayscale distribution), mid frequency (table lines), and high frequency (tampering edge noise). , These are the Fourier domain spectral coefficient matrices. Horizontal and vertical coordinates; for each parameter group Perform the inverse discrete Fourier transform to convert it into spatial domain data. Ensure that each weight group responds only to specific frequencies (e.g., low-frequency groups capture paper texture consistency, high-frequency groups capture tampered edge anomalies); spatial domain data Pruning and recombining into standard convolution weights This results in 10 weighted reassemblies with differentiated frequency responses; The KEPM submodule for precise kernel element modulation includes a local channel sensing branch and a global channel guidance branch. The local channel sensing branch captures local information such as text strokes and table lines through 1D convolution to generate a dense modulation matrix. The global channel guidance branch outputs dimension-level modulation values ​​through global average pooling and fully connected layers. The two are fused element-wise to obtain the final modulation matrix α, achieving precise element-wise adjustment of the convolution kernel. The specific process is as follows: The fifth splicing feature The input local channel sensing branch uses lightweight 1D convolution to capture local channel information of the document, resulting in a dense modulation matrix. This enables fine-grained modulation of each convolutional kernel element, reducing computational costs. The fifth splicing feature The input is fed into the global channel guidance branch, where global average pooling is used to extract global statistics. The input and output channels of the three different fully connected layers modulate the values. Output channel modulation value and nuclear space modulation value This involves adapting to different channel frequency features of the document, optimizing multi-channel fusion consistency, and adjusting the spatial frequency response range of the convolution kernel (to adapt to components of different sizes, such as small fonts and large stamps); thereby obtaining sparse modulation vectors. The formula is expressed as follows: , , , , , in, Indicates the outer product operation; , , The three weight matrices representing the fully connected layer are a trainable parameter matrix. , , Representing the three different biases of the fully connected layer, it is a trainable parameter vector; Compact modulation matrix and sparse modulation vector The final modulation matrix is ​​obtained by fusing the components using the Hadamard product operation. It preserves details of local frequency abrupt changes while ensuring consistency of global frequency distribution, accurately responding to local anomalies such as text tampering and line breakage. Standard convolution weights With the final modulation matrix Hadamard product operations are performed to obtain modulated parallel weights; the adjustment of each element combines local and global channel information; based on the fifth concatenation feature... The generated attention coefficient Control the i-th parallel weight after modulation, and output the fused weight. The formula is expressed as follows: , , in, This represents the attention coefficient corresponding to the i-th parallel weight; satisfy ; The spatial-frequency band dynamic matching (SFM) submodule breaks the spatial invariance limitation of traditional convolution. It decomposes the convolution kernel into four frequency band weights using a binary mask, calculates the characteristic response of each frequency band in the Fourier domain, generates a spatial modulation map, dynamically controls the contribution of each frequency band, and obtains the fused feature through element-wise weighted summation, highlighting the frequency anomalies in the tampered region. The specific process is as follows: fusion weight Zero-padding to the fifth splicing feature Size; octave-based binary mask , ; The zero-padding fusion weight The frequency bands are weighted into four categories: extremely low frequency, low frequency, mid frequency, and high frequency. The formula is as follows: , in, This represents the frequency band weight of the b-th frequency band; , These represent the Discrete Fourier Transform (DFT) operation and the Inverse Discrete Fourier Transform (IFT) operation, respectively. This represents the binary mask for the b-th frequency band; different frequency band weights correspond to different detection requirements (e.g., high-frequency weights capture tampered edges, while low-frequency weights verify texture consistency). Based on the convolution theorem, the characteristic responses of each frequency band are calculated directly in the Fourier domain, avoiding the infinite support problem of spatial domain filters. The formula is expressed as follows: , in, The convolution output feature of the b-th frequency band directly reflects the response of that frequency band to the input features. The fifth splicing feature After dimensionality reduction using a 1×1 convolutional layer, spatial modulation maps for each frequency band are generated using a Sigmoid activation function. value range , , , Dynamically control the contribution of each frequency band at different spatial locations (e.g., tampering with edges to enhance high-frequency response, and suppressing high-frequency noise in blank areas). Spatial modulation map Multiplication by broadcast Multiply the features and sum the modulated features over all frequency bands to obtain the final output prediction map. .

[0014] Furthermore, the total loss function Defined as: , in, This represents the adaptive gradient cosine loss; Represents cross-entropy loss; Indicates Lovaz's loss; , , These represent three different loss weights.

[0015] The advantages of this invention are: This invention integrates visual features and DCT frequency domain features. It uses a cross-domain feature calibration unit (CDCU) to calibrate feature weights, effectively capturing tampering clues such as compression artifacts and frequency anomalies. A dynamic kernel fusion mechanism: the frequency domain adaptive convolution module (FACM) accurately captures frequency abrupt changes and subtle tampering differences in document structure components through frequency band grouping, kernel modulation, and spatial-frequency band matching. Adaptive gradient modulation: the adaptive gradient cosine loss function (AGCL) is designed based on feature direction differences, effectively solving the class imbalance problem by modulating gradient allocation through relative differences. In various document tampering scenarios, its overall performance surpasses existing methods, enabling it to meet the document tampering detection needs of different types and complexities. Attached Figure Description

[0016] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used together with the embodiments of the invention to explain the invention and do not constitute a limitation thereof.

[0017] Figure 1 This is a flowchart of the steps of the method of the present invention; Figure 2 This is a visual comparison diagram between the method of the present invention and existing methods. Detailed Implementation

[0018] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0019] Example 1 In this embodiment, as Figure 1 As shown, this invention provides a document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation, the specific steps of which include: S1. Obtain the RGB image of the document to be detected; S2. Construct a feature encoder, including a dual-branch feature extraction module and a feature update module; the dual-branch feature extraction module includes a ConvNeXt V2-Base backbone network and a cross-domain feature calibration module; the feature update module includes a preprocessing unit, a frequency component separation unit, a frequency component enhancement unit, a cross-scale fusion unit, and a final feature optimization unit; The dual-branch feature extraction module specifically includes: The RGB image Feature extraction was performed using the ConvNeXt V2-Base backbone network to obtain an initial multi-scale visual feature set. , These represent the first visual feature, the second visual feature, the third visual feature, and the fourth visual feature, respectively, with resolutions of [resolution values ​​missing]. , , , ;in, Represents RGB image height, Represents RGB image The width.

[0020] In the cross-domain feature calibration module, the RGB image is... Convert to YCbCr color space, perform Discrete Cosine Transform (DCT) on the Y channel to extract frequency features. , , The number of channels representing frequency characteristics; frequency characteristics With second visual features The first splicing feature is obtained by concatenating the data along the channel dimension. , , The number of channels representing the second visual feature; For the first splicing feature Global average pooling is performed on each channel, and the average value of each channel is... Each spatial pixel value is compressed into a single channel statistical value, generating a channel feature vector. , dimension The channel feature vector After processing by the weight generator, the channel weights are obtained. , dimension The weight range is [0,1]; the weight generator includes a fully connected layer and a sigmoid activation function; the fully connected layer includes a dimensionality-reduced fully connected layer and a dimensionality-increasing fully connected layer; the dimensionality-reduced fully connected layer reduces the number of channels from... Down to r is the compression ratio, r=16, reducing computational load; the upgraded fully connected layer restores the number of channels to , Indicates second visual features The number of channels; Representing frequency characteristics The number of channels; the formula is as follows: , in, This indicates a fully connected layer in an upgraded dimension; This represents a dimension-reduced fully connected layer; Represents the ReLU activation function; This represents the Sigmoid activation function; Channel weights With the first splicing feature Perform element-wise multiplication along the channel dimension, that is, multiply all spatial pixel values ​​of each channel by the weight corresponding to that channel to generate channel-weighted features. Dimension and first concatenation feature Consistency; if a channel corresponds to the edge features of the tampered area, its weight is close to 1, and the feature is preserved; if a channel corresponds to background noise, its weight is close to 0, and the feature is suppressed. Channel weighted features Perform global max pooling along the channel dimension to obtain the max pooled feature map. , dimension ; Features after channel weighting Perform global average pooling along the channel dimension to obtain the average pooled feature map. , dimension Max pooling feature map and average pooling feature map By concatenating along the channel dimension, the second concatenation feature is obtained. Dimensions are 2× The second splicing feature The dimensionality is reduced to 1 channel by a 1×1 convolutional layer, and then processed by a sigmoid activation function to obtain the spatial weights. , dimension The weight range is [0,1]; the formula is expressed as follows: Wherein, Concat represents the concatenation operation along the channel dimension; This indicates a convolution operation with a kernel size of 1×1; This represents the global max pooling operation; This indicates a global average pooling operation; Spatial weights Features after channel weighting Perform element-wise multiplication along the spatial dimension to generate channel-space dual-weighted features. If there are signs of tampering such as inconsistent fonts or broken edges in a certain spatial location, its weight is close to 1, and the feature is strengthened; if it is a normal character or background, the weight is close to 0, and the feature is weakened. The channel-space dual weighting feature After processing with a 1×1 convolutional layer, a batch normalization layer, and a ReLU activation function, the number of channels is adjusted to obtain enhanced frequency domain features. The number of channels is The enhanced frequency domain features After processing by a zero-initialized convolutional layer, it is combined with second visual features. Element-by-element addition and fusion are performed to obtain the calibration fusion characteristics. .

[0021] The convolution kernel weights of the zero-initialized convolutional layer All values ​​are initialized to 0 before training begins, ensuring that the convolutional layers are zero-initialized during the initial training phase. The transformed output is approximately 0 because the output value is close to 0 after the input features are calculated with a 0-weight convolution kernel. At this time, the frequency domain features... Its contribution to the final fusion result is minimal, thus avoiding interference with the second visual features. Detection of "explicit tampering" (such as inconsistent fonts or positional shifts); The number of input channels and output channels of the zero-initialization convolutional layer are both set to... To ensure that subsequent interactions with second visual features are possible. Element-wise addition fusion is performed; the kernel size of the zero-initialized convolutional layer is 3×3, balancing local feature capture capability and computational efficiency, and avoiding parameter redundancy caused by excessively large kernels. The enhanced frequency domain features... After processing by a zero-initialized convolutional layer, the frequency domain transform feature is obtained, expressed by the following formula: , in, Indicates frequency domain transform characteristics, Represents the convolution kernel weights , This represents the element-wise multiplication operation; Due to convolution kernel weights Initially set to 0, frequency domain transform features are trained in the first few rounds. The value is close to 0, only when the model learns the frequency domain information through backpropagation (such as in slightly tampered samples, where frequency domain features can supplement the deficiencies of RGB features). The weights will gradually deviate from 0 values, frequency domain transformation characteristics Their contributions increased accordingly; Frequency domain transform characteristics of zero-initialized convolutional layer output With second visual features By fusing element-wise, calibration fusion features are generated. .

[0022] The preprocessing unit specifically comprises: updating the multi-scale visual feature set. After passing through a 1×1 convolutional layer, the number of channels is standardized to C, which initially suppresses noise and ensures consistency in feature extraction by subsequent convolutional kernels, resulting in a standardized feature set as the output. .

[0023] The frequency component separation unit specifically refers to the standardized feature set. After the features in the data are processed by mean aggregation convolution kernels and difference sensing convolution kernels, they are then subjected to an average downsampling operation with a stride of 2 to generate low-frequency component features. High-frequency component characteristics The mean-aggregate convolution kernel is used for low-frequency extraction, and the initialization matrix is: The differential-sensory convolutional kernel is used for high-frequency extraction, and the initialization matrix is: The formula is expressed as follows: , , in, Represents the features in the standardized feature set. correspond ; This represents a mean-aggregate convolution kernel; This represents a difference-aware convolutional kernel; This indicates element-wise multiplication; This indicates an average downsampling operation with a step size of 2. After downsampling... and All space dimensions are The number of channels remains C. , Representing features respectively Height and width.

[0024] The frequency component enhancement unit specifically works by enhancing the effective information in the separated frequency components and suppressing redundant interference, focusing on the characteristics of low-frequency components. High-frequency component characteristics The adaptive enhancement process was executed separately to obtain the low-frequency enhancement component. and high frequency enhancement components The operation process includes: The low-frequency component characteristics After performing dimensionality regularization and nonlinear mapping using lightweight feature processing blocks to enhance feature representation capabilities, channel attention and spatial attention mechanisms are introduced sequentially. Channel attention strengthens the response to key frequency dimensions for tamper detection by modeling the importance of different frequency channels; spatial attention focuses on potential tampering regions and suppresses invalid information in the background. The processing results after introducing channel attention and spatial attention mechanisms are then combined with low-frequency component features. Perform the Hadamard product operation to obtain the low-frequency enhancement component. Similarly, high-frequency component characteristics After the above process, the high-frequency enhancement component is obtained. The formula is expressed as follows: , , in, This indicates the channel attention mechanism operation; This represents the spatial attention mechanism operation; The light feature processing block comprises a convolutional layer with a kernel size of 3×3, a batch normalization layer, and a ReLU activation function.

[0025] The cross-scale fusion unit specifically employs guided feature aggregation and window linear modeling to enhance the low-frequency component set. and high frequency enhancement component set The process involves precise alignment and fusion of cross-scale features to obtain the fused low-frequency component. and fusion of high-frequency components The formula is expressed as follows: , , in, This indicates a window linear modeling operation; This indicates a guided feature aggregation operation; it provides high-quality frequency feature support for subsequent fusion with F1 and F4, ensuring that both global structural anomalies and local detail anomalies related to document tampering are effectively preserved.

[0026] The design process of the Window-based Linear Model (WLM) revolves around cross-scale feature alignment to meet the need for preserving subtle features in document tampering detection. Document image tampering is often small-scale localized (e.g., single character) and directly fusing features of different scales (e.g., ...) would be problematic. size and size (This is because) spatial misalignment can easily lead to information loss due to tampering. The core of WLM is to learn adaptive scaling and offset parameters for features at different scales to achieve pixel-level alignment.

[0027] Taking the high-frequency enhanced component set as an example, the specific process of the window linear modeling and the guided feature aggregation is as follows: Window linear modeling: High frequency enhancement component set The features in the data are sorted by scale as follows: First scale features Second-scale features Third-scale features and fourth-scale features ; First-scale features at the largest scale Based on this, the second-scale features Third-scale features and fourth-scale features Upsampled to the first scale feature respectively The spatial dimensions are used to obtain the second preliminary alignment feature. Third preliminary alignment features and the fourth preliminary alignment feature First-scale features Without any processing, the spatial dimensions remain unchanged, and this is denoted as the first preliminary alignment feature. ; The first preliminary alignment feature Second preliminary alignment features Third preliminary alignment features and the fourth preliminary alignment feature Window partitioning is performed, with window sizes designed based on document character dimensions to ensure each window can cover 1-2 characters, preventing excessively large windows from obscuring tampered information; in one embodiment, all partitions are divided into non-overlapping 8×8 windows; for each window, scaling parameters are learned. With offset parameter The formula is expressed as: ,in, Indicates the first Preliminary alignment features are the features aligned to a single window, k=1,2,3,4; No. The features under a single window corresponding to the initial alignment features; w represents a single window; This represents the scaling parameters for a single window. This represents the offset parameter for a single window; the scaling parameter for a single window. With offset parameter Adaptive learning is used to learn the differences between the mean and variance of features within a window. For example, if a window has been tampered with... It will increase to enhance the ability to manipulate differences. It will be adjusted to match. The grayscale distribution; All windows By concatenating the features into a complete feature set, we obtain the aligned feature set. ; Guided feature aggregation: First scale feature After processing with a 1×1 convolutional layer and a sigmoid activation function, a guided weight map is generated. , dimension ; For each alignment feature Scale weights are generated by assigning weights based on their scale contribution. In one embodiment, the first alignment feature For fine-grained tampering, the weight is set to 0.4; second alignment feature For medium-to-fine tampering, the weight is set to 0.3; third alignment feature Corresponding to medium-to-coarse tampering; weight set to 0.2, fourth alignment feature. For the coarse-grained structure, the weight is set to 0.1; Based on guided weight graph Scale weight Alignment features Generate fused high-frequency components The formula is expressed as follows: , in, This indicates element-wise multiplication; Similarly, the fused low-frequency components are obtained. .

[0028] The final feature optimization unit is as follows: First visual features It is the feature with the highest spatial resolution and richest high-frequency details among the original multi-scale features (corresponding to local characters and edges in the document), and the fused high-frequency components. (Enhancing subtle tampering clues) Fusion can further improve the detection accuracy of small-scale tampering. Fourth visual feature It is the feature with the lowest spatial resolution and the most significant global structure among the original multi-scale features (corresponding to the overall document layout), and the fused low-frequency component. (Optimizing global structural information) integration can improve the ability to judge global structural anomalies caused by tampering; The fused high-frequency components The space dimensions are First visual features The space dimensions are The high-frequency components need to be fused first. Upsampled to bilinear interpolation Ensure consistency with the first visual feature The spatial dimensions are consistent.

[0029] Integrating low-frequency components The space dimensions are Fourth visual feature The space dimensions are The low-frequency components need to be fused first. Upsampled to bilinear interpolation Ensure compatibility with fourth visual features Consistent spatial dimensions; Specifically, High-frequency components are fused through bilinear interpolation upsampling. Upsampling to the first visual feature The spatial dimensions are consistent, and then the upsampled fused high-frequency components are combined with the first visual features. The channels are concatenated along the channel dimension, reducing the number of channels to 2C, resulting in the third concatenated feature. This third concatenated feature is then input into a convolutional layer with a kernel size of 1×1, restoring the number of channels to C. Feature dimension compatibility is adjusted to generate high-frequency dominant features. ; The low-frequency components are fused by bilinear interpolation upsampling. Upsampling to fourth visual features The spatial dimensions are consistent, and then the upsampled fused low-frequency components are combined with the fourth visual features. The channels are concatenated along the channel dimension, reducing the number of channels to 2C, resulting in the fourth concatenated feature. This fourth concatenated feature is then input into a convolutional layer with a kernel size of 1×1, restoring the number of channels to C. Feature dimension compatibility is adjusted to generate a low-frequency dominant feature. ; Finally, the optimized multi-scale feature set is obtained. , , .

[0030] S3. Construct a frequency domain adaptive feature decoder. The frequency domain adaptive feature decoder is designed for document structure features and frequency anomaly characteristics, and completes deep feature fusion through a dynamic kernel fusion mechanism. The frequency domain adaptive feature decoder includes a multi-scale feature unified mapping unit and a frequency domain adaptive convolution module; Feature fusion is achieved through a frequency domain adaptive convolution module, enabling accurate capture of frequency features. The frequency domain adaptive convolution module includes a Fourier band grouping weight (FBGW) submodule, a kernel element precise modulation (KEPM) submodule, and a spatial-frequency band dynamic matching (SFM) submodule. The optimized multi-scale feature set The final output prediction map is generated after processing by the frequency domain adaptive feature decoder. .

[0031] The multi-scale feature unified mapping unit specifically involves optimizing the multi-scale feature set through a lightweight MLP module. The features in the image are mapped to a unified embedding dimension, upsampled to the same spatial resolution, and then concatenated along the channel dimension to obtain the fifth concatenated feature. .

[0032] The frequency domain adaptive convolution module is specifically: Fourier Band Grouping Weighted FBGW Submodule: Given input with fixed initial parameters and weights , , ; Indicates the fifth splicing feature The dimension has a value of 512; express The value is 2; the initial parameter weights will be fixed. Reconstructed into a Fourier domain spectral coefficient matrix , According to Fourier index of norm Sort from low to high and divide evenly. disjoint parameter sets It covers all frequency features of the document, including extremely low frequency (paper background color), low frequency (text grayscale distribution), mid frequency (table lines), and high frequency (tampering edge noise). , These are the Fourier domain spectral coefficient matrices. Horizontal coordinates, vertical coordinates; parameter group satisfy: , in, For the i-th group of Fourier indexes The corresponding coefficients; for each parameter set Perform the inverse discrete Fourier transform to convert it into spatial domain data. , The formula is expressed as follows: in, Representing spatial domain data Mid-space position The value ensures that each weight group only responds to specific frequencies (e.g., the low-frequency group captures paper texture consistency, and the high-frequency group captures tampered edge anomalies). Spatial domain data Pruning and recombining into standard convolution weights , This results in 10 weighted reassemblies with differentiated frequency responses; the specific process is as follows: Spatial domain data The column dimensions are split into groups of k columns to obtain... independent submatrices , 1; For each independent submatrix Split the row dimensions into groups of k rows to obtain a smaller submatrix , 1; All smaller submatrices The standard convolution weights are obtained by rearranging them according to their spatial dimensions, input channels, and output channels. Consistent with the initial weight pattern, but the frequency response changed from The frequency range is determined by this.

[0033] The KEPM submodule for precise kernel element modulation includes a local channel sensing branch and a global channel guidance branch. The local channel sensing branch captures local information such as text strokes and table lines through 1D convolution to generate a dense modulation matrix. The global channel guidance branch outputs dimension-level modulation values ​​through global average pooling and fully connected layers. The two are fused element-wise to obtain the final modulation matrix α, achieving precise element-wise adjustment of the convolution kernel. The specific process is as follows: The fifth splicing feature The input local channel sensing branch uses lightweight 1D convolution to capture local channel information of the document, resulting in a dense modulation matrix. This enables fine-grained modulation of each convolutional kernel element, reducing computational costs. The formula is as follows: , in, Indicates reshaping into Operations on two-dimensional matrices; This represents a one-dimensional convolution operation; The fifth splicing feature The input is fed into the global channel guidance branch, where global average pooling is used to extract global statistics. The input and output channels of the three different fully connected layers modulate the values. Output channel modulation value and nuclear space modulation value This involves adapting to different channel frequency features of the document, optimizing multi-channel fusion consistency, and adjusting the spatial frequency response range of the convolution kernel (to adapt to components of different sizes, such as small fonts and large stamps); thereby obtaining sparse modulation vectors. The formula is expressed as follows: , , , , , in, Indicates the outer product operation; , , The three weight matrices representing the fully connected layer are a trainable parameter matrix. , , Representing the three different biases of the fully connected layer, it is a trainable parameter vector; Modulation fusion: combining dense modulation matrices and sparse modulation vector The final modulation matrix is ​​obtained by fusing the components using the Hadamard product operation. , It preserves details of local frequency abrupt changes while ensuring consistency in global frequency distribution, accurately responding to local anomalies such as text tampering and line breaks; the formula is expressed as follows: ; Element-wise modulation of weights: Modulating standard convolution weights With the final modulation matrix The Hadamard product is performed to obtain the modulated parallel weights. The adjustment of each element combines local and global channel information, as expressed by the following formula: , in, This represents the i-th parallel weight after modulation; Attention-weighted fusion: based on the fifth splicing feature The generated attention coefficient Control the i-th parallel weight after modulation, and output the fused weight. The formula is expressed as follows: , , in, This represents the attention coefficient corresponding to the i-th parallel weight; satisfy ; The spatial-frequency band dynamic matching (SFM) submodule breaks the spatial invariance limitation of traditional convolution. It decomposes the convolution kernel into four frequency band weights using a binary mask, calculates the characteristic response of each frequency band in the Fourier domain, generates a spatial modulation map, dynamically controls the contribution of each frequency band, and obtains the fused feature through element-wise weighted summation, highlighting the frequency anomalies in the tampered region. The specific process is as follows: fusion weight Zero-padding to the fifth splicing feature Dimensions; The zero-padded fusion weights are decomposed into multiple frequency bands, and binary masks are based on octave division. , ; the zero-padding fusion weight The frequency bands are weighted into four categories: extremely low frequency, low frequency, mid frequency, and high frequency. The formula is as follows: in, This represents the frequency band weight of the b-th frequency band; , These represent the Discrete Fourier Transform (DFT) operation and the Inverse Discrete Fourier Transform (IFT) operation, respectively. This represents the binary mask for the b-th frequency band; different frequency band weights correspond to different detection requirements (e.g., high-frequency weights capture tampered edges, while low-frequency weights verify texture consistency). Based on the convolution theorem, the characteristic responses of each frequency band are calculated directly in the Fourier domain, avoiding the infinite support problem of spatial domain filters. The formula is expressed as follows: , in, The convolution output feature of the b-th frequency band directly reflects the response of that frequency band to the input features. The fifth splicing feature After dimensionality reduction using a 1×1 convolutional layer, spatial modulation maps for each frequency band are generated using a Sigmoid activation function. value range , , , Dynamically control the contribution of each frequency band at different spatial locations (e.g., tampering with edges to enhance high-frequency response, and suppressing high-frequency noise in blank areas). Spatial modulation map Multiplication by broadcast Multiply the features and sum the modulated features over all frequency bands to obtain the final output prediction map. The formula is as follows: , in, This indicates broadcast multiplication.

[0034] S4. During training, adaptive gradient cosine loss, cross-entropy loss and Lovars loss are used to jointly optimize the model parameters.

[0035] The adaptive gradient cosine loss is calculated as follows: Point-level difference measurement: Cosine similarity is used to calculate the final output predicted map. The difference in orientation from the true label T, ; in, Indicates pixel-level differences; Let T represent the cosine function, and T represent the true label. Global average difference: Calculates the average difference at the pixel level across all pixels within a batch. ; in, , These represent the final output prediction graphs. Height and width; This represents the point-level pixel difference of the feature vector at (i,j); Modulation factor: The modulation factor is designed based on the relative difference theory. ,in, γ represents the modulation factor (relative difference), and γ is a hyperparameter. It does not require a preset threshold and automatically adjusts the gradient assignment to alleviate class imbalance.

[0036] The formula for adaptive gradient cosine loss is as follows: , in, This represents the adaptive gradient cosine loss.

[0037] To achieve pixel-level fine-grained classification, the model is forced to learn and respond to subtle, localized feature differences between the tampered and original regions. In this framework, cross-entropy loss is used. This is applied to the model's final output prediction map Y, where each pixel value represents the confidence level that the location has been tampered with. The fundamental task is to measure, pixel by pixel, the difference between the probability distribution predicted by the model and the true binary label (tampered / untampered).

[0038] To directly optimize the shape matching between the predicted tampered region and the real region, and improve the cross-union ratio (CUP), thereby obtaining detection results with clearer boundaries and more complete structures, the framework employs Lowaz loss. It doesn't concern itself with the probability of a single pixel's prediction being right or wrong. Instead, it treats the entire prediction result and the true label as two separate sets and calculates a differentiable surrogate loss directly related to the IoU loss. Tampered regions in a document typically constitute a very small percentage. Lowaz loss is calculated based on region IoU, naturally insensitive to the size of the foreground region, effectively preventing the model from being dominated by a massive amount of "real" background pixels.

[0039] Total loss function Defined as: , in, This represents the adaptive gradient cosine loss; Represents cross-entropy loss; Indicates Lovaz's loss; , , These represent three different loss weights; , , It balances pixel-level classification accuracy, regional structural integrity, and category balance.

[0040] Example 2 To simulate different levels of compression that images may undergo during transmission or storage, this invention uses the DocTamper dataset to test three different JPEG compression quality factors. The DocTamper dataset includes 170,000 altered document images (contracts, invoices, and receipts, in both Chinese and English), using techniques such as copy-and-move, stitching, and generation. The DocTamper dataset is divided into a training subset of 120,000 images and a test subset of the same domain, DocTamper-T, containing 30,000 images. Furthermore, it includes cross-domain FCD and SCD datasets, containing 2,000 and 18,000 images respectively, from the Noisy Office dataset and Huawei Cloud, to evaluate the model's generalization ability. The three different JPEG compression quality factors are denoted as Q100 (highest quality, almost no compression loss), Q90 (medium compression), and Q75 (high compression, significant image quality degradation). Experiments were conducted to evaluate the performance of each model at these three compression levels. This experiment selected four representative existing models as comparison objects, specifically: Swin-User: a model based on SwinTransforme; ConvNextV2: a model based on the ConvNeXt V2 architecture; DTD*: a detection model that highly relies on image DCT (Discrete Cosine Transform) domain information; and FFDN: a detection model based on frequency domain feature learning. To comprehensively evaluate the detection capabilities of each model, this experiment used precision (P), recall (R), and the combined F1 score (F) as evaluation metrics.

[0041] Table 1. Performance comparison of different models under different JPEG compression levels Based on the data in Table 1, it can be seen that: Performance under high-quality compression (Q100): Under the almost lossless Q100 condition, the model of this invention and the FFDN model performed best, with F1 scores reaching 0.96. The precision and recall were also at the leading level, proving its excellent detection capability under ideal conditions.

[0042] Performance under moderate quality compression (Q90): When the compression level increases to Q90, the performance of the comparative models begins to decline to varying degrees. However, the model of this invention still maintains a high level of detection capability, with an F1 score of 0.94, which is significantly better than other comparative models, demonstrating good compression resistance.

[0043] Performance under low-quality compression (Q75): Under the most challenging Q75 high compression condition, image details are severely lost. At this point, the performance of the DTD* model, which heavily relies on DCT information, drops sharply, with its F1 score falling to 0.65. Other comparative models also show significant performance degradation. In contrast, the model of this invention demonstrates the most significant advantage, achieving an F1 score of 0.85, far exceeding other models. This indicates that the model of this invention can still effectively extract key features for detecting tampering traces even under extreme JPEG compression, exhibiting extremely strong robustness.

[0044] Specific examples are visualized as follows: Figure 2 As shown in the figure, the detection results of the method of the present invention are closer to the true label. Compared with other existing models, the present invention has better detection performance.

[0045] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation, characterized in that, Includes the following steps: S1. Obtain the RGB image of the document to be detected; S2. Construct a feature encoder, including a dual-branch feature extraction module and a feature update module; The dual-branch feature extraction module includes a ConvNeXt V2-Base backbone network and a cross-domain feature calibration module; The feature update module includes a preprocessing unit, a frequency component separation unit, a frequency component enhancement unit, a cross-scale fusion unit, and a final feature optimization unit. RGB image The initial multi-scale visual feature set is obtained by processing the data through the ConvNeXt V2-Base backbone network and the cross-domain feature calibration module. and calibration fusion features ;in, These represent the first visual feature, the second visual feature, the third visual feature, and the fourth visual feature, respectively. The resolution of the first visual feature is... The resolution of the second visual feature is The resolution of the third visual feature is The resolution of the fourth visual feature is H Representing RGB images respectively Height and width; calibration fusion features Replace the initial multi-scale visual feature set Second visual features To obtain an updated multi-scale visual feature set The feature update module processes the updated multi-scale visual feature set using a learnable wavelet decomposition operator to obtain an optimized multi-scale feature set. ; The cross-domain feature calibration module specifically includes: RGB image Convert to YCbCr color space, and perform discrete cosine transform on the Y channel to extract frequency features. ; frequency characteristics With second visual features The first splicing feature is obtained by concatenating the features along the channel dimension. ; For the first splicing feature Global average pooling is performed on each channel to compress the spatial pixel value of each channel into a single channel statistical value, generating a channel feature vector. The channel feature vector After processing by the weight generator, the channel weights are obtained. The weight generator includes a fully connected layer and a sigmoid activation function; the fully connected layer includes a dimensionality-reduced fully connected layer and a dimensionality-increasing fully connected layer. Channel weights With the first splicing feature Perform element-wise multiplication along the channel dimension to generate channel-weighted features. ; Features after channel weighting Perform global max pooling along the channel dimension to obtain the max pooled feature map. ; Features after channel weighting Perform global average pooling along the channel dimension to obtain the average pooled feature map. Max pooling feature map and average pooling feature map By concatenating along the channel dimension, the second concatenation feature is obtained. The second splicing feature The dimensionality is reduced to 1 channel by a 1×1 convolutional layer, and then processed by a sigmoid activation function to obtain the spatial weights. Spatial weights Features after channel weighting Perform element-wise multiplication along the spatial dimension to generate channel-space dual-weighted features. ; The channel-space dual weighting feature After processing with a 1×1 convolutional layer, a batch normalization layer, and a ReLU activation function, the number of channels is adjusted to obtain enhanced frequency domain features. The enhanced frequency domain features After processing by a zero-initialized convolutional layer, it is combined with second visual features. Element-by-element addition and fusion are performed to obtain the calibration fusion characteristics. ; S3. Construct a frequency domain adaptive feature decoder and complete deep feature fusion through a dynamic kernel fusion mechanism; The frequency domain adaptive feature decoder includes a multi-scale feature unified mapping unit and a frequency domain adaptive convolution module; The frequency domain adaptive convolution module includes a Fourier band grouping weight (FBGW) submodule, a kernel element precise modulation (KEPM) submodule, and a space-frequency band dynamic matching (SFM) submodule. The optimized multi-scale feature set The final output prediction map is generated after processing by the frequency domain adaptive feature decoder. ; S4. During training, adaptive gradient cosine loss, cross-entropy loss and Lovars loss are used to jointly optimize the model parameters.

2. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 1, characterized in that, The preprocessing unit in step S2 specifically involves updating the multi-scale visual feature set. After passing through a convolutional layer with a kernel size of 1×1, the number of channels is standardized, and a standardized feature set is output. .

3. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 2, characterized in that, The frequency component separation unit in step S2 specifically refers to: the standardized feature set. After the features in the data are processed by mean aggregation convolution kernels and difference sensing convolution kernels, they are then subjected to an average downsampling operation with a stride of 2 to generate low-frequency component features. High-frequency component characteristics , correspond .

4. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 3, characterized in that, The frequency component enhancement unit in step S2 specifically involves: enhancing the characteristics of low-frequency components. High-frequency component characteristics The adaptive enhancement process was executed separately to obtain the low-frequency enhancement component. and high frequency enhancement components ; The operation process includes: The low-frequency component characteristics After dimensional normalization and nonlinear mapping using lightweight feature processing blocks, channel attention and spatial attention mechanisms are introduced sequentially. The processing results after introducing channel attention and spatial attention mechanisms are then compared with low-frequency component features. Perform the Hadamard product operation to obtain the low-frequency enhancement component. Similarly, high-frequency component characteristics After the above process, the high-frequency enhancement component is obtained. .

5. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 4, characterized in that, The cross-scale fusion unit in step S2 specifically involves: using guided feature aggregation and window linear modeling to process the low-frequency enhancement component set. and high frequency enhancement component set The process is performed to obtain the fused low-frequency components. and fusion of high-frequency components ; Taking the high-frequency enhanced component set as an example, the specific process of the window linear modeling and the guided feature aggregation is as follows: Window linear modeling: High frequency enhancement component set The features in the data are sorted by scale as follows: First scale features Second-scale features Third-scale features and fourth-scale features ; First-scale features at the largest scale Based on this, the second-scale features Third-scale features and fourth-scale features Upsampled to the first scale feature respectively The spatial dimensions are used to obtain the second preliminary alignment feature. Third preliminary alignment features and the fourth preliminary alignment feature First-scale features Without any processing, the spatial dimensions remain unchanged, and this is denoted as the first preliminary alignment feature. ; The first preliminary alignment feature Second preliminary alignment features Third preliminary alignment features and the fourth preliminary alignment feature Divide the window into sections; for each window, learn the scaling parameters. With offset parameter The formula is expressed as: ,in, Indicates the first Preliminary alignment features are the features aligned to a single window, k=1,2,3,4; No. The features under a single window corresponding to the initial alignment features; w represents a single window; This represents the scaling parameters for a single window; This represents the offset parameter corresponding to a single window; it represents the offset parameter for all windows. By concatenating the features into a complete feature set, we obtain the aligned feature set. ; Guided feature aggregation: First scale feature After processing with a 1×1 convolutional layer and a sigmoid activation function, a guided weight map is generated. For each alignment feature Scale weights are generated by assigning weights based on their scale contribution. Based on guided weight graph Scale weight Alignment features Generate fused high-frequency components The formula is expressed as follows: , in, This indicates element-wise multiplication; Similarly, the fused low-frequency components are obtained. .

6. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 5, characterized in that, The final feature optimization unit in step S2 is specifically as follows: High-frequency components are fused through bilinear interpolation upsampling. Upsampling to the first visual feature The spatial dimensions are consistent, and then the upsampled fused high-frequency components are combined with the first visual features. The concatenation is performed along the channel dimension to obtain the third concatenated feature; the third concatenated feature is input into a convolutional layer with a kernel size of 1×1 to generate the high-frequency dominant feature. ; The low-frequency components are fused by bilinear interpolation upsampling. Upsampling to fourth visual features The spatial dimensions are consistent, and then the upsampled fused low-frequency components are combined with the fourth visual features. The features are concatenated along the channel dimension to obtain the fourth concatenated feature; this fourth concatenated feature is input into a convolutional layer with a kernel size of 1×1 to generate a low-frequency dominant feature. ; Finally, the optimized multi-scale feature set is obtained. , , .

7. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 6, characterized in that, The multi-scale feature unification mapping unit mentioned in step S3 specifically involves optimizing the multi-scale feature set through a lightweight MLP module. The features in the image are mapped to a unified embedding dimension, upsampled to the same spatial resolution, and then concatenated along the channel dimension to obtain the fifth concatenated feature. .

8. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 7, characterized in that, The frequency-domain adaptive convolution module mentioned in step S3 is specifically as follows: Fourier Band Grouping Weight (FBGW) submodule: Given input, fixed initial parameters and weights ; Fix initial parameter weights Reconstructed into a Fourier domain spectral coefficient matrix ; Fourier domain spectral coefficient matrix By Fourier index of norm Sort from low to high and divide evenly. disjoint parameter sets , , These are the Fourier domain spectral coefficient matrices. Horizontal and vertical coordinates; for each parameter group Perform the inverse discrete Fourier transform to convert it into spatial domain data. Spatial domain data Pruning and recombining into standard convolution weights This results in 10 weighted reassemblies with differentiated frequency responses; The KEPM submodule for precise modulation of nuclear elements includes a local channel sensing branch and a global channel guidance branch. The specific process is as follows: The fifth splicing feature The input local channel sensing branch uses lightweight 1D convolution to capture local channel information of the document, resulting in a dense modulation matrix. ; The fifth splicing feature The input is fed into the global channel guidance branch, where global average pooling is used to extract global statistics. The input and output channels of the three different fully connected layers modulate the values. Output channel modulation value and nuclear space modulation value ; and thus obtain the sparse modulation vector The formula is expressed as follows: , , , , , in, Indicates the outer product operation; , , This represents the three different weight matrices of the fully connected layer; , , Representing three different biases of the fully connected layer; the dense modulation matrix and sparse modulation vector The final modulation matrix is ​​obtained by fusing the components using the Hadamard product operation. ; Standard convolution weights With the final modulation matrix Perform Hadamard product operation to obtain modulated parallel weights; based on the fifth concatenation feature The generated attention coefficient Control the i-th parallel weight after modulation, and output the fused weight. The formula is expressed as follows: , , in, This represents the attention coefficient corresponding to the i-th parallel weight; satisfy ; The specific process of the Space-Frequency Band Dynamic Matching (SFM) submodule is as follows: fusion weight Zero-padding to the fifth splicing feature Size; octave-based binary mask , ; The zero-padding fusion weight The frequency bands are weighted into four categories: extremely low frequency, low frequency, mid frequency, and high frequency. The formula is as follows: , in, This represents the frequency band weight of the b-th frequency band; , These represent the Discrete Fourier Transform (DFT) operation and the Inverse Discrete Fourier Transform (IFT) operation, respectively. Let represent the binary mask of the b-th frequency band; based on the convolution theorem, the characteristic responses of each frequency band are directly calculated in the Fourier domain, as shown in the following formula: , in, This represents the convolutional output feature of the b-th frequency band; The fifth splicing feature After dimensionality reduction using a 1×1 convolutional layer, spatial modulation maps for each frequency band are generated using a Sigmoid activation function. Spatial modulation map Multiplication by broadcast Multiply the features and sum the modulated features over all frequency bands to obtain the final output prediction map. .

9. The document tampering detection method based on dynamic kernel fusion and adaptive gradient modulation according to claim 8, characterized in that... Total loss function Defined as: , in, This represents the adaptive gradient cosine loss; Represents cross-entropy loss; Indicates Lovaz's loss; , , These represent three different loss weights.

Citation Information

Patent Citations

  • Qualification certificate image tampering detection method based on multi-scale suspicious prediction box

    CN116385407A

  • Document image tampering detection method based on text aggregation and multi-frequency enhancement

    CN121768022A