Method, apparatus, device and storage medium for liveness detection
By obtaining liveness detection commands and configuration parameters for identity verification, and using light interaction commands for light verification, the problems of long response time and false positives in liveness detection are solved, thus improving the accuracy and security of liveness detection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- FEIHU INTERACTIVE TECH BEIJING CO LTD
- Filing Date
- 2023-09-04
- Publication Date
- 2026-04-28
AI Technical Summary
Existing liveness detection technologies have excessively long response times, which can easily lead to the misidentification of pre-recorded data as real-time recorded data, resulting in low accuracy and security.
By obtaining the liveness detection method and configuration parameters corresponding to the liveness detection command, identity verification is performed, and a real-time verification value is generated. If the verification value is greater than or equal to a preset threshold, the light detection parameters are extracted to generate a light interaction command, and light verification is performed to generate a success or failure result.
It enables more objective and faster user authentication, improves the accuracy and security of liveness detection, and avoids misjudgment of user identity.
Smart Images

Figure CN117095470B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of facial recognition technology, and in particular to a method for liveness detection, a device for liveness detection, an electronic device, and a computer-readable storage medium. Background Technology
[0002] Liveness detection technology is mainly used to determine the true physiological characteristics of an object in some identity verification scenarios. Facial recognition technology is a commonly used and mature liveness detection technology. Facial recognition technology mainly uses the image acquisition device of the device to collect the user's image or video, and then identifies whether the facial features in the image or video belong to the user, thereby realizing the user's identity verification. In daily life, facial recognition technology has been widely used in payment, document processing and security scenarios.
[0003] However, traditional liveness detection systems primarily rely on features such as image quality, texture, and depth to determine if a living being is a real user. These features are relatively vulnerable to attack, potentially causing the system to mistakenly pass user authentication. This results in low accuracy and security for liveness detection technology. Furthermore, if liveness detection is required during business transactions, the large video data files recorded by the image acquisition device can prevent the system from quickly and promptly transmitting the video data to the verification backend, leading to excessively long response times. Additionally, the system may mistakenly identify pre-recorded videos or pre-captured images as real-time recorded user videos or real-time captured user images, further compromising the accuracy and security of liveness detection. Summary of the Invention
[0004] This application provides a method, apparatus, device, and storage medium for liveness detection, which can solve or partially solve the problems of excessively long response time and easy misidentification of pre-recorded data as real-time recorded data in current liveness detection technologies, resulting in low accuracy and security of liveness detection.
[0005] The first aspect of this application provides a method for liveness detection, comprising:
[0006] In response to a liveness detection command for a user, obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method;
[0007] The detection user is authenticated according to the liveness detection method and the configuration parameters to obtain a real-time verification value;
[0008] If the real-time verification value is greater than or equal to a preset threshold, then light detection parameters are extracted from the configuration parameters, and light interaction commands are generated using the light detection parameters.
[0009] The system performs light verification processing on the detected user according to the light interaction command, and generates and returns a detection success result or a detection failure result corresponding to the light interaction command.
[0010] Optionally, the liveness detection method includes one or more of face recognition, motion interaction, and light interaction methods. The configuration parameters include face detection parameters associated with the face recognition method, motion detection parameters associated with the motion interaction method, and light detection parameters associated with the light interaction method. Obtaining the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method includes:
[0011] Obtain one or more of the following methods: face recognition, action interaction, and light interaction, corresponding to the liveness detection command;
[0012] Obtain face detection parameters associated with the face recognition method, and / or motion detection parameters associated with the motion interaction method, and / or light detection parameters associated with the light interaction method.
[0013] Optionally, the face detection parameters include historical facial features and face recognition time, the identity verification process includes face verification processing, the real-time verification value includes a face verification value, and the step of performing identity verification processing on the detected user according to the liveness detection method and the configuration parameters to obtain the real-time verification value includes:
[0014] If the liveness detection method includes the face recognition method, then the current face image of the detected user within the face recognition time period is obtained;
[0015] The current face image is used to perform face verification processing on the detected user to obtain the current facial features of the detected user;
[0016] The face verification value is obtained by calculating the feature similarity between the current facial features and the historical facial features.
[0017] Optionally, the action detection parameters include an action set and action interaction time, the authentication processing includes action verification processing, the real-time verification value includes an action verification value, and the step of performing authentication processing on the detected user according to the liveness detection method and the configuration parameters to obtain the real-time verification value includes:
[0018] If the face verification value is greater than or equal to the preset face value, then the action set and the action interaction time are used to perform action verification processing on the detected user to obtain the current sequence frame image corresponding to the action verification processing;
[0019] The action similarity is calculated between the current sequence frame image and the preset sequence frame image to obtain the action verification value.
[0020] Optionally, the action set includes several first reference interaction actions, and the step of performing action verification processing on the detected user using the action set and the action interaction time to obtain the current sequence frame image corresponding to the action verification processing includes:
[0021] Obtain the image of the interactive action corresponding to the first reference interactive action performed by the detected user during the interaction time.
[0022] Arrange several interactive action images in the order of their generation time to obtain the current sequence frame image corresponding to the action verification process;
[0023] The first reference interaction action is used to instruct the detected user to move according to the motion trajectory of the first reference interaction action.
[0024] Optionally, the light detection parameters include a second reference interaction action, the number of light changes, the light color, and the light duration. If the real-time verification value is greater than or equal to a preset threshold, the light detection parameters are extracted from the configuration parameters, and a light interaction command is generated using the light detection parameters, including:
[0025] If the action verification value is greater than or equal to the preset threshold, then the number of light changes, the light color, and the light duration are extracted from the configuration parameters respectively.
[0026] The light interaction command is generated using the number of light changes, the light color, and the light duration.
[0027] The light interaction command is used to randomly issue at least one of the light colors and instruct the user to move according to the motion trajectory of the second reference interaction action.
[0028] Optionally, the step of performing light verification processing on the detected user according to the light interaction command, and generating and returning a detection success result or detection failure result corresponding to the light interaction command, includes:
[0029] Obtain the current environment image of the detected user corresponding to the color of the light during the duration of the light;
[0030] The current environment image is compared with a preset lighting image in terms of color value, and a detection success result or a detection failure result corresponding to the color value comparison process is generated and returned.
[0031] Optionally, the step of performing color value comparison processing between the current environment image and a preset lighting image, and generating and returning a detection success result or detection failure result corresponding to the color value comparison processing, includes:
[0032] The color values of the current environment image and the preset light image are compared to generate a light verification value corresponding to the current environment image.
[0033] If the light verification value is greater than or equal to the preset light value, then the real-time verification value and the light verification value are weighted and calculated to obtain the liveness detection value for the detected user;
[0034] If the liveness detection value is greater than or equal to the preset detection value, the detection success result is returned;
[0035] If the liveness detection value is less than the preset detection value, the detection failure result is returned.
[0036] Optionally, the method further includes:
[0037] When the terminal device used by the detected user experiences network communication abnormalities, the current facial image and historical contour information of the detected user are acquired.
[0038] The current face image is cropped and extracted to obtain the initial contour information of the detected user;
[0039] The initial contour information and historical contour information are compared to calculate the contour similarity to obtain the contour verification value, and the detection result corresponding to the contour verification value is output.
[0040] Optionally, the step of calculating the contour similarity between the initial contour information and the historical contour information to obtain the contour verification value, and outputting the detection result corresponding to the contour verification value, includes:
[0041] The initial contour information is subjected to size compression processing to generate target contour information;
[0042] The target contour information and the historical contour information are compared to calculate the contour similarity to obtain the contour verification value.
[0043] If the contour verification value is greater than or equal to the preset contour verification value, then the detection success result is returned;
[0044] If the contour verification value is less than the preset contour verification value, the detection failure result is returned.
[0045] A second aspect of this application provides a device for liveness detection, comprising:
[0046] The liveness detection command response module is used to respond to a liveness detection command for a user and obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method.
[0047] An authentication module is used to perform authentication processing on the detected user according to the liveness detection method and the configuration parameters, and obtain a real-time authentication value;
[0048] A light interaction command generation module is used to extract light detection parameters from the configuration parameters and generate light interaction commands using the light detection parameters if the real-time verification value is greater than or equal to a preset threshold.
[0049] The detection result generation module is used to perform light verification processing on the detection user according to the light interaction command, and generate and return the detection success result or detection failure result corresponding to the light interaction command.
[0050] A third aspect of this application provides an electronic device, comprising:
[0051] Processor; and
[0052] A memory that stores executable code, which, when executed by the processor, causes the processor to perform the method described above.
[0053] A fourth aspect of this application provides a computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method described above.
[0054] The technical solution provided in this application may include the following beneficial effects:
[0055] This application is capable of responding to a liveness detection command for a user, obtaining the liveness detection method corresponding to the command and the configuration parameters associated with it, then performing identity verification on the user based on the liveness detection method and configuration parameters to obtain a real-time verification value. If the real-time verification value is greater than or equal to a preset threshold, light detection parameters are extracted from the configuration parameters, and a light interaction command is generated using these parameters. Simultaneously, light verification is performed on the user based on the light interaction command, generating and returning a successful or failed detection result corresponding to the light interaction command. Thus, by obtaining the liveness detection method corresponding to the command and the configuration parameters associated with it, this application achieves... The system flexibly determines the liveness detection method based on actual needs using liveness detection commands, and accurately configures the parameters associated with the determined liveness detection method. It can also use these parameters to perform targeted identity verification on the detected user, quantifying the user's authenticity into a specific real-time verification value. This enables more objective and rapid user identity verification. Finally, when the real-time verification value is greater than or equal to a preset threshold, the system performs real-time light verification on the detected user using light interaction commands. This utilizes the physical properties of light to determine in real-time whether the detected user is a real biological entity, not only avoiding misidentification of user identity but also significantly improving the accuracy and security of liveness detection.
[0056] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0057] The above and other objects, features and advantages of this application will become more apparent from the following description of exemplary embodiments in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of this application.
[0058] Figure 1 This is a schematic flowchart illustrating a method for liveness detection according to an embodiment of this application;
[0059] Figure 2 This is another schematic flowchart illustrating a method for liveness detection as shown in an embodiment of this application;
[0060] Figure 3 This is a schematic diagram of the communication architecture of a liveness detection system shown in an embodiment of this application;
[0061] Figure 4 This is a data transmission schematic diagram of a liveness detection method shown in an embodiment of this application;
[0062] Figure 5 This is a schematic diagram of the structure of a liveness detection device shown in an embodiment of this application;
[0063] Figure 6 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application. Detailed Implementation
[0064] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While embodiments of this application are shown in the drawings, it should be understood that this application may be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to make this application more thorough and complete, and to fully convey the scope of this application to those skilled in the art.
[0065] The terminology used in this application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. The singular forms “a,” “the,” and “the” used in this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more of the associated listed items.
[0066] It should be understood that although the terms "first," "second," "third," etc., may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, without departing from the scope of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0067] With the continuous development of the information society, more and more businesses are linked to user information. Among them, the application of user information for user identification is the most widespread. For example, it is used in the financial field such as banking, securities, and insurance, or in the field of government affairs. When conducting liveness detection on users, multiple facial images of users can be collected to generate continuous image frames and uploaded to relevant platforms to verify the authenticity of user accounts used for business transactions. This ensures the security of user accounts to a certain extent, while reducing manual review, lowering review costs and business processing time.
[0068] However, current liveness detection methods are limited and cannot quickly process large amounts of video data, resulting in long response times, low accuracy, and low security.
[0069] To address the aforementioned issues, this application provides a method for liveness detection. This method can obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with that method. It allows for flexible determination of the liveness detection method based on actual needs, accurate configuration of the parameters associated with the determined liveness detection method, and targeted authentication of the detected user using these parameters. This quantifies the authenticity of the detected user's identity into a specific real-time verification value, enabling more objective and rapid user identity verification. Finally, when the real-time verification value is greater than or equal to a preset threshold, real-time light verification is performed on the detected user using a light interaction command. This utilizes the physical properties of light to determine in real-time whether the detected user is a real biological entity, not only avoiding misidentification of the user's identity but also significantly improving the accuracy and security of liveness detection.
[0070] The technical solutions of the embodiments of this application are described in detail below with reference to the accompanying drawings.
[0071] Figure 1 This is a schematic flowchart illustrating a method for liveness detection according to an embodiment of this application. See also... Figure 1 The method includes at least the following steps:
[0072] Step 101: In response to a liveness detection command for a user, obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method;
[0073] In this embodiment of the application, in response to a liveness detection command for a user, the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method can be obtained.
[0074] In a practical implementation, the liveness detection instruction can be an instruction to the liveness detection system to perform liveness detection on the user. The liveness detection method can be a specific method set in advance by relevant technical personnel to determine the user's true identity. The configuration parameters can be various parameters that need to be used in the liveness detection process, such as the liveness detection method being a face recognition method, and the configuration parameters associated with the face recognition method being the user's real face data, the duration of face recognition, etc.
[0075] Step 102: Perform identity verification on the detected user according to the liveness detection method and configuration parameters to obtain a real-time verification value;
[0076] In this embodiment, the user is authenticated using a liveness detection method and configuration parameters to obtain a real-time verification value.
[0077] In practical implementation, identity verification processing can be used to verify whether a user is a real biological entity and a real user. The real-time verification value can be a quantified value of the identity verification process. For example, during the identity verification process, the similarity comparison between the real-time collected user data and configuration parameters is quantified as the similarity between the data. The real-time verification value can be used to determine whether the user is a real user. The larger the real-time verification value, the greater the probability that the detected user is a real user. The smaller the real-time verification value, the less likely the detected user is a real user.
[0078] Step 103: If the real-time verification value is greater than or equal to the preset threshold, then extract the light detection parameters from the configuration parameters and use the light detection parameters to generate light interaction commands.
[0079] In this embodiment of the application, if the real-time verification value is greater than or equal to the preset threshold, it indicates that the identity of the detected user is highly credible after identity verification processing. Therefore, the detected user can be further verified by first extracting the light detection parameters from the configuration parameters, then using the light detection parameters to generate light interaction commands, and using the light interaction commands to perform more refined identity verification of the detected user.
[0080] In practical implementation, the preset threshold can be a value pre-set by relevant technical personnel based on the actual application scenario. These personnel can flexibly change the value of the preset threshold according to different application scenarios. It includes at least preset face values and preset action values. A larger preset threshold indicates a higher required liveness detection accuracy for the application scenario, while a smaller preset threshold indicates a lower required liveness detection accuracy. For example, the preset threshold in an electronic door lock scenario can be smaller than the preset threshold in a government affairs processing scenario. Light detection parameters can be various parameters involved in light verification processing, such as the color of the light used in the light verification process, the duration of the light, etc. Light interaction commands can be instructions to interact with the detection user in real time by issuing at least one light color.
[0081] Step 104: Perform light verification processing on the detected user according to the light interaction command, generate and return the detection success result or detection failure result corresponding to the light interaction command.
[0082] In this embodiment, the detection user can be subjected to light verification processing according to the light interaction command, and a detection success result or detection failure result corresponding to the light interaction command can be generated and returned.
[0083] In a specific implementation, ray verification processing can be used to detect whether a user is a real biological entity. A successful detection result is that the user is both a real user and a real biological entity, while a failed detection result is that the user is neither a real user nor a real biological entity.
[0084] The embodiments provided in this application quantify the identity verification process into real-time verification values, thereby concretizing the abstract process and enabling a more objective judgment of the identity of the detected user, improving the accuracy of liveness detection. At the same time, by performing light verification processing on the detected user when the real-time verification value is greater than or equal to a preset threshold, it avoids performing light verification processing on the detected user when the detected user is obviously not a real user (real-time verification value is less than the preset threshold), which would increase the number of steps and detection time in liveness detection. On the other hand, by combining light verification processing with other identity verification processes, it is possible to further determine whether the detected user is a real biological entity, greatly improving the security of liveness detection.
[0085] Furthermore, it should be noted that all user data involved in this application was obtained with the user's permission and under the premise that the data is legal.
[0086] Figure 2 This is a flowchart illustrating a method for liveness detection according to another embodiment of this application. Figure 2 relatively Figure 1 The technical solution of the embodiments of this application is described in more detail. The method may include the following steps:
[0087] Step 201: In response to a liveness detection command for a user, obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method;
[0088] In this embodiment of the application, in response to a liveness detection command for a detected user, one or more of a face recognition method, an action interaction method, and a light interaction method can be obtained, along with face detection parameters associated with the face recognition method, and / or action detection parameters associated with the action interaction method, and / or light detection parameters associated with the light interaction method.
[0089] Optionally, the liveness detection method may include one or a combination of face recognition, motion interaction, and light interaction. For example, the liveness detection method may be face recognition, motion interaction, or light interaction alone, each of which can work independently to expand the range of applicable scenarios. It may also be a combination of face recognition and motion interaction, or a combination of face recognition, motion interaction, and light interaction, etc., to adapt to scenarios with higher accuracy in detecting user identity.
[0090] Among them, the facial recognition method can determine whether the detected user is a real user by comparing the current facial features of the detected user on the image acquisition interface with the facial features uploaded by the real user in the past. The action interaction method can determine whether the detected user is a real user by comparing the head movement image of the detected user on the image acquisition interface with the movement trajectory of the pre-set reference motion image. For example, it can identify the number of times the detected user opens their mouth and the reference number of times they open their mouth, the direction of the detected user's head turning and the reference direction of the head turning, and the magnitude of the detected user's head tilt and the reference magnitude of the head tilt. The light interaction method can determine whether the detected user is a real user by comparing the color value difference between the light information of the detected user on the acquisition interface collected in real time by the terminal device and the actual emitted light information.
[0091] Face detection parameters can be the data used for face recognition, which at least include historical facial features and face recognition time. Historical facial features are sensory features extracted from facial images uploaded by real users in the past, such as the shape, size, and position of the eyes. Face recognition time is the time for a single face recognition operation.
[0092] Action detection parameters can be data used during action interaction, including at least an action set and action interaction time. The action set is a collection of several first reference interaction actions, which are arranged in a set order. During action verification, these actions are issued one by one in the arranged order and displayed on the front-end interface of the liveness detection system. This is mainly used to instruct the user to move in real time according to each first reference interaction action. The action interaction time can be the duration or display time of each first reference interaction action. For example, the first reference interaction action can be: first step: head moves to the right, second step: mouth opens twice, third step: blinks three times, etc. The action interaction time of each first reference interaction action is two seconds.
[0093] The light detection parameters can be the data used when performing light interaction. They include at least the number of light changes, the light color, and the light duration. The number of light changes can be the number of times the light color changes in a single light interaction detection. The light duration can be the dwell time of each type of light. For example, the light color includes red, yellow, and blue, the number of light changes is three, and the light duration is three seconds for each.
[0094] Reference Figure 3 , Figure 3This is a schematic diagram of the communication architecture of a liveness detection system according to an embodiment of this application. The liveness detection system includes at least a terminal device, a liveness detection front-end component, a liveness detection back-end service, and a liveness detection backend. The terminal device can be a PC (Personal Computer) or a mobile terminal. The detection user can access the system login interface provided by the liveness detection front-end component through the PC or mobile terminal. After successful login, the terminal device can generate a liveness detection command and send it to the liveness detection back-end service. The liveness detection back-end service responds to the liveness detection command, selects the corresponding liveness detection mode and the configuration parameters associated with the liveness detection mode, and notifies the liveness detection backend to start the detection work. After the detection work is completed, the detection backend can also feed back the detection results and related information to the liveness detection front-end component for display.
[0095] As an example, when the liveness detection backend service receives a liveness detection command from the terminal device, it can first perform a compatibility test on the terminal device. If the terminal device is compatible with the liveness detection system, the liveness detection process is officially started, and the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method are obtained. If the terminal device is incompatible with the liveness detection system, the liveness detection process is directly terminated, a compatibility test failure message is returned, and the message is displayed through the liveness detection frontend component.
[0096] Step 202: Perform identity verification on the detected user according to the liveness detection method and configuration parameters to obtain a real-time verification value;
[0097] In this embodiment of the application, the liveness detection backend service can divide the identity verification process into face verification processing and action verification processing according to the liveness detection method. The liveness detection backend can perform face verification processing and / or action verification processing on the detected user according to the configuration parameters, thereby obtaining the real-time verification value.
[0098] Optionally, the face verification process refers to first acquiring several face images captured in real time by an image acquisition device, and then extracting the facial features of the detected user from these images. The action verification process refers to first acquiring head movement video recorded in real time by an image acquisition device, then splitting it into individual motion images according to motion time or motion trajectory, and combining them into a sequence of frame images. Real-time verification values include face verification values and action verification values. The face verification value is the value generated after calculating the feature similarity between the detected user's facial features and historical facial features, while the action verification value is the value generated after calculating the action similarity between the detected user's sequence of frame images and a preset sequence of frame images.
[0099] In one example of this application, if the liveness detection method includes face recognition, the liveness detection backend service determines that the identity verification process includes face verification. The liveness detection backend can then obtain the current face image of the detected user within the face recognition time, and then use the current face image to perform face verification processing on the detected user to obtain the current facial features of the detected user. The current facial features are then compared with historical facial features to calculate the feature similarity, thereby obtaining the face verification value for the detected user.
[0100] In another example of this application, if the liveness detection method includes an action interaction method, the liveness detection backend service determines that the identity verification process includes action verification processing. At the same time, if the face verification value is greater than or equal to the preset face value, the liveness detection backend can use the action set and action interaction time to perform action verification processing on the detected user, obtain the current sequence frame image corresponding to the action verification processing, and calculate the action similarity between the current sequence frame image and the preset sequence frame image to obtain the action verification value.
[0101] In its implementation, the liveness detection backend can obtain images of interactive actions performed by the detected user during the interaction time corresponding to the first reference interactive action. Then, it arranges several interactive action images according to their generation time to obtain the current sequence frame images corresponding to the action verification process. The first reference interactive action is used to instruct the detected user to move according to the motion trajectory of the reference interactive action. By comparing the timestamps of consecutive image frames, it can avoid related liveness detection pre-recording evasion attacks.
[0102] Specifically, the current sequence frame image refers to the photo captured in real time at regular intervals, while the preset sequence frame image refers to the photo corresponding to the first reference interaction action.
[0103] As an example, the terminal device notifies the liveness detection backend to start the detection process via a liveness detection command. The liveness detection backend issues configuration parameters for face recognition, action interaction, and light interaction methods. The terminal device first starts the face recognition detection function according to the obtained face detection parameters, calls its own camera to capture the current face image of the user, and sends it to the liveness detection backend for feature similarity calculation. It then returns a face verification value. When the face verification value is greater than or equal to a preset face value, the action interaction detection function can be started. The liveness detection frontend component displays a first reference interaction action and prompts the user to move according to the movement trajectory of the first reference interaction action. The terminal device can also call its own camera to capture several images of the user's movement, generate the current sequence frame image according to the user's movement trajectory or movement time, and then send the current sequence frame image to the liveness detection backend for action comparison processing, returning an action verification value.
[0104] Step 203: If the real-time verification value is greater than or equal to the preset threshold, then extract the light detection parameters from the configuration parameters and use the light detection parameters to generate light interaction commands.
[0105] In this embodiment of the application, if the action verification value is greater than or equal to a preset threshold, the second reference interaction action, the number of light changes, the light color, and the light duration are extracted from the configuration parameters respectively. Then, the number of light changes, the light color, and the light duration are used to generate a light interaction instruction. The light interaction instruction is used to randomly issue at least one light color and instruct the user to move according to the movement trajectory of the second reference interaction action.
[0106] It should be noted that the difference between the second reference interaction action and the first reference interaction action is that the first reference interaction action is used in the liveness detection method of motion interaction, while the second reference interaction action is used in the liveness detection method of light interaction. When performing light verification, the second reference interaction action can also be issued one by one in the arranged order and displayed on the front-end interface of the liveness detection system to instruct the detected user to move in real time according to each second reference interaction action in a random lighting environment.
[0107] Step 204: Perform light verification processing on the detected user according to the light interaction command, generate and return the detection success result or detection failure result corresponding to the light interaction command;
[0108] In this embodiment, after the liveness detection backend generates the light interaction command, it can send the light interaction command to the terminal device. When the terminal device receives the light interaction command, it can start the video recording function to obtain video data of the user performing the movement corresponding to the second reference interaction action under different lighting environments. Then, it extracts the current environment image of the user and the light color during the light duration from the video data. Finally, it performs color value comparison processing between the current environment image and the preset light image to generate and return the detection success result or detection failure result corresponding to the color value comparison processing.
[0109] Optionally, the current environment image includes at least the user's face, occlusion areas, registration, human pose, lighting, and timestamp information of the generated image, etc., and this data is compressed and uploaded to the liveness detection backend. In the specific implementation, the current environment image is compared with a preset lighting image to generate a lighting verification value corresponding to the current environment image. If the lighting verification value is greater than or equal to the preset lighting value, the real-time verification value and the lighting verification value are weighted and calculated to obtain the liveness detection value for the user. If the liveness detection value is greater than or equal to the preset detection value, a detection success result is returned; if the liveness detection value is less than the preset detection value, a detection failure result is returned.
[0110] Optionally, the light verification value is used to characterize the color similarity between the current lighting environment of the user and the randomly distributed light. The preset light value can be the light similarity that relevant technicians set in advance based on the corresponding application scenario.
[0111] Specifically, if the liveness detection simultaneously satisfies three quantitative relationships: the face verification value generated during face recognition detection is greater than or equal to the preset face value, the action verification value generated during action interaction detection is greater than or equal to the preset action value, and the light verification value generated during light interaction detection is greater than or equal to the preset light value, then the pre-set face weight coefficient multiplied by the face verification value, the pre-set action weight coefficient multiplied by the action verification value, and the pre-set light weight coefficient multiplied by the light verification value can be used. Finally, the weighted scores are summed to obtain the liveness detection value for the detected user.
[0112] As an example, if the color values of the current environment image are the same or similar to those of the preset lighting image, it means that the lighting environment in which the user is currently located is the same or highly similar to the emitted lighting. In this case, the real-time verification value and the lighting verification value can be weighted and calculated to obtain the liveness detection value for the user. If the liveness detection value is greater than or equal to the preset detection value, a successful detection result is returned. If the liveness detection value is less than the preset detection value, a failed detection result and the reason for the failure are returned. The liveness detection value is used to further determine whether the detection result is a successful or failed result, thereby greatly improving the accuracy of liveness detection.
[0113] Step 205: If the real-time verification value is less than the preset threshold, a detection failure result is generated and returned.
[0114] In this embodiment, if the face verification value generated during face recognition detection is less than the preset face value, or the action verification value generated during action interaction detection is less than the preset action value, it indicates that the image captured by the image acquisition device or the video recorded is a pre-captured image or pre-recorded video, and the detected user is not a real biological entity. Therefore, the detection failure result is returned directly without subsequent light verification processing, thereby avoiding unnecessary detection steps, simplifying the liveness detection process, saving liveness detection time, and improving liveness detection efficiency.
[0115] Furthermore, as an example of this application, when a network communication anomaly is detected in the terminal device used by the user, the current face image and historical contour information of the user can be obtained. The current face image can be cropped and extracted to obtain the initial contour information of the user. The contour similarity between the initial contour information and the historical contour information is calculated to obtain the contour verification value, and the detection result corresponding to the contour verification value is output.
[0116] In the specific implementation, the initial contour information can be compressed in size first, and then the target contour information can be generated. The contour similarity between the target contour information and the historical contour information can be calculated to obtain the contour verification value. If the contour verification value is greater than or equal to the preset contour verification value, the detection success result is returned. If the contour verification value is less than the preset contour verification value, the detection failure result is returned.
[0117] Specifically, network communication anomalies include situations where the terminal device is in a weak network environment, has a poor network signal, or is in a misconfigured intranet environment. Contour information can be information about the detected user's facial shape extracted or cropped using algorithms. The specific algorithm for extracting contour information can be adapted based on the features of the contour point set. Size compression processing involves compressing the contour information to a specified pixel size, such as compressing the initial contour information to 64x64, 128x128, or 256x256 pixels. The contour verification value is the result of comparing the cropped and compressed image with pre-set contour information.
[0118] As another example of this application, the number of detections for face recognition, action interaction, and light interaction in the liveness detection method can be configured as needed, and this application does not limit the specific number of detections.
[0119] Reference Figure 4 , Figure 4This is a data transmission diagram illustrating a liveness detection method according to an embodiment of this application. A user logs into the liveness detection system via a PC or mobile device. Before logging in, a compatibility test is performed on the user's device. If the compatibility test passes, the liveness detection backend service obtains the configuration parameters generated by the liveness detection backend for this liveness detection. The device terminal notifies the liveness detection backend to begin detection. The liveness detection backend issues configuration descriptions for face recognition, motion interaction, and light interaction for the detected user. The device terminal obtains the corresponding configuration parameters from the liveness detection backend service, opens the high-definition camera, and captures face images in real time according to the face recognition configuration parameters. These face images are then sent to the liveness detection backend for detection, which returns a face verification value for face recognition. When the face verification value is greater than or equal to a preset face value, motion interaction detection is initiated. The high-definition camera captures a sequence of frames showing the user's movements, and these frames are sent to the liveness detection backend, which again returns the motion verification value. When the action verification value is greater than or equal to the preset lighting value, light interaction detection is activated. The liveness detection backend randomly sends out several colors of light, and simultaneously requires the device terminal to change the lighting according to a preset number of times. Then, the high-definition camera acquires images or videos of the user performing the specified action under different lighting conditions. The device terminal can also calculate the duration of the lighting change to obtain the sequence of images acquired by the device terminal in the current state. The above steps are repeated several times, the number of times is configurable. The liveness detection backend can compare the multiple randomly sent color verification images with the lighting environment images in the returned sequence frame images and return the lighting verification value. Finally, the face verification value, action verification value, and lighting verification value are weighted and calculated using preset weight coefficients to obtain the final similarity. If the similarity is less than the threshold, the result of detection failure and the reason are returned; if the similarity is greater than or equal to the threshold, the result of detection success is returned.
[0120] This application embodiment can achieve the following: by obtaining the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method, the liveness detection method can be flexibly determined according to actual needs through the liveness detection command, and the configuration parameters associated with the determined liveness detection method can be accurately configured. At the same time, the configuration parameters can be used to perform identity verification processing on the detected user in a targeted manner, so as to quantify the authenticity of the detected user's identity into a specific real-time verification value, thereby achieving more objective and faster verification of user identity. Finally, when the real-time verification value is greater than or equal to a preset threshold, the detected user is subjected to real-time light verification processing through light interaction command, thereby realizing the real-time determination of whether the detected user is a real biological body by utilizing the physical properties of light. This not only avoids the situation of misjudging the user's identity, but also greatly improves the accuracy and security of liveness detection.
[0121] Corresponding to the aforementioned application function implementation method embodiments, this application also provides a liveness detection device, electronic device, and corresponding embodiments.
[0122] Figure 5 This is a schematic diagram of a liveness detection device according to an embodiment of this application. See also... Figure 5 The device includes at least the following modules:
[0123] The liveness detection command response module 501 is used to respond to a liveness detection command for a detection user, and to obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method.
[0124] The identity verification module 502 is used to perform identity verification processing on the detected user according to the liveness detection method and configuration parameters, and obtain a real-time verification value.
[0125] The light interaction command generation module 503 is used to extract light detection parameters from the configuration parameters and generate light interaction commands using the light detection parameters if the real-time verification value is greater than or equal to a preset threshold.
[0126] The detection result generation module 504 is used to perform light verification processing on the detection user according to the light interaction command, and generate and return the detection success result or detection failure result corresponding to the light interaction command.
[0127] In some embodiments, the liveness detection method includes one or more of face recognition, motion interaction, and light interaction methods. The configuration parameters include face detection parameters associated with the face recognition method, motion detection parameters associated with the motion interaction method, and light detection parameters associated with the light interaction method. The liveness detection command response module 501 is specifically used for:
[0128] Obtain one or more of the following methods corresponding to the liveness detection command: face recognition method, motion interaction method, and light interaction method;
[0129] Obtain face detection parameters associated with the face recognition method, and / or motion detection parameters associated with the motion interaction method, and / or light detection parameters associated with the light interaction method.
[0130] In some embodiments, the face detection parameters include historical facial features and face recognition time, the identity verification process includes face verification processing, the real-time verification value includes a face verification value, and the identity verification module 502 includes:
[0131] The face recognition submodule is used to obtain the current face image of the detected user within the face recognition time if the liveness detection method includes face recognition.
[0132] The facial feature acquisition submodule is used to perform facial verification processing on the detected user using the current facial image to obtain the current facial features of the detected user;
[0133] The face verification value generation submodule is used to calculate the feature similarity between the current facial features and historical facial features to obtain the face verification value.
[0134] In some embodiments, the action detection parameters include a set of actions and an action interaction time, the authentication processing includes action verification processing, the real-time verification value includes an action verification value, and the authentication module 502 specifically includes:
[0135] The action verification submodule is used to perform action verification processing on the detected user using an action set and action interaction time if the face verification value is greater than or equal to the preset face value, and obtain the current sequence frame image corresponding to the action verification processing.
[0136] The action verification value generation submodule is used to calculate the action similarity between the current sequence frame image and the preset sequence frame image to obtain the action verification value.
[0137] In some embodiments, the action set includes several first reference interaction actions, and the action verification submodule is specifically used for:
[0138] Acquire images of interactive actions performed by the detected user during the interaction time that correspond to the first reference interactive action;
[0139] Arrange several interactive action images in the order of their generation time to obtain the current sequence frame image corresponding to the action verification process;
[0140] The first reference interaction action is used to instruct the detected user to move according to the motion trajectory of the first reference interaction action.
[0141] In some embodiments, the light detection parameters include a second reference interaction action, the number of light changes, the light color, and the light duration. The light interaction instruction generation module is specifically used for:
[0142] If the action verification value is greater than or equal to the preset threshold, then extract the number of light changes, light color, and light duration from the configuration parameters respectively;
[0143] Light interaction commands are generated using the number of light changes, light color, and light duration.
[0144] Among them, the light interaction command is used to randomly issue at least one light color and instruct the user to move according to the motion trajectory of the second reference interaction action.
[0145] In some embodiments, the detection result generation module 504 includes:
[0146] The current environment image acquisition submodule is used to acquire the current environment image of the detected user corresponding to the color of the light during the duration of the light;
[0147] The detection result generation submodule is used to perform color value comparison processing between the current environment image and the preset lighting image, and generate and return the detection success result or detection failure result corresponding to the color value comparison processing.
[0148] In some embodiments, the detection result generation submodule is specifically used for:
[0149] The color values of the current environment image and the preset light image are compared to generate a light verification value corresponding to the current environment image.
[0150] If the light verification value is greater than or equal to the preset light value, the real-time verification value and the light verification value are weighted and calculated to obtain the liveness detection value for the detection user.
[0151] If the liveness detection value is greater than or equal to the preset detection value, a successful detection result will be returned.
[0152] If the liveness detection value is less than the preset detection value, a detection failure result will be returned.
[0153] In some embodiments, the apparatus further includes:
[0154] The network communication anomaly module is used to obtain the current facial image and historical contour information of the detected user when a network communication anomaly is detected in the terminal device used by the user.
[0155] The initial contour information module is used to crop and extract the current face image to obtain the initial contour information of the detected user;
[0156] The contour verification value module is used to calculate the contour similarity between the initial contour information and the historical contour information, obtain the contour verification value, and output the detection result corresponding to the contour verification value.
[0157] In some embodiments, the contour verification value module is specifically used for:
[0158] The initial contour information is dimensionally compressed to generate the target contour information;
[0159] The contour similarity between the target contour information and historical contour information is calculated to obtain the contour verification value.
[0160] If the contour verification value is greater than or equal to the preset contour verification value, a successful detection result is returned.
[0161] If the contour verification value is less than the preset contour verification value, a detection failure result is returned.
[0162] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated further here.
[0163] Figure 6 This is a schematic diagram of the structure of an electronic device shown in an embodiment of this application.
[0164] See Figure 6 The electronic device 600 includes a memory 610 and a processor 620.
[0165] The processor 620 can be a Central Processing Unit (CPU), or 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, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0166] Memory 610 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. ROM may store static data or instructions required by the processor 620 or other modules of the computer. Permanent storage devices may be read-write storage devices. Permanent storage devices may be non-volatile storage devices that retain stored instructions and data even when the computer is powered off. In some embodiments, permanent storage devices use mass storage devices (e.g., magnetic or optical disks, flash memory) as permanent storage devices. In other embodiments, permanent storage devices may be removable storage devices (e.g., floppy disks, optical drives). System memory may be a read-write storage device or a volatile read-write storage device, such as dynamic random access memory. System memory may store some or all of the instructions and data required by the processor during operation. Furthermore, memory 610 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, memory 610 may include a removable storage device that is readable and / or writable, such as a laser disc (CD), a read-only digital multifunction optical disc (e.g., DVD-ROM, dual-layer DVD-ROM), a read-only Blu-ray disc, an ultra-high density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not contain carrier waves or transient electronic signals transmitted wirelessly or via wired connections.
[0167] The memory 610 stores executable code, which, when processed by the processor 620, can cause the processor 620 to execute part or all of the methods described above.
[0168] Furthermore, the method according to this application can also be implemented as a computer program or computer program product, which includes computer program code instructions for performing some or all of the steps in the method described above.
[0169] Alternatively, this application may be implemented as a computer-readable storage medium (or a non-transitory machine-readable storage medium or a machine-readable storage medium) storing executable code (or computer program or computer instruction code) thereon, which, when executed by a processor of an electronic device (or server, etc.), causes the processor to perform part or all of the steps of the methods described above according to this application.
[0170] The various embodiments of this application have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen to best explain the principles, practical application, or improvement of the technology in the market, or to enable others skilled in the art to understand the embodiments disclosed herein.
Claims
1. A method for detecting liveness, characterized in that, include: In response to a liveness detection command for a user, obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method; The detection user is authenticated according to the liveness detection method and the configuration parameters to obtain a real-time verification value; If the real-time verification value is greater than or equal to a preset threshold, then light detection parameters are extracted from the configuration parameters, and light interaction commands are generated using the light detection parameters. The detection user is subjected to light verification processing according to the light interaction command, and a detection success result or detection failure result corresponding to the light interaction command is generated and returned. The liveness detection method includes one or more of face recognition, motion interaction, and light interaction methods. The configuration parameters include face detection parameters associated with the face recognition method, motion detection parameters associated with the motion interaction method, and light detection parameters associated with the light interaction method. Obtaining the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method includes: Obtain one or more of the following methods: face recognition, action interaction, and light interaction, corresponding to the liveness detection command; Obtain face detection parameters associated with the face recognition method, and / or motion detection parameters associated with the motion interaction method, and / or light detection parameters associated with the light interaction method; If the liveness detection method simultaneously satisfies face recognition, action interaction, and light interaction, the weighted scores are calculated by multiplying the face verification value by a preset face weight coefficient, the action verification value by a preset action weight coefficient, and the light verification value by a preset light weight coefficient. The scores are then summed to obtain the liveness detection value for the detected user.
2. The method according to claim 1, characterized in that, The face detection parameters include historical facial features and face recognition time; the identity verification process includes face verification processing; the real-time verification value includes a face verification value; and the step of performing identity verification processing on the detected user according to the liveness detection method and the configuration parameters to obtain the real-time verification value includes: If the liveness detection method includes the face recognition method, then the current face image of the detected user within the face recognition time period is obtained; The current face image is used to perform face verification processing on the detected user to obtain the current facial features of the detected user; The face verification value is obtained by calculating the feature similarity between the current facial features and the historical facial features.
3. The method according to claim 2, characterized in that, The action detection parameters include an action set and action interaction time; the identity verification process includes action verification processing; the real-time verification value includes an action verification value; and the step of performing identity verification processing on the detected user according to the liveness detection method and the configuration parameters to obtain the real-time verification value includes: If the face verification value is greater than or equal to the preset face value, then the action set and the action interaction time are used to perform action verification processing on the detected user to obtain the current sequence frame image corresponding to the action verification processing; The action similarity is calculated between the current sequence frame image and the preset sequence frame image to obtain the action verification value.
4. The method according to claim 3, characterized in that, The action set includes several first reference interaction actions. The step of performing action verification processing on the detected user using the action set and the action interaction time to obtain the current sequence frame image corresponding to the action verification processing includes: Obtain the image of the interactive action corresponding to the first reference interactive action performed by the detected user during the interaction time. Arrange several interactive action images in the order of their generation time to obtain the current sequence frame image corresponding to the action verification process; The first reference interaction action is used to instruct the detected user to move according to the motion trajectory of the first reference interaction action.
5. The method according to claim 3, characterized in that, The light detection parameters include a second reference interaction action, the number of light changes, the light color, and the light duration. If the real-time verification value is greater than or equal to a preset threshold, the light detection parameters are extracted from the configuration parameters, and a light interaction command is generated using the light detection parameters, including: If the action verification value is greater than or equal to the preset threshold, then the number of light changes, the light color, and the light duration are extracted from the configuration parameters respectively. The light interaction command is generated using the number of light changes, the light color, and the light duration. The light interaction command is used to randomly issue at least one of the light colors and instruct the user to move according to the motion trajectory of the second reference interaction action.
6. The method according to claim 5, characterized in that, The step of performing light verification processing on the detected user according to the light interaction command, and generating and returning a detection success result or detection failure result corresponding to the light interaction command, includes: Obtain the current environment image of the detected user corresponding to the color of the light during the duration of the light; The current environment image is compared with a preset lighting image in terms of color value, and a detection success result or a detection failure result corresponding to the color value comparison process is generated and returned.
7. The method according to claim 6, characterized in that, The step of performing color value comparison processing between the current environment image and a preset lighting image, and generating and returning a detection success result or detection failure result corresponding to the color value comparison processing, includes: The color values of the current environment image and the preset light image are compared to generate a light verification value corresponding to the current environment image. If the light verification value is greater than or equal to the preset light value, then the real-time verification value and the light verification value are weighted and calculated to obtain the liveness detection value for the detected user; If the liveness detection value is greater than or equal to the preset detection value, the detection success result is returned; If the liveness detection value is less than the preset detection value, the detection failure result is returned.
8. The method according to claim 1, characterized in that, The method further includes: When the terminal device used by the detected user experiences network communication abnormalities, the current facial image and historical contour information of the detected user are acquired. The current face image is cropped and extracted to obtain the initial contour information of the detected user; The initial contour information and historical contour information are compared to calculate the contour similarity to obtain the contour verification value, and the detection result corresponding to the contour verification value is output.
9. The method according to claim 8, characterized in that, The step of calculating the contour similarity between the initial contour information and the historical contour information to obtain the contour verification value, and outputting the detection result corresponding to the contour verification value, includes: The initial contour information is subjected to size compression processing to generate target contour information; The target contour information and the historical contour information are compared to calculate the contour similarity to obtain the contour verification value. If the contour verification value is greater than or equal to the preset contour verification value, then the detection success result is returned; If the contour verification value is less than the preset contour verification value, the detection failure result is returned.
10. A device for detecting liveness, characterized in that, The device includes: The liveness detection command response module is used to respond to a liveness detection command for a user and obtain the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method. An authentication module is used to perform authentication processing on the detected user according to the liveness detection method and the configuration parameters, and obtain a real-time authentication value; A light interaction command generation module is used to extract light detection parameters from the configuration parameters and generate light interaction commands using the light detection parameters if the real-time verification value is greater than or equal to a preset threshold. The detection result generation module is used to perform light verification processing on the detection user according to the light interaction command, and generate and return the detection success result or detection failure result corresponding to the light interaction command. The liveness detection method includes one or more of face recognition, motion interaction, and light interaction methods. The configuration parameters include face detection parameters associated with the face recognition method, motion detection parameters associated with the motion interaction method, and light detection parameters associated with the light interaction method. Obtaining the liveness detection method corresponding to the liveness detection command and the configuration parameters associated with the liveness detection method includes: Obtain one or more of the following methods: face recognition, action interaction, and light interaction, corresponding to the liveness detection command; Obtain face detection parameters associated with the face recognition method, and / or motion detection parameters associated with the motion interaction method, and / or light detection parameters associated with the light interaction method; If the liveness detection method simultaneously satisfies face recognition, action interaction, and light interaction, the weighted scores are calculated by multiplying the face verification value by a preset face weight coefficient, the action verification value by a preset action weight coefficient, and the light verification value by a preset light weight coefficient. The scores are then summed to obtain the liveness detection value for the detected user.
11. An electronic device, characterized in that, include: processor; as well as A memory having executable code stored thereon, which, when executed by the processor, causes the processor to perform the method as described in any one of claims 1-9.
12. A computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to perform the method as described in any one of claims 1-9.
Citation Information
Patent Citations
Bio-assay method and device and computer readable storage medium
CN107832712A
Living body detection method and device, electronic equipment and computer readable storage medium
CN112528909A