A method for judging a picture of an original identity card
By using ID card segmentation and material segmentation recognition models, the problem of recognizing original ID card images has been solved, achieving accurate judgment and generalization capabilities in complex scenarios and adapting to different application environments.
Patent Information
- Application Number
- CN202210917911.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-01
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2042-08-01
AI Technical Summary
Existing technologies struggle to effectively distinguish between original ID card photos and non-original ID card photos, exhibiting poor generalization performance in complex scenarios and failing to effectively handle photos taken from different devices and materials.
Using an ID card segmentation model and a material segmentation and recognition model, and through image processing and deep learning technology, the ID card area is first separated and flipped in perspective to determine whether it is a screen or a real object image. Then, the material segmentation and recognition model is used to determine whether it is a photograph of the original ID card.
It achieves accurate recognition of original ID card images in complex scenarios, effectively distinguishing between screen-photographed images and printed forgeries, improving the model's generalization and accuracy, and the area threshold is adjustable to adapt to different application environments.
Smart Images

Figure CN115311492B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image processing, in particular to a method for judging an original ID card picture. BACKGROUND
[0002] Artificial intelligence deep learning technology is maturing, and has been deeply involved in various industries. In the field of computer vision, image classification, target detection and segmentation have become an indispensable part of industrial application. In daily life, almost everyone has encountered the need to take pictures of ID cards and upload authentication when dealing with bank or government business. When the business party receives the ID card picture uploaded by the user, if the user must upload the direct original ID card picture, the application of target detection and classification technology is used to detect the ID card and judge whether it is a direct picture of the original ID card. The direct picture of the non-original ID card cannot pass the verification and handle the business.
[0003] Firstly, the traditional image classification technology mainly uses a hand-designed feature method, and then uses a machine learning classifier (such as SVM) for recognition. It can only make judgments for a single type or a few specific cases. In simple scenarios, it can achieve good results, but in different scenarios, the parameters of each module need to be designed independently. It is tedious and difficult to design a model with good generalization performance in complex scenarios.
[0004] Secondly, in the existing method for judging ID card photocopying using deep learning, some directly use a binary classification method, ignoring the photocopying pictures produced by different devices, different ways of shooting and real material printing forgery. SUMMARY
[0005] In order to solve the technical problems mentioned in the background art, a method for judging an original ID card picture is proposed.
[0006] In order to achieve the above purpose, the present application adopts the following technical scheme:
[0007] A method for judging an original ID card picture, comprising the following steps:
[0008] S1, ID card original picture A processing: S11, taking an ID card original picture A, and recording the long side length of the original picture A as L0;
[0009] S12, modifying the size of the original picture A according to the long side to 388 pixels. If the short side size of the original picture A is less than 388 pixels, uniformly fill the short side of the original picture A on both sides. The filling pixel value is [0, 0, 0], and the filled picture B is obtained. The size of the picture B is [3, 388, 388];
[0010] S13, picture B mirror expansion obtains picture C, and the size of picture C is [3, 572, 572];
[0011] S14, the pixel value of picture C is normalized to obtain picture D, wherein the normalization mode is: mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], min_val=[0, 0, 0], max_val=[255.0, 255.0, 255.0];
[0012] S2, picture D processing: S21, picture D input identity card segmentation model, output picture size is [2, 388, 388], wherein 388*388 corresponds to the height and width of the original picture A, the first value in the dimension number 2 represents the probability that the pixel of picture D is a background area, and the second value in the dimension number 2 represents the probability that the pixel of picture D is an identity card area;
[0013] S22, the serial number of the probability with the maximum value in the dimension number 2 is taken as the class number of each pixel point of picture D, and picture D mask with the dimension of [1, 388, 388] is obtained, wherein the number 1 position represents the identity card area, and the number 0 position represents the background area;
[0014] S3, picture D mask processing: S31, picture D mask is modified to the dimension of [1, L0, L0] as the original picture A mask;
[0015] S32, the minimum circumscribed rectangle of the area of the pixel 1 area of the original picture A mask picture is detected by using the image processing tool opencv, and the four vertex coordinates of the minimum circumscribed rectangle are obtained;
[0016] S33, according to the filling mode when the size of the original picture A is modified in step S12, the four vertex coordinates of the corresponding rectangular area of the original picture A are reversely obtained and saved, and the rectangular area is recorded as the identity card area;
[0017] S4, according to the four vertex coordinates of the identity card area, the rectangular area surrounded by the four vertexes is cut out on the original picture A, the rectangular area is inversely perspective to a rectangular picture with the XY axis parallel to the plane, and the four sides are cut to the range of 96% of the original length respectively, and the picture E not containing the edge of the identity card is saved;
[0018] S5, after the size modification and normalization processing of picture E, picture G is obtained;
[0019] S6, picture G processing: S61, picture G is input into the ID card screen real picture classification model, and the output picture size is [1, 2], wherein the first value represents the probability that picture G is a real picture, and the second value represents the probability that picture G is a screen picture;
[0020] S62, if the first value is less than the second value, it is determined that picture G is a screen picture, and picture G is no longer processed in the next step, otherwise, it is determined that picture G is a real picture, and step S7 is entered;
[0021] S7, picture enhancement, horizontal flip and normalization processing are performed on picture G to obtain picture H;
[0022] S8, picture H is processed in the manner of step S1 to obtain picture I;
[0023] S9, picture I processing: picture I is input into the material segmentation identification model, and the output picture size is [n, 388, 388], wherein in the dimension number n, the first dimension represents the background or other unidentified categories, and the second-n represents the material 2-n in turn. The serial number of the maximum value in the dimension number n is taken as the category number of each pixel point of picture I, and the picture I mask dimension is [1, 388, 388];
[0024] When the area ratio of the region corresponding to the ID original material in picture I mask exceeds the area threshold of 50%, it is determined that the original picture A is an ID original picture, otherwise, the original picture A is regarded as a non-ID original picture.
[0025] As a further description of the above technical solution:
[0026] In step S5, the following steps are further included:
[0027] S51, picture E is modified in size by changing the long side to 224 pixels, and if the short side size of picture E is less than 224 pixels, the short sides of picture E are uniformly filled, and the filling pixel value is [0, 0, 0], to obtain the filled picture F, and the size of picture F is [3, 224, 224];
[0028] S52, the pixel value of picture F is normalized to obtain picture G, wherein the normalization method is: mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225], min_val = [0, 0, 0], and max_val = [255.0, 255.0, 255.0].
[0029] As a further description of the above technical solution:
[0030] The ID card segmentation model is a semantic segmentation Unet network. The first half of the network extracts features from the input image, and the second half upsamples the image to the original size. The model output dimension is 2, and the output data size is [2, 388, 388].
[0031] As a further description of the above technical solution:
[0032] The material segmentation and recognition model uses the semantic segmentation Unet network as a pre-trained model and is trained using a material segmentation dataset. The model output dimension is n, and the output data size is [n, 388, 388].
[0033] The material segmentation dataset includes: images of original ID cards and images of non-original ID cards that have been fragmented, and then 24 fragmented squares randomly selected from the two types of images are stitched together. Non-original ID cards refer to fake ID cards printed from paper or plastic.
[0034] As a further description of the above technical solution:
[0035] The images of the original ID card and non-original ID card are fragmented at a 1:1 ratio. The fragmentation process is as follows: 25% of the shorter side length 'a' of the image is taken as the side length 'b' of a square, where b = 0.25a. Squares with side length 'b' are cut off from left to right and from top to bottom. When the image is cut off at the edge, the remaining part with a length greater than 0.5b and less than 'b' is filled with a randomly generated solid color. Squares with a length less than or equal to 0.5b are discarded.
[0036] As a further description of the above technical solution:
[0037] The method of piecing together the 24 randomly selected fragmented squares includes:
[0038] Method 1: Calculate the average side length L1 of the 24 fragmented squares, modify the side length of the selected 24 squares to L1, and randomly stitch them together into an image with a width of 4*L1 and a length of 6*L1 and save it.
[0039] Method 2: Create a 4×6 chessboard with each square having a side length of L1. Then, randomly fill each square with 24 selected squares. For squares with a side length greater than L1, adjust their size to L1. For squares with a side length less than L1, randomly fill them into the square's area. Fill any unoccupied areas with a solid color and save.
[0040] When any one of the splicing modes is completed, the label mask of the corresponding segmentation data is labeled, different square block materials correspond to different category labels, and the pure color filling part is labeled according to the background category; the training data set includes n-1 different materials and n background categories, and the label is a number 1-number n, 1 represents that the pixel is a background, and numbers 2-n represent materials 2-n in turn.
[0041] As a further description of the above technical solution:
[0042] The identity card screen real object picture classification model selects MobileNetV3 network as a pre-training model, and trains the model through a two-classification data set, the two-classification data set includes screen pictures and real object pictures, the screen pictures include pictures taken by different shooting devices on the identity card displayed on the screen of an electronic device, and the real object pictures include identity card original pictures and non-identity card original pictures.
[0043] The screen pictures and the real object pictures are trained according to a 1:1 ratio.
[0044] As described above, since the above technical solution is adopted, the beneficial effects of the present application are:
[0045] 1、In the present application, by taking the photographed identity card picture as input data, the identity card region and the picture background region are separated, the identity card position is extracted, the identity card region on the identity card position is perspective flipped to a plane, the interference of the identity card edge and the background is removed, the obtained picture is input into the trained screen real object picture classification model to judge the category, when the category is judged as a screen picture, the recognition is stopped, when the category is judged as a real object picture, it is input into the material segmentation model again to identify whether it is an identity card original picture.
[0046] 2、In the present application, first, screen flipping and other printed fake identity cards can be judged at the same time, second, the fragmentation processing in the material segmentation identification model increases the accuracy of the model, the introduction of the background increases the generalization of the untrained fake identity card material, and finally, the area threshold is controllable, different threshold values can be set according to different application environments to meet the requirements. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 A flowchart of an identity card original picture judgment method according to an embodiment of the present application is shown;
[0048] Figure 2 A semantic segmentation Unet network structure diagram of an identity card original picture judgment method according to an embodiment of the present application is shown;
[0049] Figure 3A MobileNetV3 network structure schematic diagram of a method for judging a picture of an original ID card is shown. DETAILED DESCRIPTION
[0050] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative labor fall within the protection scope of the present application.
[0051] Embodiment one
[0052] Please refer to Figures 1-3 The present application provides a technical solution: a method for judging a picture of an original ID card, comprising the following steps:
[0053] S1, original ID card picture A processing: S11, taking a picture of the original ID card picture A, and recording the long side length of the original picture A as L0;
[0054] S12, modifying the size of the original picture A according to the long side to be 388 pixels, if the short side size of the original picture A is less than 388 pixels, uniformly filling the two sides of the short side of the original picture A, and obtaining a filled picture B with pixel value [0, 0, 0], the size of the picture B is [3, 388, 388];
[0055] S13, obtaining picture C by mirroring and expanding picture B, the size of picture C is [3, 572, 572];
[0056] S14, obtaining picture D by normalizing the pixel value of picture C, wherein the normalization method is: mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], min_val=[0, 0, 0], max_val=[255.0, 255.0, 255.0];
[0057] S2, picture D processing: S21, inputting picture D into an ID card segmentation model, and outputting a picture with a size of [2, 388, 388], wherein 388*388 corresponds to the height and width of the original picture A, the first value in the dimension number 2 represents the probability that the pixel of picture D is a background area, and the second value in the dimension number 2 represents the probability that the pixel of picture D is an ID card area;
[0058] S22, taking the serial number of the maximum probability in the dimension number 2 as the class number of each pixel point of picture D, obtaining picture D mask with a dimension of [1, 388, 388], wherein the number 1 position represents the ID card area, and the number 0 position represents the background area;
[0059] S3, picture D mask processing: S31, picture D mask modifies the size to the dimension [1, L0, L0] as the original picture Amask;
[0060] S32, using the image processing tool opencv to detect the minimum circumscribed rectangle of the area of the pixel 1 region of the original picture A mask picture, and obtaining the four vertex coordinates of the minimum circumscribed rectangle;
[0061] S33, according to the filling method when the original picture A is modified in size in step S12, the four vertex coordinates of the corresponding rectangular region of the original picture A are reversely obtained and saved, and the rectangular region is recorded as the ID card region;
[0062] S4, according to the four vertex coordinates of the ID card region, a rectangular region surrounded by the four vertices is cut out on the original picture A, and the rectangular region is inversely perspective to a rectangular picture with the XY axis parallel to the plane high and width. In order to avoid the influence of the shooting background of the ID card edge region in the training data on the accuracy of the model, the rectangular picture is saved by cutting the four sides to the range of 96% of the original side length, and the picture E not containing the ID card edge is obtained;
[0063] S5, after the size modification and normalization processing of the picture E, the picture G is obtained;
[0064] In step S5, the following steps are further included:
[0065] S51, the picture E is modified in size according to the long side to 224 pixels, if the short side size of the picture E is less than 224 pixels, the short side of the picture E is uniformly filled, the pixel value is [0, 0, 0], the filled picture F is obtained, and the size of the picture F is [3, 224, 224];
[0066] S52, the pixel value of the picture F is normalized to obtain the picture G, wherein the normalization method is: mean = [0.485, 0.456, 0.406], std = [0.229, 0.224, 0.225], min_val = [0, 0, 0], max_val = [255.0, 255.0, 255.0];
[0067] S6, picture G processing: S61, the picture G is input into the ID card screen real object picture classification model, and the output picture size is [1, 2], wherein the first value represents the probability that the picture G is a real object picture, and the second value represents the probability that the picture G is a screen picture;
[0068] S62, the serial number of the maximum value is taken as the class number of each pixel point of the picture G, and the picture G mask with the dimension [1, 388, 388] is obtained;
[0069] S7, picture enhancement, horizontal flip and normalization processing are performed on the picture G to obtain picture H, considering the problems encountered by users in the actual shooting process, image enhancement processing is added, including blur, noise, exposure, reflection and color change, horizontal flip is performed, and finally normalization is performed, and then input into a material identification and segmentation model;
[0070] S8, picture H is processed according to the method of step S1 to obtain picture I;
[0071] S9, picture I processing: picture I is input into a material segmentation and identification model, and the output picture size is [9, 388, 388], wherein, in the dimension number 9, the first dimension represents the background or other unidentified categories, and the second to ninth dimensions represent materials 2-9, respectively, the serial number of the probability with the maximum value in the dimension number 9 is taken as the category number of each pixel point of picture I, and a picture I mask with a dimension of [1, 388, 388] is obtained;
[0072] When the area ratio of the region corresponding to the original ID card material in the picture I mask exceeds the area threshold of 50%, it is judged that the original picture A is an ID card original picture, otherwise, the original picture A is regarded as a non-ID card original picture, wherein, whether the classification picture I is an ID card original picture or a non-ID card original picture is essentially the difference in the material of the picture, and the above area threshold of 50% is a temporary value, which can be adjusted according to the test data set under different conditions to achieve the threshold value of the optimal accuracy rate deployed in the application.
[0073] Please refer to Figure 2 , Figure 2 The semantic segmentation Unet network is a semantic segmentation Unet network, the first half of the network extracts the features of the input picture, and the second half is up-sampled to the original picture size, the model output dimension is 2, and the output data size is [2, 388, 388].
[0074] Please refer to Figure 2 , Figure 2 The semantic segmentation Unet network is a semantic segmentation Unet network, the first half of the network extracts the features of the input picture, and the second half is up-sampled to the original picture size, the model output dimension is 2, and the output data size is [2, 388, 388].
[0075] The material segmentation data set includes: after the ID card original picture and the non-ID card original picture are fragmented, 24 fragmented square pictures are randomly selected from the two types of pictures, wherein, the non-ID card original refers to a false ID card printed by printing paper or plastic;
[0076] The original ID card picture and the non-original ID card picture are fragmented in a 1:1 ratio. The fragmentation processing generates contrast in a picture to increase the difference between different materials and make the segmentation more accurate. The randomly generated background color occupies a certain area ratio, so that the material segmentation identification model regards the untrained material picture as a background area when inputting, thereby increasing the robustness of the model.
[0077] Specifically, the fragmentation processing step is as follows: taking 25% of the short side length a of the picture as the square side length b, b = 0.25a, and cutting the square with a side length of b from left to right and top to bottom. When the edge part of the picture is cut, the remaining length greater than 0.5b and less than b is filled with a randomly generated solid color, and the square less than or equal to 0.5b is discarded.
[0078] The 24 randomly selected fragmented squares are spliced in the following ways:
[0079] Splicing method one: calculate the average value L1 of the side lengths of the 24 fragmented squares, modify the size of the selected 24 squares to L1, and randomly splice them into a picture with a width of 4*L1 and a length of 6*L1 and save it;
[0080] Splicing method two: create a 4x6 chessboard with each grid having a side length of L1, and then randomly fill the selected 24 squares into each grid. The square with a side length greater than L1 is modified to L1, and the square with a side length less than L1 is randomly filled into the grid area. After filling the pure color in the unoccupied part, save it;
[0081] At the same time, the label mask of the corresponding segmentation data is labeled. Different square blocks of different materials are labeled with different categories. The pure color filling part is labeled as background. The training data set contains 8 different materials and 9 background categories, and the label is a number 1-9. 1 represents the background, and numbers 2-9 represent materials 2-9.
[0082] Please refer to Figure 3 , Figure 3 MobileNetV3 network structure for lightweight model. The model features fewer parameters, less computation, and shorter inference time. The ID card screen real picture classification model selects MobileNetV3 network as the pre-training model and trains the model through a binary classification data set. The input data size of the model is [3, 224, 224], and the output data size is [1, 2].
[0083] The binary classification data set includes screen pictures and real pictures, the screen pictures include pictures taken by different shooting devices on the identity card displayed on the screen of an electronic device, and the real pictures include pictures taken by the original identity card and pictures taken by non-original identity cards;
[0084] The screen pictures and the real pictures are trained on the model according to a 1:1 ratio.
[0085] The application solves the problem that other non-compliant pictures are uploaded when the user uploads the original shooting picture by taking the shooting picture of the identity card as the input, and through a series of image processing and recognition, finally judging whether the input picture is the original shooting picture of the identity card. Specifically, the shooting picture of the identity card is taken as the input data, the identity card region and the picture background region are separated, the identity card position is extracted, the identity card region on the identity card position is perspective flipped to the plane, the interference of the identity card edge and the background is removed, the obtained picture is input into the trained screen-real picture classification model to judge the category, when the category is judged as the screen picture, the recognition is stopped, when the category is judged as the real picture, it is input into the material segmentation model again to identify whether it is the original shooting picture of the identity card.
[0086] In summary, the application has the following advantages: (1) screen flipping and other printed fake identity cards can be judged at the same time; (2) the fragmentation processing in the material segmentation recognition model increases the accuracy of the model, and the introduction of the background increases the generalization of the untrained fake identity card materials; (3) the area threshold is controllable, different thresholds can be set according to different application environments to meet the needs.
[0087] The above is only the preferred specific embodiment of the application, but the protection scope of the application is not limited to this, any person skilled in the art can make equivalent replacement or change according to the technical solution and the inventive concept of the application within the technical range disclosed by the application, which should be covered within the protection scope of the application.
Claims
1. An identity card original photograph picture judgment method, characterized in that, The method comprises the following steps: S1, identity card original picture A processing: S11, taking the identity card original picture A, and recording the long side length of the original picture A as L0; S12, modifying the size of the original picture A according to the long side to 388 pixels, if the short side size of the original picture A is less than 388 pixels, uniformly filling the short side of the original picture A on both sides, the filling pixel value is [0, 0, 0], obtaining the filled picture B, the size of the picture B is [3, 388, 388]; S13, obtaining the picture C by mirror image expansion of the picture B, the size of the picture C is [3, 572, 572]; S14, obtaining the picture D by normalizing the pixel value of the picture C, wherein the normalization method is: mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], min_val=[0, 0, 0], max_val=[255.0, 255.0, 255.0]; S2, picture D processing: S21, inputting the picture D into the identity card segmentation model, outputting the picture size [2, 388, 388], wherein 388*388 corresponds to the height and width of the original picture A, the first value in the dimension number 2 represents the probability that the pixel of the picture D is a background area, and the second value in the dimension number 2 represents the probability that the pixel of the picture D is an identity card area; S22, taking the serial number of the probability with the maximum value in the dimension number 2 as the class number of each pixel point of the picture D, obtaining the picture Dmask with the dimension [1, 388, 388], wherein the number 1 position represents the identity card area, and the number 0 position represents the background area; S3, picture D mask processing: S31, modifying the size of the picture D mask to the dimension [1, L0, L0] as the original picture A mask; S32, detecting the minimum circumscribed rectangle of the pixel 1 area of the original picture A mask picture by using the image processing tool opencv, and obtaining the four vertex coordinates of the minimum circumscribed rectangle; S33, according to the filling method when modifying the size of the original picture A in step S12, the four vertex coordinates of the corresponding rectangular area of the original picture A are reversely obtained and saved, and the rectangular area is recorded as the identity card area; S4, according to the four vertex coordinates of the identity card area, the rectangular area surrounded by the four vertexes is cut out on the original picture A, and the rectangular area is inversely perspective to a rectangular picture with the XY axis parallel to the plane, and the four sides are cut to the original length of 96% respectively, and saved, obtaining the picture E without the identity card edge; S5, after the size modification and normalization processing of the picture E, the picture G is obtained; S6, picture G processing: S61, inputting the picture G into the identity card screen real object picture classification model, outputting the picture size [1, 2], wherein the first value represents the probability that the picture G is a real object picture, and the second value represents the probability that the picture G is a screen picture; S62, if the first value is less than the second value, it is determined that the picture G is a screen picture, and the picture G is not processed further to output the result, otherwise, it is determined that the picture G is a real object picture, and step S7 is entered; S7, picture enhancement, horizontal flip and normalization processing are performed on the picture G to obtain a picture H; S8, picture H is processed in the manner of step S1 to obtain a picture I; S9, picture I processing: picture I is input into the material segmentation identification model, and an output picture size is [n, 388, 388], wherein, in the dimension number n, the first dimension represents the background or other unidentified categories, and the second-n represents the material 2-n in turn, the serial number of the maximum value in the dimension number n is taken as the category number of each pixel point of picture I, and a picture I mask with a dimension of [1, 388, 388] is obtained; When the area proportion of the region corresponding to the original ID card material in the picture I mask exceeds the area threshold of 50%, it is judged that the original picture A is an ID card original picture, otherwise, the original picture A is regarded as a non-ID card original picture.
2. The method of claim 1, wherein the original identity card is photographed and the picture is judged. In step S5, the following steps are further included: S51, the size of picture E is modified to 224 pixels along the long side, and if the short side size of picture E is less than 224 pixels, the short sides of picture E are uniformly filled, and the filling pixel value is [0, 0, 0], to obtain a filled picture F, and the size of picture F is [3, 224, 224]; S52, the pixel value of picture F is normalized to obtain picture G, wherein the normalization method is: mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225], min_val=[0, 0, 0], max_val=[255.0, 255.0, 255.0].
3. The method of claim 1, wherein the original identity card is a Korean national ID card. The ID card segmentation model is a semantic segmentation Unet network, the front half of the network extracts the features of the input picture, the back half is up-sampled to the original picture size, the model output dimension is 2, and the output data size is [2, 388, 388].
4. The method of claim 1, wherein the original identity card is a Korean national ID card. The material segmentation identification model selects a semantic segmentation Unet network as a pre-training model, and trains the model through a material segmentation data set, the model output dimension is n, and the output data size is [n, 388, 388]; The material segmentation data set includes: after the ID card original picture and the non-ID card original picture are fragmented, 24 fragmented squares are randomly selected from the two types of pictures for splicing, wherein the non-ID card original refers to a false ID card printed by printing paper or plastic.
5. The method of claim 4, wherein the step of determining whether the original document is an ID card is characterized by: The ID card original picture and the non-ID card original picture are fragmented in a 1:1 ratio, and the fragmentation step is: taking 25% of the short side length a of the picture as the square side length b, b=0.25a, from left to right and from top to bottom, the square with side length b is cut off, when the edge part of the picture is cut off, the part with a length greater than 0.5b and less than b is filled with a random pure color, and the square with a length less than or equal to 0.5b is discarded.
6. The method of claim 5, wherein the step of determining whether the original document is an ID card is characterized by: The splicing method of the 24 randomly selected fragmented squares includes: The first splicing mode: calculate the average value L1 of the side length of the 24 fragmented squares, modify the size of the side length of the 24 squares to L1, and randomly splice them into a picture according to the mode of 4*L1 in width and 6*L1 in length and save them; The second splicing mode: create a 4*6 chessboard, and the side length of each grid is L1, then randomly fill the 24 squares into each grid, modify the size of the side length of the square larger than L1 to L1, randomly fill the grid area for the square smaller than L1, and save them after filling the pure color in the unoccupied part; At the same time of completing any one of the splicing modes, mark the label mask of the corresponding segmentation data, mark different categories according to different square blocks, mark the pure color filling part according to the background category, and the training data set contains n-1 different materials and background categories, a total of n, and the label is a number 1-number n, 1 represents that the pixel is background, and numbers 2-n represent materials 2-n in turn.
7. The method of claim 1, wherein the method further comprises: determining whether the picture is a picture of the original identity card by using a picture of the original identity card as a reference picture. The identity card screen real object picture classification model selects MobileNetV3 network as a pre-training model, and trains the model through a two-classification data set, the two-classification data set includes screen pictures and real object pictures, the screen pictures include pictures taken by different shooting devices on the identity card displayed on the screen of the electronic device, and the real object pictures include identity card original shooting pictures and non-identity card original shooting pictures; The screen pictures and the real object pictures train the model according to a 1:1 ratio.
Citation Information
Patent Citations
Certificate verification and identity verification methods, devices and equipment
CN110263805A
Identification method and system for copied photo containing identity card
CN114333037A