Document tampering detection method and system based on image data processing

By constructing a physical potential energy field and a virtual viscous resistance field to simulate fluid dynamics processes, and combining this with graph neural network analysis, the problem of detecting highly integrated visual texture tampering traces in existing technologies has been solved, achieving efficient and accurate document tampering detection.

CN121810690BActive Publication Date: 2026-05-15DOROAD ENERGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-03-10
Publication Date
2026-05-15

AI Technical Summary

Technical Problem

Existing document tampering detection technologies struggle to capture subtle tampering traces that blend visual textures, resulting in insufficient detection accuracy.

Method used

By constructing a document tampering detection method based on image data processing, the method utilizes noise residual maps to map physical potential energy fields, extracts microscopic penetration features of text stroke edges, simulates fluid dynamics evolution to generate virtual flow velocity vector fields, constructs heterogeneous maps, and uses graph neural networks for inference analysis to locate tampered areas.

Benefits of technology

It significantly improves the ability to detect tampering in high-resolution documents, reduces computational redundancy, provides detection results with strong physical interpretability, and reduces false positives and false negatives.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121810690B_ABST
    Figure CN121810690B_ABST
Patent Text Reader

Abstract

The present application relates to the field of digital image processing and information security, and discloses a document tampering detection method and system based on image data processing, comprising the following steps: first, extracting the noise residual and microscopic penetration characteristics of the document image, and constructing a physical potential energy field and a virtual viscous resistance field; then, using a Darcy law variant model for dynamic evolution, generating a virtual flow velocity vector field to simulate the sliding behavior of fluid in heterogeneous media; subsequently, constructing a heterogeneous graph based on the flow field divergence singular point and streamline trajectory, using a graph neural network to aggregate the node dynamics characteristics for deep reasoning, and finally generating a tampering positioning mask. The present application innovatively introduces fluid mechanics field theory, converts hidden static texture differences into significant dynamic flow field anomalies, solves the problem that the prior art is difficult to capture microscopic tampering traces, and significantly improves the detection accuracy and generalization ability in complex document scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of digital image processing and information security technology, specifically to a document tampering detection method and system based on image data processing. Background Technology

[0002] With the widespread adoption of digital office and e-government, the digital processing of various documents such as contracts, invoices, and certificates has become a crucial aspect of social operations. However, the rapid development of image editing software and generative artificial intelligence technologies in recent years has made it unprecedentedly easy and difficult to detect with the naked eye to tamper with or forge digital documents. Verifying the authenticity and originality of document images has become a core issue that urgently needs to be addressed in the fields of financial risk control, forensic identification, and information security.

[0003] In existing document tampering detection technologies, early traditional methods mainly relied on statistical analysis of the inherent fingerprints of imaging devices or specific compression traces. However, these methods often fail when faced with scanned documents or images transmitted via social media, because resampling during scanning, ink diffusion during printing, and secondary compression during transmission severely damage the weak high-frequency signals left by the original camera sensor, leading to a significant decrease in the robustness of detection models based on statistical features.

[0004] To overcome the limitations of manual features, deep learning-based detection schemes have gradually become mainstream in recent years. These methods typically utilize convolutional neural networks to automatically extract deep features from images to locate tampered regions. While deep learning methods perform excellently in object-level tampering detection of natural scene images, they face significant technical bottlenecks when processing document images. Specifically, document images often feature simple background textures and discrete foreground text symbols. Existing convolutional networks tend to focus on the semantic content of the image rather than the physical consistency of the imaging medium. When attackers use high-precision "copy-paste" or generative filling techniques to fine-tune key numbers or text in a document, the tampered area and background are highly integrated visually and semantically, even exhibiting extremely smooth pixel-level textures. Existing neural network models lack the ability to explicitly model the microscopic physical properties of images, making it difficult to capture these visually "perfectly integrated" but fundamentally different physical generation mechanisms, resulting in high false negative and false positive rates in challenging document tampering scenarios. Therefore, how to overcome the limitations of purely visual features and mine deep tampering clues from the perspective of physical consistency is a pressing technical challenge. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a document tampering detection method and system based on image data processing. This solves the technical problem that existing technologies lack explicit modeling of the microscopic physical properties of the document imaging medium, making it difficult to capture concealed tampering traces with highly integrated visual textures, thus resulting in insufficient detection accuracy.

[0006] To achieve the above objectives, the present invention provides the following technical solution: The first aspect of the present invention provides a document tampering detection method based on image data processing, the method comprising the following steps:

[0007] The document image to be detected is acquired, and the noise residual map of the document image is extracted by denoising differential calculation, and the noise residual map is mapped to a physical potential energy field; at the same time, the microscopic penetration features of the edges of the strokes of the characters in the document image are extracted, and a virtual viscous resistance field is constructed based on the microscopic penetration features.

[0008] Based on the physical potential energy field and the virtual viscous resistance field, fluid dynamics evolution calculations are performed to simulate the flow process of fluid in heterogeneous media and generate a virtual velocity vector field.

[0009] A heterogeneous graph is constructed based on the dynamic distribution characteristics of the virtual velocity vector field. The topology of the heterogeneous graph is determined by the streamline characteristics and singularity characteristics of the virtual velocity vector field.

[0010] The heterogeneous graph is analyzed using a graph neural network. By aggregating flow dynamics features and texture features, detection results are generated to locate the document tampering area.

[0011] Furthermore, in constructing the physical potential field, this invention utilizes the inherent fingerprint of the imaging device (such as photoresponse non-uniformity noise) as a benchmark for physical consistency. Specifically, the document image is converted into a grayscale image. A smooth image is obtained by processing the grayscale image using a nonlocal mean denoising filter (NLM). The noise residual map is obtained by calculating the difference between the two. And the pixel intensity is defined as the physical potential energy field. Its mathematical expression is as follows:

[0012]

[0013] in, These are pixel coordinates. In the real area, the noise distribution conforms to the statistical laws of the sensor, and the potential energy distribution is relatively uniform; however, in the tampered area, due to interpolation or copy-paste operations, the noise fingerprint is destroyed, forming a region of abrupt change in potential energy.

[0014] Furthermore, in constructing the virtual viscous resistance field, this invention utilizes the difference between the physical penetration phenomenon of real ink stains and paper fibers and the smoothed edges of the digitally altered area. Specific steps include: calculating the multi-scale gradient and high-frequency response intensity of the document image, and statistically analyzing local windows. variance of internal gradient with the mean The ratio, combined with the high-frequency response intensity Obtain local permeability :

[0015]

[0016] in , These are weighting coefficients. To prevent the use of tiny quantities with a denominator of zero, a mapping function is then used. Convert local permeability into viscous drag coefficient This results in real ink areas corresponding to high viscous resistance (difficult fluid flow), while smooth altered areas correspond to low viscous resistance (easy fluid sliding):

[0017]

[0018] in and This is a constant used to control the mapping curvature.

[0019] Furthermore, the fluid dynamics evolution calculation is based on a variant model of Darcy's law. This invention models the tamper detection process as a process of virtual fluid overcoming medium resistance driven by a potential energy difference. Virtual velocity vector field. Defined as:

[0020]

[0021] in, This represents the gradient of the physical potential field. In this model, when the virtual viscous drag field... The coefficients decreased abnormally (corresponding to the tampered region) and the potential energy gradient... When present, the velocity vector magnitude It will increase significantly, forming a "fluid slip" phenomenon, thus highlighting the traces of tampering at the dynamic level.

[0022] Furthermore, in order to capture the topological anomalies of the flow field, the divergence field of the virtual velocity vector field is calculated before constructing the heterogeneous map. :

[0023]

[0024] Extreme points in the divergence field are identified as singularities in the flow field. These singularities typically correspond to the "sources" or "sinks" of the fluid, indicating altered boundaries of abrupt changes in the fluid medium properties.

[0025] Furthermore, the process of constructing the heterogeneous graph includes: selecting the singular points of the flow field and several random background sampling points as a set of topological anchor nodes. ; Calculate any two topological anchor nodes , The connection between two points is established only when the two points lie on the same fluid trajectory trend and satisfy the condition of consistent streamline direction. .

[0026] Furthermore, when using graph neural networks for inference analysis, for each node, its local texture features in the original document image are obtained. And combined with flow field characteristics (velocity modulus) Viscous resistance coefficient A comprehensive node feature vector is constructed. The attention coefficients between nodes are calculated using the Graph Attention (GAT) mechanism. And update node status :

[0027]

[0028] Finally, the updated nodes are classified into two categories, and interpolation is performed in combination with the directional constraints of the flow velocity vector field to generate a binary tampering location mask.

[0029] A second aspect of the present invention provides a document tampering detection system based on image data processing, the system comprising:

[0030] The system comprises the following modules: a physical domain initialization module for acquiring a document image to be detected, extracting a noise residual map from the document image, and using the noise residual map as a physical potential energy field; a resistance field construction module for extracting microscopic penetration features of the edges of text strokes in the document image and constructing a virtual viscous resistance field based on these microscopic penetration features; a flow field evolution module for performing fluid dynamics evolution calculations based on the physical potential energy field and the virtual viscous resistance field to generate a virtual velocity vector field; a graph topology construction module for constructing a heterogeneous graph based on the dynamic distribution characteristics of the virtual velocity vector field, wherein the topology of the heterogeneous graph is determined by the streamline features and singularity features of the virtual velocity vector field; and an inference detection module for using a graph neural network to perform inference analysis on the heterogeneous graph and generate detection results for locating document tampering areas.

[0031] In an optional implementation, the graph topology construction module is specifically configured to calculate the divergence field of the virtual velocity vector field to identify flow field singularities; select the flow field singularities and several background random sampling points as topology anchor nodes, and establish streamline adjoint edges only when two topology anchor nodes are located on the same fluid trace trend and satisfy the streamline direction consistency condition, thereby constructing the heterogeneous graph.

[0032] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method described in the first aspect above.

[0033] This invention provides a document tampering detection method and system based on image data processing. It has the following beneficial effects:

[0034] 1. A potential energy driving mechanism based on imaging physical consistency was constructed. This invention does not merely stop at the pixel statistics level, but creatively maps the noise residual map of the document image into a physical potential energy field. This design cleverly utilizes the inherent fingerprint characteristics of imaging sensors, such as the non-uniformity of light response, to transform the originally chaotic noise signal into a potential energy distribution with directional guidance. Under this mechanism, untampered areas exhibit a smooth potential energy due to the preservation of the original camera's statistical regularity, while tampered areas that have undergone interpolation, splicing, or duplication disrupt this microscopic consistency, forming a significant potential energy gradient. This provides a clear "physical driving force" for subsequent detection algorithms, effectively solving the problem of feature insensitivity in traditional methods when dealing with homologous copying tampering.

[0035] 2. Macroscopic dynamic amplification of microscopic stroke penetration characteristics. To address the edge-connection traces in high-quality forged documents that are difficult to detect with the naked eye, this invention establishes a virtual viscous resistance field model to simulate the microscopic penetration effect of real ink in paper fibers. By mapping the local gradient variance and high-frequency response to resistance coefficients, this method can accurately distinguish between the high viscous resistance generated by "physical ink" and the abnormally low resistance generated by "digital editing." During the flow field evolution, this minute difference in medium properties is transformed into a drastic change in the flow velocity vector, i.e., fluid slippage, successfully amplifying the hidden microscopic tampering traces at the dynamic level, significantly improving the ability to capture fine tampering boundaries.

[0036] 3. A global correlation analysis framework based on flow field topology was established. Unlike traditional convolutional neural networks that are limited to local feature extraction within a rectangular receptive field, this invention constructs a heterogeneous graph based on the dynamic characteristics of the virtual velocity vector field, utilizing streamline features and singularities to determine the topology. This method effectively constructs a "tampering mechanics skeleton" for a document image, enabling the algorithm to connect discrete and discontinuous tampering fragments along fluid traces across spatial distances. This not only allows the model to infer occluded or blurred tampering areas through streamline connectivity but also endows it with the ability to understand global tampering logic, reducing false detections caused by isolated noise points.

[0037] 4. Significantly reduces computational redundancy in high-resolution document detection. By introducing a flow field singularity sampling mechanism, this invention cleverly transforms the originally dense pixel-level segmentation task into a sparse graph node classification task. The system only needs to focus on key nodes where the flow velocity changes abruptly or diverges, i.e., topological anchor points, rather than traversing millions of background pixels. This sparsity processing strategy, while ensuring accurate localization of tampered areas, greatly compresses the amount of data for feature processing, making this method faster inference and lower memory usage compared to full-pixel scanning segmentation networks when processing large-format, high-resolution contract or invoice images.

[0038] 5. This invention endows deep learning models with explicit physical interpretability. By coupling "physical field theory initialization" with "graph neural network inference," it overcomes the "black box" drawback of traditional AI detection algorithms. The detection result is no longer just a probability value, but can be traced back to specific physical manifestations: the tampered area is intuitively presented as a region with abnormally increased fluid velocity and disordered streamlines, while the real area is a medium with uniform flow velocity and stable resistance. This intuitive physical metaphor not only enhances the credibility of the detection results but also provides a visual logical support basis for subsequent manual review and forensic identification. Attached Figure Description

[0039] Figure 1 This is a schematic diagram of the main flow of the method of the present invention;

[0040] Figure 2 This is a schematic diagram of the system functional module structure of the present invention;

[0041] Figure 3 This is a schematic diagram comparing the construction principles of the physical potential field and the virtual viscous drag field of the present invention.

[0042] Figure 4 This is a visual schematic diagram of the fluid dynamics evolution and fluid slip phenomenon of the present invention;

[0043] Figure 5 This is a schematic diagram of the heterogeneous graph topology construction based on flow field singularities and streamlines according to the present invention;

[0044] Figure 6 This is a diagram of the graph neural network inference and feature aggregation architecture of the present invention;

[0045] Figure 7 This is a structural block diagram of the electronic device of the present invention. Detailed Implementation

[0046] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of 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.

[0047] Please see the appendix Figures 1-7 This invention provides a document tampering detection method and system based on image data processing, including a computer system and a detection method. The computer system includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the various steps of the detection method. The detection method mainly utilizes the consistency of noise fingerprints and the physical characteristics of ink penetration in document images to construct a virtual physical field environment and capture tampering traces that are difficult for the human eye to detect by simulating fluid dynamics processes.

[0048] This document tampering detection method based on image data processing mainly includes the following steps: First, acquire the document image to be detected, extract the noise residual map of the document image, and use the noise residual map as a physical potential energy field; second, extract the microscopic penetration features of the edges of the strokes in the document image, and construct a virtual viscous drag field based on the microscopic penetration features; then, perform fluid dynamics evolution calculations based on the physical potential energy field and the virtual viscous drag field to generate a virtual velocity vector field; subsequently, construct a heterogeneous graph based on the dynamic distribution characteristics of the virtual velocity vector field, and the topology of the heterogeneous graph is determined by the streamline features and singularity features of the virtual velocity vector field; finally, use a graph neural network to perform inference analysis on the heterogeneous graph to generate detection results that locate the document tampering area.

[0049] In the specific implementation process, the first step involves the initial construction of the physical potential energy field. The processor first acquires the document image to be detected. The image is typically a high-resolution scan or photograph in RGB format. To eliminate the interference of color channels on noise extraction and reduce computational dimensionality, the document image needs to be converted into a single-channel grayscale image. ,in It represents the coordinate position of a pixel on the image plane.

[0050] Subsequently, a nonlocal mean denoising filter was used to denoise the grayscale image. The NLM filter was chosen because it utilizes the self-similarity within the image, effectively removing random shot noise from the imaging sensor while preserving text edges and texture details in the document to the greatest extent possible, resulting in a smooth, denoised image. Smooth image In this embodiment, it is considered an "ideal noise-free content benchmark". Next, the difference between the grayscale image and the smoothed image is calculated to obtain a noise residual map. The noise residual map mainly contains inherent non-uniformity noise in the light response of the imaging device and foreign noise artifacts introduced by tampering operations. In this embodiment, the absolute value of pixel intensity in the noise residual map is directly defined as the physical potential energy field. The potential energy distribution is calculated using the following formula:

[0051]

[0052] In the original, unaltered region, the noise residual follows a specific statistical distribution, and the potential field exhibits a uniform high-frequency random fluctuation. However, in altered regions that have undergone image editing, erasing, or copying and pasting, the original noise fingerprint is destroyed or interrupted due to the smoothing effect of interpolation algorithms or the stitching of different source images, resulting in a different potential field. Significant energy drops or abrupt changes occur at the altered boundary, and this potential energy difference will become the driving force for the subsequent flow of virtual fluid.

[0053] Simultaneously, the processor executes the step of constructing a virtual viscous drag field. This step aims to simulate the physical penetration behavior of real ink on paper fibers. Due to ink capillary action, the edges of text in a real document exhibit irregular, jagged penetration marks at a microscale, and possess rich high-frequency textures; while digitally synthesized or altered text edges are often too smooth or regular. To quantify this characteristic, the system calculates the multi-scale gradient and high-frequency response intensity of the document image. Specifically, a pixel-based gradient is defined. local window centered Calculate the variance of the image gradient within this window. with the mean .

[0054] The ratio of gradient variance to mean reflects the dispersion of local texture; this ratio is higher at the edges of realistic ink blots. Simultaneously, the high-frequency response intensity of the image is extracted using the Laplacian operator or a high-pass filter. In the specific algorithm implementation of this embodiment, this step is achieved by performing a convolution operation on the image with a preset 3x3 or 5x5 convolution kernel. Combined with the above statistics, the local penetration rate is calculated. The calculation formula is as follows:

[0055]

[0056] In the formula, and These are preset weighting coefficients used to balance the contributions of gradient statistical features and high-frequency response features. To prevent extremely small positive numbers with a denominator of zero.

[0057] It should be noted that the penetration rate here... At the data level, this is represented as texture complexity and edge sharpness within the neighborhood of a pixel. In physical mapping, "resistance" is essentially a non-linear inverse weighting of this texture complexity.

[0058] Obtain local permeability Then, a mapping function is used to convert it into a viscous drag coefficient. This mapping follows physical intuition: Real ink areas, due to their complex fibrous permeability structure, should exhibit extremely high resistance to fluid flow (i.e., fluid has difficulty penetrating); while altered areas (such as smooth backgrounds or digitally generated text), lacking microscopic texture details, exhibit low permeability and low resistance (i.e., fluid easily slides over them). The mapping function is defined as follows:

[0059]

[0060] In the formula, The normalization constant is An exponential parameter (usually greater than 1) is used to control the steepness of the mapping curve. This is a constant used to adjust the reference resistance. This step involves iterating through all pixels of the document image, using the calculated... This creates a virtual viscous drag field with the same dimensions as the original image. In this field, the real region forms a "high viscosity zone," while the altered region forms a "low viscosity sliding zone," laying the medium foundation for the subsequent differentiated flow of fluid driven by potential energy.

[0061] Accordingly, this invention also provides a document tampering detection system based on image data processing, which includes multiple functional modules. The physical domain initialization module performs the operations described above: acquiring document images, performing grayscale conversion and non-local mean denoising, calculating noise residuals, and generating a physical potential energy field. The drag field construction module performs the operations of calculating gradient statistics and high-frequency responses within a local window, calculating local permeability, and mapping it to a virtual viscous drag coefficient. Data transmission between modules is achieved through an internal bus or memory sharing mechanism to ensure strict alignment of the physical potential energy field matrix and the virtual viscous drag field matrix in pixel coordinates.

[0062] In this embodiment, after constructing the physical potential energy field and the virtual viscous drag field, a fluid dynamics evolution calculation step is further performed. The core of this step lies in establishing a dynamic balance between potential energy drive and medium resistance, transforming static image features into dynamic flow field vector features, thereby generating a virtual velocity vector field. This invention creatively introduces a variant model of Darcy's law to describe this virtual physical process, treating the document image plane as a non-uniform porous medium through which fluid flows under the drive of potential energy difference, and its flow velocity is constrained by local permeability (i.e., the reciprocal of viscous drag).

[0063] Virtual velocity vector field based on a variant model of Darcy's law Defined as a physical potential field The gradient is proportional to the virtual viscous resistance field. A vector field inversely proportional to the viscous drag coefficient at the corresponding position. Its mathematical expression is as follows:

[0064]

[0065] In the formula, Representing coordinates The velocity vector at that location includes a horizontal component. and vertical components ; This is the virtual viscous resistance coefficient at that point, which is obtained by mapping the microscopic permeability characteristics in the aforementioned embodiments; The gradient vector of the physical potential energy field is represented by the symbol "". This means that fluids always flow from regions of high potential energy to regions of low potential energy.

[0066] To solve the above equations on a discrete digital image plane, this embodiment employs the finite difference method for numerical discretization, requiring the calculation of the spatial gradient of the physical potential field. Specifically, the first-order partial derivatives of the potential field in the horizontal and vertical directions are calculated using either the central difference method or the Sobel operator. To prevent numerical instability, a mirror-fill strategy is used for image boundary pixels. Let... and They represent the potential energy field at shaft and The gradient component along the axial direction is the component of the velocity vector in both directions. and Calculated separately as follows:

[0067]

[0068]

[0069] In the actual code implementation, the above calculations are represented as point-to-point matrix operations. The final virtual velocity vector field is obtained. Vectors at all pixels Together they constitute the whole. At this point, the so-called "fluid evolution" process is concretized in the computer as an adaptive gradient filtering process constrained by texture features (resistance R).

[0070] Through the above evolutionary calculations, the differences in physical properties across different regions of the document image are transformed into a significant contrast in flow velocity vectors, forming a phenomenon known as "fluid slip." In real document areas, this is due to the viscous drag coefficient caused by ink penetration. The potential energy gradient is relatively high, and the uniform distribution of imaging noise makes the potential energy gradient... The velocity vector magnitude is relatively small; based on the formula above, the calculated value is... Approaching zero, it manifests as a state of fluid "stagnation" or "slow seepage".

[0071] Conversely, in the altered area, the micro-texture is erased by digital editing operations (such as Gaussian blur and clone patch), resulting in a decrease in the viscosity coefficient at that location. An abnormal drop (approaching the resistance of a fluid on a smooth surface); simultaneously, foreign noise or splicing traces introduced by the tampering operation cause drastic fluctuations in the local potential field, resulting in a decrease in the gradient value. The denominator decreases and the numerator increases. Under the combined effect of these two factors (decreasing denominator and increasing numerator), the velocity vector magnitude corresponding to the tampered region will increase exponentially, manifesting as high-speed "slippage" of the fluid on the smooth tampered surface. In the algorithm logic of this embodiment, the "fluid slippage" phenomenon is quantified as the velocity vector magnitude. Local abnormal mutations. The system can be set with an adaptive threshold. When the flow velocity modulus at a certain pixel When the region is determined to have undergone dynamic slippage, it corresponds to a potentially tampered area in the document image.

[0072] This fluid slip phenomenon not only numerically amplifies tampering traces but also exhibits a clear physical directionality. Due to the presence of potential energy gradients, the velocity vector tends to point in the direction of potential energy drop, thus forming a coherent cluster of streamlines along the tampering boundary. This dynamic characteristic allows previously isolated, weak pixel-level tampering clues to connect in the flow field into dynamic streamlines with an overall topological structure, greatly enhancing the sensitivity of detection algorithms to fine-grained tampering and subtle traces.

[0073] In the document tampering detection system provided by this invention, this step is performed by the flow field evolution module. The flow field evolution module receives potential energy field data from the physical domain initialization module and drag coefficient data from the drag field construction module. It uses parallel computing units (such as the CUDA cores of a GPU) to perform point-by-point gradient calculations and vector division operations on all pixels of the image to quickly generate a high-resolution virtual flow velocity vector field. This vector field data is then transmitted to the subsequent graph topology construction module for structured analysis.

[0074] In this embodiment, after generating the virtual velocity vector field, in order to capture the topological structure of tampering traces at a macroscopic level and reduce the computational complexity of subsequent processing, a heterogeneous graph needs to be constructed based on the dynamic distribution characteristics of the velocity vector field. This step aims to transform the originally dense pixel-level flow field data into sparse but semantically rich graph-structured data, where the topological structure of the heterogeneous graph is jointly determined by the streamline characteristics and singularity characteristics of the flow field. This process is executed through a graph topology construction module, which uses the continuity principle of fluid mechanics to correlate discrete local anomalies.

[0075] To accurately locate key structural points in the flow field, this invention first calculates the divergence field of the virtual velocity vector field. The divergence field describes the degree of convergence or divergence of the fluid at each point, effectively indicating boundary regions where the fluid medium properties undergo abrupt changes. For the virtual velocity vector field... Its divergence field The calculation formula is as follows:

[0076]

[0077] In the formula, and These represent the partial derivatives of the horizontal and vertical components of the flow velocity vector, respectively.

[0078] After calculating the divergence field, the system detects the extreme points within it. Physically, positive divergence extreme points correspond to the fluid's "source," while negative divergence extreme points correspond to its "sink." In the context of document tampering detection, these extreme points often appear at the boundary between the real and tampered regions because abrupt changes in the medium's viscous drag lead to drastic changes in velocity and discontinuities in flow direction. The system marks the detected divergence extreme points as flow field singularities; these singularities constitute key feature anchors indicating the tampering boundary.

[0079] Subsequently, a node set for the heterogeneous graph is constructed based on the aforementioned flow field singularities. To ensure that the graph structure can focus on potentially tampered regions while also covering the global background information of the image, all flow field singularities and several background random sampling points are selected as the topological anchor nodes of the heterogeneous graph. Background sampling points can be obtained through Poisson disk sampling or uniform grid sampling strategies to ensure appropriate node distribution even in non-singular regions, so that the model can learn the flow field patterns in normal regions. These nodes are collectively referred to as the topological anchor node set. .

[0080] After determining the nodes, the connectivity between any two topological anchor nodes is calculated to establish an edge set. This invention does not simply establish connections based on Euclidean distance, but rather establishes streamline adjoint edges based on the trajectory trends of fluid dynamics. For any two nodes... and A connection edge is established only if the nodes lie on the same fluid trajectory trend and satisfy the condition of consistent streamline direction. Specifically, from node... Starting from the velocity vector Numerical integration is performed in the direction to generate streamline trajectories. Specifically, the numerical integration employs either the Euler method or the second-order Runge-Kutta method with iterative steps. If the node... If two points fall within a preset neighborhood width of the streamline trajectory, and the cosine of the angle between their velocity directions is greater than a preset threshold, then they are determined to have a hydrodynamic relationship. This determination method based on integral trajectories achieves non-Euclidean distance connections along the flow field direction in computer vision.

[0081] Streamline direction consistency condition through computation nodes velocity vector at the location With nodes velocity vector at the location The cosine similarity between them is used to determine the similarity, and the calculation formula is as follows:

[0082]

[0083] Only when ( A directed edge is established between two nodes only when the directional consistency threshold is reached. This streamline-based edge-connection strategy can connect discrete singular points belonging to the same tampering operation (such as an erasure or the same copying region) across spatial distances, forming a heterogeneous graph structure with clear physical semantics.

[0084] In the document tampering detection system of this invention, the graph topology construction module is responsible for performing the above operations. This module receives virtual flow velocity vector field data, calculates the divergence field using an efficient difference operator, accurately locates singular points in the flow field using the non-maximum suppression (NMS) algorithm, and generates a node list using a random sampler. Subsequently, it traverses node pairs using a streamline tracing algorithm to construct an adjacency matrix. The resulting heterogeneous graph not only contains the spatial location information of the nodes but also encodes the global dynamic evolution logic of the flow field through streamline adjoint edges, providing highly structured input data for subsequent inference and analysis by the graph neural network.

[0085] In this embodiment, after constructing a heterogeneous graph containing the flow field dynamics topology, a graph neural network is used to perform inference analysis on the heterogeneous graph to generate the final detection result for locating document tampering regions. This step is executed by the inference detection module, the core of which lies in deeply fusing the flow field features based on the physical model with the texture features based on deep learning, and propagating the features on the sparse topology through a graph attention mechanism, thereby achieving accurate determination of tampered regions.

[0086] First, the system performs node feature aggregation. This is done for each topological anchor node in the heterogeneous graph. This involves obtaining the local texture features of the corresponding coordinates in the original document image. Specifically, nodes are extracted using truncated convolutional neural networks (such as shallow residual blocks of ResNet). Texture feature vectors in the neighborhood To integrate physical field information, the virtual velocity vector magnitude generated during the flow field evolution stage is used. and virtual viscous drag coefficient Normalization is performed and then concatenated into the texture feature vector to form the initial feature representation of the node. This feature construction method ensures that the neural network not only "sees" the visual texture of the image, but also "perceives" the medium resistance properties and hydrodynamic state at that location.

[0087] Subsequently, the attention coefficients between nodes connected by streamlined adjoint edges are calculated, and the node states are updated using a graph attention mechanism. For each node... and its neighboring nodes First, calculate the nonnormalized correlation coefficient between them. The calculation process uses a learnable weight matrix. The node features are linearly transformed, and the transformed features are concatenated and then passed through a shared attention weight vector. The mapping to a scalar is as follows:

[0088]

[0089] In the formula, This represents a vector concatenation operation. LeakyReLU is a non-linear activation function used to enhance the expressive power of the model.

[0090] To ensure the comparability of weights between nodes, the correlation coefficients are normalized using the Softmax function to obtain the final attention coefficients. :

[0091]

[0092] In the formula, Represents a node The set of all neighboring nodes connected by the accompanying edge of the flow line. Attention coefficient. The neighboring nodes were dynamically measured. For the central node The importance of nodes. In the context of fluid mechanics, this means that nodes located on the same streamline trend and with significant velocity characteristics will receive higher weights, thus enabling the tampered signal to propagate efficiently along the flow path of the virtual fluid.

[0093] Based on the calculated attention coefficient, the node features within the neighborhood are weighted and aggregated to update the nodes. status :

[0094]

[0095] In the formula, This is a nonlinear activation function (such as ELU). By stacking multiple graph attention layers, nodes in the heterogeneous graph can aggregate contextual information from singular points in the flow field at a distance, thereby effectively distinguishing between isolated artifacts caused by imaging noise and large-scale flow field anomalies caused by tampering operations.

[0096] After updating the node state, binary classification is performed on the updated node features. A fully connected layer (MLP) maps the high-dimensional node features to tamper probability values. The system determines whether a node belongs to a "tampered area" or the "real background." To map the classification results of sparse nodes back to the full-resolution image space, the system performs interpolation based on the discrimination results and the directional constraints of the virtual flow velocity vector field.

[0097] The interpolation process is not a simple geometric distance weighting, but rather employs a streamline-guided diffusion strategy. Specifically, this strategy is implemented as an inverse distance-weighted interpolation along a streamline path. For any pixel on the image plane that is not selected as a node... The system first backtracks the streamline containing the point to find the nearest topological anchor nodes on the streamline; then it calculates the point... The distance from these anchor nodes along the streamline trajectory is used, rather than the straight-line Euclidean distance; finally, the classification probability of the anchor nodes is weighted and averaged according to the reciprocal of the curved distance to obtain the point. The tampering confidence level is determined. If a pixel is located on a high-velocity streamline connecting two nodes identified as tampered, that pixel is assigned a high tampering probability. Finally, the interpolated probability map is thresholded to generate a binary tampering location mask. This mask is output as a black and white binary image, where the white areas precisely locate the tampered parts of the document, clearly outlining traces of operations such as forged text, stamp replacement, or background erasure.

[0098] In this embodiment, to implement the aforementioned document tampering detection method, the present invention further provides a document tampering detection system based on image data processing. This system runs on a high-performance computing device in the form of software code, hardware circuitry, or a combination of both. The functional modules collaborate closely through a data bus or shared memory, forming a closed-loop physical flow field simulation and intelligent inference architecture. The system mainly includes a physical domain initialization module, a drag field construction module, a flow field evolution module, a graph topology construction module, and an inference detection module.

[0099] The physical domain initialization module, serving as the system's sensing front-end, is primarily configured to perform image preprocessing and potential energy field mapping tasks. This module first acquires the high-resolution document image to be detected through the image acquisition interface and processes the image data using a parallel-accelerated nonlocal mean denoising algorithm. Its core logic lies in separating the inherent fingerprint noise of the imaging device, calculating the absolute difference between the original grayscale image and the denoised smoothed image, and instantiating this difference data matrix into a physical potential energy field. The physical domain initialization module ensures that the subsequent fluid evolution process has an energy driving source based on the actual sensor noise distribution, causing the tampered area to exhibit an abnormal potential energy gradient due to the disruption of the noise fingerprint.

[0100] The drag field construction module works in parallel with the physical domain initialization module, focusing on mining the microscopic texture attributes in document images. This module is equipped with a high-frequency filter and a statistical analysis unit to traverse each local window of the image, calculating the variance-to-mean ratio of the gradient and the high-frequency response intensity. The drag field construction module does more than just extract features; more importantly, it performs a physical mapping function, generating a virtual viscous drag field based on the calculated microscopic permeability characteristics using a nonlinear mapping function. The drag field data output by this module accurately quantifies the medium's resistance to the virtual fluid, marking real ink areas as high-resistivity media and smooth, altered areas as low-resistivity media.

[0101] The flow field evolution module is the core dynamics simulation engine of this system, connecting the physical potential energy field and the virtual viscous drag field. This module is configured for numerical calculations based on a variant of Darcy's law model, specifically reading the potential energy gradient data output from the physical domain initialization module and the drag coefficient data output from the drag field construction module, and calculating the virtual velocity vector pixel by pixel. By dynamically adjusting the magnitude and direction of the velocity vector, the flow field evolution module simulates the slip behavior of fluids in heterogeneous media, outputting a virtual velocity vector field containing global dynamic information. This module effectively transforms static texture differences into dynamic flow field anomalies, providing a rich data foundation for subsequent topology analysis.

[0102] The graph topology construction module is responsible for transforming dense flow field data into sparse graph structure data, thus achieving a transition from the pixel domain to the graph domain. This module integrates a divergence calculation unit and a streamline tracing unit. The divergence calculation unit calculates the divergence distribution of the virtual velocity vector field, identifying the fluid's "sources" and "sinks" as flow field singularities. The streamline tracing unit then traces the velocity vector along its direction, starting from these singularities and random background sampling points. Based on the streamline connectivity and directional consistency between nodes, the graph topology construction module establishes streamline adjoint edges, constructing a heterogeneous graph structure that reflects the logical connections of tampering, and outputting graph data containing node features and an adjacency matrix.

[0103] The inference detection module, acting as the system's decision-making terminal, utilizes a graph neural network to perform deep inference on the input heterogeneous graph. This module loads a pre-trained graph attention network model, aggregating local texture features and flow dynamics features of nodes, and propagating the tampering signal across the graph topology through an attention mechanism. The inference detection module not only performs binary classification of each node but also incorporates flow velocity direction information provided by the flow field evolution module, interpolating the prediction results of sparse nodes back into the original image space to ultimately generate a binary tampering location mask. This mask visually identifies the tampered area in the document, allowing users or downstream systems to perform forensic analysis.

[0104] Furthermore, the present invention also provides a computer-readable storage medium, such as a hard disk, flash memory, or optical disk. This storage medium stores computer program instructions, which, when read and executed by a computer system's processor, cause the computer system to sequentially perform the steps described in the above embodiments, including physical potential field extraction, virtual viscous drag field construction, fluid dynamics evolution calculation, heterogeneous graph construction, and graph neural network inference analysis, thereby achieving automated detection and location of tampered areas in document images.

[0105] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A document tampering detection method based on image data processing, characterized in that, Includes the following steps: Acquire a document image to be detected, extract a noise residual map from the document image, and use the noise residual map as a physical potential energy field; Microscopic penetration features of the edges of text strokes in the document image are extracted, and a virtual viscous resistance field is constructed based on the microscopic penetration features; The step of extracting the microscopic penetration features of the edges of text strokes in the document image and constructing a virtual viscous drag field based on the microscopic penetration features specifically includes: Calculate the multi-scale gradient and high-frequency response intensity of the document image, calculate the ratio of the variance to the mean of the gradient within a local window, and obtain the local penetration rate by combining the high-frequency response intensity. Calculate local permeability The calculation formula is as follows: In the formula, The coordinates of the pixel; For local windows Variance of the internal gradient; For local windows The mean of the inner gradient; High-frequency response intensity; and These are preset weighting coefficients used to balance the contributions of gradient statistical features and high-frequency response features. To prevent extremely small positive numbers with a denominator of zero; The local permeability is converted into a viscous resistance coefficient using a mapping function, wherein the local permeability is positively correlated with the viscous resistance coefficient, so that the real ink area corresponds to a high viscous resistance coefficient and the smoothed tampered area corresponds to a low viscous resistance coefficient. Traverse all pixels of the document image to form the virtual viscous drag field composed of the viscous drag coefficient; Based on the physical potential energy field and the virtual viscous resistance field, fluid dynamics evolution calculations are performed to generate a virtual velocity vector field; A heterogeneous graph is constructed based on the dynamic distribution characteristics of the virtual velocity vector field. The topology of the heterogeneous graph is determined by the streamline characteristics and singularity characteristics of the virtual velocity vector field. The heterogeneous graph is analyzed using a graph neural network to generate detection results for locating tampered areas in the document.

2. The document tampering detection method based on image data processing according to claim 1, characterized in that, The step of extracting the noise residual map of the document image specifically includes: Convert the document image to a grayscale image; The grayscale image is processed using a nonlocal mean denoising filter to obtain a smooth image; The difference between the grayscale image and the smoothed image is calculated to obtain the noise residual map, wherein the pixel intensity value in the noise residual map is defined as the potential energy distribution of the physical potential energy field.

3. The document tampering detection method based on image data processing according to claim 1, characterized in that, The step of generating a virtual velocity vector field by performing fluid dynamics evolution calculations based on the physical potential energy field and the virtual viscous drag field specifically includes: Based on a variant model of Darcy's law, the virtual velocity vector field is defined as a vector field that is proportional to the gradient of the physical potential energy field and inversely proportional to the viscous drag coefficient at the corresponding position in the virtual viscous drag field. Calculate the velocity vector at each point on the document image plane. When the viscous drag coefficient of the virtual viscous drag field decreases abnormally, the corresponding velocity vector magnitude increases, resulting in fluid slippage.

4. The document tampering detection method based on image data processing according to claim 3, characterized in that, Before the step of constructing a heterogeneous graph based on the dynamic distribution characteristics of the virtual velocity vector field, the method further includes: Calculate the divergence field of the virtual velocity vector field; The extreme points in the divergence field are detected and used as flow field singularities in the virtual velocity vector field to indicate the altered boundaries of abrupt changes in fluid medium properties.

5. The document tampering detection method based on image data processing according to claim 4, characterized in that, The step of constructing a heterogeneous graph based on the dynamic distribution characteristics of the virtual velocity vector field specifically includes: The singular points in the flow field and several random background sampling points are selected as the topological anchor nodes of the heterogeneous graph; Calculate the connection relationship between any two topological anchor nodes. Establish a streamline adjoint edge only when the two topological anchor nodes are located on the same fluid trace trend and satisfy the streamline direction consistency condition. The heterogeneous graph is generated based on the topological anchor nodes and the streamline accompanying edges.

6. The document tampering detection method based on image data processing according to claim 5, characterized in that, The step of using a graph neural network to perform inference analysis on the heterogeneous graph and generate detection results for locating document tampering regions specifically includes: The local texture features of the topological anchor node in the document image are obtained, and the local texture features, the velocity vector magnitude of the virtual velocity vector field, and the viscous drag coefficient of the virtual viscous drag field are aggregated as node features. Calculate the attention coefficients between nodes connected by streamlined adjoint edges, and update the node states using a graph attention mechanism; The updated nodes are classified into two categories, and interpolation is performed based on the classification results and the directional constraints of the virtual flow velocity vector field to generate a binary tampering location mask.

7. A document tampering detection system based on image data processing, characterized in that, The system includes: The physical domain initialization module is used to acquire the document image to be detected, extract the noise residual map of the document image, and use the noise residual map as a physical potential energy field. The resistance field construction module is used to extract the microscopic penetration features of the edges of the strokes of the text in the document image, and construct a virtual viscous resistance field based on the microscopic penetration features; The flow field evolution module is used to perform fluid dynamics evolution calculations based on the physical potential energy field and the virtual viscous drag field, and generate a virtual flow velocity vector field. The graph topology construction module is used to construct a heterogeneous graph based on the dynamic distribution characteristics of the virtual velocity vector field. The topology of the heterogeneous graph is determined by the streamline characteristics and singularity characteristics of the virtual velocity vector field. The inference detection module is used to perform inference analysis on the heterogeneous graph using a graph neural network to generate detection results for locating document tampering areas.

8. The document tampering detection system based on image data processing according to claim 7, characterized in that, The graph topology construction module is specifically configured as follows: Calculate the divergence field of the virtual velocity vector field to identify singularities in the flow field; The flow field singular points and several background random sampling points are selected as topological anchor nodes, and streamline adjoint edges are established only when two topological anchor nodes are located on the same fluid trace trend and satisfy the streamline direction consistency condition, thereby constructing the heterogeneous graph.

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