CN113591603A - Certificate verification method and device, electronic equipment and storage medium - Google Patents

Certificate verification method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113591603A
CN113591603A CN202110778885.8A CN202110778885A CN113591603A CN 113591603 A CN113591603 A CN 113591603A CN 202110778885 A CN202110778885 A CN 202110778885A CN 113591603 A CN113591603 A CN 113591603A
Authority
CN
China
Prior art keywords
certificate
video
verified
video data
video frames
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110778885.8A
Other languages
Chinese (zh)
Inventor
王鹏
姚聪
周争光
陈坤鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Original Assignee
Beijing Kuangshi Technology Co Ltd
Beijing Megvii Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kuangshi Technology Co Ltd, Beijing Megvii Technology Co Ltd filed Critical Beijing Kuangshi Technology Co Ltd
Priority to CN202110778885.8A priority Critical patent/CN113591603A/en
Publication of CN113591603A publication Critical patent/CN113591603A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computational Linguistics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Evolutionary Biology (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the application discloses a certificate verification method and device, electronic equipment and a storage medium. The method comprises the following steps: acquiring video data of a certificate to be verified; extracting a plurality of video frames from the video data; and verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model. By adopting the mode, the authenticity of the certificate to be verified is verified based on the plurality of video frames and the pre-trained certificate verification model, so that the working efficiency and the accuracy of certificate verification are improved.

Description

Certificate verification method and device, electronic equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of artificial intelligence, in particular to a certificate verification method and device, electronic equipment and a storage medium.
Background
At present, the related documents are required to be presented to prove the identity of the individual in various places, for example, when a bank transacts business, the identity card is required to be presented to prove the identity of the individual. With the wide application of certificate identification technology, a large number of counterfeit certificates are identified, and therefore certificate authentication is more and more concerned by people. The certificate authentication judgment refers to a technology which can automatically judge whether a certificate in a given certificate image or video is from a real certificate or a fake certificate (a copying plate, a copying plate and the like). The certificate verification and judgment is an important technical means for preventing attack and fraud, and has wide application in industries and occasions related to remote identity authentication, such as banks, insurance, internet finance, electronic commerce and the like.
At present, the existing certificate verification detection technology is very few, generally, the detection is carried out by human eyes, the labor is very consumed, the consumed time is very long, and the accuracy is lower. Therefore, how to improve the working efficiency and accuracy of certificate verification becomes an urgent problem to be solved.
Disclosure of Invention
The embodiment of the application provides a certificate verification method and device, an electronic device and a storage medium, and aims to solve the technical problems of time and labor consumption and low accuracy in certificate verification in the prior art.
In one aspect, an embodiment of the present application provides a method for verifying a certificate, where the method includes:
acquiring video data of a certificate to be verified;
extracting a plurality of video frames from the video data;
and verifying the authenticity of the certificate to be verified based on the plurality of video frames and a certificate verification model trained in advance.
In a possible embodiment, the verifying the authenticity of the document to be verified based on the plurality of video frames and a pre-trained document verification model includes:
inputting the video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified; the evaluation value comprises a score value or a label value, and the score value comprises a score value of the certificate to be verified as a true certificate and/or a score value of the certificate to be verified as a false certificate;
and acquiring the evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
In a practical embodiment, the evaluating the authenticity of the document to be verified based on the plurality of video frames by the document verification model to obtain an evaluation value corresponding to the document to be verified includes:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
determining fusion characteristic vectors corresponding to the video frames;
and determining the evaluation value corresponding to the certificate to be verified based on each sub-feature vector and the fused feature vector.
In a possible embodiment, the determining the fused feature vector corresponding to each of the video frames includes:
obtaining convolution characteristics corresponding to each video frame;
splicing the convolution characteristics to obtain spliced convolution characteristics;
and determining the fusion feature vector based on the splicing convolution feature.
In a practical embodiment, the evaluating the authenticity of the document to be verified based on the plurality of video frames by the document verification model to obtain an evaluation value corresponding to the document to be verified includes:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
and performing fusion processing on each sub-feature vector to obtain an evaluation value corresponding to the certificate to be verified.
In a possible embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified;
the verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model comprises the following steps:
verifying the authenticity of the certificate to be verified based on a plurality of first video frames extracted from the front video data and the certificate verification model to obtain a first verification result; verifying the authenticity of the certificate to be verified based on a plurality of second video frames extracted from the reverse side video data and the certificate verification model to obtain a second verification result;
and determining the authenticity of the certificate to be verified based on the first verification result and the second verification result.
In a possible embodiment, the determining the authenticity of the document to be verified based on the first verification result and the second verification result includes:
if the first verification result and the second verification result both indicate that the certificate to be verified is a real certificate, determining that the certificate to be verified is the real certificate; otherwise, the certificate to be verified is determined to be a counterfeit certificate.
In a possible embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified;
the extracting a plurality of video frames from the video data includes:
extracting a plurality of first video frames from the front side video data and a plurality of second video frames from the back side video data;
correspondingly, the verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model comprises:
inputting the plurality of first video frames and the plurality of second video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the plurality of first video frames and the plurality of second video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified;
and acquiring the evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
In a possible embodiment, the extracting a plurality of video frames from the video data includes:
dividing the video data into a plurality of video segments, and extracting at least one frame of video frame from each video segment;
alternatively, the first and second electrodes may be,
determining a video frame sequence corresponding to the video data, and extracting video frames from the video frame sequence according to a set extraction rule; wherein, the set extraction rule comprises: setting a time interval or setting a video frame interval.
In a possible embodiment, the certificate verification model is trained by:
acquiring a video sample set; the video sample set comprises video data of a plurality of sample certificates and marking data of each sample certificate; the marking data of the sample certificate shows that the sample certificate is a real certificate or a forged certificate;
inputting the video sample set into an initial certificate verification model to obtain an evaluation value corresponding to each sample certificate in the video sample set;
and performing loss calculation based on the labeled data of each sample certificate and each evaluation value, and updating the model parameters of the initial certificate verification model based on the loss calculation result to obtain the certificate verification model.
In another aspect, an embodiment of the present application provides a device for verifying a document, where the device includes:
the video data acquisition module is used for acquiring video data of the certificate to be verified;
a video frame extraction module, which is used for extracting a plurality of video frames from the video data;
and the verification module is used for verifying the authenticity of the certificate to be verified based on the plurality of video frames and a certificate verification model trained in advance.
In one aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the processor and the memory are connected to each other;
the memory is used for storing computer programs;
the processor is configured to perform the method provided in any of the alternative embodiments of the method of verifying a credential when the computer program is invoked.
In one aspect, the present application provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method provided in any one of the possible embodiments of the method for verifying a certificate.
The scheme provided by the embodiment of the application has the beneficial effects that:
according to the certificate verification method, the certificate verification device, the electronic equipment and the storage medium, when certificate verification is carried out, video data of a certificate to be verified are obtained, and then a plurality of video frames are extracted from the video data; the method provided by the embodiment of the application verifies the authenticity of the certificate to be verified based on a plurality of video frames and a pre-trained certificate verification model, when the authenticity of the certificate to be verified is verified, the method verifies the authenticity of the certificate to be verified based on the plurality of video frames in the extracted video data of the certificate to be verified and the pre-trained certificate verification model, and due to the use of the plurality of video frames, the problem that the verification result of the certificate to be verified is unreliable due to insufficient information when only a single-frame image is used can be avoided, so that the factors of the plurality of video frames can be comprehensively considered when the certificate is verified, the verification accuracy is effectively improved, and the pre-trained certificate verification model is adopted to verify the authenticity of the certificate, the consumed time is short, and the labor force can be greatly saved, the working efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic flowchart of an implementation flow of a certificate verification method in an application scenario according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for verifying a document provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a document verification model provided by an embodiment of the present application;
FIG. 4 is a schematic diagram of a verification device for a document provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
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, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In recent years, technical research based on artificial intelligence, such as computer vision, deep learning, machine learning, image processing, and image recognition, has been actively developed. Artificial Intelligence (AI) is an emerging scientific technology for studying and developing theories, methods, techniques and application systems for simulating and extending human Intelligence. The artificial intelligence subject is a comprehensive subject and relates to various technical categories such as chips, big data, cloud computing, internet of things, distributed storage, deep learning, machine learning and neural networks. Computer vision is used as an important branch of artificial intelligence, particularly a machine is used for identifying the world, and the computer vision technology generally comprises the technologies of face identification, living body detection, fingerprint identification and anti-counterfeiting verification, biological feature identification, face detection, pedestrian detection, target detection, pedestrian identification, image processing, image identification, image semantic understanding, image retrieval, character identification, video processing, video content identification, behavior identification, three-dimensional reconstruction, virtual reality, augmented reality, synchronous positioning and map construction (SLAM), computational photography, robot navigation and positioning and the like. With the research and progress of artificial intelligence technology, the technology is applied to various fields, such as security, city management, traffic management, building management, park management, face passage, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone images, cloud services, smart homes, wearable equipment, unmanned driving, automatic driving, smart medical treatment, face payment, face unlocking, fingerprint unlocking, testimony verification, smart screens, smart televisions, cameras, mobile internet, live webcasts, beauty treatment, medical beauty treatment, intelligent temperature measurement and the like. For example, the certificate verification method in the embodiment of the present application uses video content recognition, image processing, image recognition, and other technologies.
As an example, fig. 1 is a schematic implementation flow diagram of a certificate verification method provided in this embodiment in an application scenario, and it can be understood that the certificate verification method provided in this embodiment may be applied to, but is not limited to, the application scenario shown in fig. 1.
In this example, as shown in fig. 1, the verification system for authenticity of certificates in this example may include, but is not limited to, a user terminal 101, a network 102, and a server 103. A user terminal 101, such as a user's smartphone, may communicate with a server 103 over a network 102, and the user terminal 101 may send video data of a certificate to be authenticated to the server 103 over the network. The user terminal 101 runs a target application, which has the requirement of verifying the authenticity of the user's certificate, for example, if some function or functions of the target application require the authenticity verification of the user's identity certificate, the next operation can be continued only after the verification is passed. The target Application may be a web Application, an Application (APP for short), and the like. The user terminal 101 may include a human-computer interaction screen 1011, a processor 1012 and a memory 1013. The user can interact with the user terminal 101 through the man-machine interaction screen 1011 to realize the operation of the target application, for example, the acquisition of the video data of the certificate to be verified can be triggered through the man-machine interaction screen 1011, and the video data of the certificate to be verified is uploaded to the server 103 through the video uploading operation, so that the authenticity of the video data is verified through the server 103. Processor 1012 is configured to process user-related operations. The memory 1013 is used for storing various data of the user terminal 101, such as the user side application code of the above target application and various data that the user terminal 101 needs to store or cache in the authentication process. The server 103 may include a database 1031 and a processing engine 1032, and the database 1031 may store application program codes of a server side including, but not limited to, a target application, various data involved in an authentication process, and the like, and may further include login information of a user logging in the target application, a data record generated when the user uses the target application, and the like.
The following describes a method for verifying a certificate provided by the present application with reference to a system for verifying authenticity of a certificate shown in fig. 1, taking an example that the certificate to be verified is a user identification card.
As shown in fig. 1, the specific implementation process of the certificate verification method in this example may include steps S101 to S103:
step S101, the user uploads the video data of the certificate to be verified through the target application in the user terminal 101, the video data includes at least two frames of images, and the user terminal 101 sends the video data of the certificate to be verified to the server 103 corresponding to the target application through the network 102.
Specifically, when a user uses a certain function of a target application that requires identity card verification, a user interface of the target application may display corresponding prompt information, for example, information of "start identity card verification" or "identity card video acquisition" is displayed in the user interface, and after the user clicks a corresponding button for confirming the identity card verification, the user terminal may start a video acquisition device (such as a built-in or external camera of the terminal) of the user terminal to trigger video acquisition, and may end the acquisition after acquiring a certain duration of video, so as to obtain video data.
In step S102, a plurality of video frames are extracted from the video data.
Optionally, a plurality of video frames are obtained by using a certain frame extraction strategy for the video data. The step of framing the video data may be performed at the user terminal, or may be performed at the server, which is not limited herein.
In step S103, the processing engine 1032 in the server 103 verifies the authenticity of the certificate to be verified based on the plurality of video frames and the certificate verification model trained in advance.
It is understood that the above is only an example, and the present embodiment is not limited thereto.
The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server or a server cluster providing basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a CDN (Content Delivery Network), a big data and artificial intelligence platform, and the like. Such networks may include, but are not limited to: a wired network, a wireless network, wherein the wired network comprises: a local area network, a metropolitan area network, and a wide area network, the wireless network comprising: bluetooth, Wi-Fi, and other networks that enable wireless communication. The user terminal may be a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a notebook computer, a digital broadcast receiver, an MID (Mobile Internet Devices), a PDA (personal digital assistant), a desktop computer, a vehicle-mounted terminal (e.g., a vehicle-mounted navigation terminal), a smart speaker, a smart watch, etc., and the user terminal and the server may be directly or indirectly connected through wired or wireless communication, but are not limited thereto. The determination may also be based on the requirements of the actual application scenario, and is not limited herein.
Referring to fig. 2, fig. 2 is a schematic flowchart of a certificate verification method provided in an embodiment of the present application, where the method may be executed by any electronic device, such as a server or a user terminal, or alternatively, the method may be completed by the user terminal and the server in an interactive manner, as shown in fig. 2, the certificate verification method provided in the embodiment of the present application includes the following steps:
step S201, acquiring video data of a certificate to be verified;
step S202, extracting a plurality of video frames from the video data;
and step S203, verifying the authenticity of the certificate to be verified based on the plurality of video frames and a certificate verification model trained in advance.
Alternatively, the document to be verified may be any identity document, such as a resident identity card, a work document, a social medical insurance card, and the like, and is not limited herein. The video data may be obtained by shooting the certificate to be verified, and may only include the front video of the certificate to be verified, or only include the back video of the certificate to be verified, or may also include the front video and the back video of the certificate to be verified, which is not limited herein.
The video data comprises at least two frames of images, information such as reflection and texture of the certificate to be verified at different angles can be seen through the multiple frames of images, and more information of the certificate to be verified can be extracted. The single-frame image can have attack forms of different forms, for example, the name of a user corresponding to the certificate to be verified is covered, or the head portrait of the user is covered, and the like, while the multi-frame image is extracted from the video data, and the authenticity of the certificate to be verified is verified based on the multi-frame image, so that the problem that the verification result of the certificate to be verified is unreliable due to incomplete information when the single-frame image is used for judgment can be avoided.
The method includes the steps that video data of a certificate to be verified are obtained, the video data can be locally stored videos or videos collected in real time, the method is not limited to how the video data are obtained, optionally, when the certificate verification needs to be conducted on a user, the user can upload the video data through a user terminal, for example, the user can conduct video collection on the certificate to be verified of the user in a real-time collection mode by starting a video collection device (such as a built-in camera or an external camera of the terminal) of the user terminal, then the video data collected by the user terminal are sent to a server, and the server can obtain the video data.
After the video data is acquired, frame extraction processing is carried out on the video data to obtain a plurality of video frames, the plurality of video frames are input into a certificate verification model which is trained in advance, the plurality of video frames are verified through the certificate verification model, namely, the authenticity of the certificate to be verified is verified, and the authenticity of the certificate to be verified is determined.
According to the embodiment of the application, when certificate verification is carried out, video data of a certificate to be verified are obtained, and then a plurality of video frames are extracted from the video data; the method provided by the embodiment of the application verifies the authenticity of the certificate to be verified based on a plurality of video frames and a pre-trained certificate verification model, when the authenticity of the certificate to be verified is verified, the authenticity of the certificate to be verified is verified based on the plurality of video frames in the extracted video data of the certificate to be verified and the pre-trained certificate verification model, and due to the fact that the plurality of video frames are used, the problem that when only a single-frame image is used for judging, the verification result of the certificate to be verified is unreliable due to insufficient information can be avoided, so that the factors of the plurality of video frames can be comprehensively considered when the certificate is verified, the verification accuracy is effectively improved, and the authenticity of the certificate is verified by the pre-trained certificate verification model, the consumed time is short, the labor force can be greatly saved, the working efficiency is improved.
In an optional embodiment, the verifying the authenticity of the document to be verified based on the plurality of video frames and a pre-trained document verification model includes:
inputting the video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified; the evaluation value comprises a score value or a label value, and the score value comprises a score value of the certificate to be verified as a true certificate and/or a score value of the certificate to be verified as a false certificate; and acquiring the evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
Optionally, a plurality of video frames extracted based on the video data of the certificate to be verified are input into the certificate verification model, and then the authenticity of the certificate to be verified is evaluated through the certificate verification model based on the plurality of video frames to obtain the evaluation value of the certificate to be verified.
In an optional embodiment, the obtained evaluation value of the certificate to be verified may be a score of the certificate to be verified, where the score may be a score of the certificate to be verified as a true certificate, a score of the certificate to be verified as a false certificate, or a score of the certificate to be verified as a true certificate and a score of the certificate to be verified as a false certificate. For example, the score value of the certificate to be verified as a true certificate is assumed to be 80; the score value of the certificate to be verified which is assumed to be a fake certificate is 20; the obtained score value for the certificate to be verified as a true certificate is assumed to be 90, and the score value for the certificate to be verified as a false certificate is assumed to be 10. The specific form of the score value in the embodiment of the present application is not limited, and may be an integer between 0 and 100, an integer between 0 and 10, or a numerical value between 0 and 1, it is understood that the above is only an example, and the embodiment is not limited in any way herein.
In an optional embodiment, the obtained evaluation value of the document to be verified can also be a tag value of the document to be verified, and the tag value represents whether the document to be verified is a real document or a fake document. For example, the tag values may be 1 and 0, where 1 indicates that the document to be verified is a counterfeit document, and 0 indicates that the document to be verified is a genuine document; certainly, 1 may also indicate that the certificate to be verified is a real certificate, and 0 indicates that the certificate to be verified is a counterfeit certificate; the present embodiment is not limited thereto.
In an example, the obtained evaluation value of the document to be authenticated can be a probability value of the document to be authenticated, the probability value representing a probability that the document to be authenticated is a real document and/or a counterfeit document. The probability value can be a probability value that the certificate to be verified is a true certificate, or a probability value that the certificate to be verified is a false certificate, or a probability value that the certificate to be verified is a true certificate and a probability value that the certificate to be verified is a false certificate.
Then, an evaluation value output by the certificate verification model is obtained, and the authenticity of the certificate to be verified is determined according to the evaluation value. The following are two possible ways of determining the authenticity of a document to be authenticated:
mode 1: if the score value is the score of the genuine certificate, the score value can be compared with a genuine certificate evaluation threshold value to determine whether the certificate to be verified is the genuine certificate or the counterfeit certificate, namely, if the score value is the score of the genuine certificate and the score value is greater than or equal to the genuine certificate evaluation threshold value, the certificate to be verified can be determined to be the genuine certificate. If the score value is the score of the counterfeit certificate, the score value can be compared with a counterfeit certificate evaluation threshold value to determine whether the certificate to be verified is the real certificate or the counterfeit certificate, namely, if the score value is the score of the counterfeit certificate and is greater than or equal to the counterfeit certificate evaluation threshold value, the certificate to be verified can be determined to be the counterfeit certificate. The true evidence evaluation threshold and the false evidence evaluation threshold may be the same or different, and are not limited herein.
Mode 2: and if the evaluation value is the label value, determining the authenticity of the certificate to be verified according to the meaning represented by the label value. For example, if the output tag value is 1, it indicates that the certificate to be verified is a counterfeit certificate, and if the output tag value is 0, it indicates that the certificate to be verified is a genuine certificate.
Through this application embodiment, can confirm the authenticity nature of waiting to verify the certificate through the evaluation value of certificate verification model output, because the evaluation value can be the multiform for the mode of confirming waiting to verify the certificate is also more various, has improved the variety of the mode that the certificate verified.
In an optional embodiment, the evaluating the authenticity of the document to be verified based on the plurality of video frames by the document verification model to obtain an evaluation value corresponding to the document to be verified includes:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
determining fusion characteristic vectors corresponding to the video frames;
and determining the evaluation value corresponding to the certificate to be verified based on each sub-feature vector and the fused feature vector.
Optionally, a plurality of video frames of the document to be verified may be input to the document verification model, and a sub-feature vector corresponding to each video frame is obtained, where the sub-feature vector actually characterizes a sub-evaluation value corresponding to each video frame, and each sub-evaluation value is used to indicate a score value of whether the document to be verified in the corresponding video frame is a true document and/or a false document, or each sub-evaluation value is used to indicate a label value of the document to be verified in the corresponding video frame (i.e., whether the document to be verified in the corresponding video frame is a true document or a false document). And determining a fusion characteristic vector corresponding to each video frame, wherein the sub-fusion characteristic vector actually represents a fusion evaluation value corresponding to each video frame, namely a fusion evaluation value after all the video frames are fused. And finally, determining the evaluation value corresponding to the certificate to be verified based on the sub-feature vectors and the fusion feature vectors respectively corresponding to the plurality of video frames. The following are several possible ways to determine the evaluation value corresponding to the document to be authenticated, where the sub-evaluation value corresponding to each sub-feature vector is recorded as a first evaluation value, and the fused evaluation value corresponding to the fused feature vector is recorded as a second evaluation value:
mode 1: and taking the average value of the sum of the first evaluation value and the second evaluation value as the evaluation value corresponding to the certificate to be verified.
Mode 2: and taking the median of each first evaluation value and each second evaluation value as the evaluation value corresponding to the certificate to be verified.
Mode 3: and taking the maximum value of the first evaluation value and the second evaluation value as the evaluation value corresponding to the certificate to be verified.
Mode 4: and taking the average value of the maximum value and the minimum value in the first evaluation value and the second evaluation value as the evaluation value corresponding to the certificate to be verified.
Mode 5: the first evaluation value and the second evaluation value can be subjected to weighted summation, and the evaluation value corresponding to the certificate to be verified is determined based on the evaluation value obtained by the weighted summation.
Wherein a sum of the first weight of each first evaluation value and the second weight of the second evaluation value is 1. The second weight may be set higher than the sum of the first weights.
Wherein the first weight of each first evaluation value may be determined based on each video frame, for example, the weight of each video frame may be determined according to the corresponding capture time of each video frame, the weight of the video frame in the middle period of the video data may be set relatively higher, and then the weight of each video frame may be taken as the weight of each sub-feature vector.
Through the embodiment of the application, the evaluation value of the certificate to be verified can be obtained through the sub-feature vectors corresponding to the video frames and the fusion feature vector obtained by fusing the sub-feature vectors, and further the authenticity of the certificate to be verified can be verified based on the evaluation value.
In an optional embodiment, the determining the fused feature vector corresponding to each of the video frames includes:
obtaining convolution characteristics corresponding to each video frame;
splicing the convolution characteristics to obtain spliced convolution characteristics;
and determining the fusion feature vector based on the splicing convolution feature.
Optionally, after each video frame is input into the certificate verification model, the certificate verification model first extracts the convolution feature corresponding to each video frame, and then splices each convolution feature, that is, stacks the plurality of convolution features to form a larger convolution feature, so as to obtain a spliced convolution feature, and then determines a fusion feature vector based on the spliced convolution feature.
In the embodiment of the application, in addition to the manner of determining the fused feature vector and determining the evaluation value corresponding to the document to be verified based on the sub-feature vector and the fused feature vector provided above, the evaluation value corresponding to the document to be verified may be determined in other manners.
In an optional embodiment, the evaluating the authenticity of the document to be verified based on the plurality of video frames by the document verification model to obtain an evaluation value corresponding to the document to be verified may further be implemented as follows:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
and performing fusion processing on each sub-feature vector to obtain an evaluation value corresponding to the certificate to be verified.
Optionally, the plurality of video frames are input to the certificate verification model to obtain sub-feature vectors corresponding to the video frames, and then the sub-feature vectors are fused to determine the evaluation value corresponding to the certificate to be verified. Each sub-feature vector represents a sub-evaluation value of the certificate to be verified in the corresponding video frame. Specifically, each sub-evaluation value is used to indicate a score value/probability value that the certificate to be authenticated in the corresponding video frame is a true certificate and/or a false certificate, or each sub-evaluation value is used to indicate a label value of the certificate to be authenticated in the corresponding video frame (i.e., whether the certificate to be authenticated in the corresponding video frame is a true certificate or a false certificate).
For example, suppose that 8 frames of video frames are obtained by performing frame extraction based on video data of the document to be authenticated, the evaluation values corresponding to the sub feature vectors of the 8 frames of video frames are sub-evaluation value 1, sub-evaluation value 2, … …, and sub-evaluation value 8, respectively, and then the evaluation value of the document to be authenticated is determined based on the 8 sub-evaluation values. The evaluation value of the document to be authenticated may be a weighted average, mean, median, maximum, etc. of the 8 evaluation values, and is not limited herein.
In specific implementation, when the certificate to be verified is verified, the video data corresponding to the front side of the front side to be verified can be adopted, and the video data corresponding to the back side of the certificate to be verified can also be adopted; of course, the adopted video data may also include video data corresponding to the front side of the certificate to be verified, as well as video data corresponding to the back side of the certificate to be verified.
In an optional embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified;
for the condition that the video data comprises front video data and back video data of the front to be verified, video frames can be respectively extracted from the front video data and the back video data and input to a certificate verification model for verification; thus, for this case:
the step of extracting a plurality of video frames from the video data may include:
extracting a plurality of first video frames from the front video data and extracting a plurality of second video frames from the back video data;
correspondingly, the verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model comprises:
inputting the plurality of first video frames and the plurality of second video frames into a certificate verification model, and evaluating the authenticity of the certificate to be verified based on the plurality of first video frames and the plurality of second video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified; and acquiring an evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
When the certificate to be verified is verified through the certificate verification model, because the certificate verification model has the capability of identifying authenticity of the front video data and the back video data of the certificate, the front video data and the back video data in the video data of the certificate to be verified can not be distinguished, a plurality of first video frames extracted from the front video data of the certificate to be verified and a plurality of second video frames extracted from the back video data of the certificate to be verified are input into the certificate verification model, and the authenticity of the certificate to be verified is verified by mixing the plurality of first video frames and the plurality of second video frames.
The video data of the certificate to be verified comprises the front video data and/or the certificate to be verified, so that the video data input to the certificate verification model can only comprise the video frame corresponding to the front video data, can also only comprise the video frame corresponding to the back video data, or comprise the video frames corresponding to the front video data and the back video data, that is, the certificate verification model in the embodiment of the application can adapt to various possible situations without distinguishing the input video data of the certificate to be verified.
According to the certificate verification model, the certificate verification model has the capability of identifying the authenticity of the front video data and the back video data of the certificate, and can adapt to various service requirements when the certificate to be verified is verified through the certificate verification model, so that the adaptability and the universality of the certificate verification model are improved.
Certainly, when the certificate to be verified is verified, the front video data of the certificate to be verified and the back video data of the certificate to be verified can be distinguished, and the specific process is as follows:
in an optional embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified;
the verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model comprises the following steps:
verifying the authenticity of the certificate to be verified based on a plurality of first video frames extracted from the front video data and the certificate verification model to obtain a first verification result; verifying the authenticity of the certificate to be verified based on a plurality of second video frames extracted from the reverse side video data and the certificate verification model to obtain a second verification result;
and determining the authenticity of the certificate to be verified based on the first verification result and the second verification result.
Because the certificate usually has the front side and the back side, and the information of the front side and the information of the back side are usually different, in order to better ensure the accuracy of verification, the front side video data of the certificate to be verified and the back side video data of the certificate to be verified can be verified respectively.
Optionally, the video data of the certificate to be verified may include front video data of the certificate to be verified and back video data of the certificate to be verified. For example, taking an identification card as an example, the front video data may be video data of a national emblem of the identification card, the back video data may be video data of an image plane of the identification card, and each of the front video data and the back video data includes at least two frames of images.
When the authenticity of a certificate to be verified is verified based on a plurality of video frames and a certificate verification model trained in advance, front video data and back video data can be respectively input into the certificate verification model, the front video data and the back video data are respectively verified through the certificate verification model, a first verification result corresponding to the front video data and a second verification result corresponding to the back video data are respectively obtained, and the authenticity of the certificate to be verified is determined based on the first verification result and the second verification result.
In an optional embodiment, the determining the authenticity of the certificate to be verified based on the first verification result and the second verification result includes:
if the first verification result and the second verification result both indicate that the certificate to be verified is a real certificate, determining that the certificate to be verified is the real certificate; otherwise, the certificate to be verified is determined to be a counterfeit certificate.
For example, the user may upload a video of the national emblem of the identity card (front video data) and a video of the human image plane (back video data), wherein for the video of the national emblem, the partial video may be decomposed into N video segments, and at least one video frame is extracted from each video segment to obtain a video frame corresponding to the video of the national emblem. For the video of the human image plane, the partial video can be decomposed into N video segments, and at least one RGB color mode (RGB color mode) image is extracted from each video segment to obtain a video frame corresponding to the video of the human image plane.
In the embodiment of the present application, an image format of each of the plurality of video frames is not limited at all, and may be an image in an RGB color mode (RGB color mode), or an image in another color mode, where RGB is a color standard in the industry, and various colors are obtained by changing three color channels of Red (Red, R for short), Green (Green, G for short), and Blue (Blue, B for short) and superimposing the three color channels on each other, and RGB is a color representing three channels of Red, Green, and Blue.
Then, inputting the extracted video frame of the national emblem face into a certificate verification model, evaluating the certificate to be verified based on the video frame corresponding to the national emblem face to obtain a first verification result corresponding to the video of the national emblem face, inputting the extracted video frame of the portrait face into the certificate verification model, evaluating the certificate to be verified based on the video frame corresponding to the portrait face to obtain a second verification result corresponding to the video of the portrait face, taking the first verification result and the second verification result as the basis for judging whether the identity card is true or false, judging whether the verification results of the two videos are true, and judging the verification result of the identity card to be true. In an example, the authenticity of the certificate to be verified may be the classification result of the certificate to be verified, for example, 1 represents that the certificate to be verified is a fake certificate, and 0 represents that the certificate to be verified is a genuine certificate.
Through this application embodiment, can confirm the true and false of waiting to verify the certificate through the verification result that positive video data and the reverse side video data of waiting to verify the certificate correspond respectively, only two video verification results are true certificate, can confirm that the certificate of waiting to verify is true certificate, and this kind of dual mode of verifying has improved the rate of accuracy and the security that the certificate was verified.
Optionally, when determining the authenticity of the certificate to be verified according to the first verification result of the front side video data of the certificate to be verified and the second verification result of the back side video data of the certificate to be verified, the following situations may be adopted:
case 1: and if the first verification result indicates that the certificate to be verified is the true certificate and the second verification result indicates that the certificate to be verified is the true certificate, the certificate to be verified is the true certificate.
Case 2: and if the first verification result indicates that the certificate to be verified is a true certificate and the second verification result indicates that the certificate to be verified is a false certificate, the certificate to be verified is a false certificate.
Case 3: and if the first verification result indicates that the certificate to be verified is a fake certificate and the second verification result indicates that the certificate to be verified is a true certificate, the certificate to be verified is a fake certificate.
Case 4: and if the first verification result indicates that the certificate to be verified is a false certificate and the second verification result indicates that the certificate to be verified is a false certificate, the certificate to be verified is a false certificate.
That is, only if the first verification result and the second verification result indicate that the certificate to be verified is the real certificate, determining that the certificate to be verified is the real certificate; otherwise, determining the certificate to be verified as a forged certificate.
In addition, it should be noted that, in an optional implementation manner, the certificate verification model used in the embodiment of the present application may include a first sub-verification model and a second sub-verification model, and when a certificate to be verified is verified, a plurality of first video frames extracted from front-side video data may be input into the first sub-model of the certificate verification model to obtain a first verification result, and a plurality of second video frames extracted from back-side video data may be input into the second sub-model of the certificate verification model to obtain a second verification result; and then, based on the first verification result and the second verification result, determining the authenticity of the certificate to be verified.
In an optional embodiment, the extracting a plurality of video frames from the video data includes:
dividing the video data into a plurality of video segments, and extracting at least one frame of video frame from each video segment;
alternatively, the first and second electrodes may be,
determining a video frame sequence corresponding to the video data, and extracting video frames from the video frame sequence according to a set extraction rule; wherein, the set extraction rule comprises: setting a time interval or setting a video frame interval.
Of course, the extraction of the plurality of first video frames from the front-side video data and the extraction of the plurality of second video frames from the back-side video data may be performed in the above manner; of course, other methods may be adopted for extraction, and the embodiment of the present application is not limited thereto.
Optionally, if the main execution body of the certificate verification method in the embodiment of the present application is the user terminal, the video data of the certificate to be verified may be acquired through the user terminal, and then a plurality of video frames are obtained by extraction according to a certain frame extraction policy. Optionally, if the main execution body of the certificate verification method in the embodiment of the present application is the server, the user terminal may obtain the video data of the certificate to be verified, then extract the video frames according to a certain frame extraction policy, and send the extracted video frames to the server by the user terminal, or the user terminal may obtain the video data of the certificate to be verified, send the video data to the server by the user terminal, and extract the video frames by the server according to a certain frame extraction policy. It is understood that the step of performing frame extraction on the video data to obtain a plurality of video frames may be combined with various embodiments in the text, and the following are several possible scenarios provided by the embodiments of the present application.
In one example, the video data is divided into at least two video segments (e.g., 2, 10, etc.), and then a certain frame image is extracted from each video segment according to a certain frame extraction strategy, so as to obtain a plurality of video frames. Specifically, at least one frame image may be extracted from each video segment, and the frame image extracted from each video segment may be treated as a plurality of video frames.
Here, when the video data is divided into at least two video segments, the video data may be divided into at least two video segments at fixed time intervals (e.g., every 3 seconds, etc.), or the video data may be divided into a fixed number (e.g., 10) of video segments. Alternatively, the video data may be divided into at least two video segments on average based on the total duration of the video data. And is not limited herein.
In an example, a video frame sequence corresponding to the video data is determined, and the video frames may be extracted from the video sequence according to a set extraction rule. For example, video frames may be extracted from the video sequence at set time intervals (e.g., every 1 second, etc.), or video frames may be extracted from the video sequence at set video frame intervals (e.g., every 3 video frames, etc.).
According to the embodiment of the application, a certain frame image is extracted from the video sequence by adopting a frame extraction mode to obtain a plurality of video frames, some redundant information can be removed, the calculation amount is reduced, and the calculation efficiency is improved.
The following detailed description is made with reference to a specific embodiment, taking an example of two videos in which a document to be verified is a resident identification card (hereinafter referred to as an identification card) and video data are a national emblem surface and a human image surface of the identification card, to describe a specific process of document verification processing, where the specific processing steps of identification card verification judgment are as follows:
step 1, shooting two sections of videos (namely video data) of a national emblem surface and a human image surface of an identity card;
the duration of each video segment can be set according to requirements, and the embodiment of the application is not limited, and can be 1-3 seconds; the image format of each video frame in the video may be an image in RGB format, and it is understood that the image format may also be an image in another image format, and the present embodiment is not limited herein.
And 2, splitting the two sections of videos of the national emblem surface and the human image surface into N video segments (N is more than or equal to 1, and optionally, N is more than or equal to 2).
And 3, respectively extracting an RGB image from each of the N sections of the split national emblem videos to form N images of the national emblem, and simultaneously inputting the N images of the national emblem into the certificate verification model for evaluation. And respectively extracting an RGB image from each of the N video sections of the split human image plane to form N images of the human image plane, and simultaneously inputting the N images of the human image plane into the certificate verification model for evaluation.
Optionally, there may be multiple input manners for inputting the N images of the country emblem face and the N images of the portrait face to the certificate verification model, for example, the N images of the country emblem face and the N images of the portrait face may be simultaneously input to the certificate verification model, or the N images of the country emblem face and the N images of the portrait face may be respectively input.
The N images corresponding to the video of the national emblem surface and the N images corresponding to the video of the human image surface are the video frames of the video data.
And 4, judging whether the identity card in the input video is a true card or a false card according to an evaluation result (namely, an evaluation value) obtained by the certificate verification model.
A first verification result corresponding to the national emblem face video can be obtained through the certificate verification model, and a second verification result corresponding to the portrait face video can be obtained through the certificate verification model.
Step 5, integrating the verification results of the two videos of the national emblem surface and the portrait surface, returning the final verification result of the user, and when the national emblem surface and the portrait surface both pass the detection, determining that the identity card authentication detection passes; otherwise, the verification detection fails.
In an example, the video data may further include a first face image of a target object holding a document to be verified, then a first similarity between the first face image and a second face image on the document to be verified is determined, and prompt information for prompting whether the holder of the document to be verified is the target object himself or herself is obtained according to the first similarity, for example, the prompt information may be "non-personally holding the document, please note! The prompt information may be set according to an actual application scenario, and is not limited herein.
Optionally, referring to fig. 3, fig. 3 is a schematic diagram of a certificate verification model provided in an embodiment of the present application, and as shown in fig. 3, the certificate verification model includes a convolution layer, a first full-link layer, a second full-link layer, and a third full-link layer, where an input of the convolution layer is video data, an output of the convolution layer is connected to inputs of the first full-link layer and the second full-link layer, and an output of the first full-link layer and an output of the second full-link layer are connected to an input of the third full-link layer.
In the example shown in fig. 3, the number of the first fully-connected layer, the second fully-connected layer, and the third fully-connected layer is one, and in practical applications, the number of the first fully-connected layer, the second fully-connected layer, and the third fully-connected layer may be at least one, which is not limited herein. For the specific training process, reference may be made to the following description, which is not repeated herein.
Optionally, in a specific embodiment, the first full connection layer and the second full connection layer may be the same full connection layer or different full connection layers.
As shown in fig. 3, a plurality of video frames of the certificate to be verified are input to the convolution layer to obtain convolution characteristics of the plurality of video frames, the convolution characteristics of the plurality of video frames are subjected to characteristic extraction through the first full connection layer to obtain sub-feature vectors of the plurality of video frames, the sub-feature vectors of the plurality of video frames are subjected to characteristic fusion through the second full connection layer to obtain fusion feature vectors of the plurality of video frames, and the sub-feature vectors of the plurality of video frames and the fusion feature vectors of the video data are processed through the third full connection layer to determine the authenticity of the certificate to be verified.
According to the embodiment of the application, most of the existing certificate verification methods are based on single-frame RGB images, and a lot of useful information is lost.
The following describes the training process of the document verification model, and it is understood that the training process of the document verification model can be combined with any of the embodiments of the present application.
In an alternative embodiment, the certificate verification model is trained by:
acquiring a video sample set; the video sample set comprises video data of a plurality of sample certificates and marking data of each sample certificate; the marking data of the sample certificate shows that the sample certificate is a real certificate or a forged certificate;
inputting the video sample set into an initial certificate verification model to obtain an evaluation value corresponding to each sample certificate in the video sample set;
and performing loss calculation based on the labeled data of each sample certificate and each evaluation value, and updating the model parameters of the initial certificate verification model based on the loss calculation result to obtain the certificate verification model.
Optionally, the video sample set includes video data of a plurality of sample certificates and annotation data of each sample certificate. The video sample set may include a genuine video set and a counterfeit video set, and the respective proportions of the genuine video set and the counterfeit video set in the embodiment of the present application are not limited, for example, the proportions of the genuine video set and the counterfeit video set in the video sample set may be equal. The true certificate video set comprises video data of at least two sample certificates and annotation data of the certificates of all the sample certificates, and the false certificate video set comprises video data of at least two sample certificates and annotation data of the certificates of all the sample videos. Wherein the label data of each sample document indicates whether the sample document is a genuine document or a counterfeit document.
After the video sample set is obtained, the video data of each sample certificate in the video sample set can be input into an initial certificate verification model one by one, wherein the initial certificate verification model can be a neural network model. Then, obtaining an evaluation value corresponding to each sample certificate in the video sample set through the initial certificate verification model, performing loss calculation based on the label data and each evaluation value of each sample certificate to obtain a value of a total loss function corresponding to the initial certificate verification model, performing iterative training on the initial certificate verification model based on the total loss function, the value of the total loss function and the video data of each sample certificate in the video sample set, continuously updating model parameters of the initial certificate verification model until a preset training end condition is met, wherein the training end condition can be that the total loss function is converged, if the total loss function is converged, taking the initial certificate verification model when converged as a final certificate verification model, and if the total loss function is not converged, continuing training the initial certificate verification model until the total loss function is converged.
Optionally, for each sample certificate, the video data of the sample certificate includes each frame of sample image, and the annotation data of the sample certificate includes first annotation data of each frame of sample image of the video data of the sample certificate and second annotation data of the video data of the sample certificate, where each first annotation data represents that the certificate to be verified in the corresponding sample image is a real certificate or a counterfeit certificate, and the second annotation data represents that the certificate to be verified corresponding to the entire video data of the sample certificate is a real certificate or a counterfeit certificate.
It should be noted that, in practical applications, the first annotation result of each frame of sample image and the second annotation data of the video data of the sample certificate are kept consistent, and when each frame of sample image is annotated, the second annotation result can be directly annotated as the first annotation result. Or, the second labeling result is directly used for representing the authenticity of each frame of sample image without labeling each frame of sample image.
For any of the above-mentioned video data of the sample certificate, each frame of sample image of the video data of the sample certificate can be input into the initial certificate verification model, and the following processes are performed by the initial certificate verification model:
extracting a first sample convolution characteristic of each frame of sample image; obtaining a first prediction evaluation value of each frame of sample image based on the first sample convolution characteristic of the frame of sample image; obtaining a fusion convolution characteristic of video data of the sample certificate by fusing the first sample convolution characteristic of each frame of sample image, and obtaining a second prediction evaluation value of the video data of the sample certificate based on the first sample convolution characteristic of each frame of sample image and the fusion convolution characteristic of the video data of the sample certificate, wherein a prediction verification result corresponding to the video data of the sample certificate comprises the first prediction evaluation value of each frame of sample image and the second prediction evaluation value of the video data of the sample certificate;
calculating a first loss value of a first loss function based on a first prediction evaluation value and first annotation data of each frame of sample image of video data of each sample certificate;
calculating a second loss value of a second loss function based on a second prediction evaluation value and second annotation data of the video data of each sample certificate;
and determining a total loss value of the total loss function based on the first loss value of the first loss function and the second loss value of the second loss function, and adjusting the model parameters of the initial certificate verification model based on the total loss value of the total loss function.
Optionally, taking the certificate to be verified as the identity card as an example, a specific training process of the certificate verification model is described, and the specific steps are as follows:
data preprocessing: collecting a batch of identity card videos and labeling the identity card videos, extracting frames of the videos into RGB images to obtain a video sample set, and training the video sample set to obtain a certificate verification model (also called as a certificate verification model).
Wherein, can collect the short video of the true and false ID card of shooting, form true card video set and false card video set, the video sample set includes true card video set and false card video set. Then, each video in the authentic video set and the fake video set is divided into N (N > ═ 1) sections, one RGB image is extracted from each section, and the video in each section is subjected to sparse frame extraction to obtain N RGB images, so that some redundant information is removed, and the calculated amount is reduced.
For the video data of each sample certificate in the video sample set, training a neural network model by using each frame of sample image (such as N RGB images) generated in the video data of each sample certificate;
and fusing the evaluation result of the RGB image to judge whether the identity card in the video is a true card.
Specifically, for the video data of each sample certificate in the video sample set, N RGB images extracted from the video data are sent to an initial certificate verification model (which may be a convolutional neural network model), so as to obtain N three-dimensional convolution features, and then the N convolution features are processed in two ways. On one hand, the N convolution characteristics are subjected to full connection layer to obtain N (1, 2) vectors (marked as A) (namely, the evaluation value corresponding to each sample certificate), each vector is two scores, one is the score of a true certificate, the other is the score of a false certificate, and the N vectors are actually the scores of the N images; on the other hand, stacking the N convolution characteristics to form a larger convolution characteristic, and obtaining the vector of (1, 2) after the stacked convolution characteristics pass through the full connection layer; and obtaining N +1 (1, 2) vectors, and finally obtaining the final (1, 2) vector (marked as B) after the N +1 (1, 2) vectors pass through a full connection layer, wherein the vector is the score of the video data of the final sample certificate.
The final loss function is composed of the score a and the score B, and a cross-entropy loss function (not limited to this loss function) can be used as the loss function, and the loss function of the score a (i.e. the first loss function) is as follows:
Figure BDA0003156881300000221
wherein N is N sample images fed into the initial certificate verification model,
Figure BDA0003156881300000231
representing the original labeling result of the ith image in the N sample images (namely the labeling data of the ith frame image of the video data of the sample certificate, the labeling data is consistent with the labeling result of the video data of the sample certificate),
Figure BDA0003156881300000232
the value of (A) can be 0 or 1, 1 represents a fake certificate, 0 represents a genuine certificate, yi(x) evaluation value of ith frame image of video data representing sample documenti,yi) Evaluation value, x, representing ith imageiRepresenting the probability that the document in the ith sample image is a genuine document, yiRepresenting the ith sample imageIs a probability that the certificate in (1) is a false certificate.
The loss value corresponding to the video data of one sample certificate is given by formula (1), and in practical application, the first loss value corresponding to the first loss function is the sum of the loss values of the video data of all sample certificates.
The penalty function (i.e., the second penalty function) for score B is as follows:
Figure BDA0003156881300000233
wherein the content of the first and second substances,
Figure BDA0003156881300000234
and y represents a second predictive assessment value of the sample video, and x represents a probability that the certificate in the video data of the sample certificate is a genuine certificate.
The loss value corresponding to the video data of one sample certificate is given by formula (2), and in practical application, the second loss value corresponding to the second loss function is the sum of the loss values of the video data of all sample certificates.
The final loss function is:
loss=αlossA+βlossB (3)
where α and β are coefficients of losses a and B, i.e. weights, respectively, and may be set according to actual requirements, for example, 1/2.
For each training, whether the training is finished or not can be judged according to the value of the total loss function, if the total loss function is converged, the model training can be finished, if the total loss function is not converged, the model parameters of the initial certificate verification model can be updated by using a gradient descent algorithm, and the training steps are repeated.
And performing iterative training on the initial certificate verification model, and performing loop iteration for a certain number of times to obtain a final certificate verification model.
The specific structure of the certificate verification model is not limited in the embodiment of the present application, and may be a network model based on a convolutional neural network, a cyclic neural network, or the like.
Through the embodiment of the application, the final certificate verification model can be obtained by training the initial certificate verification model, so that the obtained certificate verification model has the capability of evaluating the authenticity of the certificate, and then the certificate to be verified is verified through the trained certificate verification model, so that the verification efficiency is improved.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a verification device for a document provided in an embodiment of the present application. The authentication device 1 of the certificate provided by the embodiment of the application comprises:
the video data acquisition module 11 is used for acquiring video data of a certificate to be verified;
a video frame extracting module 12, configured to extract a plurality of video frames from the video data;
and the verification module 13 is configured to verify the authenticity of the certificate to be verified based on the plurality of video frames and a certificate verification model trained in advance.
In a possible embodiment, the verification module 13 includes:
the first processing unit is used for inputting the video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified; the evaluation value comprises a score value or a label value, and the score value comprises a score value of the certificate to be verified as a true certificate and/or a score value of the certificate to be verified as a false certificate;
and the second processing unit is used for acquiring the evaluation value output by the certificate verification model and determining the authenticity of the certificate to be verified based on the evaluation value.
In a possible embodiment, the first processing unit is specifically configured to:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
determining fusion characteristic vectors corresponding to the video frames;
and determining the evaluation value corresponding to the certificate to be verified based on each sub-feature vector and the fused feature vector.
In a possible embodiment, the first processing unit is specifically configured to:
obtaining convolution characteristics corresponding to each video frame;
splicing the convolution characteristics to obtain spliced convolution characteristics;
and determining the fusion feature vector based on the splicing convolution feature.
In a possible embodiment, the first processing unit is specifically configured to:
respectively determining the sub-feature vectors corresponding to the video frames through the certificate verification model;
and performing fusion processing on each sub-feature vector to obtain an evaluation value corresponding to the certificate to be verified.
In a possible embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified; the video frame extraction module 12 is specifically configured to:
extracting a plurality of first video frames from the front video data and extracting a plurality of second video frames from the back video data;
accordingly, the verification module 13 includes:
a third processing unit, configured to input the plurality of first video frames and the plurality of second video frames into the certificate verification model, and evaluate, by the certificate verification model, the authenticity of the certificate to be verified based on the plurality of first video frames and the plurality of second video frames to obtain an evaluation value corresponding to the certificate to be verified;
and the first determining unit is used for acquiring the evaluation value output by the certificate verification model and determining the authenticity of the certificate to be verified based on the evaluation value.
In a possible embodiment, the video data includes front video data of the certificate to be verified and back video data of the certificate to be verified; the verification module includes:
the verification unit is used for verifying the authenticity of the certificate to be verified on the basis of the plurality of first video frames extracted from the front-side video data and the certificate verification model to obtain a first verification result; verifying the authenticity of the certificate to be verified based on a plurality of second video frames extracted from the reverse side video data and the certificate verification model to obtain a second verification result;
and the second determining unit is used for determining the authenticity of the certificate to be verified based on the first verification result and the second verification result.
In a possible embodiment, the second determining unit is configured to:
if the first verification result and the second verification result both indicate that the certificate to be verified is a real certificate, determining that the certificate to be verified is the real certificate; otherwise, the certificate to be verified is determined to be a counterfeit certificate.
In a possible embodiment, the video frame extraction module is specifically configured to;
dividing the video data into a plurality of video segments, and extracting at least one frame of video frame from each video segment;
alternatively, the first and second electrodes may be,
determining a video frame sequence corresponding to the video data, and extracting video frames from the video frame sequence according to a set extraction rule; wherein, the set extraction rule comprises: setting a time interval or setting a video frame interval.
In a possible embodiment, the apparatus further includes a training module, where the training module is specifically configured to:
acquiring a video sample set; the video sample set comprises video data of a plurality of sample certificates and marking data of each sample certificate; the marking data of the sample certificate shows that the sample certificate is a real certificate or a forged certificate;
inputting the video sample set into an initial certificate verification model to obtain an evaluation value corresponding to each sample certificate in the video sample set;
and performing loss calculation based on the labeled data of each sample certificate and each evaluation value, and updating the model parameters of the initial certificate verification model based on the loss calculation result to obtain the certificate verification model.
The device provided by the embodiment of the application acquires the video data of the certificate to be verified, and then extracts a plurality of video frames from the video data; the method provided by the embodiment of the application verifies the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model, when the authenticity of the certificate to be verified is verified, the method is based on the plurality of extracted video frames in the video data of the certificate to be verified and the pre-trained certificate verification model verifies the authenticity of the certificate to be verified, and due to the fact that the plurality of video frames are used, the problem that when only single-frame images are used for judgment, the verification result of the certificate to be verified is unreliable due to incomplete information can be avoided, so that the factors of the plurality of video frames can be comprehensively considered when the certificate is verified, and the verification accuracy is effectively improved.
In a specific implementation, the apparatus 1 may execute the implementation manners provided in the steps in fig. 2 through the built-in functional modules, which may specifically refer to the implementation manners provided in the steps, and are not described herein again.
Referring to fig. 5, fig. 5 is a schematic structural diagram of an electronic device provided in an embodiment of the present application. As shown in fig. 5, the electronic device 1000 in the present embodiment may include: the processor 1001, the network interface 1004, and the memory 1005, and the electronic device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display) and a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a standard wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may optionally be at least one memory device located remotely from the processor 1001. As shown in fig. 5, a memory 1005, which is a kind of computer-readable storage medium, may include therein an operating system, a network communication module, a user interface module, and a device control application program.
In the electronic device 1000 shown in fig. 5, the network interface 1004 may provide network communication functions; the user interface 1003 is an interface for providing a user with input; and the processor 1001 may be used to invoke a device control application stored in the memory 1005.
It should be understood that in some possible embodiments, the processor 1001 may be a Central Processing Unit (CPU), and the processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The memory may include both read-only memory and random access memory, and provides instructions and data to the processor. The portion of memory may also include non-volatile random access memory. For example, the memory may also store device type information.
In a specific implementation, the electronic device 1000 may execute the implementation manners provided in the steps in fig. 2 through the built-in functional modules, which may specifically refer to the implementation manners provided in the steps, and are not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and is executed by a processor to implement the method provided in each step in fig. 2, which may specifically refer to the implementation manner provided in each step, and is not described herein again.
The computer readable storage medium may be an internal storage unit of the task processing device provided in any of the foregoing embodiments, for example, a hard disk or a memory of an electronic device. The computer readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a Smart Memory Card (SMC), a Secure Digital (SD) card, a flash card (flash card), and the like, which are provided on the electronic device. The computer readable storage medium may further include a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), and the like. Further, the computer readable storage medium may also include both an internal storage unit and an external storage device of the electronic device. The computer-readable storage medium is used for storing the computer program and other programs and data required by the electronic device. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
Embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided by the steps of fig. 2.
The terms "first", "second", and the like in the claims and in the description and drawings of the present application are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or electronic device that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or electronic device. Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments. The term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not intended to limit the scope of the present application, which is defined by the appended claims.

Claims (13)

1. A method of authenticating a document, comprising:
acquiring video data of a certificate to be verified;
extracting a plurality of video frames from the video data;
and verifying the authenticity of the certificate to be verified based on the plurality of video frames and a pre-trained certificate verification model.
2. The method of claim 1, wherein verifying the authenticity of the document to be verified based on the plurality of video frames and a pre-trained document verification model comprises:
inputting the video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified; the evaluation value comprises a score value or a label value, and the score value comprises a score value of the certificate to be verified as a true certificate and/or a score value of the certificate to be verified as a false certificate;
and acquiring the evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
3. The method of claim 2, wherein the evaluating the authenticity of the document to be authenticated based on the plurality of video frames by the document authentication model to obtain an evaluation value corresponding to the document to be authenticated comprises:
respectively determining sub-feature vectors corresponding to the video frames through the certificate verification model;
determining fusion characteristic vectors corresponding to the video frames;
and determining the evaluation value corresponding to the certificate to be verified based on each sub-feature vector and the fusion feature vector.
4. The method of claim 3, wherein said determining the fused feature vector corresponding to each of the video frames comprises:
obtaining convolution characteristics corresponding to each video frame;
splicing the convolution characteristics to obtain spliced convolution characteristics;
determining the fused feature vector based on the splice convolution features.
5. The method of claim 2, wherein the evaluating the authenticity of the document to be authenticated based on the plurality of video frames by the document authentication model to obtain an evaluation value corresponding to the document to be authenticated comprises:
respectively determining sub-feature vectors corresponding to the video frames through the certificate verification model;
and performing fusion processing on each sub-feature vector to obtain an evaluation value corresponding to the certificate to be verified.
6. The method of any one of claims 1 to 5, wherein the video data comprises front side video data of the document to be authenticated and back side video data of the document to be authenticated;
verifying the authenticity of the certificate to be verified based on the plurality of video frames and a pre-trained certificate verification model, comprising:
verifying the authenticity of the certificate to be verified based on a plurality of first video frames extracted from the front video data and the certificate verification model to obtain a first verification result; verifying the authenticity of the certificate to be verified based on a plurality of second video frames extracted from the reverse side video data and the certificate verification model to obtain a second verification result;
and determining the authenticity of the certificate to be verified based on the first verification result and the second verification result.
7. The method as claimed in claim 6, wherein said determining the authenticity of the document to be authenticated based on the first and second authentication results comprises:
if the first verification result and the second verification result both indicate that the certificate to be verified is a real certificate, determining that the certificate to be verified is the real certificate; otherwise, determining the certificate to be verified as a forged certificate.
8. The method of any one of claims 1 to 5, wherein the video data comprises front side video data of the document to be authenticated and back side video data of the document to be authenticated;
the extracting a plurality of video frames from the video data comprises:
extracting a plurality of first video frames from the front side video data and extracting a plurality of second video frames from the back side video data;
correspondingly, the verifying the authenticity of the certificate to be verified based on the plurality of video frames and the pre-trained certificate verification model comprises:
inputting the plurality of first video frames and the plurality of second video frames into the certificate verification model, and evaluating the authenticity of the certificate to be verified based on the plurality of first video frames and the plurality of second video frames through the certificate verification model to obtain an evaluation value corresponding to the certificate to be verified;
and acquiring the evaluation value output by the certificate verification model, and determining the authenticity of the certificate to be verified based on the evaluation value.
9. The method of any of claims 1 to 5, wherein said extracting a plurality of video frames from said video data comprises:
dividing the video data into a plurality of video segments, and extracting at least one frame of video frame from each video segment;
alternatively, the first and second electrodes may be,
determining a video frame sequence corresponding to the video data, and extracting video frames from the video frame sequence according to a set extraction rule; wherein the setting of the extraction rule comprises: setting a time interval or setting a video frame interval.
10. The method of any of claims 1 to 5, wherein the document verification model is trained by:
acquiring a video sample set; the video sample set comprises video data of a plurality of sample certificates and annotation data of each sample certificate; the marking data of the sample certificate shows that the sample certificate is a real certificate or a forged certificate;
inputting the video sample set into an initial certificate verification model to obtain an evaluation value corresponding to each sample certificate in the video sample set;
and performing loss calculation based on the annotation data of each sample certificate and each evaluation value, and updating the model parameters of the initial certificate verification model based on the loss calculation result to obtain the certificate verification model.
11. An apparatus for authenticating a document, the apparatus comprising:
the video data acquisition module is used for acquiring video data of the certificate to be verified;
the video frame extraction module is used for extracting a plurality of video frames from the video data;
and the verification module is used for verifying the authenticity of the certificate to be verified based on the plurality of video frames and a pre-trained certificate verification model.
12. An electronic device comprising a processor and a memory, the processor and the memory being interconnected;
the memory is used for storing a computer program;
the processor is configured to perform the method of any of claims 1 to 10 when the computer program is invoked.
13. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method of any one of claims 1 to 10.
CN202110778885.8A 2021-07-09 2021-07-09 Certificate verification method and device, electronic equipment and storage medium Pending CN113591603A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110778885.8A CN113591603A (en) 2021-07-09 2021-07-09 Certificate verification method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110778885.8A CN113591603A (en) 2021-07-09 2021-07-09 Certificate verification method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113591603A true CN113591603A (en) 2021-11-02

Family

ID=78246666

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110778885.8A Pending CN113591603A (en) 2021-07-09 2021-07-09 Certificate verification method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113591603A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115147627A (en) * 2022-09-01 2022-10-04 深流微智能科技(深圳)有限公司 Visual print processing method, device, terminal and storage medium for verifying credibility of video
CN116959064A (en) * 2023-06-25 2023-10-27 上海腾桥信息技术有限公司 Certificate verification method and device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200143162A1 (en) * 2017-10-20 2020-05-07 Alibaba Group Holding Limited Document verification and identity verification method and device
CN111275105A (en) * 2020-01-19 2020-06-12 支付宝实验室(新加坡)有限公司 Certificate verification method and device and electronic equipment
CN111324874A (en) * 2020-01-21 2020-06-23 支付宝实验室(新加坡)有限公司 Certificate authenticity identification method and device
CN111461089A (en) * 2020-06-17 2020-07-28 腾讯科技(深圳)有限公司 Face detection method, and training method and device of face detection model
WO2020221278A1 (en) * 2019-04-29 2020-11-05 北京金山云网络技术有限公司 Video classification method and model training method and apparatus thereof, and electronic device
CN113034433A (en) * 2021-01-14 2021-06-25 腾讯科技(深圳)有限公司 Data authentication method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200143162A1 (en) * 2017-10-20 2020-05-07 Alibaba Group Holding Limited Document verification and identity verification method and device
WO2020221278A1 (en) * 2019-04-29 2020-11-05 北京金山云网络技术有限公司 Video classification method and model training method and apparatus thereof, and electronic device
CN111275105A (en) * 2020-01-19 2020-06-12 支付宝实验室(新加坡)有限公司 Certificate verification method and device and electronic equipment
CN111324874A (en) * 2020-01-21 2020-06-23 支付宝实验室(新加坡)有限公司 Certificate authenticity identification method and device
CN111461089A (en) * 2020-06-17 2020-07-28 腾讯科技(深圳)有限公司 Face detection method, and training method and device of face detection model
CN113034433A (en) * 2021-01-14 2021-06-25 腾讯科技(深圳)有限公司 Data authentication method, device, equipment and medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115147627A (en) * 2022-09-01 2022-10-04 深流微智能科技(深圳)有限公司 Visual print processing method, device, terminal and storage medium for verifying credibility of video
CN116959064A (en) * 2023-06-25 2023-10-27 上海腾桥信息技术有限公司 Certificate verification method and device, computer equipment and storage medium
CN116959064B (en) * 2023-06-25 2024-04-26 上海腾桥信息技术有限公司 Certificate verification method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
CN105069622B (en) A kind of face recognition payment system and method for facing moving terminal
CN112699297A (en) Service recommendation method, device and equipment based on user portrait and storage medium
JP2022521038A (en) Face recognition methods, neural network training methods, devices and electronic devices
CN110796054B (en) Certificate verification method and device
CN108108711B (en) Face control method, electronic device and storage medium
CN112650875A (en) House image verification method and device, computer equipment and storage medium
CN111444873A (en) Method and device for detecting authenticity of person in video, electronic device and storage medium
CN113591603A (en) Certificate verification method and device, electronic equipment and storage medium
CN114241459B (en) Driver identity verification method and device, computer equipment and storage medium
CN113343898B (en) Mask shielding face recognition method, device and equipment based on knowledge distillation network
CN112418167A (en) Image clustering method, device, equipment and storage medium
JP7412496B2 (en) Living body (liveness) detection verification method, living body detection verification system, recording medium, and training method for living body detection verification system
CN113656761A (en) Service processing method and device based on biological recognition technology and computer equipment
CN116152870A (en) Face recognition method, device, electronic equipment and computer readable storage medium
CN111241873A (en) Image reproduction detection method, training method of model thereof, payment method and payment device
CN116311400A (en) Palm print image processing method, electronic device and storage medium
CN111738199A (en) Image information verification method, image information verification device, image information verification computing device and medium
CN114373213A (en) Juvenile identity recognition method and device based on face recognition
CN113034433B (en) Data authentication method, device, equipment and medium
CN115082873A (en) Image recognition method and device based on path fusion and storage medium
CN113762031A (en) Image identification method, device, equipment and storage medium
CN113158958A (en) Passing method and related device
CN112949363A (en) Face living body identification method and device
US20240202294A1 (en) Systems and methods for validating and extracting data dynamically from images of identification documents
Shoukat et al. Fraud detection system using facial recognition based on Google Teachable Machine for banking applications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination