A method, device, computer equipment and storage medium for identifying a photocopied document

Through the LBP feature-based replica ID recognition method, the MobilenetV3 network and LBPGenerator module are used, combined with texture feature recognition and data edge expansion training, to solve the problem of lack of robustness of traditional methods and achieve a more efficient replica ID recognition effect.

CN114677769BActive Publication Date: 2024-10-22CHINA PING AN LIFE INSURANCE CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202210369155.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-08
Publication Date
2024-10-22
Estimated Expiration
2042-04-08

AI Technical Summary

Technical Problem

Traditional methods for identifying copied documents lack scene robustness and are difficult to effectively identify copied documents under different attack vectors and image imaging devices.

Method used

A replica ID recognition method based on LBP features is used to train the model composed of MobilenetV3 network, LBPGenerator module and fully connected layer. The LBP feature map is used for texture feature recognition, and the training data is expanded with equal magnifications of 1, 1.5, and 3 times. Training to dynamically adapt to background information.

Benefits of technology

The robustness of the copied document recognition model is significantly enhanced, which can effectively identify texture features in document images, reduce misrecognition of low document quality, and improve recognition accuracy and recall in harsh light scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677769B_ABST
    Figure CN114677769B_ABST
Patent Text Reader

Abstract

The embodiments of the present application belong to the field of image processing technology in artificial intelligence, and relate to a method, device, computer equipment and storage medium for photocopying document recognition. In addition, the present application also relates to blockchain technology, and the user's ID image to be identified and the ID recognition result can be stored in the blockchain. When training the photocopying document recognition model, the present application introduces the LBP feature map as auxiliary information for model training, and performs edge expansion training on the training data according to different magnifications such as 1, 1.5, and 3 times. It can use some background information other than the ID card area to dynamically adapt to scattered discriminant clues, so that the trained model can recognize the document image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the photocopying document recognition model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology in artificial intelligence, and in particular to a method, device, computer equipment and storage medium for recognizing a reproduced ID card. Background Art

[0002] ID card photocopying recognition can identify whether the ID card photo is a photocopy or a screen copy rather than the ID card itself, thereby preventing the ID card photo from being illegally used by criminals. It is a research field with great practical value. RGB image photocopying detection can only be judged based on the information of the image itself, which faces great challenges in actual open scenarios.

[0003] The existing method for identifying copied documents is based on the idea of ​​image classification tasks, constructing an image classification model to classify and detect RGB images, thereby achieving the purpose of identifying copied documents.

[0004] However, the applicant found that traditional methods for identifying copied documents are generally not intelligent. Different attack vectors, different image imaging devices, and input resolutions often have a direct impact on the classification results. This also makes simple image classification models difficult to deploy and apply in various common situations, and lacks a certain degree of scenario robustness. It can be seen that traditional methods for identifying copied documents lack a certain degree of scenario robustness. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a method, device, computer equipment and storage medium for identifying a copied document, so as to solve the problem that the traditional method for identifying a copied document lacks certain scene robustness.

[0006] In order to solve the above technical problems, the present application embodiment provides a method for identifying a photocopied document, which adopts the following technical solution:

[0007] Acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures;

[0008] Performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image;

[0009] Inputting the initial positive sample image and the initial negative sample image into the initial model for model training operation to obtain a photocopy document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module, and a fully connected layer;

[0010] Obtain the image of the document to be identified;

[0011] Input the document image to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified;

[0012] Inputting the LBP feature map of the document to be identified into the LBP feature-based photocopy document recognition model to perform a texture feature recognition operation to obtain a texture feature recognition result;

[0013] If the texture feature recognition result shows obvious texture difference features, then the document to be identified is confirmed to be a photocopied document;

[0014] If the texture feature recognition result does not have obvious texture difference features, it is confirmed that the document to be identified is an original document.

[0015] In order to solve the above technical problems, the embodiment of the present application further provides a device for identifying a photocopied document, which adopts the following technical solution:

[0016] A sample data acquisition module, used to acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures;

[0017] A preprocessing module, used for performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image;

[0018] A model training module, used for inputting the initial positive sample image and the initial negative sample image into an initial model for model training operation, so as to obtain a photocopy document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer;

[0019] The module for obtaining the certificate to be identified is used to obtain the image of the certificate to be identified;

[0020] An LBP feature conversion module, used for inputting the document image to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified;

[0021] A texture feature recognition module, which is used to input the LBP feature map of the document to be recognized into the LBP feature-based photocopy document recognition model to perform a texture feature recognition operation to obtain a texture feature recognition result;

[0022] A first result module, configured to confirm that the document to be identified is a photocopied document if the texture feature recognition result has obvious texture difference features;

[0023] The second result module is used to confirm that the document to be identified is an original document if there is no obvious texture difference feature in the texture feature recognition result.

[0024] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0025] The invention comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the method for identifying a reproduced ID card as described above when executing the computer-readable instructions.

[0026] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0027] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the method for identifying a reproduced document are implemented.

[0028] The present application provides a method for identifying a photocopied document, comprising: obtaining sample data, wherein the sample data comprises a positive sample image annotated with a real picture and a negative sample image annotated with a photocopied picture; performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; inputting the initial positive sample image and the initial negative sample image into an initial model for model training operation to obtain a photocopied document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, and a feature extraction module. The invention comprises a method for obtaining an image of a document to be identified; inputting the image of the document to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified; inputting the LBP feature map of the document to be identified into the LBP feature-based photocopy document recognition model for texture feature recognition to obtain a texture feature recognition result; if the texture feature recognition result has obvious texture difference features, the document to be identified is confirmed to be a photocopy document; if the texture feature recognition result does not have obvious texture difference features, the document to be identified is confirmed to be an original document. Compared with the prior art, the present invention introduces LBP feature maps as auxiliary information for model training when training the photocopy document recognition model, and performs edge expansion training on the training data according to different magnifications such as 1, 1.5, and 3 times, so as to utilize some background information except the ID card area, dynamically adapt to the scattered discrimination clues, so that the trained model can recognize the document image according to the texture feature information implied by the LBP feature map, and effectively enhance the robustness of the photocopy document recognition model. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0030] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0031] Figure 2 This is a flowchart of the implementation of the photocopy document recognition method provided in Example 1 of the present application;

[0032] Figure 3 This is a flowchart of a specific implementation method of the use of supervision information and network model provided in Example 1 of the present application;

[0033] Figure 4 yes Figure 2 A flowchart of a specific implementation of step S202;

[0034] Figure 5 yes Figure 2 A flowchart of a specific implementation of step S203;

[0035] Figure 6 This is a flowchart of a specific implementation method of obtaining a sub-image of a document to be identified provided in Example 1 of the present application;

[0036] Figure 7 It is a flowchart of a specific implementation method of obtaining a target gradient map prediction model provided in Example 1 of the present application;

[0037] Figure 8 It is a structural schematic diagram of the photocopy document recognition device provided in the first embodiment of the present application;

[0038] Fig. 9 yes Figure 8 A schematic diagram of a specific implementation of the preprocessing module 220;

[0039] Fig.10 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0040] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0041] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0042] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0043] like Figure 1 As shown, the system architecture 100 may include 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.

[0044] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0045] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.

[0046] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .

[0047] It should be noted that the photocopied document recognition method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the photocopied document recognition device is generally arranged in the server / terminal device.

[0048] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to the implementation requirements.

[0049] Continue to refer Figure 2 , shows an implementation flow chart of the photocopied document recognition method provided in Example 1 of the present application. For the sake of convenience of explanation, only the parts related to the present application are shown.

[0050] The above-mentioned method for identifying a photocopied document comprises the following steps: step S201, step S202, step S203, step S204, step S205 and step S206.

[0051] Step S201: Acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures.

[0052] Step S202: performing preprocessing operations on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image.

[0053] In an embodiment of the present application, the preprocessing operation may be to use an ID card detector (Retinaface) to obtain the ID card coordinate frame in the image, and then expand the ID card frame by 1 times, 1.5 times, or 3 times according to a certain ratio, and scale the ID card images with different background sizes to a fixed size of 224x224.

[0054] Step S203: Input the initial positive sample image and the initial negative sample image into the initial model for model training operation to obtain a photocopied document recognition model based on LBP features, wherein the initial model consists of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer.

[0055] In the embodiment of the present application, after converting the reproduced image and the real image to generate the LBP feature map, we found that the LBP feature maps of the real and reproduced ID cards have obvious texture differences. Therefore, we believe that the LBP feature maps of the real and reproduced ID cards are distinguishable. We add the LBP feature map as a supervisory signal in the model training. The specific use of the supervisory information and the network model are as follows Figure 3 shown.

[0056] In the embodiment of the present application, considering that the effective discriminant information of the real / reproduced ID card is not necessarily completely distributed in the ID card area, it may also appear in the background area (such as moiré, border, etc.), so we use a backbone network (MobilenetV3) with an attention mechanism to extract image features, and differentiate into two branches in the second half of the network, one branch uses the LBPGenerator module to generate the LBP feature map, and the other branch obtains a 512-dimensional feature vector. For each scale-expanded ID card image, the above network is used for feature extraction, and then all 512-dimensional features (3 512-dimensional features) are spliced ​​to obtain 1536-dimensional features, and finally a 2-dimensional feature vector is obtained through a fully connected layer.

[0057] In the embodiment of the present application, two loss functions are used in model training, namely LBP feature loss function and softmax loss function.

[0058] Step S204: Acquire the image of the document to be identified.

[0059] In an embodiment of the present application, the image of the document to be identified may be obtained by real-time acquisition by an image acquisition terminal, and the image of the document to be identified may also be obtained by sending data carrying the image of the document to be identified by a user terminal. It should be understood that the examples of the implementation method of obtaining the image of the document to be identified are only for the convenience of understanding and are not used to limit the present application.

[0060] Step S205: input the image of the document to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified.

[0061] Step S206: input the LBP feature map of the document to be identified into the LBP feature-based photocopy document recognition model to perform a texture feature recognition operation to obtain a texture feature recognition result.

[0062] Step S207: If there are obvious texture difference features in the texture feature recognition result, it is confirmed that the document to be identified is a photocopied document.

[0063] Step S208: If there is no obvious texture difference feature in the texture feature recognition result, it is confirmed that the document to be identified is the original document.

[0064] In an embodiment of the present application, after the real ID card image and the copied ID card image are converted into LBP feature maps, the LBP feature map of the copied ID card has obvious texture features, while the LBP feature map of the real ID card has no obvious features. The present application confirms whether the ID card image to be identified is a copied ID card image by confirming whether there are obvious texture difference features in the texture feature recognition results.

[0065] In an embodiment of the present application, a method for identifying a reproduced document is provided, comprising: obtaining sample data, wherein the sample data comprises a positive sample image annotated with a real picture and a negative sample image annotated with a reproduced picture; performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; inputting the initial positive sample image and the initial negative sample image into an initial model for model training operation to obtain a reproduced document recognition model based on LBP features, wherein the initial model consists of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer; obtaining an image of a document to be identified; inputting the image of the document to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified; inputting the LBP feature map of the document to be identified into a reproduced document recognition model based on the LBP feature for texture feature recognition operation to obtain a texture feature recognition result; if the texture feature recognition result has obvious texture difference features, then it is confirmed that the document to be identified is a reproduced document; if the texture feature recognition result does not have obvious texture difference features, then it is confirmed that the document to be identified is an original document. Compared with the prior art, the present application introduces LBP feature maps as auxiliary information for model training when training the copied ID card recognition model, and expands the training data according to different magnifications such as 1, 1.5, and 3 times. It can utilize some background information other than the ID card area and dynamically adapt to scattered discrimination clues, so that the trained model can recognize the ID card image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the copied ID card recognition model.

[0066] Continue reading Figure 4 , showing Figure 2 A flowchart of a specific implementation of step S202 is shown in FIG. 1 . For ease of explanation, only the part related to the present application is shown.

[0067] In some optional implementations of this embodiment, the above step S202 specifically includes: step S401 and step S402.

[0068] Step S401: resizing the positive sample image and the negative sample image in a manner that the aspect ratio remains unchanged, to obtain a positive sample image of a standard size and a negative sample image of a standard size.

[0069] In the embodiment of the present application, the resizing process refers to the process of adjusting the size of the positive sample image, and the adjustment process always keeps the aspect ratio of the image unchanged. Specifically, the image enlargement can adopt the interpolation method, that is, inserting new elements between the pixels of the original image by using a suitable interpolation algorithm. The interpolation algorithm includes, for example, an edge-based image interpolation algorithm, an area-based image interpolation algorithm, and other known or future-developed algorithms. The image reduction can be interpolated by, for example, CV_INETR_AREA.

[0070] Step S402: segmenting the standard-sized positive sample image and the standard-sized negative sample image according to a preset size to obtain an initial positive sample image and an initial negative sample image.

[0071] In an embodiment of the present application, since the input of the quality detection model needs to meet certain size requirements, when an image that is too large is input into the quality detection model, it will affect the processing efficiency and accuracy of the model. Therefore, the positive sample image or the negative sample image is standardized through the above-mentioned size adjustment processing and segmentation processing, so that the input data of the quality detection model meets the requirements of the model, wherein the preset size can be dynamically adjusted according to actual conditions. As an example, the preset size can be 224×224. It should be understood that the example of the preset size here is only for convenience of understanding and is not used to limit the present application.

[0072] Continue reading Figure 5 , showing Figure 2 A flowchart of a specific implementation of step S203 is shown in FIG. 1 . For ease of explanation, only the part related to the present application is shown.

[0073] In some optional implementations of this embodiment, the above step S203 specifically includes: step S501, step S502, step S503 and step S504.

[0074] Step S501: Perform Fourier transform operation on the initial sample data to obtain reference feature data F G .

[0075] Step S502: Perform LBP feature prediction operation on the initial sample data according to the LBPGenerator module to obtain predicted feature data F p .

[0076] Step S503: Based on the reference feature data F G And the predicted feature data F p Construct feature loss function L LBP , feature loss function L LBP It is expressed as:

[0077]

[0078] Among them, F p Represents the predicted feature data; F G Represents reference feature data.

[0079] Step S504: According to the feature loss function L LBP The LBPGenerator module is trained until convergence to obtain a trained LBPGenerator module.

[0080] In an embodiment of the present application, the loss function L2 loss of the LBPGenerator module calculates the difference between the actual LBP feature map and the generated LBP feature map, so that the trained LBPGenerator module can predict the same LBP image features as the real feature map.

[0081] In some optional implementations of this embodiment, the loss function L of the fully connected layer is softmax It is expressed as:

[0082]

[0083] Among them, yi represents the true label of the sample, fj represents the j-th confidence of the output category, and N represents the number of training samples.

[0084] Continue reading Figure 6 , shows a flowchart of a specific implementation method of obtaining a sub-image of a document to be identified provided in Example 1 of the present application. For the sake of ease of explanation, only the part related to the present application is shown.

[0085] In some optional implementations of this embodiment, after step S104 and before step S105, the following steps are further included: step S601, step S602, and step S603. Step S105 specifically includes: step S604.

[0086] Step S601: performing an adaptive binarization operation on the document image to be identified to obtain a binary document image.

[0087] In the embodiment of the present application, the binarization algorithm takes a threshold value, and the pixel points greater than the threshold value are assigned a value of 1, that is, displayed as white, and the pixel points less than the threshold value are naturally assigned a value of 0, that is, displayed as black. Therefore, the quality of this threshold value directly affects the effect.

[0088] In an embodiment of the present application, the threshold of adaptive binarization may be the average of the entire picture; the threshold of adaptive binarization may also be the average of all pixels in the row and column where each pixel is located; the threshold of adaptive binarization may also be the average of all pixels in the matrix area where each pixel is located. It should be understood that the examples of the adaptive binarization threshold here are only for the convenience of understanding and are not used to limit the present application.

[0089] In some optimized embodiments of the present application, the document image to be identified can be divided into a smooth area (the grayscale values ​​of the pixel points are in a very small range and present a distribution curve with a protrusion in the middle) and a detail area (the grayscale values ​​of the pixel points are distributed in a large range, presenting an extreme distribution pattern). In the "matrix binarization processing", a parameter β is added in the process of comparing the pixel point with the mean of all the pixels in the matrix, that is, if (a<mean*β), where a represents a long pixel point and mean represents the pixel mean.

[0090] In the embodiment of the present application, the above parameter β may be 0.9.

[0091] Step S602: performing an erosion and dilation operation on the binary document image to obtain the document image edge line.

[0092] In the embodiment of the present application, the erosion and dilation operation refers to deleting pixels at the boundary of the binary document image (the erosion part, i.e. making the white area thinner), and at the same time, adding pixels to the boundary of the binary document image (the dilation part, i.e. making the white area fatter), and the size of this "circle" is specified by a parameter, and the user can set the value of the parameter according to actual conditions.

[0093] Step S603: segmenting the ID image to be identified according to the ID image edge lines to obtain ID sub-images to be identified.

[0094] Step S604: Perform LBP feature conversion on the ID sub-image to be identified to obtain an LBP feature map of the ID to be identified.

[0095] In the embodiment of the present application, since the size of the document image is irregular, or even oversized, when the above-mentioned text box detection operation is performed on the oversized document image, it will seriously affect the efficiency and accuracy of the text box detection. Therefore, by performing adaptive binarization operations, corrosion and dilation operations and segmentation operations on the document image to be identified, targeted area division is performed on the document image to be identified, and a small-sized image with text as the main area is obtained, thereby effectively ensuring the efficiency and accuracy of subsequent text box detection operations.

[0096] Continue reading Figure 7, shows a flowchart of a specific implementation method of obtaining a target gradient map prediction model provided in Example 1 of the present application. For ease of explanation, only the part related to the present application is shown.

[0097] In some optional implementations of this embodiment, after step S202 and before step S203, the following steps are further included: step S701 and step S702. Step S203 specifically includes: step S703.

[0098] Step S701: performing image enhancement operation on the initial positive sample image and the initial negative sample image to obtain an enhanced positive sample image and an enhanced negative sample image.

[0099] In an embodiment of the present application, the specific implementation method of the image enhancement operation is: four images image1, image2, image3, and image4 are randomly cropped (random_cut) respectively, and then the four cropped images are randomly spliced ​​and combined (random_combine) to obtain a mixed image, and finally the mixed image is resized to a fixed size as the input image of the initial gradient map prediction model.

[0100] Step S702: performing a gradient map calculation operation on the enhanced positive sample image and the enhanced negative sample image according to a two-dimensional discrete function derivation method to obtain a positive sample gradient map and a negative sample gradient map.

[0101] In the embodiment of the present application, the image gradient can be regarded as a two-dimensional discrete function, and the image gradient is actually the derivative of this two-dimensional discrete function. Specifically:

[0102] Image gradient: G(x,y)=dx(i,j)+dy(i,j);

[0103] dx(i,j)=I(i+1,j)-I(i,j);

[0104] dy(i,j)=I(i,j+1)-I(i,j);

[0105] Among them, I is the value of the image pixel (such as RGB value), and (i, j) is the coordinate of the pixel.

[0106] Image gradient can generally also be calculated using median difference:

[0107] dx(i,j)=[I(i+1,j)-I(i-1,j)] / 2;

[0108] dy(i,j)=[I(i,j+1)-I(i,j-1)] / 2;

[0109] Image edges are generally achieved by performing gradient operations on the image.

[0110] Step S703: inputting the positive sample gradient map and the negative sample gradient map into the initial model for model training operation to obtain a photocopy document recognition model based on LBP features.

[0111] In an embodiment of the present application, an image enhancement algorithm Mosaic is introduced to increase the feature content of the image input to the model, increase the training width of the model, effectively reduce the misrecognition of low-quality documents, and at the same time, increase the recall of images to be detected taken in difficult scenes such as poor lighting, thereby improving the overall accuracy and recall rate of document quality recognition.

[0112] In summary, the present application provides a method for identifying copied documents, including: obtaining sample data, wherein the sample data includes positive sample images marked with real pictures and negative sample images marked with copied pictures; performing preprocessing operations on the positive sample images and the negative sample images to obtain initial positive sample images and initial negative sample images; inputting the initial positive sample images and the initial negative sample images into an initial model for model training operations to obtain a copied document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module, and a fully connected layer; obtaining an image of a document to be identified; inputting the image of the document to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified; inputting the LBP feature map of the document to be identified into a copied document recognition model based on the LBP feature for texture feature recognition operations to obtain a texture feature recognition result; if the texture feature recognition result has obvious texture difference features, it is confirmed that the document to be identified is a copied document; if the texture feature recognition result does not have obvious texture difference features, it is confirmed that the document to be identified is an original document. Compared with the prior art, this application introduces LBP feature map as auxiliary information for model training when training the photocopy document recognition model, and expands the training data according to different magnifications such as 1, 1.5, and 3 times. It can use some background information other than the ID card area to dynamically adapt to the scattered discrimination clues, so that the trained model can recognize the document image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the photocopy document recognition model. At the same time, by performing adaptive binarization, corrosion and expansion operations and segmentation operations on the document image to be identified, the document image to be identified is divided into targeted areas, and a small-size image with text as the main area is obtained, thereby effectively ensuring the efficiency and accuracy of subsequent text box detection operations; the image enhancement algorithm Mosaic is introduced to increase the feature content of the image input to the model, increase the training width of the model, effectively reduce the misrecognition of low-quality documents, and at the same time, increase the recall of the image to be detected taken in difficult scenes such as bad light, and improve the overall accuracy and recall of document quality recognition.

[0113] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned document images to be identified and the document recognition results, the above-mentioned document images to be identified and the document recognition results can also be stored in a node of a blockchain.

[0114] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0115] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0116] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0117] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0118] Embodiment 2

[0119] Further references Figure 8 , as a response to the above Figure 2 The present application provides an embodiment of a device for identifying a photocopy of a document. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0120] like Figure 8 As shown, the photocopy document recognition device 200 of this embodiment includes: a sample data acquisition module 210, a preprocessing module 220, a model training module 230, a to-be-recognized document acquisition module 240, an LBP feature conversion module 250, a texture feature recognition module 260, a first result module 270, and a second result module 280. Among them:

[0121] The sample data acquisition module 210 is used to acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures;

[0122] A preprocessing module 220 is used to perform preprocessing operations on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image;

[0123] The model training module 230 is used to input the initial positive sample image and the initial negative sample image into the initial model for model training operation to obtain a photocopy document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer;

[0124] The to-be-recognized document acquisition module 240 is used to acquire the to-be-recognized document image;

[0125] The LBP feature conversion module 250 inputs the document image to be identified into the LBPGenerator module for LBP feature conversion to obtain the LBP feature map of the document to be identified;

[0126] Texture feature recognition module 260, used for inputting the LBP feature map of the document to be recognized into the LBP feature-based copy document recognition model to perform texture feature recognition operation and obtain texture feature recognition results;

[0127] The first result module 270 is used to confirm that the document to be identified is a photocopied document if there are obvious texture difference features in the texture feature recognition result;

[0128] The second result module 280 is used to confirm that the document to be identified is an original document if there is no obvious texture difference feature in the texture feature recognition result.

[0129] In an embodiment of the present application, after the real ID card image and the copied ID card image are converted into LBP feature maps, the LBP feature map of the copied ID card has obvious texture features, while the LBP feature map of the real ID card has no obvious features. The present application confirms whether the ID card image to be identified is a copied ID card image by confirming whether there are obvious texture difference features in the texture feature recognition results.

[0130] In an embodiment of the present application, the preprocessing operation may be to use an ID card detector (Retinaface) to obtain the ID card coordinate frame in the image, and then expand the ID card frame by 1 times, 1.5 times, or 3 times according to a certain ratio, and scale the ID card images with different background sizes to a fixed size of 224x224.

[0131] In the embodiment of the present application, after converting the reproduced image and the real image to generate the LBP feature map, we found that the LBP feature maps of the real and reproduced ID cards have obvious texture differences. Therefore, we believe that the LBP feature maps of the real and reproduced ID cards are distinguishable. We add the LBP feature map as a supervisory signal in the model training. The specific use of the supervisory information and the network model are as follows Figure 3 shown.

[0132] In the embodiment of the present application, considering that the effective discriminant information of the real / reproduced ID card is not necessarily completely distributed in the ID card area, it may also appear in the background area (such as moiré, border, etc.), so we use a backbone network (MobilenetV3) with an attention mechanism to extract image features, and differentiate into two branches in the second half of the network, one branch uses the LBPGenerator module to generate the LBP feature map, and the other branch obtains a 512-dimensional feature vector. For each scale-expanded ID card image, the above network is used for feature extraction, and then all 512-dimensional features (3 512-dimensional features) are spliced ​​to obtain 1536-dimensional features, and finally a 2-dimensional feature vector is obtained through a fully connected layer.

[0133] In the embodiment of the present application, two loss functions are used in model training, namely LBP feature loss function and softmax loss function.

[0134] In an embodiment of the present application, the image of the document to be identified may be obtained by real-time acquisition by an image acquisition terminal, and the image of the document to be identified may also be obtained by sending data carrying the image of the document to be identified by a user terminal. It should be understood that the examples of the implementation method of obtaining the image of the document to be identified are only for the convenience of understanding and are not used to limit the present application.

[0135] In an embodiment of the present application, a device 200 for identifying a photocopied document is provided, comprising: a sample data acquisition module 210, for acquiring sample data, wherein the sample data comprises a positive sample image annotated with a real picture and a negative sample image annotated with a photocopied picture; a preprocessing module 220, for performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; a model training module 230, for inputting the initial positive sample image and the initial negative sample image into an initial model for model training operation to obtain a photocopied document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module, and a fully connected layer. Composition: a module 240 for acquiring the image of the document to be identified; a LBP feature conversion module 250 for inputting the image of the document to be identified into the LBPGenerator module for performing LBP feature conversion to obtain the LBP feature map of the document to be identified; a texture feature recognition module 260 for inputting the LBP feature map of the document to be identified into a photocopied document recognition model based on the LBP feature to perform texture feature recognition operation to obtain a texture feature recognition result; a first result module 270 for confirming that the document to be identified is a photocopied document if there is an obvious texture difference feature in the texture feature recognition result; a second result module 280 for confirming that the document to be identified is an original document if there is no obvious texture difference feature in the texture feature recognition result. When training the copied ID card recognition model, this application introduces the LBP feature map as auxiliary information for model training, and expands the training data according to different magnifications such as 1, 1.5, and 3 times. It can utilize some background information other than the ID card area and dynamically adapt to scattered discrimination clues, so that the trained model can recognize the ID card image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the copied ID card recognition model.

[0136] Continue reading Fig. 9 , showing Figure 8 The schematic diagram of the structure of a specific implementation of the preprocessing module 220 is shown in the figure. For the convenience of explanation, only the part related to the present application is shown.

[0137] In some optional implementations of this embodiment, the preprocessing module 220 further includes: a size adjustment submodule 221 and a segmentation submodule 222, wherein:

[0138] A size adjustment submodule 221 is used to adjust the size of the positive sample image and the negative sample image in a manner that the aspect ratio remains unchanged, so as to obtain a positive sample image of a standard size and a negative sample image of a standard size;

[0139] The segmentation submodule 222 is used to segment the standard-sized positive sample image and the standard-sized negative sample image according to a preset size to obtain an initial positive sample image and an initial negative sample image.

[0140] In the embodiment of the present application, the resizing process refers to the process of adjusting the size of the positive sample image, and the adjustment process always keeps the aspect ratio of the image unchanged. Specifically, the image enlargement can adopt the interpolation method, that is, inserting new elements between the pixels of the original image by using a suitable interpolation algorithm. The interpolation algorithm includes, for example, an edge-based image interpolation algorithm, an area-based image interpolation algorithm, and other known or future-developed algorithms. The image reduction can be interpolated by, for example, CV_INETR_AREA.

[0141] In an embodiment of the present application, since the input of the quality detection model needs to meet certain size requirements, when an image that is too large is input into the quality detection model, it will affect the processing efficiency and accuracy of the model. Therefore, the positive sample image or the negative sample image is standardized through the above-mentioned size adjustment processing and segmentation processing, so that the input data of the quality detection model meets the requirements of the model, wherein the preset size can be dynamically adjusted according to actual conditions. As an example, the preset size can be 224×224. It should be understood that the example of the preset size here is only for convenience of understanding and is not used to limit the present application.

[0142] In some optional implementations of this embodiment, the model training module 230 includes: a Fourier transform submodule, an LBP feature prediction submodule, a loss function construction submodule and a model training submodule, wherein:

[0143] The Fourier transform submodule is used to perform Fourier transform operation on the initial sample data to obtain the reference feature data F G ;

[0144] The LBP feature prediction submodule is used to perform LBP feature prediction operations on the initial sample data according to the LBPGenerator module to obtain the predicted feature data F p ;

[0145] The loss function construction submodule is used to construct the loss function according to the reference feature data F G And the predicted feature data F p Construct feature loss function L LBP , feature loss function L LBP It is expressed as:

[0146]

[0147] Among them, F p Represents the predicted feature data; FG represents reference feature data;

[0148] The model training submodule is used to train the model according to the feature loss function L LBP The LBPGenerator module is trained until convergence to obtain a trained LBPGenerator module.

[0149] In an embodiment of the present application, the loss function L2 loss of the LBPGenerator module calculates the difference between the actual LBP feature map and the generated LBP feature map, so that the trained LBPGenerator module can predict the same LBP image features as the real feature map.

[0150] In some optional implementations of this embodiment, the loss function L of the fully connected layer is softmax It is expressed as:

[0151]

[0152] Among them, yi represents the true label of the sample, fj represents the j-th confidence of the output category, and N represents the number of training samples.

[0153] In some optional implementations of this embodiment, the photocopy document recognition device 200 further includes: a binarization module, a corrosion expansion module and a segmentation module, and the LBP feature conversion module includes: an LBP feature conversion submodule, wherein:

[0154] A binarization module is used to perform an adaptive binarization operation on the document image to be identified to obtain a binarized document image;

[0155] The corrosion and expansion module is used to perform corrosion and expansion operations on the binary document image to obtain the document image edge line;

[0156] A segmentation module, used to segment the ID image to be identified according to the ID image edge line to obtain the ID sub-image to be identified;

[0157] The LBP feature conversion submodule is used to perform LBP feature conversion on the sub-image of the document to be identified to obtain the LBP feature map of the document to be identified.

[0158] In the embodiment of the present application, the binarization algorithm takes a threshold value, and the pixel points greater than the threshold value are assigned a value of 1, that is, displayed as white, and the pixel points less than the threshold value are naturally assigned a value of 0, that is, displayed as black. Therefore, the quality of this threshold value directly affects the effect.

[0159] In an embodiment of the present application, the threshold of adaptive binarization may be the average of the entire picture; the threshold of adaptive binarization may also be the average of all pixels in the row and column where each pixel is located; the threshold of adaptive binarization may also be the average of all pixels in the matrix area where each pixel is located. It should be understood that the examples of the adaptive binarization threshold here are only for the convenience of understanding and are not used to limit the present application.

[0160] In some optimized embodiments of the present application, the document image to be identified can be divided into a smooth area (the grayscale values ​​of the pixel points are in a very small range and present a distribution curve with a protrusion in the middle) and a detail area (the grayscale values ​​of the pixel points are distributed in a large range, presenting an extreme distribution pattern). In the "matrix binarization processing", a parameter β is added in the process of comparing the pixel point with the mean of all the pixels in the matrix, that is, if (a<mean*β), where a represents a long pixel point and mean represents the pixel mean.

[0161] In the embodiment of the present application, the above parameter β may be 0.9.

[0162] In the embodiment of the present application, the erosion and dilation operation refers to deleting pixels at the boundary of the binary document image (the erosion part, i.e. making the white area thinner), and at the same time, adding pixels to the boundary of the binary document image (the dilation part, i.e. making the white area fatter), and the size of this "circle" is specified by a parameter, and the user can set the value of the parameter according to actual conditions.

[0163] In the embodiment of the present application, since the size of the document image is irregular, or even oversized, when the above-mentioned text box detection operation is performed on the oversized document image, it will seriously affect the efficiency and accuracy of the text box detection. Therefore, by performing adaptive binarization operations, corrosion and dilation operations and segmentation operations on the document image to be identified, targeted area division is performed on the document image to be identified, and a small-sized image with text as the main area is obtained, thereby effectively ensuring the efficiency and accuracy of subsequent text box detection operations.

[0164] In some optional implementations of this embodiment, the photocopy document recognition device 200 further includes: an image enhancement module and a gradient map calculation module, and the model training module 230 includes: a model training submodule, wherein:

[0165] An image enhancement module is used to perform image enhancement operations on the initial positive sample image and the initial negative sample image to obtain an enhanced positive sample image and an enhanced negative sample image;

[0166] A gradient map calculation module is used to perform gradient map calculation operations on the enhanced positive sample image and the enhanced negative sample image according to a two-dimensional discrete function derivation method to obtain a positive sample gradient map and a negative sample gradient map;

[0167] The gradient map model training submodule is used to input the positive sample gradient map and the negative sample gradient map into the initial model for model training operation to obtain a photocopy document recognition model based on LBP features.

[0168] In an embodiment of the present application, the specific implementation method of the image enhancement operation is: four images image1, image2, image3, and image4 are randomly cropped (random_cut) respectively, and then the four cropped images are randomly spliced ​​and combined (random_combine) to obtain a mixed image, and finally the mixed image is resized to a fixed size as the input image of the initial gradient map prediction model.

[0169] In the embodiment of the present application, the image gradient can be regarded as a two-dimensional discrete function, and the image gradient is actually the derivative of this two-dimensional discrete function. Specifically:

[0170] Image gradient: G(x,y)=dx(i,j)+dy(i,j);

[0171] dx(i,j)=I(i+1,j)-I(i,j);

[0172] dy(i,j)=I(i,j+1)-I(i,j);

[0173] Among them, I is the value of the image pixel (such as RGB value), and (i, j) is the coordinate of the pixel.

[0174] Image gradient can generally also be calculated using median difference:

[0175] dx(i,j)=[I(i+1,j)-I(i-1,j)] / 2;

[0176] dy(i,j)=[I(i,j+1)-I(i,j-1)] / 2;

[0177] Image edges are generally achieved by performing gradient operations on the image.

[0178] In an embodiment of the present application, an image enhancement algorithm Mosaic is introduced to increase the feature content of the image input to the model, increase the training width of the model, effectively reduce the misrecognition of low-quality documents, and at the same time, increase the recall of images to be detected taken in difficult scenes such as poor lighting, thereby improving the overall accuracy and recall rate of document quality recognition.

[0179] In summary, the present application provides a device 200 for identifying a photocopied document, comprising: a sample data acquisition module 210, for acquiring sample data, wherein the sample data comprises a positive sample image annotated with a real picture and a negative sample image annotated with a photocopied picture; a preprocessing module 220, for performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; a model training module 230, for inputting the initial positive sample image and the initial negative sample image into an initial model for model training operation to obtain a photocopied document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer. ; The certificate acquisition module 240 to be identified is used to obtain the image of the certificate to be identified; the LBP feature conversion module 250 inputs the image of the certificate to be identified to the LBPGenerator module for LBP feature conversion to obtain the LBP feature map of the certificate to be identified; the texture feature recognition module 260 is used to input the LBP feature map of the certificate to be identified to the LBP feature-based photocopy document recognition model to perform texture feature recognition operation to obtain the texture feature recognition result; the first result module 270 is used to confirm that the certificate to be identified is a photocopy document if there is an obvious texture difference feature in the texture feature recognition result; the second result module 280 is used to confirm that the certificate to be identified is an original certificate if there is no obvious texture difference feature in the texture feature recognition result. When training the photocopy ID recognition model, this application introduces the LBP feature map as auxiliary information for model training, and expands the training data according to different magnifications such as 1, 1.5, and 3 times. It can use some background information other than the ID card area to dynamically adapt to the scattered discrimination clues, so that the trained model can recognize the ID image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the photocopy ID recognition model. At the same time, by performing adaptive binarization operations, corrosion and expansion operations, and segmentation operations on the ID image to be identified, the ID image to be identified is divided into targeted areas, and a small-size image with text as the main area is obtained, thereby effectively ensuring the efficiency and accuracy of subsequent text box detection operations; the image enhancement algorithm Mosaic is introduced to increase the feature content of the image input to the model, increase the training width of the model, effectively reduce the misrecognition of low-quality documents, and at the same time, increase the recall of the image to be detected taken in difficult scenes such as bad light, and improve the overall accuracy and recall of document quality recognition.

[0180] To solve the above technical problems, the present application also provides a computer device. Fig.10 , Fig.10 This is a basic structural block diagram of the computer device in this embodiment.

[0181] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0182] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0183] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In this embodiment, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer readable instructions of the photocopy document recognition method, etc. In addition, the memory 310 can also be used to temporarily store various data that have been output or will be output.

[0184] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In this embodiment, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the photocopy document recognition method.

[0185] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.

[0186] The computer device provided in the present application introduces the LBP feature map as auxiliary information for model training when training the copied ID card recognition model, and performs edge expansion training on the training data according to different magnifications such as 1, 1.5, and 3 times. It can utilize some background information other than the ID card area and dynamically adapt to scattered discriminant clues, so that the trained model can recognize the ID card image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the copied ID card recognition model.

[0187] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the above-mentioned photocopied document recognition method.

[0188] The computer-readable storage medium provided in the present application introduces the LBP feature map as auxiliary information for model training when training the copied ID card recognition model, and performs edge expansion training on the training data according to different magnifications such as 1, 1.5, and 3 times. It can utilize some background information other than the ID card area and dynamically adapt to scattered discriminant clues, so that the trained model can recognize the ID card image according to the texture feature information implied by the LBP feature map, effectively enhancing the robustness of the copied ID card recognition model.

[0189] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0190] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A method for identifying a photocopied document. It is characterized in that The steps include: Acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures; Performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; Input the initial positive sample image and the initial negative sample image into the initial model for model training operation to obtain a photocopy document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer. The initial model uses the MobilenetV3 network with an attention mechanism to extract 512-dimensional image features, and is divided into two branches in the second half of the MobilenetV3 network. One branch uses the LBPGenerator module to generate a 512-dimensional LBP feature map, and the other branch uses the feature extraction module to obtain a 512-dimensional feature vector. The image features, the LBP feature map and the feature vector are concatenated to obtain 1536-dimensional features, and finally a 2-dimensional feature vector is obtained through a fully connected layer. Obtain the image of the document to be identified; Input the document image to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified; Inputting the LBP feature map of the document to be identified into the LBP feature-based photocopy document recognition model to perform a texture feature recognition operation to obtain a texture feature recognition result; If the texture feature recognition result shows obvious texture difference features, it is confirmed that the document to be identified is a photocopied document; If the texture feature recognition result does not have obvious texture difference features, it is confirmed that the document to be identified is an original document.

2. The method for identifying a photocopied ID card according to claim 1, It is characterized in that The step of performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image specifically includes the following steps: Resize the positive sample image and the negative sample image in a manner that the aspect ratio remains unchanged, to obtain a positive sample image of a standard size and a negative sample image of a standard size; The standard-size positive sample image and the standard-size negative sample image are segmented according to a preset size to obtain the initial positive sample image and the initial negative sample image.

3. The method for identifying a photocopied ID card according to claim 1, It is characterized in that The step of inputting the initial sample data into the initial model for model training to obtain a photocopy document recognition model based on LBP features specifically includes the following steps: Perform a Fourier transform operation on the initial sample data to obtain reference feature data ; According to the LBPGenerator module, the LBP feature prediction operation is performed on the initial sample data to obtain the predicted feature data. ; According to the reference characteristic data And the predicted feature data Constructing feature loss function , the feature loss function It is expressed as: ; in, representing the predicted feature data; represents the reference characteristic data; According to the feature loss function The LBPGenerator module is trained until convergence to obtain a trained LBPGenerator module.

4. The method for identifying a photocopied document according to claim 1, It is characterized in that After the step of acquiring the image of the document to be identified and before the step of performing the LBP feature conversion on the image of the document to be identified to obtain the LBP feature map of the document to be identified, the following steps are also included: Performing an adaptive binarization operation on the document image to be identified to obtain a binarized document image; Performing an erosion and dilation operation on the binary document image to obtain a document image edge line; Segmenting the document image to be identified according to the edge lines of the document image to obtain a sub-image of the document to be identified; The step of performing the LBP feature conversion on the image of the document to be identified to obtain the LBP feature map of the document to be identified specifically includes the following steps: The LBP feature conversion is performed on the sub-image of the document to be identified to obtain the LBP feature map of the document to be identified.

5. The method for identifying a photocopied ID card according to claim 1, It is characterized in that After the step of preprocessing the positive sample image and the negative sample image to obtain the initial positive sample image and the initial negative sample image, and before the step of inputting the initial positive sample image and the initial negative sample image into the initial model for model training to obtain the photocopied document recognition model based on LBP features, the method further includes the following steps: Performing an image enhancement operation on the initial positive sample image and the initial negative sample image to obtain an enhanced positive sample image and an enhanced negative sample image; Performing a gradient map calculation operation on the enhanced positive sample image and the enhanced negative sample image according to a two-dimensional discrete function derivation method to obtain a positive sample gradient map and a negative sample gradient map; The step of inputting the initial positive sample image and the initial negative sample image into the initial model for model training operation to obtain the photocopy document recognition model based on LBP features specifically includes the following steps: The positive sample gradient map and the negative sample gradient map are input into the initial model to perform the model training operation, so as to obtain the LBP feature-based photocopy document recognition model.

6. The method for identifying a photocopied ID card according to claim 1, It is characterized in that After the step of inputting the LBP feature map of the document to be identified into the LBP feature-based photocopy document recognition model to obtain the document recognition result, the following steps are also included: The document image to be identified and the document identification result are stored in the blockchain.

7. A device for identifying photocopied documents, It is characterized in that include: A sample data acquisition module, used to acquire sample data, wherein the sample data includes positive sample images labeled with real pictures and negative sample images labeled with re-photographed pictures; A preprocessing module, used for performing a preprocessing operation on the positive sample image and the negative sample image to obtain an initial positive sample image and an initial negative sample image; A model training module, used for inputting the initial positive sample image and the initial negative sample image into the initial model for model training operation, and obtaining a photocopy document recognition model based on LBP features, wherein the initial model is composed of a MobilenetV3 network, an LBPGenerator module, a feature extraction module and a fully connected layer, and the initial model uses the MobilenetV3 network with an attention mechanism to extract 512-dimensional image features, and is divided into two branches in the second half of the MobilenetV3 network, one branch uses the LBPGenerator module to generate a 512-dimensional LBP feature map, and the other branch uses the feature extraction module to obtain a 512-dimensional feature vector, and the image features, the LBP feature map and the feature vector are spliced ​​to obtain 1536-dimensional features, and finally a 2-dimensional feature vector is obtained through a fully connected layer; The module for obtaining the certificate to be identified is used to obtain the image of the certificate to be identified; An LBP feature conversion module, used for inputting the document image to be identified into the LBPGenerator module for LBP feature conversion to obtain an LBP feature map of the document to be identified; A texture feature recognition module, which is used to input the LBP feature map of the document to be recognized into the LBP feature-based photocopy document recognition model to perform a texture feature recognition operation to obtain a texture feature recognition result; A first result module, configured to confirm that the document to be identified is a photocopied document if the texture feature recognition result has obvious texture difference features; The second result module is used to confirm that the document to be identified is an original document if there is no obvious texture difference feature in the texture feature recognition result.

8. A computer device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the method for identifying a reproduced document as claimed in any one of claims 1 to 6 when executing the computer-readable instructions.

9. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the method for identifying a reproduced document according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Method and device for identifying copying certificate image

    CN105118048A

  • Moire pattern-based image recognition method and device, device and storage medium

    CN109558794A

  • Training method and detection method for automatically identifying copied images of original document

    CN110717450A

  • Duplicatedimage detection method and device, equipment, and storage medium

    CN112329786A

  • Duplicated image recognition method and device, computer equipment and storage medium

    CN112560683A