Document tampering detection method, device and equipment for network document content security
By adding learnable prompt words to the frequency domain components of document images and training a neural network model, the problems of insufficient robustness and generalization ability of document image tampering detection in the existing technology are solved, and more efficient document tampering detection is achieved.
Patent Information
- Application Number
- CN202411558985.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-04
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-11-04
AI Technical Summary
Existing document image tampering detection methods lack robustness and cross-domain generalization capabilities when faced with document images of different quality and content, and are unable to effectively identify tampering behavior.
By adding learnable prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component of the initial document image respectively, a target document image is generated, and it is used as a training image to train the pre-trained neural network model to obtain a document tampering detection model.
It improves the accuracy and generalization performance of document tampering detection, can more effectively capture the distortion features of tampered text, and improves the tampering detection ability of document images.
Smart Images

Figure CN119445344B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical fields of image processing and network security, and in particular to a document tampering detection method, device and equipment for network document content security. Background Art
[0002] With the rapid development of information technology, digital documents have been widely adopted in various application scenarios, especially in fields such as business, law, and medicine, where they have become the primary form of information exchange and storage. However, compared to paper documents, digital documents are more easily modifiable. They can be easily modified using image editing tools, or key information in document images can be tampered with using deep learning networks. These operations are often difficult to detect, making it extremely difficult to identify forgeries. Tampering seriously affects the authenticity and integrity of document content.
[0003] Existing document image tampering detection methods primarily rely on text features, document content structured features, and texture features, effectively achieving document image tampering detection under certain conditions. However, when faced with document images of varying quality and content, greater robustness and cross-domain generalization are required. Existing document image tampering detection methods are sensitive to document image type and content, and their generalization performance still needs to be improved, failing to meet these requirements. Summary of the Invention
[0004] The present invention provides a document tampering detection method, device and equipment for network document content security, so as to realize tampering detection of document images.
[0005] In a first aspect, an embodiment of the present invention provides a document tampering detection method for network document content security, the method comprising:
[0006] generating a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component according to an initial document image;
[0007] adding prompt words to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively, and generating a target document image according to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component after the prompt words are added;
[0008] The target document image is used as a training image to train a pre-trained neural network model to obtain a document tampering detection model, and document tampering detection is performed using the document tampering detection model.
[0009] In a second aspect, an embodiment of the present invention further provides a document tampering detection device for network document content security, the device comprising:
[0010] a component determination module configured to generate a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component according to the initial document image;
[0011] a target document image determination module configured to add a prompt word to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively, and generate a target document image according to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component after the prompt word is added;
[0012] a document tampering detection module configured to train the pre-trained neural network model by taking the target document image as a training image, obtain a document tampering detection model, and perform document tampering detection through the document tampering detection model.
[0013] In a third aspect, an electronic device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the document tampering detection method for network document content security according to any of the embodiments of the present application when executing the program.
[0014] In a fourth aspect, a storage medium storing computer executable instructions is provided, and the computer executable instructions are used to execute the document tampering detection method for network document content security according to any of the embodiments of the present application when executed by a computer processor.
[0015] The technical scheme of the embodiments of the present application realizes tampering detection of a document image by adding prompt words to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component of an initial document image respectively, processing the initial document image, taking the target document image as a training image to train a neural network model, obtaining a document tampering detection model, and performing document tampering detection, thereby improving the document tampering detection performance.
[0016] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the present application, nor is it used to limit the scope of the present application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed in the embodiment description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0018] Figure 1 This is a flow chart of a document tampering detection method for network document content security provided by the first embodiment of the present invention;
[0019] Figure 2 This is a flow chart of a document tampering detection method for network document content security provided by the second embodiment of the present invention;
[0020] Figure 3 is a schematic diagram of a text image and a background image provided by the second embodiment of the present invention;
[0021] Figure 4 This is a schematic structural diagram of a document tampering detection device for network document content security provided by a third embodiment of the present invention;
[0022] Figure 5 This is a structural diagram of an electronic device provided in Example 4 of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices. In the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be considered as exemplary. Their purpose is merely to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0025] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0026] Example 1
[0027] Figure 1 A flowchart of a document tampering detection method for network document content security is provided for the first embodiment of the present invention. This embodiment is applicable to document image tampering detection. The method can be executed by a document tampering detection device for network document content security. The document tampering detection device for network document content security can be implemented in the form of hardware and / or software. The document tampering detection device for network document content security can be configured in any electronic device with network communication and computing capabilities. Figure 1 As shown, the method includes:
[0028] S110 , generating a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component according to the initial document image.
[0029] In this embodiment, the initial document image is an image obtained by photographing or scanning the document, the background amplitude domain component is the amplitude component of the background area in the frequency domain, the background phase domain component is the phase component of the background area in the frequency domain, the text amplitude domain component is the amplitude component of the text area in the frequency domain, and the text phase domain component is the phase component of the text area in the frequency domain.
[0030] In this embodiment, the initial document image can be obtained by photographing a paper document or an electronic document with a camera, or by scanning a paper document with a scanner, or can be directly obtained from an existing document image database. This embodiment does not limit the method for obtaining the initial document image.
[0031] Furthermore, by processing the initial document image through an image processing algorithm, the amplitude and phase domain components of the initial document image can be obtained. The amplitude domain component of the initial document image contains more style information, and the phase domain component contains more semantic content. By obtaining the background amplitude domain component, background phase domain component, text amplitude domain component, and text phase domain component, the accuracy of subsequent document tampering detection can be improved.
[0032] S120, adding prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component respectively, and generating a target document image based on the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component after adding the prompt words.
[0033] In this embodiment, the prompt words represent a set of adjustable learnable parameters, and the target document image represents the document image after the prompt words are added.
[0034] It should be noted that compared with manually designed fixed prompt words, learnable prompt words are more flexible and can better capture the requirements and characteristics of the task.
[0035] In practical applications, learnable cue words are added to the background amplitude domain component, background phase domain component, text amplitude domain component, and text phase domain component. These learnable cue words can learn information from different regions of a document image. By training document images with these cue words added to update and optimize the model, the model can more effectively capture the distortion characteristics of tampered text, thereby improving the generalization performance of existing tampering detection methods.
[0036] Furthermore, learnable prompt words are added, which are automatically adjusted through optimization during the neural network model training process. By introducing a small number of learnable prompt words at the input, the document tampering detection method for network document content security can be adapted to various network architectures, achieving plug-and-play operation.
[0037] Furthermore, the target document image is obtained through image processing based on the background amplitude domain component, the background phase domain component, the text amplitude domain component and the text phase domain component after the prompt word is added.
[0038] Optionally, prompt words are added to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively, including:
[0039] Prompt words are added to the central areas of the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively.
[0040] In this embodiment, the amplitude domain reflects signal strength information. The central region of the amplitude domain component can be a region with a highly focused signal amplitude, a region with significant amplitude characteristics, or a core range of concentrated amplitude distribution. The phase domain contains signal phase information. The central region of the phase domain component can be a region with a stable phase, a region with dominant phase characteristics, or a location with a prominent phase.
[0041] Specifically, the center regions of each amplitude and phase domain component can be determined by analyzing the signal and finding the key locations of amplitude and phase. For example, in multi-resolution image analysis, the center regions of different frequencies can be determined by performing spectral decomposition on the full phase system function.
[0042] Furthermore, a learnable cue word is added to the central region of the determined background amplitude domain component, background phase domain component, text amplitude domain component, and text phase domain component. The cue word can be a specific numerical value, vector, or function, and its value can be adjusted through training to adapt to different task requirements. For example, the learnable cue word can be used as a direct replacement for text embedding to activate task-related features.
[0043] It should be noted that the center regions of the amplitude domain component and the phase domain component contain the most information and features, and therefore, the hint words are added in the center regions of the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component, which is beneficial to improve the distortion features of the tampered text captured by the document tampering detection model, and improve the accuracy and generalization performance of the document tampering detection method for network document content security.
[0044] In S130, the target document image is taken as a training image to train the pre-trained neural network model to obtain a document tampering detection model, and the document tampering detection model is used for document tampering detection.
[0045] In this embodiment, the document tampering detection model represents a model for performing document tampering detection, and the document tampering detection model is obtained by training a neural network model with a target document image as a training image.
[0046] Commonly used neural network models include convolutional neural network models, residual network models, and Transformer network models, etc.
[0047] It should be noted that in this embodiment, the target document image is obtained by processing the initial document image, which is used to train the neural network model to obtain the document tampering detection model, and then the document tampering detection model is used for document tampering detection of the document image, which is beneficial to improve the accuracy of the document tampering detection model for document image tampering detection and the generalization performance of the document tampering detection method for network document content security.
[0048] Optionally, the document tampering detection by the document tampering detection model includes:
[0049] The document tampering detection result output by the document tampering detection model is obtained by inputting the to-be-recognized document image into the document tampering detection model.
[0050] In this embodiment, the to-be-recognized document image represents an image containing text content to be recognized, and the document tampering detection result is whether the to-be-recognized document image is a document tampering image.
[0051] In actual application, the document tampering detection result can be returned to the terminal for visual display. Specifically, the document tampering detection result can be displayed in the form of pure text on the terminal, directly listing the key information of the detection, such as whether it is tampered with, the tampering position or the tampering type (such as text replacement, deletion, addition, etc.), so that the document tampering detection result is clear and easy to understand. The original image of the document or the preview image of the electronic document can also be displayed on the terminal, and different colors and shapes of markers can be used to highlight the tampered areas. The visual display of the document tampering detection result in this embodiment is not specifically limited.
[0052] The technical solution of the embodiment of the present invention obtains a target document image by adding prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component of the initial document image and then processing them. The target document image is used as a training image to train a pre-trained neural network model to obtain a document tampering detection model and perform document tampering detection, thereby realizing tampering detection of document images and improving the generalization performance of the document tampering detection method for network document content security.
[0053] Example 2
[0054] Figure 2 This is a flowchart of a document tampering detection method for network document content security, provided in Example 2 of the present invention. This embodiment is applicable to document image tampering detection. The method can be performed by a document tampering detection device for network document content security. The device can be implemented in hardware and / or software and can be configured in any electronic device capable of network communication and computing. This embodiment of the present invention further refines the above-mentioned embodiment.
[0055] like Figure 2 As shown, the method includes:
[0056] S210: Perform character recognition on the initial document image to obtain a text area mask.
[0057] In this embodiment, the text area mask represents a binary image consisting of a white area and a black area.
[0058] It should be noted that the text area mask can be obtained by marking the text area in the document image and covering the background area through a specific character recognition method, forming a "mask" that only targets the text area. The mask can be binary or have areas with different transparency or color values to distinguish between text and background.
[0059] Among them, commonly used character recognition methods include character recognition methods based on template matching, character recognition methods based on feature extraction, and character recognition methods based on deep learning. In this embodiment, the character recognition method used for character recognition of the initial document image is not specifically limited.
[0060] Specifically, the existing deep learning-based optical character recognition method can be used to detect the text area and background area (non-text area) in the initial document image, set the pixel value of the text area to all 1 to display white, and set the pixel value of the background area to all 0 to display black, to obtain the text area mask of the corresponding binary image.
[0061] S220 : Divide the initial document image into a text area and a background area according to the text area mask.
[0062] It should be noted that the white area in the text area mask of the binary image represents the text area, and the black area represents the background area. This is because the pixel values of the text area in the text area mask are all 1 and appear white, while the pixel values of the background area are all 0 and appear black.
[0063] Therefore, the text area and background area of the original document image can be determined based on the black area and the white area in the text area mask.
[0064] S230: Generate a text image according to the text area, and generate a background image according to the background area.
[0065] In this embodiment, the text area in the original document is retained according to the text area mask, and the pixel values of the background area are set to 0 to display black, thereby obtaining a text image. At the same time, the pixel values of the text area are set to 0 to display black according to the text area mask, and the background area in the original document is retained to obtain a background image.
[0066] It should be noted that, considering that document image tampering typically occurs in the text region, the text region mask generated by the optical character recognition algorithm distinguishes different regions in the original document image. A text image is generated based on the text region, and a background image is generated based on the background region. This allows the document tampering detection model to better distinguish between text and background, allowing it to focus more on the text, which helps improve the accuracy of the document tampering detection model in detecting document image tampering.
[0067] S240: Convert the background image to the background frequency domain, and split the background frequency domain into a background amplitude domain component and a background phase domain component; and convert the text image to the text frequency domain, and split the text frequency domain into a text amplitude domain component and a text phase domain component.
[0068] It should be noted that the background frequency domain and the text frequency domain are complex matrices, wherein the background frequency domain contains the amplitude and phase information of the signal in the background image, and the text frequency domain contains the amplitude and phase information of the signal in the text image.
[0069] In this embodiment, converting the background image to the background frequency domain means converting the signal in the background image from the spatial domain to the frequency domain, thereby revealing the distribution of different frequency components in the background image. Similarly, converting the text image to the text frequency domain means converting the signal in the text image from the spatial domain to the frequency domain, thereby revealing the distribution of different frequency components in the text image.
[0070] Furthermore, the background frequency domain can be split into a background amplitude domain component and a background phase domain component, and the text frequency domain can be split into a text amplitude domain component and a text phase domain component.
[0071] Optionally, converting the background image into a background frequency domain and splitting the background frequency domain into a background amplitude domain component and a background phase domain component includes steps A1-A2:
[0072] Step A1: Perform discrete Fourier transform on the background image to obtain the background frequency domain.
[0073] Step A2: performing amplitude calculation on the background frequency domain to obtain a background amplitude domain component, and performing phase calculation on the background frequency domain to obtain a background phase domain component.
[0074] It should be noted that commonly used frequency conversion methods include discrete Fourier transform and wavelet transform. Among them, commonly used amplitude calculation methods include vector amplitude calculation method and amplitude spectrum calculation method based on frequency domain signal, and phase calculation methods include phase calculation based on phase difference and phase calculation based on trigonometric functions.
[0075] In this embodiment, a background frequency domain is obtained by performing a discrete Fourier transform on the background image, which is expressed by the following formula:
[0076]
[0077] in, is the background frequency domain, I b For the background image, H is the image height, W is the image width, and C is the number of RGB channels in the image.
[0078] Furthermore, the background frequency domain amplitude spectrum can be determined by using an amplitude spectrum calculation method based on the frequency domain signal to determine the background amplitude component. The background phase domain component can be obtained by calculating the phase of the complex number in the background frequency domain.
[0079] Convert the text image to the text frequency domain, and split the text frequency domain into the text amplitude domain component and the text phase domain component, including steps C1-C2:
[0080] Step C1: Perform discrete Fourier transform on the text image to obtain the text frequency domain.
[0081] Step C2: performing amplitude calculation on the text frequency domain to obtain the text amplitude domain component, and performing phase calculation on the text frequency domain to obtain the text phase domain component.
[0082] In this embodiment, a discrete Fourier transform is performed on the text image to obtain the text frequency domain, which is expressed by the following formula:
[0083]
[0084] in, is the text frequency domain, I t For text images, H is the image height, W is the image width, and C is the number of RGB channels in the image.
[0085] Furthermore, the amplitude spectrum of the text in the frequency domain can be determined by using an amplitude spectrum calculation method based on frequency domain signals to determine the background amplitude component. The phase domain component of the text can be obtained by calculating the phase of the complex number in the frequency domain of the text.
[0086] It's important to note that the amplitude domain components of text reflect the intensity information of text in the frequency domain. By analyzing the amplitude domain, we can obtain characteristics such as the thickness variation of text strokes. Using the amplitude domain components of text, we can distinguish text in different fonts. Different fonts have different stroke structures and distributions, and thus exhibit different amplitude distribution patterns in the frequency domain. For example, Songtiface and Boldtiface. Songtiface has thin strokes and more decorative strokes, and thus may have richer amplitude information in the high-frequency region. Boldtiface, on the other hand, has more uniform stroke thickness and may have relatively more stable amplitude information in the low-frequency region.
[0087] Furthermore, the text phase domain component contains positional information about the text's strokes and structure. It can provide more stable features for text deformations (such as tilt and rotation). Because phase information is somewhat related to the text's geometric structure, when text is deformed, the phase domain may better reflect the text's original structural features than the amplitude domain. Therefore, using the text phase domain component can help improve the robustness of deformed text recognition.
[0088] Since the document tampering area is more concentrated in the text area, the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component are obtained respectively, which is conducive to better distinguishing the amplitude domain features and phase domain features of the text area and the background area, so that the document tampering model pays more attention to the text. When faced with document images with different quality and content, the document tampering detection method used for network document content security has stronger robustness and cross-domain generalization capabilities.
[0089] S250, respectively add prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component, and generate a target document image based on the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component after adding the prompt words.
[0090] The specific process of adding prompt words has been described in the above embodiment and will not be repeated here in this embodiment.
[0091] Optionally, generating a target document image according to the background amplitude domain component, background phase domain component, text amplitude domain component, and text phase domain component after adding the prompt word includes steps B1-B2:
[0092] Step B1: Perform inverse Fourier transform on the background amplitude domain component and background phase domain component after adding the prompt word to obtain a background prompt image, and perform inverse Fourier transform on the text amplitude domain component and text phase domain component after adding the prompt word to obtain a text prompt image.
[0093] Step B2: Fuse the background prompt image and the text prompt image to obtain a target prompt image.
[0094] In this embodiment, the background prompt image represents an image containing the background area obtained by inverse Fourier transforming the background amplitude and phase components after the prompt word is added. The text prompt image represents an image containing the text area obtained by inverse Fourier transforming the text amplitude and phase components after the prompt word is added. The target prompt image represents an image containing the background and text areas obtained by fusion of the background prompt image and the text prompt image.
[0095] The inverse Fourier transform is the inverse of the Fourier transform. In image processing, the inverse Fourier transform can be used for image reconstruction. By performing a Fourier transform on an image, a frequency domain representation of the image is obtained. This frequency domain representation is then processed, and the inverse Fourier transform is used to convert the processed frequency domain signal back into a spatial domain representation of the image, achieving image reconstruction.
[0096] In this embodiment, a background prompt image and a text prompt image are obtained by inverse Fourier transform, and the background prompt image and the text prompt image are fused to obtain a complete target prompt image.
[0097] Specifically, the background amplitude domain component and the background phase domain component after adding the prompt word are subjected to inverse Fourier transform to obtain a background prompt image, which is expressed by the following formula:
[0098]
[0099] in, Represents the background hint image, represents the inverse Fourier transform, represents the background amplitude domain component, represents the background phase domain component, and Indicates the prompt words added to the background amplitude domain component and the prompt words added to the background phase domain component.
[0100] Specifically, the amplitude domain component and the phase domain component of the text after adding the prompt word are subjected to inverse Fourier transform to obtain the text prompt image, which is expressed by the following formula:
[0101]
[0102] in, Represents a text hint image, represents the inverse Fourier transform, Represents the amplitude domain component of the text, represents the phase domain component of the text, and Indicates the prompt words added to the amplitude domain component of the text and the prompt words added to the phase domain component of the text.
[0103] Specifically, the background prompt image and the text prompt image are fused to obtain the target prompt image, which is expressed as follows:
[0104]
[0105] Among them, I P represents the target prompt image, Represents the background hint image, Represents a text hint image.
[0106] S260: Use the target document image as a training image to train a pre-trained neural network model to obtain a document tampering detection model, and perform document tampering detection using the document tampering detection model.
[0107] The technical solution of the embodiment of the present invention generates a text area mask by performing character recognition on the initial document image, determines the text image and background image according to the document area mask, and adds prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component respectively, and then processes them to obtain a target document image. The target document image is used as a training image to train a pre-trained neural network model to obtain a document tampering detection model and perform document tampering detection, thereby realizing tampering detection of the document image and improving the generalization performance of the document tampering detection method for network document content security.
[0108] To verify the effectiveness of the document tampering detection method for network document content security presented in this embodiment, Datasets A and B were used as test sets. Cross-database experiments were conducted on image detection and semantic segmentation models, including existing deep learning-based models A, B, and C, and an existing convolutional neural network-based model D. Both datasets contained high-resolution certificate documents with rich content and used multiple operations to simulate manual tampering, encompassing a wider range of practical application scenarios.
[0109] The experimental results all use intersection over union (IoU), precision, recall and F1-score as evaluation indicators.
[0110] Table 1 shows the results of the cross-database experiment. If the model is not fine-tuned (model a, model b, model c, model d), the cross-database performance is poor.
[0111] Fine-tuning only the decoder in each model's network architecture (model a(F), model b(F), model c(F), and model d(F)) yields some performance improvement, but the gains are modest. Fine-tuning was performed using dataset C, which contains images of documents such as certificates and documents with rich background colors and large tampered areas. During fine-tuning, the cue size was 64×64 pixels, the model input size was 512×512 pixels, and an optimizer with a learning rate of 3e was used. -5 , with a batch size of 12 and trained for 20 epochs using the cross entropy loss and loss function.
[0112] However, by extending the document tampering method of the present application to various models (a+MFVP(F) model, b+MFVP(F) model, c+MFVP(F) model, d+MFVP(F) model), the performance gain is the greatest in most cases, proving the effectiveness and scalability of the document tampering detection method of the present application for network document content security.
[0113] Table 1 Cross-database experimental results (the best performance under each backbone network is marked in bold)
[0114]
[0115]
[0116] Among them, -F means using dataset C to fine-tune the network's decoder; -MFVP(F) means adding learnable prompt words to the frequency domain space of different areas of the initial document image, that is, expanding the document tampering detection method for network document content security of this application on the original model.
[0117] In addition, the document tampering detection method for network document content security is expanded on each original model to visualize the prompt words learned in the amplitude domain of the text image and background image.
[0118] See also Figure 3 The figure shows a diagram of a text image and a background image. The information learned from the text image and the background image is different, proving that the prompt word can capture the difference between the two and more effectively capture the distortion traces introduced by tampering operations.
[0119] Furthermore, in order to prove the effectiveness of introducing text region masks to distinguish the text region and background region in the document image, and adding prompt words in the frequency domain of the text image and background image respectively.
[0120] Model a, which showed good cross-database performance, was selected for ablation experiments. Table 2 shows the ablation results, where FVP represents Fourier transforming the input image and adding learnable prompts to it in the frequency domain, regardless of region division. Since document image tampering primarily occurs in text regions, the gains from region division are more significant, demonstrating the importance of introducing text region masks to distinguish between text and background regions in document images.
[0121] Table 2 Ablation experiment results (the best performance is marked in bold)
[0122]
[0123] Example 3
[0124] Figure 4 This is a schematic diagram of the structure of a document tampering detection device for network document content security provided by the third embodiment of the present invention. This embodiment is applicable to document image tampering detection. The document tampering detection device for network document content security can be implemented in the form of hardware and / or software. The document tampering detection device for network document content security can be configured in any electronic device with network communication and computing capabilities. Figure 4 As shown, the device includes:
[0125] A component determination module 310 is configured to generate a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component based on an initial document image;
[0126] a target document image determination module 320 for adding prompt words to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component, respectively, and generating a target document image based on the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component after the prompt words are added;
[0127] The document tampering detection module 330 is configured to train the pre-trained neural network model by taking the target document image as a training image to obtain a document tampering detection model, and perform document tampering detection by using the document tampering detection model.
[0128] Optionally, the component determination module 310 comprises:
[0129] generating a background image and a text image according to the initial document image;
[0130] converting the background image to a background frequency domain, and splitting the background frequency domain into a background amplitude domain component and a background phase domain component, and converting the text image to a text frequency domain, and splitting the text frequency domain into a text amplitude domain component and a text phase domain component.
[0131] Optionally, the component determination module 310 comprises:
[0132] performing character recognition on the initial document image to obtain a text region mask;
[0133] dividing the initial document image into a text region and a background region according to the text region mask;
[0134] generating a text image according to the text region, and generating a background image according to the background region.
[0135] Optionally, the component determination module 310 comprises:
[0136] performing discrete Fourier transform on the background image to obtain a background frequency domain;
[0137] performing amplitude calculation on the background frequency domain to obtain a background amplitude domain component, and performing phase calculation on the background frequency domain to obtain a background phase domain component;
[0138] converting the text image to a text frequency domain, and splitting the text frequency domain into a text amplitude domain component and a text phase domain component, comprising:
[0139] performing discrete Fourier transform on the text image to obtain a text frequency domain;
[0140] performing amplitude calculation on the text frequency domain to obtain a text amplitude domain component, and performing phase calculation on the text frequency domain to obtain a text phase domain component.
[0141] Optionally, the target document image determination module 320 comprises:
[0142] adding prompt words in the center regions of the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component, respectively.
[0143] Optionally, the target document image determination module 320 includes:
[0144] Performing an inverse Fourier transform on the background amplitude domain component and the background phase domain component after the prompt word is added to obtain a background prompt image, and performing an inverse Fourier transform on the text amplitude domain component and the text phase domain component after the prompt word is added to obtain a text prompt image;
[0145] The background prompt image and the text prompt image are fused to obtain the target prompt image.
[0146] Optionally, the document tampering detection module 330 includes:
[0147] Inputting the document image to be identified into the document tampering detection model to obtain the document tampering detection result output by the document tampering detection model;
[0148] The document tampering detection result is used to indicate whether the document image to be identified is a document tampering image.
[0149] The technical solution of the embodiment of the present invention obtains a target document image by adding prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component of the initial document image and then processing them. The target document image is used as a training image to train a pre-trained neural network model to obtain a document tampering detection model and perform document tampering detection, thereby realizing tampering detection of document images and improving the generalization performance of the document tampering detection method for network document content security.
[0150] The document tampering detection device for network document content security provided by the embodiment of the present invention can execute the document tampering detection method for network document content security provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0151] Example 4
[0152] Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0153] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0154] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0155] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the document tampering detection method for network document content security.
[0156] In some embodiments, the document tampering detection method for network document content security can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the document tampering detection method for network document content security described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to execute the document tampering detection method for network document content security in any other appropriate manner (for example, by means of firmware).
[0157] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0158] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0159] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0160] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0161] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0162] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0163] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0164] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A document tampering detection method for network document content security, characterized in that: include: generating a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component according to an initial document image; adding prompt words to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively, and generating a target document image according to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component after the prompt words are added; The target document image is used as a training image to train a pre-trained neural network model to obtain a document tampering detection model, and document tampering detection is performed using the document tampering detection model.
2. The method according to claim 1, characterized in that Based on the initial document image, a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component are generated, including: generating a background image and a text image based on an initial document image; The background image is converted into the background frequency domain, and the background frequency domain is split into a background amplitude domain component and a background phase domain component. Also, the text image is converted into the text frequency domain, and the text frequency domain is split into a text amplitude domain component and a text phase domain component.
3. The method according to claim 2, characterized in that Generate a background image and text image based on an initial document image, including: Perform character recognition on the initial document image to obtain a text area mask; According to the text region mask, the initial document image is divided into a text region and a background region; A text image is generated based on the text region, and a background image is generated based on the background region.
4. The method according to claim 2, characterized in that Convert the background image to the background frequency domain, and split the background frequency domain into background amplitude domain components and background phase domain components, including: Perform discrete Fourier transform on the background image to obtain the background frequency domain; Performing amplitude calculation on the background frequency domain to obtain a background amplitude domain component, and performing phase calculation on the background frequency domain to obtain a background phase domain component; Convert the text image to the text frequency domain and split the text frequency domain into the text amplitude domain component and the text phase domain component, including: Perform discrete Fourier transform on the text image to obtain the text frequency domain; An amplitude calculation is performed on the frequency domain of the text to obtain an amplitude domain component of the text, and a phase calculation is performed on the frequency domain of the text to obtain a phase domain component of the text.
5. The method according to claim 1, wherein Add prompt words to the background amplitude domain component, background phase domain component, text amplitude domain component and text phase domain component respectively, including: Prompt words are added to the central areas of the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component respectively.
6. The method according to claim 1, characterized in that Generate a target document image according to the background amplitude domain component, background phase domain component, text amplitude domain component, and text phase domain component after adding the prompt word, including: Performing an inverse Fourier transform on the background amplitude domain component and the background phase domain component after the prompt word is added to obtain a background prompt image, and performing an inverse Fourier transform on the text amplitude domain component and the text phase domain component after the prompt word is added to obtain a text prompt image; The background prompt image and the text prompt image are fused to obtain the target prompt image.
7. The method according to claim 1, characterized in that Document tampering detection is performed using the document tampering detection model, including: Inputting the document image to be identified into the document tampering detection model to obtain the document tampering detection result output by the document tampering detection model; The document tampering detection result is used to indicate whether the document image to be identified is a document tampering image.
8. A document tampering detection device for network document content security, characterized in that: include: A component determination module, configured to generate a background amplitude domain component, a background phase domain component, a text amplitude domain component, and a text phase domain component based on an initial document image; a target document image determination module, configured to add prompt words to the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component, respectively, and generate a target document image based on the background amplitude domain component, the background phase domain component, the text amplitude domain component, and the text phase domain component after the prompt words are added; The document tampering detection module is used to use the target document image as a training image to train the pre-trained neural network model to obtain a document tampering detection model, and perform document tampering detection using the document tampering detection model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the document tampering detection method for network document content security as described in any one of claims 1 to 7 is implemented.
10. A storage medium storing computer executable instructions, characterized in that: When executed by a computer processor, the computer executable instructions are used to execute the document tampering detection method for network document content security as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Text tampering detection method and device, equipment and storage medium
CN118823796A
Systems and methods for identity document fraud detection
US20240177161A1