Certificate tampering detection method and device, electronic equipment and storage medium
By performing weighted fusion processing on the detection image of the document and the easily tampered area, and using the tampered object detection backbone network and multi-branch classification network, the detection accuracy of minor handwriting tampering and small foreign object attacks is improved, and the detection accuracy problem in the existing technology is solved. This reduces the problem and enhances the robustness and efficiency of document tampering detection.
Patent Information
- Application Number
- CN202410884163.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-04-18
- Filing Date
- 2024-07-02
- Publication Date
- 2024-10-01
AI Technical Summary
Existing trusted identity authentication technology has low detection accuracy when faced with tiny handwriting tampering attacks and small foreign object attacks, resulting in incorrect identification of identity authentication and increasing financial security risks.
By obtaining the detection image of the document to be verified, determine the area prone to tampering, and input the image and area into the trained tampering detection model to obtain the document tampering detection score. If the score exceeds the threshold, it is determined to be a tampering behavior, and the tampered object detection backbone network is used Perform weighted fusion with multi-branch classification network to improve detection accuracy.
It improves the detection success rate of minor handwriting tampering and small foreign object attacks, improves the accuracy and efficiency of tampering detection, reduces the false alarm rate, and enhances the robustness of document tampering detection.
Smart Images

Figure CN118736588A_ABST
Abstract
Description
Background Art
[0002] Trusted identity authentication technology refers to the use of AI technology to remotely and automatically verify user identity and personal information registration and authentication, helping companies understand the true identity of users and reduce the risks caused by identity fraud. Compared with the traditional offline identity authentication process, online verification is simpler and more efficient, and provides a better user experience. For example, the electronic identity authentication platform eKYC and the digital identity authentication platform ADVANCE.AI that use trusted identity authentication technology.
[0003] Currently, there is a new type of tampering attack based on tiny handwriting tampering attacks and small foreign objects. This type of tampering attack may cause the OCR (Optical Character Recognition) recognition algorithm of trusted identity authentication to misrecognize the name, ID number, etc. on the document, which may cause the same person to open different accounts at the bank, threatening the customer's financial security. In the current tampering detection scheme, the detection success rate of fine tampering behaviors such as tiny handwriting tampering attacks and small foreign objects is low, and the accuracy of tampering behavior detection results is low.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of this specification, and therefore may include information that does not constitute prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the embodiments of this specification is to provide a document tampering detection method, a document tampering detection device, an electronic device and a computer-readable storage medium, thereby improving the success rate of detecting fine tampering areas of the document to be verified and improving the accuracy of tampering behavior detection results.
[0006] Other features and advantages of the present specification will become apparent from the following detailed description, or may be learned in part from the practice of the present specification.
[0007] According to a first aspect of an embodiment of this specification, a method for detecting tampering of a certificate is provided, comprising:
[0008] Obtaining a detection image of the document to be verified, and determining a tamper-prone area corresponding to the detection image;
[0009] Inputting the detection image and the tamper-prone area into a trained tamper detection model to obtain a document tamper detection score corresponding to the document to be verified;
[0010] If it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold, it is determined that there is tampering with the certificate to be verified.
[0011] In some example embodiments of the present specification, based on the aforementioned scheme, the method of inputting the detection image and the easily tampered area into a pre-trained tampering detection model to obtain a tampering detection score corresponding to the document to be verified includes: inputting the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image; inputting the easily tampered area into the tampering detection model to obtain a local tampering detection score corresponding to the easily tampered area; and weightedly fusing the global tampering detection score and the local tampering detection score according to preset score weights to obtain a document tampering detection score corresponding to the document to be verified.
[0012] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the inputting the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image includes: acquiring a first multi-scale edge feature of the detection image through the tampering object detection backbone network; classifying each of the first multi-scale edge features based on each branch classification network in the multi-branch classification network to obtain a first tampering prediction score corresponding to each of the branch classification networks; and weighted fusion of the first tampering prediction scores to obtain a global tampering detection score corresponding to the detection image.
[0013] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the inputting the tamper-prone area into the tampering detection model to obtain a local tampering detection score corresponding to the tamper-prone area includes: acquiring a second multi-scale edge feature of the tamper-prone area through the tampering object detection backbone network; classifying each of the second multi-scale edge features based on each branch classification network in the multi-branch classification network to obtain a second tampering prediction score corresponding to each of the branch classification networks; and weighted fusion of the second tampering prediction scores to obtain a local tampering detection score corresponding to the tamper-prone area.
[0014] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the inputting the tamper-prone area into the tampering detection model to obtain a local tampering detection score corresponding to the tamper-prone area includes: acquiring a second multi-scale edge feature of the tamper-prone area through the tampering object detection backbone network; classifying a target multi-scale edge feature in the second multi-scale edge feature based on at least one target branch classification network in the multi-branch classification network to obtain a third tampering prediction score corresponding to the target branch classification network; and determining the local tampering detection score corresponding to the tamper-prone area according to the third tampering prediction score.
[0015] In some example embodiments of the present specification, based on the aforementioned scheme, the multi-scale edge features include basic image features, image edge semantic features, tampered object edge guiding features and tampered object segmentation images; the tampered object detection backbone network includes: a backbone feature extraction module, used to extract features from an input image to obtain basic image features; an edge perception module, connected to the backbone feature extraction module, used to perform edge perception on the basic image features to obtain image edge semantic features; an edge guiding feature module, connected to the backbone feature extraction module and the edge perception module, used to fuse the image edge semantic features with basic image features at different levels to obtain tampered object edge guiding features; a context aggregation module, connected to the edge guiding feature module, used to perform spiral convolution mining on the tampered object edge guiding features and aggregate multi-scale context semantics to obtain a tampered object segmentation image.
[0016] In some example embodiments of the present specification, based on the aforementioned scheme, the method further includes: obtaining a preset card data set, and pre-training a self-supervised model based on sparse mask modeling according to the card data set to obtain a card detection pre-training model; constructing the backbone feature extraction module through the card detection pre-training model to achieve model initialization of the tampering detection model.
[0017] In some example embodiments of the present specification, based on the aforementioned scheme, the multi-branch classification network includes: a basic image feature classification branch subnetwork, connected to the output end of the trunk feature extraction module, for classifying the basic image features to obtain a fourth tampering prediction score; an edge-guided feature classification branch subnetwork, connected to the output end of the edge perception module, for classifying the image edge semantic features after the first pooling processing to obtain a fifth tampering prediction score; a tampering object area classification branch subnetwork, connected to the output end of the context aggregation module, for classifying the tampering object segmented image after the second pooling processing to obtain a sixth tampering prediction score.
[0018] In some example embodiments of the present specification, based on the aforementioned scheme, determining the easily tampered area corresponding to the detection image includes: determining the document type corresponding to the document to be verified; performing region segmentation on the detection image based on the document type to obtain the easily tampered area corresponding to the detection image.
[0019] In some example embodiments of the present specification, based on the aforementioned scheme, the region segmentation of the detection image based on the certificate type to obtain the easily tampered area corresponding to the detection image includes: matching the region segmentation template in a preset database according to the certificate type; and region segmentation of the detection image using the region segmentation template to obtain the easily tampered area corresponding to the detection image.
[0020] In some example embodiments of the present specification, based on the aforementioned scheme, the method further includes: obtaining a preset handwriting image and a card image data set for training; performing tampering simulation processing on the card image in the card image data set according to the handwriting image to obtain a tampering training data set; and performing supervised learning training on a pre-built tampering detection model through the tampering training data set to obtain a trained tampering detection model.
[0021] In some example embodiments of the present specification, based on the aforementioned scheme, the card image in the card image data set is subjected to tampering simulation processing according to the handwriting image to obtain a tampering training data set, including: optically recognizing the card image to determine text data in the card image; determining easy-to-tamper keywords in the card image through the text data; generating a tampered handwriting simulation image according to the easy-to-tamper keywords and the handwriting image; fusing the tampered handwriting simulation image to the position area corresponding to the easy-to-tamper keywords on the card image to obtain a training tampered image, and constructing a tampered training data set through the training tampered image.
[0022] According to a second aspect of the embodiments of this specification, there is provided a document tampering detection device, comprising:
[0023] An input image acquisition module is used to acquire a detection image of the document to be verified and determine the tamper-prone area corresponding to the detection image;
[0024] A certificate tampering estimation module, used to input the detection image and the tamper-prone area into a trained tampering detection model to obtain a certificate tampering detection score corresponding to the certificate to be verified;
[0025] The certificate tampering behavior identification module is used to determine that the certificate to be verified has been tampered with if it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold.
[0026] According to a third aspect of the embodiments of this specification, an electronic device is provided, comprising: a processor; and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the document tampering detection method in the first aspect is implemented.
[0027] According to a fourth aspect of the embodiments of this specification, there is provided a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the document tampering detection method in the first aspect.
[0028] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0029] The certificate tampering detection method in the example embodiment of the present specification can obtain a detection image of the certificate to be verified, and then determine the easy-to-tamper area corresponding to the detection image, and simultaneously input the detection image and the easy-to-tamper area into a trained tampering detection model to obtain a certificate tampering detection score corresponding to the certificate to be verified, and then compare the certificate tampering detection score with a preset tampering score threshold. If it is determined that the certificate tampering detection score is greater than or equal to the tampering score threshold, it can be determined that the certificate to be verified has been tampered with. On the one hand, a detection image of the certificate to be verified can be collected, and the easily tampered area can be cropped in the detection image, and the detection image and the easily tampered area can be input into the tampering detection model together, so that the tampering detection model can pay more attention to the easily tampered area where tiny handwriting tampering attacks and small foreign body attacks are more likely to occur, thereby improving the tampering detection model's detection success rate for tampering behaviors such as tiny handwriting tampering attacks and small foreign body attacks, and improving the accuracy of the tampering behavior detection results; on the other hand, the tampering detection model can obtain the predicted certificate tampering detection score of the certificate to be verified, and then the certificate tampering detection score and the preset tampering score threshold can be used to quickly detect the certificate tampering behavior, thereby improving the detection efficiency of the certificate tampering behavior; on the other hand, instead of directly outputting the recognition result of the tampering behavior through the tampering detection model, a tampering score threshold that can be adjusted according to actual usage or application scenarios is set to detect the tampering behavior, thereby improving the scope of application of the tampering detection model, improving the robustness of the detection result of the certificate tampering behavior, and reducing the false alarm rate.
[0030] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present specification. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The accompanying drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the specification, and together with the specification are used to explain the principles of the specification. Obviously, the accompanying drawings described below are only some embodiments of the specification, and for those of ordinary skill in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0032] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a method and device for detecting document tampering according to an embodiment of the present specification can be applied is shown.
[0033] Figure 2 The flowchart of the document tampering detection method according to some embodiments of this specification is schematically shown.
[0034] Figure 3 A schematic diagram of the structure of a tamper detection model according to some embodiments of this specification is schematically shown.
[0035] Figure 4 The structure diagram of the tampered object detection backbone network according to some embodiments of the present specification is schematically shown.
[0036] Figure 5 The structure diagram of the edge perception module according to some embodiments of the present specification is schematically shown.
[0037] Figure 6 The schematic diagram shows the structure of the edge guidance feature module according to some embodiments of the present specification.
[0038] Figure 7 The structural diagram of the context aggregation module according to some embodiments of the present specification is schematically shown.
[0039] Figure 8 A schematic diagram of the structure of another tampering detection model according to some embodiments of this specification is schematically shown.
[0040] Fig. 9 A schematic diagram of a process for generating a certificate tampering detection score according to some embodiments of the present specification is schematically shown.
[0041] Fig.10 A schematic diagram of the structure of yet another tampering detection model according to some embodiments of the present specification is schematically shown.
[0042] Fig.11 The schematic diagram schematically shows the principle of identifying and segmenting the tamper-prone areas in the detection image according to some embodiments of the present specification.
[0043] Fig.12 A schematic diagram of a process for training a tamper detection model according to some embodiments of the present specification is schematically shown.
[0044] Fig.13 A schematic diagram of a process for constructing a tampered training dataset according to some embodiments of the present specification is schematically shown.
[0045] Fig.14 The structure diagram of the document tampering detection device according to some embodiments of this specification is schematically shown.
[0046] Fig.15A schematic diagram of the structure of a computer system of an electronic device according to some embodiments of the present specification is schematically shown.
[0047] Fig.16 A schematic diagram of a computer-readable storage medium according to some embodiments of the present specification is schematically shown.
[0048] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0049] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with this specification. Instead, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0050] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the" and "the" used in this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0051] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0052] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of this specification sheet. However, those skilled in the art will appreciate that the technical solutions of this specification sheet may be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of this specification sheet.
[0053] Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0054] Figure 1 A schematic diagram of a system architecture of an exemplary application environment in which a method and device for detecting document tampering according to an embodiment of the present specification can be applied is shown.
[0055] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with data processing functions, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0056] The certificate tampering detection method provided in the embodiments of this specification is generally executed by the terminal devices 101, 102, and 103, and accordingly, the certificate tampering detection device is generally set in the terminal devices 101, 102, and 103. However, it is easy for those skilled in the art to understand that the certificate tampering detection method provided in the embodiments of this specification can also be executed by the server 105, and accordingly, the certificate tampering detection device can also be set in the server 105, which is not particularly limited in this exemplary embodiment.
[0057] In the embodiments of this specification, a method for detecting certificate tampering is first provided. The method for detecting certificate tampering can be applied to a terminal device or a server. This exemplary embodiment does not make any special limitation to this. The following description will take the execution of the method by a server as an example.
[0058] Figure 2 The following schematically shows a flow chart of a method for detecting tampering of a certificate according to some embodiments of the present specification. Figure 2 As shown, the document tampering detection method may include the following steps:
[0059] Step S220, obtaining a detection image of the document to be verified, and determining an easily tampered area corresponding to the detection image;
[0060] Step S240, inputting the detection image and the easily tampered area into a trained tampering detection model to obtain a document tampering detection score corresponding to the document to be verified;
[0061] Step S260: If it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold, it is determined that there is tampering with the certificate to be verified.
[0062] According to the document tampering detection method in the embodiment of the present specification, on the one hand, a detection image of the document to be verified can be collected, and the easily tampered area can be cropped in the detection image, and the detection image and the easily tampered area can be input into the tampering detection model together, so that the tampering detection model can pay more attention to the easily tampered area where tiny handwriting tampering attacks and small foreign body attacks are more likely to occur, thereby improving the detection success rate of the tampering detection model for tampering behaviors such as tiny handwriting tampering attacks and small foreign body attacks, and improving the accuracy of the tampering behavior detection result; on the other hand, the predicted document tampering detection score of the document to be verified can be obtained through the tampering detection model, and then the document tampering behavior can be quickly detected through the document tampering detection score and the preset tampering score threshold, thereby improving the detection efficiency of the document tampering behavior; on the other hand, the identification result of the tampering behavior is not directly output through the tampering detection model, but a tampering score threshold that can be adjusted according to actual usage or application scenarios is set to detect the tampering behavior, thereby improving the scope of application of the tampering detection model, improving the robustness of the detection result of the document tampering behavior, and reducing the false alarm rate.
[0063] Next, the document tampering detection method in this example embodiment will be further described.
[0064] In step S220, a detection image of the document to be verified is obtained, and an easily tampered area corresponding to the detection image is determined.
[0065] In an example embodiment of the present specification, the document to be verified refers to a carrier that carries the customer's personal information and privacy information. For example, the document to be verified can be a personal ID card, passport, driver's license, etc., or it can be a bank card, social security card, etc. This example embodiment does not specifically limit the type of document to be verified.
[0066] The detection image refers to the image corresponding to the document to be verified, which is used to detect and identify whether the document to be verified has been tampered with. For example, taking the document to be verified as a personal ID card, the detection image can be the front and back images of the personal ID card; it can be understood that in some special scenarios, the detection image can also be an image captured by the user holding the document to be verified. This example embodiment does not impose any special limitation on the form of expression of the detection image.
[0067] The detection image can be obtained by pre-shooting and uploading it through the network or medium, or by real-time acquisition by an image acquisition unit on a verification device or a user terminal device. This embodiment does not limit the method for acquiring the detection image.
[0068] The easily tampered area refers to the image ROI (Region of Interest) area on the detection image that is more susceptible to tampering attacks. For example, taking the document to be verified as a personal ID card, the easily tampered area on the detection image corresponding to the personal ID card can be the area where the name is located, or it can be the area where the ID number is located. Therefore, the name area and the ID number area in the detection image corresponding to the personal ID card can be used as the easily tampered area of the detection image.
[0069] A detection segmentation model for identifying tamper-prone areas in a detection image can be pre-trained, and the tamper-prone areas can be identified by inputting the detection image into the detection segmentation model, and the tamper-prone areas can be segmented; of course, the documents to be verified can also be classified, and the segmentation template can be matched according to the document type, and then the determination and segmentation identification of tamper-prone areas in the detection image can be achieved through the segmentation template. It is easy for those skilled in the art to understand that this is only an illustrative example and should not cause any special limitation to this exemplary embodiment.
[0070] In step S240, the detection image and the easily tampered area are input into a trained tampering detection model to obtain a document tampering detection score corresponding to the document to be verified.
[0071] In an example embodiment of the present specification, the tampering detection model refers to an artificial intelligence model used to identify and predict tampering behaviors in detection images and tampering-prone areas. For example, the tampering detection model may be a machine learning model, such as the tampering detection model may be a random forest model or a support vector machine model (SVM); of course, the tampering detection model may also be a neural network model, such as the tampering detection model may be a tampering object detection model constructed based on an edge-guided detection network (Boundary Guided Network, BGNet), or a tampering object detection model constructed based on a context-aware cross-level fusion network (Context-aware Cross-level Fusion Network, C2FNet). This example embodiment does not specifically limit the type of tampering detection model.
[0072] The detection image and the easily tampered area can be input together into a trained tampering detection model to output a document tampering detection score corresponding to the document to be verified. Of course, the detection image and the easily tampered area can also be input separately into two tampering detection models with the same model parameters or two different model parameters to obtain their respective document tampering detection scores, and the respective document tampering detection scores are weightedly fused to finally obtain the document tampering detection score corresponding to the document to be verified. This embodiment does not make any special limitation on the method of predicting tampering behavior of the detection image and the easily tampered area.
[0073] In step S260, if it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold, it is determined that tampering has occurred in the certificate to be verified.
[0074] In an example embodiment of the present specification, the tampering score threshold refers to a preset parameter for evaluating whether there is any tampering on the certificate to be verified. For example, the preset tampering score threshold may be 0.95. If the certificate tampering detection score of the certificate to be verified is greater than or equal to 0.95, it can be considered that there is tampering on the certificate to be verified; if the certificate tampering detection score of the certificate to be verified is less than 0.95, it can be considered that there is no tampering on the certificate to be verified; of course, it is easy for those skilled in the art to understand that the tampering score threshold may also be 0.90, 0.98, etc. The specific tampering score threshold may be customized according to actual conditions and application scenarios, and this example embodiment does not specifically limit this.
[0075] By inputting the detection image and the easily tampered area into the tampering detection model together, the tampering detection model can pay more attention to the easily tampered areas that are more prone to tiny handwriting tampering attacks and small foreign object attacks, thereby improving the tampering detection model's detection success rate for tampering behaviors such as tiny handwriting tampering attacks and small foreign object attacks, and improving the accuracy of tampering detection results; through the tampering detection model and the preset tampering score threshold, the detection of document tampering behaviors can be quickly realized, thereby improving the detection efficiency of document tampering behaviors; by setting the tampering score threshold to detect tampering behaviors, the scope of application of the tampering detection model can be improved, and the robustness of the detection results of document tampering behaviors can be improved.
[0076] Next, steps S220 to S260 are described in detail.
[0077] In an exemplary embodiment of the present specification, the tampering detection model may be composed of a tampering object detection backbone network and a multi-branch classification network connected to the tampering object detection backbone network.
[0078] Among them, the tampering object detection backbone network can be used to obtain multi-scale edge features of the input image. For example, the multi-scale edge features can be global basic image features of the input image, or edge prediction features of the detection object in the input image. Of course, the tampering object detection backbone network can also be other types of image features in the input image that are related to tampering behavior detection. This example embodiment does not specifically limit the type of multi-scale edge features extracted by the tampering object detection backbone network.
[0079] The multi-branch classification network can be connected to the tampering object detection backbone network. The multi-branch classification network can include multiple branch classification networks, which are used to obtain multi-scale edge features from the tampering object detection backbone network, and classify and predict different types of multi-scale edge features to obtain prediction scores for possible tampering behaviors in each multi-scale edge feature.
[0080] refer to Figure 3 As shown, the tampering detection model 300 may include a tampering object detection backbone network 311 and a multi-branch classification network 312. The tampering object detection backbone network 311 may extract feature information such as image features, edge semantic prediction features, segmented region features, etc. in the detection image 320 and the tamper-prone region 321 corresponding to the detection image 320, for identifying the edge and region of the tampered object; the multi-branch classification network 312 may be connected to the tampering object detection backbone network 311, and may be used to capture feature information from the tampering object detection backbone network 311, and predict the document tampering detection score 330 corresponding to the document to be verified based on the feature information.
[0081] Optionally, the multi-scale edge features may include basic image features, image edge semantic features, tampered object edge guidance features, and tampered object segmentation images. Accordingly, the tampered object detection backbone network may include a backbone feature extraction module (Backbone), an edge perception module (Edge-aware Module, EAM), an edge guidance feature module (Edge-guidance Feature Module, EFM), and a context aggregation module (Context Aggregation Module, CAM). Wherein:
[0082] The backbone feature extraction module refers to a neural network pre-set for extracting features from an input image. For example, the backbone feature extraction module may be a convolutional neural network (CNN), a Res2Net-50 network, or a pre-trained self-supervised model based on sparse mask modeling (Spark). This exemplary embodiment does not specifically limit the type of the backbone feature extraction module. The backbone feature extraction module may be used to extract features from an input image to obtain basic image features. For example, in this embodiment, the input image may be a detection image of a document to be verified and an easily tampered area in the detection image; the edge perception module may be connected to the backbone feature extraction module to perform edge perception on basic image features to obtain image edge semantic features. The edge perception module may be integrated with low-level local edge information and high-level global position information to explore edge semantics related to object boundaries under explicit boundary supervision; the edge guidance feature module may be connected to the backbone feature extraction module and the edge perception module to fuse image edge semantic features with basic image features at different levels to obtain tampered object edge guidance features. The edge-guided feature module can force the network to pay more attention to the object structure and details, and then gradually aggregate multi-level fusion features from top to bottom to predict the tampered object; the context aggregation module can be connected to the edge-guided feature module to perform spiral convolution mining on the edge-guided features of the tampered object and aggregate multi-scale context semantics to obtain the tampered object segmentation image.
[0083] refer to Figures 4 to 7 As shown, the tampering object detection backbone network 311 may include a backbone feature extraction module (Backbone) 3111, an edge awareness module (EAM) 3112, an edge guided feature module (EFM) 3113 and a context aggregation module (CAM) 3114.
[0084] The network structure of the backbone feature extraction module 3111 can be referenced Figure 4 As shown, the feature extraction of the input image is realized through a multi-layer feature extraction network to obtain the basic image features.
[0085] The network structure of the edge awareness module (EAM) 3112 can be referred to Figure 5 As shown, a good edge prior is beneficial to target detection in segmentation and localization. Although low-level features contain rich edge details, they also introduce many non-object edges. Therefore, high-level semantic or location information is required to facilitate the exploration of edge features related to tampered objects. In the edge perception module (EAM) 3112, low-level features f2 and high-level features f5 are combined to model edge information related to objects. Specifically, two 1×1 convolutional layers are first used to change the channels of f2 and f5 to 64 f'2 and 256 f'5, respectively, and then f'2 and f'5 are upsampled and integrated through array connection Concat operation. Finally, the image edge semantic features are obtained through two 3×3 convolutions, one 1×1 convolution and a Sigmoid function.
[0086] The network structure of the edge-guided feature module (EFM) 3113 can be referred to Figure 6 As shown, the edge-guided feature module (EFM) 3113 aims to inject boundary-related edge cues into representation learning to enhance feature representation with object structure semantics. As we all know, different feature channels usually contain different semantics. Therefore, in order to achieve good integration and obtain powerful feature representation, a local channel attention mechanism is introduced to explore cross-channel interactions and mine key cues between channels. Input base image feature f i and image edge semantic features f e , first use additional residual connections and 3×3 convolutions to perform feature multiplication between them to obtain the initial fused features. In order to enhance the feature representation, local attention is introduced to explore the key feature channels. Specifically, the convolution features can be aggregated using channel global average pooling (GAP), and then the corresponding channel attention weights can be obtained through 1d convolution and sigmoid function. Unlike the fully connected operation, which captures the dependencies between all channels but shows high complexity, the edge-guided feature module (EFM) 3113 mainly explores local cross-channel interactions and learns each attention in a local manner, for example, only considering the k neighbors of each channel. Finally, the channel attention can be multiplied with the input feature, and the number of channels can be reduced through 1×1 convolution to obtain the tampered object edge-guided feature f a i .
[0087] The network structure of the context aggregation module (CAM) 3114 can be referred to Figure 7As shown, several independent parallel branches are used to extract features of different scales respectively, without considering the semantic relevance between the branches. The context aggregation module (CAM) 3114 considers cross-scale interactions to enhance feature representation. First, the edge-guided features f of the tampered object can be upsampled and concatenated. a i and f a i+1 and the tampered object segmentation image f output by other context aggregation modules (CAM) 3114 c i+1 , and then pass through a 1×1 convolutional layer to obtain the initial aggregated features f m Then, along the channel dimension, it is evenly divided into four feature maps (f 1 m , f 2 m , f 3 m , f 4 m ), and then perform cross-scale interactive learning, that is, integrate the features of adjacent branches through a series of hole convolutions to extract multi-scale context features. These four multi-scale features can then be concat, followed by 1×1 convolution, residual connection, and 3×3 convolution, and then the tampered object segmentation image f can be obtained. c i .
[0088] By adopting the tampering detection model of the tampering object detection backbone network (BGNet), the features of the tampered objects in the detection images and easy-to-tamper areas can be effectively extracted, which can effectively improve the tampering detection model's detection of tampering behaviors on the documents to be verified, and improve the detection success rate of tampering behaviors and the accuracy of detection results.
[0089] In an example embodiment of the present specification, the multi-branch classification network may include a basic image feature classification branch sub-network, an edge-guided feature classification branch sub-network, a tampered object region classification branch sub-network, and a tampering detection sub-network.
[0090] The basic image feature classification branch sub-network can be connected to the output end of the trunk feature extraction module to classify the basic image features and obtain a fourth tampering prediction score.
[0091] The edge-guided feature classification branch subnetwork can be connected to the output end of the edge perception module to classify the edge semantic features of the image after the first pooling process to obtain the fifth tampering prediction score. Among them, the first pooling process refers to a process for performing feature dimensionality reduction processing on the edge semantic features of the image so that it can be used as the input of the edge-guided feature classification branch subnetwork. For example, the first pooling process can be a maximum pooling process or an average pooling process, and this embodiment is not limited to this. The first pooling process can reduce the feature dimension of the edge semantic features of the image, thereby reducing the difficulty of constructing the edge-guided feature classification branch subnetwork and improving the processing and recognition efficiency.
[0092] The tampered object region classification branch subnetwork is connected to the output end of the context aggregation module, and is used to classify the tampered object segmentation image after the second pooling process to obtain a sixth tampering prediction score. Among them, the second pooling process refers to a process for performing feature dimensionality reduction processing on the tampered object segmentation image so that it can be used as an input of the tampered object region classification branch subnetwork. For example, the second pooling process can be a convolutional generalized average pooling process or a learnable average pooling process (Learnable avgpool), and this embodiment is not limited to this. The second pooling process can reduce the feature dimension of the tampered object segmentation image, thereby reducing the difficulty of constructing the tampered object region classification branch subnetwork and improving the processing and recognition efficiency.
[0093] The tampering detection subnetwork can be connected to the basic image feature classification branch subnetwork, the edge-guided feature classification branch subnetwork and the tampering object area classification branch subnetwork to perform weighted fusion on the fourth tampering prediction score, the fifth tampering prediction score and the sixth tampering prediction score to obtain the tampering detection score of the input image.
[0094] It can be understood that the "fourth", "fifth" and "sixth" in the "fourth tampering prediction score", "fifth tampering prediction score" and "sixth tampering prediction score" in this embodiment are only used to distinguish the tampering prediction scores output by different branch classification networks, and do not have any special meaning and should not cause any special limitation to this example embodiment.
[0095] refer to Figure 8 As shown, the multi-branch classification network 312 may include a basic image feature classification branch subnetwork 3121 , an edge-guided feature classification branch subnetwork 3122 , a tampered object area classification branch subnetwork 3123 , and a tampering detection subnetwork 3124 .
[0096] The basic image feature classification branch subnetwork 3121 can be connected to the output end of the trunk feature extraction module 3111 to obtain the basic image features from the trunk feature extraction module 3111 and classify the basic image features to obtain a first tampering prediction score.
[0097] The edge-guided feature classification branch subnetwork 3122 can be connected to the output end of the edge perception module 3112, and is used to obtain the image edge semantic features from the edge perception module 3112, and perform maximum pooling processing (maxpool) on the image edge semantic features, and then classify the image edge semantic features after the maximum pooling processing to obtain a second tampering prediction score.
[0098] The tampered object area classification branch subnetwork 3123 can be connected to the output end of the context aggregation module 3114, and is used to obtain the tampered object segmentation image from the context aggregation module 3114, and perform convolution generalized average pooling processing (ConvGeM) on the tampered object segmentation image. Then, the tampered object segmentation image after the convolution generalized average pooling processing can be classified to obtain a third tampering prediction score.
[0099] The tampering detection subnetwork 3124 can be connected to the basic image feature classification branch subnetwork 3121, the edge-guided feature classification branch subnetwork 3122 and the tampering object area classification branch subnetwork 3123 respectively, and is used to perform weighted fusion on the first tampering prediction score, the second tampering prediction score and the third tampering prediction score to obtain the document tampering detection score of the input image.
[0100] Through the multi-branch classification network 312 connected to the tampering object detection backbone network, the feature information of each level in the tampering object detection backbone network can be captured, and the captured feature information can be classified for tampering detection, so as to obtain the document tampering detection score of the document to be verified, thereby converting the tampering object recognition task of the tampering object detection backbone network into a document tampering behavior prediction task, effectively improving the detection rate of tampering behavior for the document to be verified, and improving the accuracy of tampering behavior detection results.
[0101] In an exemplary embodiment of the present specification, Fig. 9 The steps in the above example are used to input the detection image and the vulnerable area into the pre-trained tamper detection model to obtain the tamper detection score corresponding to the document to be verified. Fig. 9 As shown, it may specifically include:
[0102] Step S920, inputting the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image;
[0103] Step S940, inputting the tamper-prone area into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone area;
[0104] Step S960: weightedly fuse the global tampering detection score and the local tampering detection score according to a preset score weight to obtain a document tampering detection score corresponding to the document to be verified.
[0105] The global tampering detection score refers to the prediction score obtained by performing tampering detection on the global feature information of the detection image. For example, the global tampering detection score can be a tampering prediction score obtained by inputting the detection image into the tampering detection model and weighted fusion of the tampering prediction scores obtained by classification prediction of each branch classification network in the multi-branch classification network.
[0106] The local tampering detection score refers to the prediction score obtained by performing tampering detection on the tampering-prone area that is local to the detection image, and the tampering detection score of the feature information that is local to the detection image. For example, the local tampering detection score can be the tampering prediction score obtained by inputting the tampering-prone area into the tampering detection model and weighted fusion of the tampering prediction scores obtained by classification prediction by each branch classification network in the multi-branch classification network; of course, the local tampering detection score can also be the tampering prediction score output by the tampering object area classification branch subnetwork in the multi-branch classification network.
[0107] Optionally, the detection image may be input into the tampering detection model to obtain a global tampering detection score corresponding to the detection image through the following steps, which may specifically include:
[0108] The first multi-scale edge features of the detection image can be obtained through the tampering object detection backbone network, and each first multi-scale edge feature is classified based on each branch classification network in the multi-branch classification network to obtain a first tampering prediction score corresponding to each branch classification network; the first tampering prediction scores are weightedly fused to obtain a global tampering detection score corresponding to the detection image.
[0109] Among them, the first multi-scale edge features may include basic image features corresponding to the detection image, image edge semantic features, tampered object edge guide features and tampered object segmentation images.
[0110] The tampering prediction score obtained by classification prediction of each branch classification network in the multi-branch classification network can effectively improve the credibility of the global tampering prediction score corresponding to the detected image and improve the accuracy of the global tampering detection score.
[0111] Optionally, the tamper-prone area may be input into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone area through the following steps, which may specifically include:
[0112] The second multi-scale edge features of the easy-to-tamper area can be obtained through the tampering object detection backbone network; the second multi-scale edge features are classified based on each branch classification network in the multi-branch classification network to obtain the second tampering prediction score corresponding to each branch classification network; the second tampering prediction score is weightedly fused to obtain the local tampering detection score corresponding to the easy-to-tamper area.
[0113] Among them, the second multi-scale edge features may include basic image features corresponding to the easy-to-tamper area, image edge semantic features, tampered object edge guide features and tampered object segmentation images.
[0114] The tampering prediction score obtained by classification prediction of each branch classification network in the multi-branch classification network can effectively improve the credibility of the local tampering detection score corresponding to the easy-to-tamper area and improve the accuracy of the local tampering detection score.
[0115] Optionally, the tamper-prone area may be input into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone area through the following steps, which may specifically include:
[0116] The second multi-scale edge features of the easy-to-tamper area can be obtained through the tampering object detection backbone network, and the target multi-scale edge features in the second multi-scale edge features are classified based on at least one target branch classification network in the multi-branch classification network to obtain the third tampering prediction score corresponding to the target branch classification network, and the local tampering detection score corresponding to the easy-to-tamper area is determined according to the third tampering prediction score.
[0117] Among them, the target branch classification network refers to a branch classification network obtained in advance and having a high credibility in predicting and identifying tampering behavior in easily tampered areas in a multi-branch classification network. For example, the target branch classification network can be a tampering object area classification branch subnetwork in a multi-branch classification network, or it can be an edge-guided feature classification branch subnetwork. Of course, the target branch classification network can also be at least two branch classification networks in a multi-branch classification network, such as the target branch classification network can also be a tampering object area classification branch subnetwork and an edge-guided feature classification branch subnetwork. Specifically, at least one suitable branch classification network can be selected from the multi-branch classification network as the target branch classification network according to actual conditions, and this example embodiment does not make any special limitations on this.
[0118] Since the easy-to-tamper area belongs to the local area of the detection image, we only need to pay attention to whether there is a tampered object area in the easy-to-tamper area. Therefore, the output result of the branch classification network with the highest credibility in the multi-branch classification network can be used as the local tampering detection score corresponding to the easy-to-tamper area, which can effectively reduce the computational complexity of tampering behavior prediction in the easy-to-tamper area and further improve the output efficiency of the tampering detection model.
[0119] refer to Fig.10 As shown, the target branch classification network is selected to determine the local tampering detection score corresponding to the easy-to-tamper area, and the target branch classification network is the tampering object area classification branch subnetwork as an example:
[0120] The detection image 320 can be input into the tampering object detection backbone network 311 of the tampering detection model, and the backbone feature extraction module 3111, the edge perception module 3112, the edge guided feature module 3113 and the context aggregation module 3114 in the tampering object detection backbone network 311 respectively extract the basic image features, image edge semantic features, tampering object edge guiding features and tampering object segmentation image of the detection image 320; then the multi-branch classification network 312 connected to the tampering object detection backbone network 311 can extract feature information for tampering prediction. For example, the basic image features, image edge semantic features and tampering object segmentation image can be obtained respectively by the basic image feature classification branch sub-network 3121, the edge guided feature classification branch sub-network 3122 and the tampering object region classification branch sub-network 3123 in the multi-branch classification network 312, and tampering prediction classification is performed to obtain three tampering prediction scores, and finally the tampering detection sub-network 3124 performs weighted fusion on the three tampering prediction scores to obtain the global tampering detection score corresponding to the detection image.
[0121] Then, the first tamper-prone region 321, the second tamper-prone region 322, and the third tamper-prone region 323 can be simultaneously input into the tamper-prone object detection backbone network 311 of the tamper-prone detection model, and the tamper-prone object detection backbone network 311 can have the same model parameters as the tamper-prone object detection backbone network 311 that processes the detection image 320, and then only the local tamper-prone detection score output by the tamper-prone object region classification branch subnetwork 3123 is obtained. Finally, the global tamper-prone detection score and the local tamper-prone detection score can be weightedly fused according to the preset score weight to obtain the document tamper-prone detection score 320 corresponding to the document to be verified.
[0122] It can be understood by those skilled in the art that Fig.10This is only one implementation of the present example embodiment. Of course, the detection image 320 and the first easily tampered area 321, the second easily tampered area 322 and the third easily tampered area 323 can also be input into the tampering detection model together, and the global tampering detection scores corresponding to the detection image 320 and the first easily tampered area 321, the second easily tampered area 322 and the third easily tampered area 323 can be weightedly fused to obtain the document tampering detection score 320. This example embodiment is not limited to this.
[0123] In an exemplary embodiment of the present specification, the tamper-prone area corresponding to the detected image may be determined by the following steps, which may specifically include:
[0124] The document type corresponding to the document to be verified can be determined; the detection image is segmented based on the document type to obtain the tamper-prone area corresponding to the detection image.
[0125] The document type refers to the standard type of the document to be verified. For example, the document type of the document to be verified can be a personal ID card, or a bank card. Since the distribution area of personal information of the documents to be verified of the same document type is the same, the identification and segmentation of the easily tampered area in the detection image can be achieved by the document type corresponding to the document to be verified.
[0126] Optionally, a region segmentation template may be matched in a preset database according to the document type; the detection image is segmented by the region segmentation template to obtain an easily tampered region corresponding to the detection image.
[0127] refer to Fig.11 As shown, assuming that for the detection image 1120 of the document 1110 to be verified, it is necessary to determine the easily tampered area of the detection image 1120, the document type of the document 1110 to be verified can be determined first, for example, if the document type of the document 1110 to be verified is determined to be a driver's license, then the regional segmentation template 1130 of the driver's license can be matched in the preset database; then the detection image 1120 can be segmented according to the regional segmentation template 1130 to obtain the easily tampered area 1140, the easily tampered area 1150 and the easily tampered area 1160 corresponding to the detection image 1120.
[0128] Optionally, the image size of the detection image input into the tampering detection model can be doubled, and then the easy-to-tamper area can be segmented not from the original image of the detection image, but from the extracted feature level to obtain the easy-to-tamper area at the image feature level, which can improve the accuracy of the easy-to-tamper area and improve the success rate of the tampering detection model in detecting tampering behavior in the easy-to-tamper area.
[0129] In an exemplary embodiment of the present specification, the model initialization of the tamper detection model can be implemented by the following steps:
[0130] A preset card data set can be obtained, and a self-supervised model based on sparse mask modeling (Spark) can be pre-trained according to the card data set to obtain a card detection pre-trained model. Then, a backbone feature extraction module can be constructed through the card detection pre-trained model to achieve model initialization of the tampering detection model.
[0131] By using the card detection pre-training model obtained by pre-training based on the card dataset and the self-supervised model based on sparse mask modeling (Spark) as the backbone feature extraction module of the tampering detection model, the generalization of the tampering detection model can be effectively improved, the detection rate of the tampering detection model for document tampering behavior can be further improved, and the accuracy of the document tampering detection score output by the tampering detection model can be improved; at the same time, the convergence speed of the tampering detection model can be effectively improved, and the training efficiency of the tampering detection model can be improved.
[0132] In an exemplary embodiment of the present specification, Fig.12 The steps in the training of the tamper detection model are implemented, refer to Fig.12 As shown, it may specifically include:
[0133] Step S1220, obtaining a preset handwriting image and a card image dataset for training;
[0134] Step S1240, performing tampering simulation processing on the card image in the card image dataset according to the handwriting image to obtain a tampering training dataset;
[0135] Step S1260 , performing supervised learning training on the pre-built tampering detection model using the tampering training data set to obtain a trained tampering detection model.
[0136] Among them, the handwriting image refers to an image of human-drawn handwriting obtained in advance from an open source database or a public database, and the card image dataset may include card images used for model training.
[0137] The handwriting images can be used to simulate the tampering of the card images in the card image dataset to obtain a large number of tampering training datasets, so as to realize the supervised learning training of the tampering detection model through the tampering training dataset, which can effectively improve the generalization of the tampering detection model and ensure the quality of the tampering detection model.
[0138] Optionally, you can Fig.13 The steps in the above are used to simulate the tampering of the card image in the card image dataset based on the handwriting image, and obtain the tampering training dataset. Fig.13 As shown, it may specifically include:
[0139] Step S1320, optically identifying the card image to determine text data in the card image;
[0140] Step S1340, determining the easily tampered keywords in the card image through the text data;
[0141] Step S1360, generating a tampered handwriting simulation image according to the easily tampered keyword and the handwriting image;
[0142] Step S1380, merging the simulated image of the tampered handwriting into the position area corresponding to the easily tampered keyword on the card image to obtain a training tampered image, and constructing a tampered training data set through the training tampered image.
[0143] Among them, the easily tampered keyword refers to a keyword that is easy to be modified by handwriting description to achieve text data on the certificate. For example, "U" is easy to be tampered with to "O", so if the text data in the card image contains "U", "U" can be identified as an easily tampered keyword; "O" is easy to be tampered with to "8", so if the text data in the card image contains "O", "O" can be identified as an easily tampered keyword. Of course, this is only an illustrative example and should not cause any special limitation to this embodiment.
[0144] The handwriting image corresponding to the easy-to-tamper keyword can be matched, and the image area corresponding to the easy-to-tamper keyword can be cut out from the handwriting image to serve as a tampered handwriting simulation image; then the tampered handwriting simulation image can be fused to the position area corresponding to the easy-to-tamper keyword on the card image to obtain a training tampered image.
[0145] By constructing training tampered images with handwriting images with real human handwriting, and training the tampering detection model with the tampering training data set constructed by the training tampered images, the generalization of the tampering detection model is effectively improved, the quality of the tampering detection model is ensured, the success rate of the tampering detection model in detecting tampering behaviors is improved, and the accuracy of the detection results of tampering behaviors is improved.
[0146] To summarize, the detection image of the document to be verified can be obtained, and then the tamper-prone area corresponding to the detection image can be determined, and the detection image and the tamper-prone area can be simultaneously input into the trained tampering detection model to obtain the document tampering detection score corresponding to the document to be verified, and then the document tampering detection score can be compared with the preset tampering score threshold. If it is determined that the document tampering detection score is greater than or equal to the tampering score threshold, it can be determined that the document to be verified has been tampered with. On the one hand, a detection image of the certificate to be verified can be collected, and the easily tampered area can be cropped in the detection image, and the detection image and the easily tampered area can be input into the tampering detection model together, so that the tampering detection model can pay more attention to the easily tampered area where tiny handwriting tampering attacks and small foreign body attacks are more likely to occur, thereby improving the tampering detection model's detection success rate for tampering behaviors such as tiny handwriting tampering attacks and small foreign body attacks, and improving the accuracy of the tampering behavior detection results; on the other hand, the tampering detection model can obtain the predicted certificate tampering detection score of the certificate to be verified, and then the certificate tampering detection score and the preset tampering score threshold can be used to quickly detect the certificate tampering behavior, thereby improving the detection efficiency of the certificate tampering behavior; on the other hand, instead of directly outputting the recognition result of the tampering behavior through the tampering detection model, a tampering score threshold that can be adjusted according to actual usage or application scenarios is set to detect the tampering behavior, thereby improving the scope of application of the tampering detection model, improving the robustness of the detection result of the certificate tampering behavior, and reducing the false alarm rate.
[0147] It should be noted that, although the steps of the method in this specification are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0148] In addition, in this exemplary embodiment, a document tampering detection device is also provided. Figure 4 As shown, the document tampering detection device 1400 includes: an input image acquisition module 1410, a document tampering estimation module 1420 and a document tampering behavior recognition module 1430. Among them:
[0149] The input image acquisition module 1410 may be used to acquire a detection image of the document to be verified, and determine the tamper-prone area corresponding to the detection image;
[0150] The document tampering estimation module 1420 may be used to input the detection image and the tamper-prone area into a trained tampering detection model to obtain a document tampering detection score corresponding to the document to be verified;
[0151] The certificate tampering behavior identification module 1430 can be used to determine that the certificate to be verified has been tampered with if it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold.
[0152] In some example embodiments of the present specification, based on the aforementioned scheme, the certificate tampering estimation module 1420 may include: a global tampering detection score determination unit, used to input the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image; a local tampering detection score determination unit, used to input the tamper-prone area into the tampering detection model to obtain a local tampering detection score corresponding to the tamper-prone area; a certificate tampering detection score determination unit, used to weightedly fuse the global tampering detection score and the local tampering detection score according to a preset score weight to obtain a certificate tampering detection score corresponding to the certificate to be verified.
[0153] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the global tampering detection score determination unit is configured to: obtain the first multi-scale edge features of the detection image through the tampering object detection backbone network; classify each of the first multi-scale edge features based on each branch classification network in the multi-branch classification network to obtain a first tampering prediction score corresponding to each of the branch classification networks; and perform weighted fusion on the first tampering prediction scores to obtain a global tampering detection score corresponding to the detection image.
[0154] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the local tampering detection score determination unit is configured to: obtain the second multi-scale edge features of the tampering-prone area through the tampering object detection backbone network; classify each of the second multi-scale edge features based on each branch classification network in the multi-branch classification network to obtain a second tampering prediction score corresponding to each of the branch classification networks; and perform weighted fusion on the second tampering prediction scores to obtain a local tampering detection score corresponding to the tampering-prone area.
[0155] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; the local tampering detection score determination unit is configured to: obtain the second multi-scale edge features of the tampering-prone area through the tampering object detection backbone network; classify the target multi-scale edge features in the second multi-scale edge features based on at least one target branch classification network in the multi-branch classification network, and obtain a third tampering prediction score corresponding to the target branch classification network; determine the local tampering detection score corresponding to the tampering-prone area according to the third tampering prediction score.
[0156] In some example embodiments of the present specification, based on the aforementioned scheme, multi-scale edge features include basic image features, image edge semantic features, tampered object edge guiding features and tampered object segmented images; the tampered object detection backbone network may include: a backbone feature extraction module, used to extract features from an input image to obtain basic image features; an edge perception module, connected to the backbone feature extraction module, used to perform edge perception on the basic image features to obtain image edge semantic features; an edge guiding feature module, connected to the backbone feature extraction module and the edge perception module, used to fuse the image edge semantic features with basic image features at different levels to obtain tampered object edge guiding features; a context aggregation module, connected to the edge guiding feature module, used to perform spiral convolution mining on the tampered object edge guiding features and aggregate multi-scale context semantics to obtain a tampered object segmented image.
[0157] In some example embodiments of the present specification, based on the aforementioned scheme, the document tampering detection device 1400 also includes a model initialization unit, which can be configured to: obtain a preset card and certificate data set, and pre-train a self-supervised model based on sparse mask modeling according to the card and certificate data set to obtain a card and certificate detection pre-trained model; construct the backbone feature extraction module through the card and certificate detection pre-trained model to achieve model initialization of the tampering detection model.
[0158] In some example embodiments of the present specification, based on the aforementioned scheme, a multi-branch classification network may include: a basic image feature classification branch subnetwork, connected to the output end of the trunk feature extraction module, for classifying the basic image features to obtain a fourth tampering prediction score; an edge-guided feature classification branch subnetwork, connected to the output end of the edge perception module, for classifying the image edge semantic features after the first pooling processing to obtain a fifth tampering prediction score; a tampering object region classification branch subnetwork, connected to the output end of the context aggregation module, for classifying the tampered object segmented image after the second pooling processing to obtain a sixth tampering prediction score; a tampering detection subnetwork, connected to the basic image feature classification branch subnetwork, the edge-guided feature classification branch subnetwork and the tampering object region classification branch subnetwork, for weighted fusion of the fourth tampering prediction score, the fifth tampering prediction score and the sixth tampering prediction score to obtain a tampering detection score for the input image.
[0159] In some example embodiments of the present specification, based on the aforementioned scheme, the document tampering estimation module 1420 can be configured to: input the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image; input the easy-to-tamper area into the tampering detection model, and capture the local tampering detection score output by the tampering object area classification branch subnetwork of the tampering detection model; and perform weighted fusion of the global tampering detection score and the local tampering detection score according to preset score weights to obtain a document tampering detection score corresponding to the document to be verified.
[0160] In some example embodiments of the present specification, based on the aforementioned scheme, the input image acquisition module 1410 may include a tamper-prone area segmentation unit, which may be configured to: determine the document type corresponding to the document to be verified; perform region segmentation on the detection image based on the document type to obtain the tamper-prone area corresponding to the detection image.
[0161] In some example embodiments of the present specification, based on the aforementioned scheme, the tamper-prone area segmentation unit can be configured to: match the area segmentation template in a preset database according to the document type; perform area segmentation on the detection image through the area segmentation template to obtain the tamper-prone area corresponding to the detection image.
[0162] In some example embodiments of the present specification, based on the aforementioned scheme, the document tampering detection device 1400 also includes a tampering detection model training unit, which can be configured to: obtain a preset handwriting image and a card image data set for training; perform tampering simulation processing on the card image in the card image data set according to the handwriting image to obtain a tampering training data set; and perform supervised learning training on a pre-built tampering detection model through the tampering training data set to obtain a trained tampering detection model.
[0163] In some example embodiments of the present specification, based on the aforementioned scheme, the tampering detection model training unit can be configured to: perform optical recognition on the card image to determine the text data in the card image; determine the easy-to-tamper keywords in the card image through the text data; generate a tampered handwriting simulation image based on the easy-to-tamper keywords and the handwriting image; fuse the tampered handwriting simulation image to the position area corresponding to the easy-to-tamper keywords on the card image to obtain a training tampered image, and construct a tampered training data set through the training tampered image.
[0164] The specific details of each module of the above-mentioned document tampering detection device have been described in detail in the corresponding document tampering detection method, so they will not be repeated here.
[0165] It should be noted that although several modules or units of the document tampering detection device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the implementation of this specification, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units for embodiment.
[0166] In addition, in an exemplary embodiment of the present specification, an electronic device capable of implementing the above-mentioned document tampering detection method is also provided.
[0167] It will be understood by those skilled in the art that various aspects of this specification may be implemented as a system, method or program product. Therefore, various aspects of this specification may be specifically implemented in the following forms, namely: a complete hardware embodiment, a complete software embodiment (including firmware, microcode, etc.), or an embodiment combining hardware and software aspects, which may be collectively referred to herein as a "circuit", "module" or "system".
[0168] Refer to the following Fig.15 An electronic device 1500 according to such an embodiment of the present specification is described. Fig.15 The electronic device 1500 shown is merely an example and should not limit the functionality and scope of use of the embodiments of this specification.
[0169] like Fig.15 As shown, the electronic device 1500 is in the form of a general computing device. The components of the electronic device 1500 may include, but are not limited to: the at least one processing unit 1510, the at least one storage unit 1520, a bus 1530 connecting different system components (including the storage unit 1520 and the processing unit 1510), and a display unit 1540.
[0170] The storage unit stores a program code, which can be executed by the processing unit 1510, so that the processing unit 1510 performs the steps according to various exemplary embodiments of the present specification described in the above “Exemplary Method” section of the present specification. For example, the processing unit 1510 can perform the following steps: Figure 2 In step S220 shown in the figure, a detection image of the document to be verified is obtained, and an easily tampered area corresponding to the detection image is determined; in step S240, the detection image and the easily tampered area are input into a trained tampering detection model to obtain a document tampering detection score corresponding to the document to be verified; in step S260, if it is determined that the document tampering detection score is greater than or equal to a preset tampering score threshold, it is determined that tampering has occurred in the document to be verified.
[0171] The storage unit 1520 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1521 and / or a cache memory unit 1522 , and may further include a read-only memory unit (ROM) 1523 .
[0172] The storage unit 1520 may also include a program / utility 1524 having a set (at least one) of program modules 1525, such program modules 1525 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0173] Bus 1530 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0174] The electronic device 1500 may also communicate with one or more external devices 1570 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1500, and / or communicate with any device that enables the electronic device 1500 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1550. Furthermore, the electronic device 1500 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1560. As shown, the network adapter 1560 communicates with other modules of the electronic device 1500 via a bus 1530. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1500, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0175] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of this specification can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of this specification.
[0176] In the exemplary embodiments of this specification, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of this specification is stored. In some possible embodiments, various aspects of this specification can also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to execute the steps according to various exemplary embodiments of this specification described in the above "Exemplary Method" section of this specification.
[0177] refer to Fig.16 As shown, a program product 1600 for implementing the above-mentioned document tampering detection method according to an embodiment of the present specification is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present specification is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0178] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0179] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0180] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0181] Program code for performing the operations of the present specification may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0182] In addition, the above-mentioned figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present specification, and are not intended to be limiting. It is easy to understand that the processes shown in the above-mentioned figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0183] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of this specification can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of this specification.
[0184] Those skilled in the art will readily appreciate other embodiments of the specification after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the specification that follow the general principles of the specification and include common knowledge or customary techniques in the art that are not disclosed in the specification. The specification and examples are to be considered merely exemplary, and the true scope and spirit of the specification are indicated by the claims.
[0185] It should be understood that the present description is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present description is limited only by the appended claims.
Claims
1. A method for detecting document tampering, comprising: Obtaining a detection image of the document to be verified, and determining a tamper-prone area corresponding to the detection image; Inputting the detection image and the tamper-prone area into a trained tamper detection model to obtain a document tamper detection score corresponding to the document to be verified; If it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold, it is determined that there is tampering with the certificate to be verified.
2. The document tampering detection method according to claim 1, wherein: The step of inputting the detection image and the tamper-prone area into a pre-trained tamper detection model to obtain a tamper detection score corresponding to the document to be verified includes: Inputting the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image; Inputting the tamper-prone area into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone area; The global tampering detection score and the local tampering detection score are weightedly fused according to a preset score weight to obtain a document tampering detection score corresponding to the document to be verified.
3. The document tampering detection method according to claim 2, wherein: The tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; The step of inputting the detection image into the tampering detection model to obtain a global tampering detection score corresponding to the detection image includes: Acquire a first multi-scale edge feature of the detection image through the tampering object detection backbone network; Classifying each of the first multi-scale edge features based on each branch classification network in the multi-branch classification network, and obtaining a first tampering prediction score corresponding to each of the branch classification networks; The first tampering prediction scores are weightedly fused to obtain a global tampering detection score corresponding to the detection image.
4. The document tampering detection method according to claim 2, wherein: The tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; The step of inputting the tamper-prone region into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone region includes: Acquire the second multi-scale edge features of the tamper-prone area through the tamper-prone object detection backbone network; Classifying each of the second multi-scale edge features based on each branch classification network in the multi-branch classification network, and obtaining a second tampering prediction score corresponding to each of the branch classification networks; The second tampering prediction scores are weightedly fused to obtain a local tampering detection score corresponding to the tamper-prone area.
5. The document tampering detection method according to claim 2, wherein: The tampering detection model includes a tampering object detection backbone network and a multi-branch classification network; The step of inputting the tamper-prone region into the tamper-detection model to obtain a local tamper-detection score corresponding to the tamper-prone region includes: Acquire the second multi-scale edge features of the tamper-prone area through the tamper-prone object detection backbone network; Classifying target multi-scale edge features in the second multi-scale edge features based on at least one target branch classification network in the multi-branch classification network, and obtaining a third tampering prediction score corresponding to the target branch classification network; A local tampering detection score corresponding to the tamper-prone area is determined according to the third tampering prediction score.
6. The document tampering detection method according to any one of claims 3 to 5, wherein: The multi-scale edge features include basic image features, image edge semantic features, tampered object edge guide features and tampered object segmentation images; the tampered object detection backbone network includes: The backbone feature extraction module is used to extract features from the input image to obtain basic image features; An edge perception module, connected to the backbone feature extraction module, for performing edge perception on the basic image features to obtain image edge semantic features; An edge guiding feature module, connected to the backbone feature extraction module and the edge perception module, for fusing the image edge semantic features with basic image features at different levels to obtain edge guiding features of the tampered object; The context aggregation module is connected to the edge guidance feature module and is used to perform spiral convolution mining on the edge guidance features of the tampered object and aggregate multi-scale context semantics to obtain a tampered object segmentation image.
7. The document tampering detection method according to claim 6, wherein: The method further comprises: Obtain a preset card data set, and pre-train a self-supervised model based on sparse mask modeling according to the card data set to obtain a card detection pre-training model; The backbone feature extraction module is constructed through the card detection pre-training model to achieve model initialization of the tampering detection model.
8. The document tampering detection method according to claim 6, wherein: The multi-branch classification network includes: A basic image feature classification branch subnetwork, connected to the output end of the trunk feature extraction module, is used to classify the basic image features to obtain a fourth tampering prediction score; An edge-guided feature classification branch subnetwork is connected to the output end of the edge perception module and is used to classify the edge semantic features of the image after the first pooling process to obtain a fifth tampering prediction score; The tampered object region classification branch subnetwork is connected to the output end of the context aggregation module, and is used to classify the tampered object segmentation image after the second pooling processing to obtain a sixth tampering prediction score.
9. The document tampering detection method according to claim 8, wherein: The multi-branch classification network also includes: The tampering detection subnetwork is connected to the basic image feature classification branch subnetwork, the edge-guided feature classification branch subnetwork and the tampering object area classification branch subnetwork, and is used to weightedly fuse the fourth tampering prediction score, the fifth tampering prediction score and the sixth tampering prediction score to obtain the document tampering detection score of the input image.
10. The document tampering detection method according to claim 1, wherein: The determining the tamper-prone area corresponding to the detection image includes: Determine the document type corresponding to the document to be verified; The detection image is segmented into regions based on the document type to obtain an easily tampered region corresponding to the detection image.
11. The document tampering detection method according to claim 10, wherein: The performing region segmentation on the detection image based on the certificate type to obtain the easily tampered region corresponding to the detection image includes: Matching a region segmentation template in a preset database according to the document type; The detection image is segmented into regions using the region segmentation template to obtain the easily tampered region corresponding to the detection image.
12. The document tampering detection method according to claim 1, wherein: The method further comprises: Obtaining a preset handwriting image and a card image dataset for training; Performing tampering simulation processing on the card image in the card image dataset according to the handwriting image to obtain a tampering training dataset; The pre-built tampering detection model is trained through supervised learning using the tampering training data set to obtain a trained tampering detection model.
13. The document tampering detection method according to claim 12, wherein: The step of performing tampering simulation processing on the card image in the card image data set according to the handwriting image to obtain a tampering training data set includes: Optically identifying the card image to determine text data in the card image; Determine the easily tampered keywords in the card image through the text data; Generate a tampered handwriting simulation image according to the easily tampered keyword and the handwriting image; The simulated image of the tampered handwriting is fused to the position area corresponding to the easily tampered keyword on the card image to obtain a training tampered image, and a tampered training data set is constructed through the training tampered image.
14. A document tampering detection device, comprising: An input image acquisition module is used to acquire a detection image of the document to be verified and determine the tamper-prone area corresponding to the detection image; A document tampering estimation module, used for inputting the detection image and the tamper-prone area into a trained tampering detection model to obtain a document tampering detection score corresponding to the document to be verified; The certificate tampering behavior identification module is used to determine that the certificate to be verified has been tampered with if it is determined that the certificate tampering detection score is greater than or equal to a preset tampering score threshold.
15. An electronic device, comprising: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the document tampering detection method according to any one of claims 1 to 13.
16. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the document tampering detection method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Certificate image processing method and device
CN110378328A
Certificate authenticity verification method and device, computer equipment and storage medium
CN111191539A
Tamper detection method and system
CN112597808A
Image labeling method and device, storage medium and computer equipment
CN116012493A
Image aesthetics grade evaluation method based on ordered classification
CN116630703A
