Training method of face attack detection model, face attack detection method and device
By obtaining and extracting the features of the face-swiping image sample sequence and the behavior sample sequence, the face attack detection model is trained, which solves the problem of low face attack detection accuracy in the existing technology and achieves higher detection accuracy and reliability. .
Patent Information
- Application Number
- CN202211025324.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-25
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2042-08-25
AI Technical Summary
Existing face attack detection solutions have low accuracy and cannot effectively identify new account attacks and new attack methods. They only consider facial features or statistical features, which can easily lead to missed reports.
By obtaining the user's face-swiping image sample sequence and behavior sample sequence, feature extraction is performed respectively, and the face-swiping image features and behavioral features are used to train the face attack detection model to more comprehensively characterize user behavior and improve detection accuracy.
It improves the accuracy and reliability of face attack detection, can more accurately identify face attack behaviors, and makes up for the underreporting problem of existing solutions.
Smart Images

Figure CN115622730B
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of artificial intelligence, and in particular, to a training method for a face attack detection model, a face attack detection method, and a device. Background Art
[0002] With the development of artificial intelligence technology, face recognition algorithms have also made great progress. At present, face recognition related products have been widely used and have been involved in all aspects of life, such as payment, risk control, and government affairs.
[0003] However, where there is profit, there is also black industry. Black industry uses leaked facial images, ID cards and other personal privacy data to conduct facial attacks through technical means and break through the facial identity verification system. Then, they carry out gambling, money laundering and account theft, which poses a huge threat to the security of facial recognition products and also brings security risks to users' information and property. Summary of the invention
[0004] One or more embodiments of this specification describe a training method for a face attack detection model, a face attack detection method, and a device, which can improve the accuracy of face attack detection.
[0005] According to a first aspect, a training method for a face attack detection model is provided, comprising:
[0006] Acquire a face-scanning image sample sequence and a behavior sample sequence of the user; wherein the face-scanning image sample sequence is used to represent the time sequence of the user's face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent the time sequence of the operations performed by the user before and after each collection of the user's face image;
[0007] Performing feature extraction on the face scanning image sample sequence to obtain at least one face scanning image feature;
[0008] Extracting features from the behavior sample sequence to obtain at least one behavior feature;
[0009] The face attack detection model is trained using the at least one face scan image feature, the at least one behavior feature, and the label of the sample sequence.
[0010] In a possible implementation, the face scanning image sample sequence includes a normal face scanning image sample sequence and an attack face scanning image sample sequence annotated with a label;
[0011] The step of extracting features from the face-scanning image sample sequence to obtain at least one face-scanning image feature comprises:
[0012] Extracting frequent item sets of the normal face-scanning image sample sequence to obtain a normal face-scanning image frequent item set; wherein the normal face-scanning image frequent item set is used to represent a set of sequences whose frequency of appearing in the normal face-scanning image sample sequence is much greater than that of appearing in the attack face-scanning image sample sequence; and,
[0013] Extract the frequent item sets of the attack face-swiping image sample sequence to obtain the attack face-swiping image frequent item sets; wherein the attack face-swiping image frequent item sets are used to represent a set of sequences whose frequency of appearing in the attack face-swiping image sample sequence is much greater than their frequency of appearing in the normal face-swiping image sample sequence.
[0014] In a possible implementation, the behavior sample sequence includes a normal behavior sample sequence and an attack behavior sample sequence annotated with a label;
[0015] The extracting features from the behavior sample sequence to obtain at least one behavior feature includes:
[0016] Extracting frequent item sets of the normal behavior sample sequence to obtain a normal behavior frequent item set; wherein the normal behavior frequent item set is used to represent a set of sequences whose frequency of appearing in the normal behavior sample sequence is much greater than that of appearing in the attack behavior sample sequence; and,
[0017] Frequent item sets of the attack behavior sample sequence are extracted to obtain attack behavior frequent item sets; wherein the attack behavior frequent item sets are used to represent a set of sequences whose frequency of appearing in the attack behavior sample sequence is much greater than that of appearing in the normal behavior sample sequence.
[0018] In a possible implementation, the behavior sample sequence includes a normal behavior sample sequence annotated with a label;
[0019] The extracting features from the behavior sample sequence to obtain at least one behavior feature includes:
[0020] At least one sample behavior set is extracted from the normal behavior sample sequence; wherein each of the sample behavior sets includes at least two adjacent user operations, and any two adjacent user operations are different.
[0021] In a possible implementation, the extracting features of the face recognition image sample sequence to obtain at least one face recognition image feature includes:
[0022] Extracting at least one of user information corresponding to the face image, device information for collecting the face image, and face image information of the user from the face scanning image sample sequence;
[0023] and / or,
[0024] The extracting features from the behavior sample sequence to obtain at least one behavior feature includes:
[0025] At least one of user information of the user who performs the operation before and after the facial image is collected, device information of the operation, and operation information performed by the user before and after the facial image of the user is collected is extracted from the behavior sample sequence.
[0026] According to a second aspect, a face attack detection method is provided, comprising:
[0027] Obtaining a face scan image sequence and a behavior sequence to be subjected to face attack detection;
[0028] The face scanning image sequence and the behavior sequence are input into a face attack detection model, and a face attack detection result is output; wherein the face attack detection model is trained using any face attack detection model training method as described in the first aspect.
[0029] In a possible implementation, before inputting the face scanning image sequence and the behavior sequence into the face attack detection model, the method further includes:
[0030] Determine the confidence that the face-scanning image sequence appears in a pre-stored frequent item set of attack face-scanning images; wherein the frequent item set of attack face-scanning images is used to represent a set of sequences whose frequency of appearance in the attack face-scanning image sequence is much greater than that in the normal face-scanning image sequence;
[0031] Determining whether the confidence level is greater than a first preset threshold;
[0032] If yes, then the face attack detection result is a face attack behavior;
[0033] If not, the face scanning image sequence and the behavior sequence are input into the face attack detection model to perform face attack detection.
[0034] According to a third aspect, a training device for a face attack detection model is provided, comprising: a sample sequence acquisition module, a face image feature extraction module, a behavior feature extraction module, and a training module;
[0035] The sample sequence acquisition module is configured to acquire a user's face scanning image sample sequence and a behavior sample sequence; wherein the face scanning image sample sequence is used to represent a time sequence of user face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent a time sequence of operations performed by the user before and after each collection of the user's face image;
[0036] The face-scanning image feature extraction module is configured to perform feature extraction on the face-scanning image sample sequence acquired by the sample sequence acquisition module to obtain at least one face-scanning image feature;
[0037] The behavior feature extraction module is configured to extract features from the behavior sample sequence acquired by the sample sequence acquisition module to obtain at least one behavior feature;
[0038] The training module is configured to train the face attack detection model by using the at least one face image feature obtained by the face image feature extraction module, the at least one behavior feature obtained by the behavior feature extraction module, and the label of the sample sequence.
[0039] According to a fourth aspect, a face attack detection device is provided, comprising: a sequence acquisition module to be tested and a detection result output module;
[0040] The test sequence acquisition module is configured to acquire a face scan image sequence and a behavior sequence to be subjected to face attack detection;
[0041] The detection result output module is configured to input the face scanning image sequence and the behavior sequence acquired by the sequence acquisition module to be tested into a face attack detection model, and output the detection result of the face attack; wherein the face attack detection model is trained using the training device of the face attack detection model as described in the third aspect.
[0042] According to a fifth aspect, a computing device is provided, comprising: a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method described in any one of the first and second aspects is implemented.
[0043] According to the method and device provided in the embodiments of this specification, when training a face attack detection model, first obtain a face scan image sample sequence and a behavior sample sequence, and then perform feature extraction on the face scan image sample sequence and the behavior sample sequence respectively. Finally, the face attack detection model can be trained using the obtained face scan image features, behavior features, and sample sequence labels. Since the sample sequence used to train the face attack detection model includes not only a sample sequence of face scan images, but also a behavior sample sequence of the operations performed by the user before and after each acquisition of the user's face image. In this way, the user behavior can be more comprehensively characterized, thereby improving the reliability of the face attack detection model, so as to more accurately detect face attack behaviors. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0045] Figure 1 is a flowchart of a method for training a face attack detection model provided by an embodiment of this specification;
[0046] Figure 2 This is a flow chart of a method for extracting features from a face scan image provided by an embodiment of this specification;
[0047] Figure 3 is a flow chart of a behavior feature extraction method provided by an embodiment of this specification;
[0048] Figure 4 is a flow chart of a face attack detection method provided by an embodiment of this specification;
[0049] Figure 5 is a schematic diagram of a training device for a face attack detection model provided by an embodiment of this specification;
[0050] Figure 6 It is a schematic diagram of a face attack detection device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0051] As mentioned above, face attacks often occur in face recognition. For example, by leaking personal privacy data such as face images and ID cards, people try to use technical means to break through the face verification system, which will bring huge security risks to users. Therefore, detecting face attacks will help improve the reliability of face recognition systems.
[0052] At present, the detection of face attacks mainly relies on expert experience to extract rules to identify attacks, or on statistical features and black-and-white sample training models to identify attacks. That is, based on expert experience, the attack features are manually provided and the corresponding threshold conditions are set to perceive the attack, or the statistical features and black-and-white sample training algorithm model are used to predict the attack through the model. However, the current scheme has certain limitations in the detection of face attacks. It only considers the features of the current face scan, or only considers the statistical features before the face scan, which easily leads to the omission of attacks. For example, for attacks on new accounts, statistical features cannot effectively characterize abnormal features, resulting in missed attacks; for another example, for some new attacks, the rules extracted based on expert experience often cannot cover them. Therefore, the current face attack detection scheme has low accuracy.
[0053] Based on this, this scheme considers not only using the user's face scanning sequence to characterize the face attack behavior, but also using the behavior sample sequence of the user's operations performed before and after collecting the user's face image to characterize the face attack behavior, so as to more comprehensively cover the user's behavior and thus improve the accuracy of face attack detection.
[0054] like Figure 1 As shown, the embodiment of this specification provides a method for training a face attack detection model, which may include the following steps:
[0055] Step 101: Obtain a user's face scanning image sample sequence and behavior sample sequence; wherein the face scanning image sample sequence is used to represent the time sequence of the user's face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent the time sequence of the user's operations performed before and after each collection of the user's face image;
[0056] Step 103: extracting features from the face scanning image sample sequence to obtain at least one face scanning image feature;
[0057] Step 105: extracting features from the behavior sample sequence to obtain at least one behavior feature;
[0058] Step 107: Train a face attack detection model using at least one face scan image feature, at least one behavior feature, and a label of the sample sequence.
[0059] In this embodiment, when training the face attack detection model, firstly, the face scan image sample sequence and the behavior sample sequence are obtained, and then the features of the face scan image sample sequence and the behavior sample sequence are extracted respectively. Finally, the face attack detection model can be trained using the obtained face scan image features, behavior features and sample sequence labels. Since the sample sequence used to train the face attack detection model includes not only the sample sequence of face scan images, but also the behavior sample sequence of the operations performed by the user before and after each acquisition of the user's face image. In this way, the user behavior can be more comprehensively characterized, thereby improving the reliability of the face attack detection model, so as to detect the face attack behavior more accurately.
[0060] The following is a detailed description of the attached Figure 1 The various steps in are described below.
[0061] First, in step 101, a user's face scanning image sample sequence and behavior sample sequence are obtained.
[0062] In this step, it is first necessary to obtain the user's face scanning image sample sequence from the historical database. The face scanning image sample sequence is the time series of the user's face images collected when the user scans the face at various time points. For example, the face image can be the user's face image information collected when the user performs identity authentication, the user's face image information collected when the user logs in to the account, the user's face image information collected when the user pays by face recognition, and the face image information collected in other scenarios. The time series composed of the user's face images collected at various time points is the face scanning image sample sequence.
[0063] At the same time, in addition to obtaining the user's face image sample sequence, it is also necessary to obtain the user's behavior sample sequence, which is the time series of operations performed by the user before and after each user's face image is collected. For example, the behavior can be the user's login account, identity authentication, information query and other operations performed before the user's face image is collected, or it can be the user's account password modification, transfer transaction and other operations performed after the user's face image is collected. The time series composed of the operations performed by the user before and after each user's face image is collected is the behavior sample sequence.
[0064] Then in step 103, feature extraction is performed on the face scanning image sample sequence to obtain at least one face scanning image feature.
[0065] In this step, after obtaining the face-scanning image sample sequence, further feature extraction is considered for the face-scanning image sample sequence, so as to train the face attack detection model using the extracted face-scanning image features. When performing feature extraction on the face-scanning image sample sequence, the main considerations include extracting frequent item sets, learning the features of normal face-scanning image sample sequences, and extracting some basic statistical features from the face-scanning image sample sequences. Step 103 is described below from these three situations.
[0066] Case 1: Extracting frequent itemsets
[0067] The face-scanning image sample sequences obtained from the historical database can be labeled in advance, and they can be marked as normal face-scanning image sample sequences and attack face-scanning image sample sequences. Among them, the normal face-scanning image sample sequence is a face-scanning image sample sequence without face attack behavior, and the attack face-scanning image sample sequence is a face-scanning image sample sequence with face attack behavior. For example, the normal face-scanning image sample sequence is a sequence in which a user performs a face-scanning payment through a client. The attack face-scanning image sample sequence may be a sequence in which a user successfully logs in or fails to log in after repeatedly swiping his face when logging into an account.
[0068] like Figure 2As shown, in a possible implementation, when extracting features from the face-scanning image sample sequence to obtain at least one face-scanning image feature, step 103 can be implemented by the following steps:
[0069] Step 201: extracting frequent item sets of a normal face-scanning image sample sequence to obtain a normal face-scanning image frequent item set; wherein the normal face-scanning image frequent item set is used to represent a set of sequences whose frequency of appearing in a normal face-scanning image sample sequence is much greater than that of appearing in an attack face-scanning image sample sequence; and,
[0070] Step 203: extract frequent item sets of the attack face-swiping image sample sequence to obtain the attack face-swiping image frequent item set; wherein the attack face-swiping image frequent item set is used to represent a set of sequences whose frequency of appearing in the attack face-swiping image sample sequence is much greater than that of appearing in the normal face-swiping image sample sequence.
[0071] In this embodiment, the face-scanning image sample sequence is labeled as a normal face-scanning image sample sequence and an attack face-scanning image sample sequence. In this way, the frequent item sets of the normal face-scanning image sample sequence and the frequent item sets of the attack face-scanning image sample sequence can be extracted respectively, and the obtained normal face-scanning image frequent item sets and attack face-scanning image frequent item sets are used as face-scanning image features for subsequent training of the face attack detection model. Since the frequent item sets characterize the two types of face-scanning image sample sequences, normal and attack, that is, sequences that often appear in one type of sample sequence but rarely appear in another type of sample sequence can be extracted, and the normal and attack sequences can be significantly distinguished. In this way, the face attack detection model trained with this feature can be more reliable, and at the same time, it can more accurately detect whether the sequence has attack behavior.
[0072] The frequent item set of normal face-swiping images obtained by extracting frequent item sets from the normal face-swiping image sample sequence in step 201 represents a set of sequences whose frequency of appearance in the normal face-swiping image sample sequence is much greater than that in the attack face-swiping image sample sequence. For example, for normal face-swiping behavior, the user basically only needs to log in by face-swiping once when logging in by face-swiping. That is, in the normal face-swiping image sample sequence, there are many sequences in which the user successfully logs in to the account by just one face-swiping. For the face-swiping behavior with attacking behavior, it may take multiple consecutive attempts to log in by face-swiping to succeed or even still fail, and it is rare to successfully log in by just one face-swiping behavior. That is, in the attack face-swiping image sample sequence, there are very few sequences in which the user successfully logs in to the account by just one face-swiping. In other words, each sequence in the frequent item set of normal face-swiping images may appear more than 100 times in the normal face-swiping image sample sequence, but may only appear once in the attack face-swiping image sample sequence. That is, the frequency of each sequence in the frequent item set of normal face scanning images in the normal face scanning image sample sequence is much greater than the frequency of each sequence in the attack face scanning image sample sequence.
[0073] Similarly, the attack face scanning image frequent item set in step 203 represents a set of sequences that appear much more frequently in the attack face scanning image sample sequence than in the normal face scanning image sample sequence. For example, for face attack behaviors, it is usually attempted to break through the face authentication system by repeatedly scanning the face or using different face images to log in. Then, sequences such as multiple consecutive face scanning and multiple different face images are attack face scanning image frequent item sets, which appear more frequently in the attack face scanning image sample sequence, that is, they appear more frequently in the attack face scanning image sample sequence.
[0074] Case 2: Learning the features of normal face scan image sample sequences
[0075] Since in the historical database, more samples are face scanning image sample sequences without attack behaviors, while the samples of face scanning image sample sequences with attack behaviors are much fewer. Therefore, it is possible to consider learning the features of normal face scanning image sample sequences, so that there will be sufficient sample data for feature learning, thereby covering more face scanning image sample sequences without attack behaviors, so that the trained face attack detection model can more accurately detect whether the face scanning sequence is a normal face scanning operation.
[0076] Case 3: Extracting basic statistical features from face recognition image sample sequences
[0077] When collecting facial image information, some basic face information will be recorded in the face image sample sequence. For example, the user information corresponding to the facial image, the device information for collecting the facial image, and the user's facial image information. In this way, the basic information corresponding to the facial image collection is statistically collected to serve as features for training the face attack detection model. For example, facial image information that has been labeled multiple times in the historical database as having performed facial attack operations, and user A corresponding to the facial image has been labeled multiple times as having performed operations with attack behaviors on device S. In this way, by extracting the basic statistical features in the face image sample sequence to train the face attack detection model, the accuracy of face attack detection can be improved.
[0078] Further in step 105, feature extraction is performed on the behavior sample sequence to obtain at least one behavior feature.
[0079] As mentioned above, the current face attack detection mainly relies on rules or statistical machine learning schemes, that is, based on expert experience, the attack features are manually extracted and the corresponding threshold conditions are set to perceive the attack and the statistical features and black and white samples are used to train the algorithm model within a period of time to predict the attack. This type of attack detection scheme can effectively identify most attacks, but it cannot efficiently perceive a small number of attacks. For example, attacks on new accounts and some new attack methods will lose part of the sequence information if only statistical methods are used. Moreover, for new accounts, new devices, etc., due to the relatively small amount of historical face scanning data, statistical features are not easy to distinguish between normal and abnormal. However, in many cases, the statistical features of normal and attack are similar, and the sequences of operation behaviors before and after face scanning are often different, so this type of attack can be distinguished more effectively. Therefore, in this step, feature extraction of the behavior sample sequence is considered, for example, the behavior features can be obtained mainly by extracting frequent item sets, learning the features of normal behavior sample sequences, and extracting the basic statistical features of behavior sample sequences. The following describes these three situations respectively.
[0080] Case 1: Extracting frequent itemsets
[0081] The behavior sample sequences obtained from the historical database can be pre-labeled as normal behavior sample sequences and attack behavior sample sequences. The normal behavior sample sequence is a behavior sample sequence without face attack behaviors, while the attack behavior sample sequence is a behavior sample sequence with face attack behaviors. For example, the normal behavior sample sequence can be the behavior of a user successfully logging into an account twice with an account number and password before face scanning, or the behavior of a user querying information after face scanning, etc. The attack behavior sample sequence can be the user opening or logging into some pre-labeled pages after face scanning, or performing data transmission, transfer, and other operations to non-authenticated accounts.
[0082] like Figure 3 As shown, in a possible implementation, when extracting features from the behavior sample sequence to obtain at least one behavior feature in step 105, the steps can be implemented as follows:
[0083] Step 301: extracting frequent item sets of normal behavior sample sequences to obtain normal behavior frequent item sets; wherein the normal behavior frequent item sets are used to represent a set of sequences that appear much more frequently in normal behavior sample sequences than in attack behavior sample sequences; and,
[0084] Step 303: extract frequent item sets of the attack behavior sample sequence to obtain the attack behavior frequent item sets; wherein the attack behavior frequent item sets are used to represent a set of sequences that appear much more frequently in the attack behavior sample sequence than in the normal behavior sample sequence.
[0085] In this embodiment, the behavior sample sequence is labeled as a normal behavior sample sequence and an attack behavior sample sequence. In this way, the frequent item sets of the normal behavior sample sequence and the frequent item sets of the attack behavior sample sequence can be extracted respectively, and the obtained normal behavior frequent item sets and attack behavior frequent item sets are used as behavior features for subsequent training of the face attack detection model. Since the frequent item sets characterize the two types of behavior sample sequences, normal and attack, that is, it is possible to extract sequences that often appear in one type of sample sequence but rarely appear in another type of sample sequence, and significantly distinguish between normal and attack sequences. In this way, when training the face attack detection model with this feature, it is possible to make up for the deficiency of information omission caused by face detection through statistical features, thereby making the model more reliable and the accuracy of detecting face attacks on sequences is also higher.
[0086] The normal behavior frequent item set obtained by extracting the frequent item set from the normal behavior sample sequence in step 301 represents a set of sequences that often appear in the normal behavior sample sequence with a frequency far greater than that in the attack behavior sample sequence. For example, for normal behavior, the user may register an account before face scanning, face scanning is used for identity verification, and information query and data search are performed after face scanning verification. These sequences are very common sequences in normal behavior sequences. For aggressive user behaviors, the user may try to log in to the account through the password many times, or the user may not register with the real name, or the user logs in to a page marked as illegal, etc. These sequences are very common sequences in the attack behavior sequence. In other words, the number of times each sequence in the normal behavior frequent item set appears in the normal behavior sample sequence is far greater than the number of times it appears in the attack behavior sample sequence, that is, the frequency of each sequence in the normal behavior frequent item set in the normal behavior sample sequence is far greater than the frequency of each sequence in the attack sample behavior sequence.
[0087] Similarly, the attack behavior frequent item set in step 303 represents a set of sequences that appear much more frequently in the attack behavior sample sequence than in the normal behavior sample sequence. For details, please refer to the above description, which will not be repeated here.
[0088] Case 2: Learning the characteristics of normal behavior sample sequences
[0089] Since in the historical database, more samples are sample sequences without attack behaviors, while sample sequences with attack behaviors are much less, therefore, it is possible to consider learning the features of normal behavior sample sequences to obtain a reliable face attack detection model by using sufficient sample data for training.
[0090] For example, in one possible implementation, it is possible to extract at least one sample behavior set from a normal behavior sample sequence, wherein each sample behavior set includes at least two adjacent user operations, and any two adjacent user operations are different. In this way, by learning associated operation behaviors, it is possible to determine whether the current user's operation is a normal behavior based on the association between the current user's operation behavior and the next operation behavior. For example, the associated operation behaviors that users usually perform: log in first, then change the password, and finally pay; or log in first, then real-name authentication, and finally query, etc. In this way, by learning multiple consecutive operation behaviors of users in a normal behavior sequence, a specific algorithm can be used to calculate the probability of a normal user jumping from the current behavior to the next behavior, and then calculate the probability of multiple behaviors occurring. In this way, it is further possible to determine whether the current behavior is a normal behavior.
[0091] In addition, in a possible implementation, when learning the features of normal face scanning image sample sequences and normal behavior sample sequences, methods such as frequent pattern mining and hidden Markov models can be used to obtain them.
[0092] Case 3: Extracting basic statistical features of behavior sample sequences
[0093] The sample behavior sequence will record the relevant operation behavior information of the user before and after collecting the face information. For example, it may include the user information of the operations performed before and after collecting the face image, the device information of the operation, and the operation information performed by the user before and after collecting the user's face image. In this way, by extracting this information as behavior features to train the face attack detection model, the accuracy of face attack detection can be improved.
[0094] In addition, in a possible implementation, when obtaining the behavior sample sequence, the before and after operation sequences corresponding to each normal face scanning image sample sequence can be directly used as the normal behavior sample sequence, and the before and after operation sequences corresponding to each attack face scanning image sample sequence can be used as the attack behavior sample sequence.
[0095] Finally, in step 107, a face attack detection model is trained using at least one face scan image feature, at least one behavior feature, and the label of the sample sequence.
[0096] The process of training the face attack detection model may be aimed at minimizing the loss function. Specifically, based on the cross entropy loss function, the value of the loss function may be used for back propagation in each iteration to update the model parameters until the iteration stop condition is reached. The iteration stop condition may be, for example, when the loss function converges or the number of iterations reaches a preset number threshold.
[0097] like Figure 4 As shown, the embodiment of this specification also provides a face attack detection method, which may include the following steps:
[0098] Step 401: Obtain a face scan image sequence and a behavior sequence to be subjected to face attack detection;
[0099] Step 403: input the face scanning image sequence and the behavior sequence into the face attack detection model, and output the face attack detection result; wherein the face attack detection model is trained using the training method of the face attack detection model of any embodiment.
[0100] Since the sample sequence for training the face attack detection model includes not only the sample sequence of face scan images, but also the sample sequence of behavior operations performed by the user before and after each face image of the user is collected, this more comprehensively characterizes the user's behavior and improves the coverage of user operation features, thereby improving the accuracy of face attack detection when using the face attack detection model for face attack detection.
[0101] In a possible implementation, after step 401 and before step 403 of inputting the face scanning image sequence and the behavior sequence into the face attack detection model, the following steps may be further included:
[0102] Determine the confidence that the face-scanning image sequence appears in the pre-stored attack face-scanning image frequent item set; wherein the attack face-scanning image frequent item set is used to represent a set of sequences whose frequency of appearing in the attack face-scanning image sequence is much greater than that of appearing in the normal face-scanning image sequence;
[0103] Determining whether the confidence level is greater than a first preset threshold;
[0104] If so, the face attack detection result is a face attack behavior;
[0105] If not, the face scan image sequence and behavior sequence are input into the face attack detection model for face attack detection.
[0106] In this embodiment, before the acquired sequence is input into the face attack detection model, the confidence that the face image sequence appears in the pre-stored frequent item set of attack face images can be determined. If the confidence is greater than the first preset threshold, it means that the detection result of the face attack is a face attack behavior. If the confidence is less than the first preset threshold, the face image sequence and the behavior sequence are input into the face attack detection model for output detection. This method of using strategy and model comprehensive judgment can not only improve the efficiency of face attack detection, but also improve the accuracy of the detection results.
[0107] like Figure 5 As shown, the embodiment of this specification also provides a training device for a face attack detection model, including: a sample sequence acquisition module 501, a face image feature extraction module 502, a behavior feature extraction module 503 and a training module 504;
[0108] The sample sequence acquisition module 501 is configured to acquire a user's face scanning image sample sequence and a behavior sample sequence; wherein the face scanning image sample sequence is used to represent the time sequence of the user's face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent the time sequence of the user's operations performed before and after each collection of the user's face image;
[0109] The face recognition image feature extraction module 502 is configured to extract features from the face recognition image sample sequence acquired by the sample sequence acquisition module 501 to obtain at least one face recognition image feature;
[0110] The behavior feature extraction module 503 is configured to extract features from the behavior sample sequence acquired by the sample sequence acquisition module 501 to obtain at least one behavior feature;
[0111] The training module 504 is configured to train the face attack detection model using at least one face image feature obtained by the face image feature extraction module 502, at least one behavior feature obtained by the behavior feature extraction module 503, and the label of the sample sequence.
[0112] In a possible implementation, the face scanning image sample sequence includes a normal face scanning image sample sequence and an attack face scanning image sample sequence annotated with a label;
[0113] When extracting features from the face-scanning image sample sequence to obtain at least one face-scanning image feature, the face-scanning image feature extraction module 502 is configured to perform the following operations:
[0114] Extracting frequent item sets of the normal face scanning image sample sequence to obtain the normal face scanning image frequent item set; wherein the normal face scanning image frequent item set is used to represent a set of sequences whose frequency of appearing in the normal face scanning image sample sequence is much greater than that of appearing in the attack face scanning image sample sequence; and,
[0115] Frequent item sets of the attack face-swiping image sample sequence are extracted to obtain the attack face-swiping image frequent item set; wherein, the attack face-swiping image frequent item set is used to represent a set of sequences whose frequency of appearing in the attack face-swiping image sample sequence is much greater than that of appearing in the normal face-swiping image sample sequence.
[0116] In one possible implementation, when the face scanning image feature extraction module 502 performs feature extraction on a face scanning image sample sequence to obtain at least one face scanning image feature, it is configured to extract at least one of the user information corresponding to the face image, the device information for collecting the face image, and the user's face image information from the face scanning image sample sequence.
[0117] In a possible implementation, the behavior sample sequence includes a normal behavior sample sequence and an attack behavior sample sequence annotated with a label;
[0118] When extracting features from the behavior sample sequence to obtain at least one behavior feature, the behavior feature extraction module 503 is configured to perform the following operations:
[0119] Extracting frequent item sets of the normal behavior sample sequence to obtain the normal behavior frequent item set; wherein the normal behavior frequent item set is used to represent a set of sequences whose frequency of appearing in the normal behavior sample sequence is much greater than that of appearing in the attack behavior sample sequence; and,
[0120] Frequent item sets of the attack behavior sample sequence are extracted to obtain the attack behavior frequent item sets; wherein the attack behavior frequent item sets are used to represent a set of sequences whose frequency of appearing in the attack behavior sample sequence is much greater than that of appearing in the normal behavior sample sequence.
[0121] In a possible implementation, the behavior sample sequence includes a normal behavior sample sequence annotated with a label;
[0122] When the behavior feature extraction module 503 extracts features from the behavior sample sequence to obtain at least one behavior feature, it is configured to extract at least one sample behavior set from the normal behavior sample sequence; wherein each sample behavior set includes at least two adjacent user operations, and any two adjacent user operations are different.
[0123] In one possible implementation, when the behavior feature extraction module 503 extracts features from the behavior sample sequence to obtain at least one behavior feature, it is configured to extract at least one of the following from the behavior sample sequence: user information of the user who performs the operation before and after the facial image is collected, device information of the operation performed, and operation information performed by the user before and after the facial image of the user is collected.
[0124] like Figure 6 As shown, the embodiment of this specification also provides a face attack detection device, including: a sequence acquisition module 601 to be tested and a detection result output module 602;
[0125] The test sequence acquisition module 601 is configured to acquire a face scan image sequence and a behavior sequence to be subjected to face attack detection;
[0126] The detection result output module 602 is configured to input the face scanning image sequence and behavior sequence obtained by the sequence acquisition module 601 into the face attack detection model, and output the detection result of the face attack; wherein the face attack detection model is trained using the training device of any of the above-mentioned face attack detection models.
[0127] In a possible implementation, the face attack detection device further includes a strategy judgment module, which is used to perform the following operations before inputting the face image sequence and the behavior sequence into the face attack detection model:
[0128] Determine the confidence that the face-scanning image sequence appears in the pre-stored attack face-scanning image frequent item set; wherein the attack face-scanning image frequent item set is used to represent a set of sequences whose frequency of appearing in the attack face-scanning image sequence is much greater than that of appearing in the normal face-scanning image sequence;
[0129] Determining whether the confidence level is greater than a first preset threshold;
[0130] If so, the face attack detection result is a face attack behavior;
[0131] If not, the face scan image sequence and behavior sequence are input into the face attack detection model for face attack detection.
[0132] The present specification also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute a method in any one of the embodiments in the specification.
[0133] The present specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method in any one of the embodiments in the specification is implemented.
[0134] It is understood that the structure illustrated in the embodiments of this specification does not constitute a specific limitation on the training device for the face attack detection model and the detection device for face attack. In other embodiments of the specification, the training device for the face attack detection model and the detection device for face attack may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0135] The information interaction, execution process, etc. between the units in the above-mentioned device are based on the same concept as the method embodiments of this specification. For specific contents, please refer to the description in the method embodiments of this specification and will not be repeated here.
[0136] Those skilled in the art should be aware that in one or more of the above examples, the functions described in this specification can be implemented by hardware, software, widgets, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.
[0137] The specific implementation methods described above further illustrate the purpose, technical solutions and beneficial effects described in this specification. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.
Claims
1. The training method of the face attack detection model includes: Acquire a face-scanning image sample sequence and a behavior sample sequence of the user; wherein the face-scanning image sample sequence is used to represent the time sequence of the user's face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent the time sequence of the operations performed by the user before and after each collection of the user's face image; Performing feature extraction on the face scanning image sample sequence to obtain at least one face scanning image feature; Extracting features from the behavior sample sequence to obtain at least one behavior feature; Training the face attack detection model using the at least one face scan image feature, the at least one behavior feature, and the label of the sample sequence; Wherein, the face-swiping image sample sequence includes a normal face-swiping image sample sequence annotated with a label and an attack face-swiping image sample sequence annotated with a label; the feature extraction of the face-swiping image sample sequence to obtain at least one face-swiping image feature includes: extracting frequent item sets of the normal face-swiping image sample sequence to obtain a normal face-swiping image frequent item set; wherein, the normal face-swiping image frequent item set is used to represent a set of sequences whose frequency of appearing in the normal face-swiping image sample sequence is much greater than that in the attack face-swiping image sample sequence; and, extracting frequent item sets of the attack face-swiping image sample sequence to obtain an attack face-swiping image frequent item set; wherein, the attack face-swiping image frequent item set is used to represent a set of sequences whose frequency of appearing in the attack face-swiping image sample sequence is much greater than that in the normal face-swiping image sample sequence; and / or The behavior sample sequence includes a normal behavior sample sequence marked with a label and an attack behavior sample sequence marked with a label; the feature extraction of the behavior sample sequence to obtain at least one behavior feature includes: extracting frequent item sets of the normal behavior sample sequence to obtain normal behavior frequent item sets; wherein the normal behavior frequent item sets are used to represent a set of sequences that appear in normal behavior sample sequences with a frequency far greater than that in attack behavior sample sequences; and, extracting frequent item sets of the attack behavior sample sequence to obtain attack behavior frequent item sets; wherein the attack behavior frequent item sets are used to represent a set of sequences that appear in attack behavior sample sequences with a frequency far greater than that in normal behavior sample sequences.
2. The method according to claim 1, wherein: The behavior sample sequence includes a normal behavior sample sequence marked with a label; The extracting features from the behavior sample sequence to obtain at least one behavior feature includes: At least one sample behavior set is extracted from the normal behavior sample sequence; wherein each of the sample behavior sets includes at least two adjacent user operations, and any two adjacent user operations are different.
3. The method according to any one of claims 1 to 2, wherein: The step of extracting features from the face recognition image sample sequence to obtain at least one face recognition image feature comprises: Extracting at least one of user information corresponding to the face image, device information for collecting the face image, and face image information of the user from the face scanning image sample sequence; and / or, The extracting features from the behavior sample sequence to obtain at least one behavior feature includes: At least one of user information of the user who performs the operation before and after the facial image is collected, device information of the operation, and operation information performed by the user before and after the facial image of the user is collected is extracted from the behavior sample sequence.
4. Face attack detection method, including: Obtaining a face scan image sequence and a behavior sequence to be subjected to face attack detection; The face scanning image sequence and the behavior sequence are input into a face attack detection model, and a face attack detection result is output; wherein the face attack detection model is trained using the face attack detection model training method as described in any one of claims 1 to 3.
5. The method according to claim 4, wherein: Before inputting the face scanning image sequence and the behavior sequence into the face attack detection model, the method further includes: Determine the confidence that the face-scanning image sequence appears in a pre-stored frequent item set of attack face-scanning images; wherein the frequent item set of attack face-scanning images is used to represent a set of sequences whose frequency of appearance in the attack face-scanning image sequence is much greater than that in the normal face-scanning image sequence; Determining whether the confidence level is greater than a first preset threshold; If yes, then the face attack detection result is a face attack behavior; If not, the face scanning image sequence and the behavior sequence are input into the face attack detection model to perform face attack detection.
6. A training device for a face attack detection model, comprising: Sample sequence acquisition module, face image feature extraction module, behavior feature extraction module and training module; The sample sequence acquisition module is configured to acquire a user's face scanning image sample sequence and a behavior sample sequence; wherein the face scanning image sample sequence is used to represent a time sequence of user face images collected when the user scans his face at various time points, and the behavior sample sequence is used to represent a time sequence of operations performed by the user before and after each collection of the user's face image; The face-scanning image feature extraction module is configured to perform feature extraction on the face-scanning image sample sequence acquired by the sample sequence acquisition module to obtain at least one face-scanning image feature; The behavior feature extraction module is configured to extract features from the behavior sample sequence acquired by the sample sequence acquisition module to obtain at least one behavior feature; The training module is configured to train the face attack detection model by using the at least one face image feature obtained by the face image feature extraction module, the at least one behavior feature obtained by the behavior feature extraction module, and the label of the sample sequence; in, The face-swiping image sample sequence includes a normal face-swiping image sample sequence annotated with a label and an attack face-swiping image sample sequence annotated with a label; when the face-swiping image feature extraction module performs feature extraction on the face-swiping image sample sequence to obtain at least one face-swiping image feature, it is configured to perform the following operations: extract frequent item sets of the normal face-swiping image sample sequence to obtain a normal face-swiping image frequent item set; wherein the normal face-swiping image frequent item set is used to represent a set of sequences whose frequency of appearing in the normal face-swiping image sample sequence is much greater than that in the attack face-swiping image sample sequence; and, extract frequent item sets of the attack face-swiping image sample sequence to obtain a set of sequences whose frequency of appearing in the attack face-swiping image sample sequence is much greater than that in the normal face-swiping image sample sequence; and / or The behavior sample sequence includes a normal behavior sample sequence marked with a label and an attack behavior sample sequence marked with a label; when the behavior feature extraction module extracts features from the behavior sample sequence to obtain at least one behavior feature, it is configured to perform the following operations: extract frequent item sets from the normal behavior sample sequence to obtain normal behavior frequent item sets; wherein the normal behavior frequent item sets are used to represent a set of sequences that appear in the normal behavior sample sequence with a frequency far greater than that in the attack behavior sample sequence; and, extract frequent item sets from the attack behavior sample sequence to obtain attack behavior frequent item sets; wherein the attack behavior frequent item sets are used to represent a set of sequences that appear in the attack behavior sample sequence with a frequency far greater than that in the normal behavior sample sequence.
7. A face attack detection device, comprising: Test sequence acquisition module and test result output module; The test sequence acquisition module is configured to acquire a face scan image sequence and a behavior sequence to be subjected to face attack detection; The detection result output module is configured to input the face scanning image sequence and the behavior sequence acquired by the sequence acquisition module to be tested into a face attack detection model, and output the detection result of the face attack; wherein the face attack detection model is trained using the training device for the face attack detection model as described in claim 6.
8. A computing device, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
User attack detection method and device and electronic equipment
CN111062019A
