Certificate anti-counterfeiting detection method and device
By obtaining image data under different lighting conditions in document anti-counterfeiting detection, forming a video sequence and using a multi-frame deep learning model to extract multi-dimensional anti-counterfeiting features, the problem of low accuracy of authenticity detection in the existing technology is solved, and the further development is achieved High detection accuracy.
Patent Information
- Application Number
- CN202411606267.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-11
- Publication Date
- 2025-02-18
AI Technical Summary
In the anti-counterfeiting detection of certificates, the prior art is difficult to obtain enough printed images, which affects the detection effect of the detection model, resulting in low accuracy of authenticity detection of certificates.
By obtaining the image data of the card to be detected under different lighting conditions, forming a video sequence, and inputting a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including airspace characteristics and time domain characteristics, and determining the authenticity category of the card to be determined.
It improves the accuracy of authenticity detection of certificates and can effectively identify the visual anti-counterfeiting features of card certificates under different lighting conditions, such as laser mark reflection and discoloration.
Smart Images

Figure CN119478788A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the computer field, and in particular, to a document anti-counterfeiting detection method and device. Background Art
[0002] At present, electronic identity authentication is widely used. Document anti-counterfeiting is a key link in identity authentication. A common way to forge documents is to print out the document in color or black and white, and then impersonate the user's real document for identity authentication. This type of document forgery needs to be identified in document anti-counterfeiting detection.
[0003] In the prior art, a large number of real certificates and their corresponding printed images are often used to train the detection model, which is used to detect the authenticity of the certificate corresponding to the input card data. Among them, the user's certificate information belongs to the user's private data, and the private data needs to be protected from being leaked. Due to the influence of various environmental factors, it is difficult to obtain sufficient number and types of printed images in reality, which affects the detection effect of the detection model and the accuracy of certificate authenticity detection is low. Summary of the invention
[0004] One or more embodiments of this specification describe a document anti-counterfeiting detection method and device, which can improve the accuracy of document authenticity detection.
[0005] In a first aspect, a document anti-counterfeiting detection method is provided, the method comprising:
[0006] Acquire first image data and second image data collected under different lighting conditions of the card to be detected;
[0007] forming a video sequence based on the first image data and the second image data, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence;
[0008] The video sequence is input into a multi-frame deep learning model, and multi-dimensional anti-counterfeiting features including spatial features and temporal features are extracted through the multi-frame deep learning model. The predicted category of the card to be detected, whether it is a genuine card or a fake card, is determined based on the multi-dimensional anti-counterfeiting features.
[0009] In a possible implementation manner, the first image data is image data collected when the flash is turned on, and the second image data is image data collected when the flash is not turned on.
[0010] In a possible implementation, the video sequence is also generated based on third image data, where the third image data is a differential image reflecting element changes of the first image data relative to the second image data; and the multi-dimensional anti-counterfeiting feature also includes a gradient feature.
[0011] In a possible implementation, the video sequence is also generated based on fourth image data, and the fourth image data is a frequency spectrum diagram of the first image data or the second image data; and the multi-dimensional anti-counterfeiting feature also includes a frequency domain feature.
[0012] In a possible implementation, the multi-frame deep learning model includes a sampling network layer and an encoder; the extracting multi-dimensional anti-counterfeiting features including spatial domain features and temporal domain features through the multi-frame deep learning model includes:
[0013] Sampling three-dimensional pipeline blocks of a first number of time dimensions and two-dimensional pixel blocks of a second number of space dimensions from the video sequence through the sampling network layer, and forming a block sampling set with each three-dimensional pipeline block and two-dimensional pixel block;
[0014] The block sampling set is input into the encoder to obtain each block representation vector that can represent the multi-dimensional anti-counterfeiting feature.
[0015] Furthermore, the multi-frame deep learning model further includes an output network layer; the step of determining, based on the multi-dimensional anti-counterfeiting features, whether the card to be detected belongs to a prediction category of a genuine card or a fake card includes:
[0016] The output network layer performs attention pooling and mapping processing on each block representation vector to obtain the predicted category.
[0017] In a possible implementation, the multi-frame deep learning model includes an encoder, and the encoder adopts the following pre-training method:
[0018] Masking a number of pixel blocks on each video frame included in the sample video sequence to obtain a masked video sequence;
[0019] Inputting the mask video sequence into the encoder to obtain block representation vectors corresponding to each pixel block;
[0020] Input each block representation vector into the decoder to obtain a reconstructed video sequence;
[0021] The encoder is pre-trained based on the difference between the reconstructed video sequence and the sample video sequence.
[0022] Furthermore, the step of respectively masking a number of pixel blocks of each video frame included in the sample video sequence includes:
[0023] A number of pixel blocks are respectively masked at the same spatial position in each video frame included in the sample video sequence.
[0024] In a possible implementation, the multi-frame deep learning model is trained in the following manner:
[0025] Acquire the first image data and the second image data of the sample detection card, and the label category of the sample detection card;
[0026] Inputting a sample video sequence formed by the first image data and the second image data of the sample detection card into a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determining whether the sample detection card belongs to a predicted category of a genuine certificate or a fake certificate based on the multi-dimensional anti-counterfeiting features;
[0027] According to the difference between the predicted category and the label category of the sample detection card, the model parameters of the multi-frame deep learning model are adjusted.
[0028] In a second aspect, a document anti-counterfeiting detection device is provided, the device comprising:
[0029] An acquisition unit, used to acquire first image data and second image data collected under different lighting conditions of the card to be detected;
[0030] a sequence construction unit, configured to form a video sequence based on the first image data and the second image data acquired by the acquisition unit, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence;
[0031] The prediction unit is used to input the video sequence obtained by the sequence construction unit into a multi-frame deep learning model, extract multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determine the prediction category of the card to be detected as a genuine card or a fake card based on the multi-dimensional anti-counterfeiting features.
[0032] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method of the first aspect.
[0033] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.
[0034] Through the method and device provided in the embodiment of this specification, firstly, the first image data and the second image data collected under different lighting conditions of the card to be detected are obtained; then, a video sequence is formed based on the first image data and the second image data, and the first image data and the second image data correspond to video frames at different times in the video sequence; finally, the video sequence is input into a multi-frame deep learning model, and multi-dimensional anti-counterfeiting features including spatial features and temporal features are extracted through the multi-frame deep learning model, and the predicted category of the card to be detected as a genuine certificate or a fake certificate is determined based on the multi-dimensional anti-counterfeiting features. As can be seen from the above, in the embodiment of this specification, the first image data and the second image data collected under different lighting conditions of the card to be detected are obtained, so that the visual anti-counterfeiting features exhibited by the card under different lighting conditions can be highlighted, for example, the anti-counterfeiting features of laser pattern reflection and color change, and at the same time, the multi-frame deep learning model can extract rich spatial features and temporal features based on the input of the video sequence, so as to improve the accuracy of the authenticity detection of the certificate. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0036] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;
[0037] Figure 2 A flow chart of a document anti-counterfeiting detection method according to an embodiment is shown;
[0038] Figure 3 A schematic diagram showing the composition of a video sequence according to an embodiment;
[0039] Figure 4 A schematic diagram showing sampling from a video sequence according to one embodiment;
[0040] Figure 5 A schematic diagram showing a method of determining a prediction category based on a block sampling set according to an embodiment;
[0041] Figure 6 A schematic diagram of a pipeline masking strategy according to an embodiment is shown;
[0042] Figure 7 A schematic diagram of a pre-training framework according to an embodiment is shown;
[0043] Figure 8 A schematic block diagram of a document anti-counterfeiting detection device according to an embodiment is shown. DETAILED DESCRIPTION
[0044] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0045] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. This implementation scenario involves document anti-counterfeiting detection. It is understandable that a typical form of counterfeiting in document anti-counterfeiting detection is material counterfeiting. For example, a printed image of a real document is a fake document. The paper used for the printed image is usually significantly different from the material of the real document. In addition, real cards usually have anti-counterfeiting elements related to lighting conditions, while fake cards do not have the above anti-counterfeiting elements. The embodiment of this specification detects whether the card is real or fake by highlighting the anti-counterfeiting elements. Figure 1 , which shows a real card and its corresponding fake card. The real card and the fake card have the same text content and pictures, but different materials. The real card is made with optical holographic anti-counterfeiting film technology, which shows the visual effect of laser pattern reflection and color change under different light intensities and card holding angles, while the fake card does not have the above visual effects, thus forming a specific anti-counterfeiting element. Figure 1 The part encircled by the dotted line in the middle schematically illustrates the difference in the visual effects. It is understandable that the actual visual effects will be richer. For example, the shape of the laser pattern can be various possible styles and the color can also be various possible colors.
[0046] In the embodiment of this specification, for the task of detecting the authenticity of a card, image data of the card under different lighting conditions is collected to highlight the features of the anti-counterfeiting elements on the card, thereby identifying counterfeit cards, and it is expected that the accuracy of authenticity detection of the document can be improved.
[0047] Figure 2 A flowchart of a document anti-counterfeiting detection method according to an embodiment is shown. The method can be based on Figure 1 The implementation scenario shown in Figure 1 is as follows. Figure 2 As shown, the document anti-counterfeiting detection method in this embodiment includes the following steps: Step 21, obtaining the first image data and the second image data collected under different lighting conditions of the card to be detected; Step 22, forming a video sequence based on the first image data and the second image data, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence; Step 23, inputting the video sequence into a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determining the predicted category of the card to be detected as a genuine certificate or a fake certificate based on the multi-dimensional anti-counterfeiting features. The specific execution method of each of the above steps is described below.
[0048] First, in step 21, the first image data and the second image data collected under different lighting conditions of the card to be detected are obtained. It can be understood that the above lighting conditions may include lighting intensity, light source type, lighting time, lighting direction, etc. Among them, the light source type affects the type of light, such as visible light, invisible light, etc.; the lighting direction affects the angle between the light and the card to be detected.
[0049] In one example, the first image data is image data collected when a flash is turned on, and the second image data is image data collected when the flash is not turned on.
[0050] In this example, the anti-counterfeiting elements on the document are highlighted through the interactive method of active flashing, and the changes in the anti-counterfeiting characteristics of the card under different light intensities are captured.
[0051] It should be noted that obtaining image data of two images captured under different lighting conditions is only an example. In practice, image data of three images captured under different lighting conditions can also be obtained, or image data of four images captured under different lighting conditions can be obtained. For example, image data captured when the flash is not turned on can be obtained, and image data captured when the flash is turned on and the lighting direction is a first direction can be obtained, and image data captured when the flash is turned on and the lighting direction is a second direction can be obtained, so as to obtain image data of three images captured under different lighting conditions. There are many possible ways, which are not listed here one by one.
[0052] Then, in step 22, a video sequence is formed based on the first image data and the second image data, wherein the first image data and the second image data correspond to video frames at different times in the video sequence. It can be understood that a temporal sequence relationship is formed between the first image data and the second image data.
[0053] In one example, the video sequence is further generated based on third image data, where the third image data is a difference image reflecting element changes of the first image data relative to the second image data.
[0054] In this example, the first image data, the second image data and the third image data correspond to video frames at different times in the video sequence. On the basis of the spatial domain and the temporal domain, a differential image that can highlight the changes in anti-counterfeiting elements between frames is further introduced as gradient information, which together constitute a multi-frame sequence, which is conducive to the subsequent extraction of gradient features therein.
[0055] In one example, the video sequence is further generated based on fourth image data, and the fourth image data is a frequency spectrum diagram of the first image data or the second image data.
[0056] In this example, the first image data, the second image data, and the fourth image data correspond to video frames at different times in the video sequence. Based on the spatial domain and the temporal domain, a spectrum diagram that can assist in distinguishing the authenticity details of the card material is further introduced as frequency domain information, which together constitute a multi-frame sequence, which is conducive to the subsequent extraction of frequency domain features.
[0057] In the embodiments of the present specification, a video sequence can be formed based on the first image data, the second image data, the third image data and the fourth image data, so as to simultaneously extract multi-dimensional anti-counterfeiting features such as spatial domain, time domain, gradient and frequency domain from the video sequence.
[0058] Finally, in step 23, the video sequence is input into a multi-frame deep learning model, and multi-dimensional anti-counterfeiting features including spatial features and temporal features are extracted through the multi-frame deep learning model, and the predicted category of the card to be tested as a genuine card or a fake card is determined based on the multi-dimensional anti-counterfeiting features. It can be understood that a single video frame has spatial position information, and temporal related information is formed between two video frames, so that spatial features and temporal features can be extracted from the video sequence.
[0059] In one example, the video sequence is also generated based on third image data, where the third image data is a differential image reflecting element changes of the first image data relative to the second image data; and the multi-dimensional anti-counterfeiting feature also includes a gradient feature.
[0060] In this example, the above-mentioned difference image can be obtained by subtracting the second image data from the first image data, which can reflect the change of the card to be detected with the lighting conditions.
[0061] In one example, the video sequence is also generated based on fourth image data, and the fourth image data is a frequency spectrum diagram of the first image data or the second image data; the multi-dimensional anti-counterfeiting feature also includes a frequency domain feature.
[0062] In this example, a discrete cosine transform method may be used to obtain a frequency spectrum of the first image data or the second image data.
[0063] Figure 3 FIG. 2 is a schematic diagram showing the composition of a video sequence according to an embodiment. Figure 3In an embodiment of the present specification, a video sequence can be formed based on the first image data, the second image data, the third image data and the fourth image data, and multi-dimensional anti-counterfeiting features such as spatial domain, temporal domain, gradient and frequency domain can be simultaneously extracted from the video sequence through a multi-frame deep learning model. Among them, the first image data is image data collected when the flash is turned on, the second image data is image data collected when the flash is not turned on, the third image data is a differential map reflecting the element change of the first image data relative to the second image data, and the fourth image data is a spectrum map of the first image data or the second image data. It can be understood that in an embodiment of the present specification, the composition of the video sequence is based on the first image data and the second image data collected under different lighting conditions, and can also include one or more other image data reflecting its different dimensional characteristics, and the composition of the video sequence can be flexibly selected.
[0064] In one example, the multi-frame deep learning model includes a sampling network layer and an encoder; the extracting multi-dimensional anti-counterfeiting features including spatial domain features and temporal domain features through the multi-frame deep learning model includes:
[0065] Sampling three-dimensional pipeline blocks of a first number of time dimensions and two-dimensional pixel blocks of a second number of space dimensions from the video sequence through the sampling network layer, and forming a block sampling set with each three-dimensional pipeline block and two-dimensional pixel block;
[0066] The block sampling set is input into the encoder to obtain each block representation vector that can represent the multi-dimensional anti-counterfeiting feature.
[0067] In this example, the encoder supports the joint input of two-dimensional pixel patches in the spatial dimension and three-dimensional tube patches in the temporal dimension. It can adaptively process long and short video sequences and efficiently extract spatiotemporal features.
[0068] Figure 4 FIG. 2 is a schematic diagram showing sampling from a video sequence according to an embodiment. Figure 4In this embodiment of the specification, both two-dimensional pixel blocks and three-dimensional pipeline blocks are sampled from a video sequence. The three-dimensional pipeline block 41 is an example of a three-dimensional pipeline block. It can be seen that it spans a certain time and contains two-dimensional pixel blocks of multiple images; the two-dimensional pixel block 42 is an example of a two-dimensional pixel block. It can be seen that it corresponds to the image data of one image. In this embodiment of the specification, the sampled multiple three-dimensional pipeline blocks can have different shapes, that is, their length, width and height can be different, and their starting positions can also be different, and different three-dimensional pipeline blocks can overlap. In addition, each sampled two-dimensional pixel block or three-dimensional pipeline block has position embedding information, which uses a fixed sine or cosine embedding as the position embedding information, which can reflect its global spatiotemporal position.
[0069] Furthermore, the multi-frame deep learning model further includes an output network layer; the step of determining, based on the multi-dimensional anti-counterfeiting features, whether the card to be detected belongs to a prediction category of a genuine card or a fake card includes:
[0070] The output network layer performs attention pooling and mapping processing on each block representation vector to obtain the predicted category.
[0071] In this example, the attention mechanism is introduced into the pooling process, and the weighted average of the input information is achieved by assigning different weights to different input elements.
[0072] Figure 5 FIG. 1 is a schematic diagram showing a method of determining a prediction category based on a block sampling set according to an embodiment. Figure 5 In the embodiment of the specification, the block sampling set includes a three-dimensional pipeline block of a first number of time dimensions and a two-dimensional pixel block of a second number of space dimensions. After inputting them into the encoder, each block representation vector capable of representing the multi-dimensional anti-counterfeiting feature is obtained, and then each block representation vector is subjected to attention pooling and mapping processing to obtain the predicted category of the card to be detected as a genuine card or a fake card. The mapping processing can be implemented by a fully connected layer (FC), and the fully connected layer can be used as a part of the aforementioned output network layer.
[0073] The embodiments of this specification combine self-supervised pre-training to further improve the accuracy of the model. The encoder is pre-trained by using the generative self-supervised idea of randomly masking off some image blocks and then reconstructing and restoring them.
[0074] In one example, the multi-frame deep learning model includes an encoder, and the encoder adopts the following pre-training method:
[0075] Masking a number of pixel blocks on each video frame included in the sample video sequence to obtain a masked video sequence;
[0076] Inputting the mask video sequence into the encoder to obtain block representation vectors corresponding to each pixel block;
[0077] Input each block representation vector into the decoder to obtain a reconstructed video sequence;
[0078] The encoder is pre-trained based on the difference between the reconstructed video sequence and the sample video sequence.
[0079] In this example, inputting the masked video sequence into the encoder may specifically include: obtaining unmasked three-dimensional pipe blocks of several time dimensions and / or obtaining unmasked two-dimensional pixel blocks of several spatial dimensions from the masked video sequence, and inputting each three-dimensional pipe block and / or two-dimensional pixel block into the encoder.
[0080] Furthermore, the step of respectively masking a number of pixel blocks of each video frame included in the sample video sequence includes:
[0081] A number of pixel blocks are respectively masked at the same spatial position in each video frame included in the sample video sequence.
[0082] In this example, a tube masking strategy is adopted. For two-dimensional pixel blocks at the same spatial position, they are either masked or not masked in all video frames in the temporal dimension, thereby alleviating the information leakage problem caused by the temporal correlation of the video and improving the training effect of the encoder.
[0083] Figure 6 FIG. 4 is a schematic diagram of a pipeline masking strategy according to an embodiment. Figure 6 In the embodiment of the present specification, the video sequence includes 4 video frames, and the two-dimensional pixel blocks marked as A, B, C, and D in each video frame are unmasked pixel blocks, and the blank two-dimensional pixel blocks are masked pixel blocks. It can be understood that multiple two-dimensional pixel blocks at the same position in different video frames constitute a three-dimensional pipeline block, and the two-dimensional pixel block marked as A in each video frame is at the same position in the video frame, but because they are different video frames, the pixel values may be the same or different.
[0084] Figure 7 FIG. 1 is a schematic diagram of a pre-training framework according to an embodiment. Figure 7In the embodiment of this specification, more than 95% of the pixel blocks in the video sequence can be masked, and then the remaining small amount of image blocks can be used to restore the entire video sequence, with two-dimensional pixel blocks marked as A, B, C, and D representing unmasked pixel blocks, and blank two-dimensional pixel blocks representing masked pixel blocks. The pre-training framework here includes an encoder and a decoder. After the pre-training is completed, the encoder is applied to a multi-frame deep learning model, which has a strong video spatiotemporal feature extraction capability and is used for the task of authenticity detection of cards and certificates. After practical application, good results can be achieved. The content information of multiple frames of cards and certificates and some anti-counterfeiting features under flash can be reconstructed at a high masking rate, which also shows that the pre-trained encoder has a certain ability to represent and extract the anti-counterfeiting information of cards and certificates.
[0085] In one example, the multi-frame deep learning model is trained in the following manner:
[0086] Acquire the first image data and the second image data of the sample detection card, and the label category of the sample detection card;
[0087] Inputting a sample video sequence formed by the first image data and the second image data of the sample detection card into a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determining whether the sample detection card belongs to a predicted category of a genuine certificate or a fake certificate based on the multi-dimensional anti-counterfeiting features;
[0088] According to the difference between the predicted category and the label category of the sample detection card, the model parameters of the multi-frame deep learning model are adjusted.
[0089] In this example, supervised learning is used to adjust the model parameters of the multi-frame deep learning model to improve the prediction accuracy of the model.
[0090] Through the method provided in the embodiment of this specification, firstly, the first image data and the second image data collected under different lighting conditions of the card to be detected are obtained; then, a video sequence is formed based on the first image data and the second image data, and the first image data and the second image data correspond to video frames at different times in the video sequence; finally, the video sequence is input into a multi-frame deep learning model, and multi-dimensional anti-counterfeiting features including spatial features and temporal features are extracted through the multi-frame deep learning model, and the predicted category of the card to be detected as a genuine certificate or a fake certificate is determined based on the multi-dimensional anti-counterfeiting features. As can be seen from the above, in the embodiment of this specification, the first image data and the second image data collected under different lighting conditions of the card to be detected are obtained, so that the visual anti-counterfeiting features exhibited by the card under different lighting conditions can be highlighted, for example, the anti-counterfeiting features of laser pattern reflection and color change, and at the same time, the multi-frame deep learning model can extract rich spatial features and temporal features based on the input of the video sequence, so as to improve the accuracy of the authenticity detection of the certificate.
[0091] According to another aspect of the embodiment, there is also provided a document anti-counterfeiting detection device, which is used to execute the method provided in the embodiment of this specification. Figure 8 FIG. 1 is a schematic block diagram of a document anti-counterfeiting detection device according to an embodiment. Figure 8 As shown, the device 800 includes:
[0092] An acquisition unit 81 is used to acquire first image data and second image data collected under different lighting conditions of the card to be detected;
[0093] A sequence construction unit 82, configured to form a video sequence based on the first image data and the second image data acquired by the acquisition unit 81, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence;
[0094] The prediction unit 83 is used to input the video sequence obtained by the sequence construction unit 82 into a multi-frame deep learning model, extract multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determine the prediction category of the card to be detected as a genuine card or a fake card based on the multi-dimensional anti-counterfeiting features.
[0095] Optionally, as an embodiment, the first image data is image data collected when a flash is turned on, and the second image data is image data collected when the flash is not turned on.
[0096] Optionally, as an embodiment, the video sequence is also generated based on third image data, and the third image data is a differential image reflecting element changes of the first image data relative to the second image data; the multi-dimensional anti-counterfeiting feature also includes a gradient feature.
[0097] Optionally, as an embodiment, the video sequence is also generated based on fourth image data, and the fourth image data is a frequency spectrum diagram of the first image data or the second image data; the multi-dimensional anti-counterfeiting feature also includes a frequency domain feature.
[0098] Optionally, as an embodiment, the multi-frame deep learning model includes a sampling network layer and an encoder; the prediction unit 83 includes:
[0099] a sampling subunit, configured to sample three-dimensional pipeline blocks of a first number of time dimensions and two-dimensional pixel blocks of a second number of space dimensions from the video sequence through the sampling network layer, and form a block sampling set with each three-dimensional pipeline block and the two-dimensional pixel block;
[0100] The encoding subunit is used to input the block sampling set obtained by the sampling subunit into the encoder to obtain each block representation vector that can represent the multi-dimensional anti-counterfeiting feature.
[0101] Furthermore, the multi-frame deep learning model further includes an output network layer; the prediction unit 83 further includes:
[0102] The output processing subunit is used to perform attention pooling and mapping processing on each block representation vector obtained by the encoding subunit through the output network layer to obtain the predicted category.
[0103] Optionally, as an embodiment, the multi-frame deep learning model includes an encoder, and the encoder adopts the following pre-training method:
[0104] Masking a number of pixel blocks on each video frame included in the sample video sequence to obtain a masked video sequence;
[0105] Inputting the mask video sequence into the encoder to obtain block representation vectors corresponding to each pixel block;
[0106] Input each block representation vector into the decoder to obtain a reconstructed video sequence;
[0107] The encoder is pre-trained based on the difference between the reconstructed video sequence and the sample video sequence.
[0108] Furthermore, the step of respectively masking a number of pixel blocks of each video frame included in the sample video sequence includes:
[0109] A number of pixel blocks are respectively masked at the same spatial position in each video frame included in the sample video sequence.
[0110] Optionally, as an embodiment, the multi-frame deep learning model is trained in the following manner:
[0111] Acquire the first image data and the second image data of the sample detection card, and the label category of the sample detection card;
[0112] Inputting a sample video sequence formed by the first image data and the second image data of the sample detection card into a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determining whether the sample detection card belongs to a predicted category of a genuine certificate or a fake certificate based on the multi-dimensional anti-counterfeiting features;
[0113] According to the difference between the predicted category and the label category of the sample detection card, the model parameters of the multi-frame deep learning model are adjusted.
[0114] Through the device provided in the embodiment of this specification, first, the acquisition unit 81 acquires the first image data and the second image data collected under different lighting conditions of the card to be detected; then the sequence construction unit 82 forms a video sequence based on the first image data and the second image data, and the first image data and the second image data correspond to the video frames at different times in the video sequence; finally, the prediction unit 83 inputs the video sequence into a multi-frame deep learning model, extracts multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determines the predicted category of the card to be detected as a genuine certificate or a fake certificate according to the multi-dimensional anti-counterfeiting features. As can be seen from the above, in the embodiment of this specification, the first image data and the second image data collected under different lighting conditions of the card to be detected are acquired, so that the visual anti-counterfeiting features exhibited by the card under different lighting conditions can be highlighted, for example, the anti-counterfeiting features of laser pattern reflection and color change, and at the same time, the multi-frame deep learning model can extract rich spatial features and temporal features based on the input of the video sequence, so as to improve the accuracy of the authenticity detection of the certificate.
[0115] According to another embodiment, there is also provided a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 2 The method described.
[0116] According to another embodiment of the present invention, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the Figure 2 The method described.
[0117] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the present invention can be implemented by hardware, software, firmware or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0118] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. A document anti-counterfeiting detection method, the method comprising: Acquire first image data and second image data collected under different lighting conditions of the card to be detected; forming a video sequence based on the first image data and the second image data, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence; The video sequence is input into a multi-frame deep learning model, and multi-dimensional anti-counterfeiting features including spatial features and temporal features are extracted through the multi-frame deep learning model. The predicted category of the card to be detected, whether it is a genuine card or a fake card, is determined based on the multi-dimensional anti-counterfeiting features.
2. The method of claim 1, wherein: The first image data is image data collected when the flash is turned on, and the second image data is image data collected when the flash is not turned on.
3. The method of claim 1, wherein: The video sequence is also generated based on third image data, and the third image data is a differential image reflecting element changes of the first image data relative to the second image data; the multi-dimensional anti-counterfeiting feature also includes a gradient feature.
4. The method of claim 1, wherein: The video sequence is also generated based on fourth image data, and the fourth image data is a frequency spectrum diagram of the first image data or the second image data; the multi-dimensional anti-counterfeiting feature also includes a frequency domain feature.
5. The method of claim 1, wherein: The multi-frame deep learning model includes a sampling network layer and an encoder; the multi-dimensional anti-counterfeiting features including spatial domain features and temporal domain features are extracted by the multi-frame deep learning model, including: Sampling three-dimensional pipeline blocks of a first number of time dimensions and two-dimensional pixel blocks of a second number of space dimensions from the video sequence through the sampling network layer, and forming a block sampling set with each three-dimensional pipeline block and two-dimensional pixel block; The block sampling set is input into the encoder to obtain each block representation vector that can represent the multi-dimensional anti-counterfeiting feature.
6. The method of claim 5, wherein: The multi-frame deep learning model also includes an output network layer; the step of determining the prediction category of whether the card to be tested belongs to a genuine card or a fake card according to the multi-dimensional anti-counterfeiting feature includes: The output network layer performs attention pooling and mapping processing on each block representation vector to obtain the predicted category.
7. The method of claim 1, wherein: The multi-frame deep learning model includes an encoder, and the encoder adopts the following pre-training method: Masking a number of pixel blocks on each video frame included in the sample video sequence to obtain a masked video sequence; Inputting the mask video sequence into the encoder to obtain block representation vectors corresponding to each pixel block; Input each block representation vector into the decoder to obtain a reconstructed video sequence; The encoder is pre-trained based on the difference between the reconstructed video sequence and the sample video sequence.
8. The method of claim 7, wherein: The step of respectively masking a number of pixel blocks of each video frame included in the sample video sequence comprises: A number of pixel blocks are respectively masked at the same spatial position in each video frame included in the sample video sequence.
9. The method of claim 1, wherein: The multi-frame deep learning model is trained in the following manner: Acquire the first image data and the second image data of the sample detection card, and the label category of the sample detection card; Inputting a sample video sequence formed by the first image data and the second image data of the sample detection card into a multi-frame deep learning model, extracting multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determining whether the sample detection card belongs to a predicted category of a genuine certificate or a fake certificate based on the multi-dimensional anti-counterfeiting features; According to the difference between the predicted category and the label category of the sample detection card, the model parameters of the multi-frame deep learning model are adjusted.
10. A document anti-counterfeiting detection device, the device comprising: An acquisition unit, used to acquire first image data and second image data collected under different lighting conditions of the card to be detected; a sequence construction unit, configured to form a video sequence based on the first image data and the second image data acquired by the acquisition unit, wherein the first image data and the second image data correspond to video frames at different moments in the video sequence; The prediction unit is used to input the video sequence obtained by the sequence construction unit into a multi-frame deep learning model, extract multi-dimensional anti-counterfeiting features including spatial features and temporal features through the multi-frame deep learning model, and determine the prediction category of the card to be detected as a genuine card or a fake card based on the multi-dimensional anti-counterfeiting features.
11. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 9.
12. A computing device comprising a memory and a processor, wherein the memory stores executable codes, and when the processor executes the executable codes, the method according to any one of claims 1 to 9 is implemented.
Citation Information
Cited By
Certificate detection method
CN120932157A