Injection attack identification method and device for liveness detection
By comparing the similarity of multiple images to be detected taken by electronic devices based on different camera parameters, identifying and defending against injection attacks, the problem of difficult to identify injection attacks in the prior art is solved, and the security of the live detection system is improved.
Patent Information
- Application Number
- CN202111152676.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-29
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2041-09-29
AI Technical Summary
The prior art is difficult to effectively identify and defend against injected attacks against live detection systems. The attacker replaces the video images collected by the camera, resulting in live detection systems being deceived, resulting in user privacy data leakage and resources being stolen.
By acquiring multiple images to be detected taken by the electronic device according to the values taken by different camera parameters, comparing the similarity of these images, it is determined to be a living image if it is not similar, and if it is similar, it is determined to be an injection attack image.
The accuracy of the identification of injection attacks by the live detection system is improved, and the attacker prevents the live detection by replacing video images, enhancing the security of the system.
Smart Images

Figure CN113850214B_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer technology, and in particular, to a method and device for identifying injection attacks for liveness detection. Background Art
[0002] Face recognition is being applied to more and more scenarios, such as electronic payment and device unlocking, due to its convenient and fast operation. As an important technology supporting face recognition, liveness detection plays an important role in distinguishing the authenticity of images, resisting spoofing attacks, and protecting the security of the entire face recognition system. Injection attacks that replace video images captured by cameras with pre-recorded video images are a common attack method against liveness detection. Summary of the invention
[0003] In view of this, one or more embodiments of the present specification provide a method and device for identifying injection attacks for liveness detection.
[0004] Specifically, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a method for identifying injection attacks for liveness detection is proposed, including:
[0006] In response to a liveness detection request from a user, obtaining a plurality of images to be detected that are respectively taken by the electronic device according to different camera parameter values;
[0007] Comparing the multiple images to be detected to determine the similarity of the multiple images to be detected;
[0008] If they are not similar, it is determined that the multiple images to be detected are living body images taken by the electronic device for the user; if they are similar, it is determined that the multiple images to be detected are injection attack images.
[0009] According to a second aspect of one or more embodiments of this specification, a device for identifying injection attacks for liveness detection is provided, comprising:
[0010] An acquisition unit, configured to acquire, in response to a liveness detection request from a user, a plurality of images to be detected that are respectively taken by the electronic device according to different camera parameter values;
[0011] A comparison unit, used for comparing the multiple images to be detected to determine the similarity of the multiple images to be detected;
[0012] The determination unit is configured to determine that the plurality of images to be detected are living body images taken by the electronic device for the user if they are not similar; and to determine that the plurality of images to be detected are injection attack images if they are similar.
[0013] According to a third aspect of this specification, there is provided an electronic device, including:
[0014] processor;
[0015] a memory for storing processor-executable instructions;
[0016] The processor implements the method described in the embodiment of the first aspect above by running the executable instructions.
[0017] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which computer instructions are stored, and when the instructions are executed by a processor, the steps of the method described in the embodiments of the first aspect above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a flowchart of a method for identifying injection attacks for liveness detection provided by an exemplary embodiment.
[0019] Figure 2 It is a schematic diagram of an application scenario of living body detection provided by an exemplary embodiment.
[0020] Figure 3 It is a multi-party interaction flow chart of a method for identifying injection attacks for liveness detection provided by an exemplary embodiment.
[0021] Figure 4a-4b This is a schematic diagram of an image to be detected provided by an exemplary embodiment.
[0022] Figure 5 It is a schematic diagram of an electronic device provided by an exemplary embodiment.
[0023] Figure 6 It is a block diagram of an injection attack identification device for liveness detection provided by an exemplary embodiment. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.
[0025] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0026] During the liveness detection process, the electronic device collects video images in real time and instructs the user to perform specific actions such as blinking, shaking the head, opening the mouth, etc. during the collection process. By detecting whether the user performs specific actions as instructed in the video images collected by the electronic device, it can be determined whether the object to be detected is a real living body.
[0027] With respect to the above-mentioned liveness detection mechanism, an attacker can generate a video or dynamic image with the above-mentioned specific actions based on a user image through application software such as video generation and image processing, and use injection attack in the liveness detection process. While intercepting the data sent by the camera of the electronic device, the attacker uses the video or dynamic image generated by image processing to replace the video image collected by the electronic device, so as to attack the security detection system using the above-mentioned liveness detection mechanism, causing hazards such as leakage of user privacy data and theft of user resources.
[0028] In order to solve the above problems, Figure 1 FIG. 1 is a flow chart of a method for identifying injection attacks for liveness detection according to an exemplary embodiment of this specification. Figure 1 As shown, the following steps may be included:
[0029] Step 102: In response to a liveness detection request from a user, a plurality of images to be detected that are taken by the electronic device according to different camera parameter values are obtained.
[0030] In this specification, the injection attack identification method for liveness detection can be applied to electronic devices that capture images to be detected, such as computers, mobile phones and other computer devices, commodity vending machines, financial institutions' transfer machines and other machines and equipment that require biometric identification or liveness detection, and the captured images to be detected are directly processed and judged by the processor of the electronic device itself; it can also be applied to an independent server or a server cluster composed of multiple servers that is communicatively connected to the electronic device that captures the image to be detected and is used for liveness detection or biometric identification, and the server receives the image to be detected collected by the electronic device to process and judge it, and returns the judgment result to the electronic device. This specification does not impose any restrictions on this.
[0031] In one embodiment, the multiple detection images captured by the electronic device can be obtained by continuously adjusting the camera parameter values. Taking two images to be detected among the multiple images to be detected as an example, the electronic device can capture the first image to be detected according to the default camera parameter values, and then adjust at least one camera parameter to other values based on the default camera parameter values to capture the second image to be detected. Among them, the default camera parameter values can be the camera parameter values preset by the living body detection system, or they can be the camera parameter values automatically set by the electronic device based on the current real-time environment (such as ambient brightness) to match the current real-time environment, and those skilled in the art will not limit this.
[0032] In the above-mentioned camera parameter value adjustment process, the electronic device can adjust the value of at least one camera parameter to the maximum value or the minimum value based on the default camera parameter value. Among them, the maximum value or the minimum value can be randomly selected, or can be selected based on the size of the default value of the camera parameter to be adjusted. When the difference between the default value and the maximum value is greater than the difference between the default value and the minimum value, it can be adjusted to the maximum value; when the difference between the default value and the maximum value is less than the difference between the default value and the minimum value, it can be adjusted to the minimum value. For example, if the camera parameter to be adjusted is the exposure time, and the default exposure parameter used to shoot the first image to be detected is 0.002 seconds, the maximum value can be adjusted to 0.1 seconds, so that the difference between the adjusted camera parameter value and the default camera parameter value before adjustment is as large as possible. By adjusting the camera parameter to the maximum value or the minimum value for shooting, the difference between the second image to be detected and the first image to be detected can be improved, thereby reducing the image similarity obtained by subsequently comparing the second image to be detected with the first image to be detected, and improving the accuracy of identifying living images and injected attack images.
[0033] Furthermore, when adjusting the camera parameter values, the electronic device can also randomly select the camera parameters to be adjusted. Generally speaking, the camera parameters of a camera may include: white balance, hue, brightness and other aspects. Based on this, the electronic device can randomly select one or more of them for adjustment when shooting the image to be detected. By randomly selecting the adjusted camera parameters, the randomness of the shooting parameter values of the image to be detected can be improved, and the attacker is prevented from imitating the adjustment rules of the camera parameters to generate the corresponding injection attack image, thereby further improving the security of liveness detection.
[0034] In one embodiment, the multiple images to be detected taken by the electronic device may be taken at intervals. Still taking two images to be detected among the multiple images to be detected as an example, the second image to be detected may be taken by the electronic device after taking the first image to be detected and waiting for a random time. By randomly setting the interval time between taking the images to be detected, the randomness of the images to be detected used for liveness detection can also be improved, preventing attackers from using similar changing videos to deceive the liveness detection system, thereby improving the security of liveness detection.
[0035] In the technical solution of the present specification, before the electronic device acquires the image to be detected for injection attack identification, it can also first use the same camera parameter value to acquire multiple environmental images within a preset time length to detect the current shooting environment. Similarly, the same camera parameter value here can be the camera parameter value preset by the liveness detection system, or it can be the camera parameter value automatically set by the camera of the electronic device based on the current real-time environment (such as ambient brightness) to match the current real-time environment, and the present specification does not limit this. The electronic device or server can compare the multiple environmental images acquired according to the preset neural network model, wherein the preset neural network model can refer to the detailed description of the neural network model in the subsequent step 104, which will not be repeated here. If the multiple environmental images taken are similar, it can be determined that the current environment is relatively stable; if the multiple environmental images are not similar, it can be determined that the current environment is unstable, and there may be changes in light brightness or color, which is not conducive to liveness detection. Therefore, when the environment is detected to be unstable, the electronic device can prompt the user to stop the liveness detection until the user is in a stable environment and then take the image to be detected; or, it can continuously collect environmental images within a preset time length and analyze them to obtain the law of environmental changes, and determine the capture time of the image to be detected based on the law of environmental changes, so that the acquired image to be detected is the image to be detected in an unchanged environment. For example, if the electronic device analyzes the continuously collected environmental images and finds that the environment in which the current user is located changes once every 1.5 seconds, the electronic device can change the camera parameter value every 0.6 seconds and collect the image to be detected to ensure that the collected image to be detected is taken in an unchanged environment. By determining whether the environment for liveness detection is stable, it can avoid the changes in the environment in which the user is located from affecting the similarity between the images to be detected taken by different camera parameter values, and also avoid the attacker from using the injection attack video with constantly changing shooting parameters to impersonate, thereby improving the accuracy of liveness detection.
[0036] At the same time, since the process of environmental detection is relatively fast, the process of environmental detection can be included in the process of liveness detection and is unknown to the user, that is, during the process of environmental detection, the user has already pointed the camera of the electronic device at the face. The electronic device can use any captured environmental image containing the user's face as the first image to be detected in the images to be detected, thereby reducing the overall duration of liveness detection and improving user experience.
[0037] Step 104: Compare the multiple images to be detected to determine the similarity of the multiple images to be detected.
[0038] In the technical solution of the present specification, a neural network model can be pre-set, such as a Meta learning network model, a Siamese network model, a Triplet network model, etc., and the present specification does not limit this. The preset neural network model can compare images to determine whether the images are similar. Among them, the pre-set neural network model can be obtained by pre-training multiple groups of image pairs, wherein the multiple groups of image pairs are multiple groups of face images collected by different cameras, including positive samples and / or negative samples, and each group of image pairs includes at least two images taken for the same subject, and the positive sample is an image pair taken with the same camera parameter value, and the negative sample is an image pair taken with different camera parameter values.
[0039] In one embodiment, the electronic device or server can input the acquired multiple images to be detected into the above-mentioned pre-trained neural network model, and obtain the image similarity output by the preset neural network model. If the output image similarity is greater than the preset similarity threshold, it is determined that the multiple images to be detected are similar; if the output image similarity is not greater than the preset similarity threshold, it is determined that the multiple images to be detected are not similar.
[0040] Step 106: If they are not similar, determining that the multiple images to be detected are living images taken by the electronic device for the user; if they are similar, determining that the multiple images to be detected are injection attack images.
[0041] In one embodiment, if it is determined that the multiple images to be detected obtained are not similar, it means that the multiple images to be detected change with the change of camera parameter values, and it can be determined that the multiple images to be detected obtained are images captured by the camera of the electronic device, that is, living images captured by the user; if it is determined that the multiple images to be detected obtained are similar, it means that the multiple images to be detected do not change with the change of camera parameter values, that is, the multiple images to be detected obtained are not captured by the camera of the electronic device, it can be determined that the camera image captured by the camera is replaced, and the multiple images to be detected obtained are injection attack images.
[0042] In this specification, in addition to determining whether multiple images to be detected are similar, it is also possible to determine whether the acquired images to be detected are injection attack images by determining whether the shooting parameters of the acquired images to be detected match the camera parameters adjusted by the electronic device. After acquiring multiple images to be detected, the electronic device or server can estimate the shooting parameter values of the images to be detected through a preset image processing algorithm, and match the shooting parameter values with the camera parameter values obtained by the corresponding adjustment in the electronic device. If they match, it can be determined that the acquired multiple images to be detected are images captured by the camera of the electronic device, that is, living images captured by the user; if they do not match, it can be determined that the acquired multiple images to be detected are not captured by the camera of the electronic device, that is, the camera images captured by the camera are replaced, and the acquired multiple images to be detected are injection attack images. Among them, the image processing algorithm can be specifically recorded with reference to the relevant technology, and this specification will not be repeated here. For example, after the electronic device shoots the first image to be detected according to the default camera parameter value, it adjusts the exposure value in the camera parameter to the maximum value to shoot the second image to be detected. The server can determine whether the exposure value of the second image to be detected is greater than the exposure value of the first image to be detected according to the image processing algorithm. If it is greater, it can be determined that the second image to be detected is a living image shot by the electronic device through the camera; if it is not greater, it can be determined that the second image to be detected is an injection attack image. Alternatively, the shooting parameter value corresponding to the second image to be detected can be obtained according to the image processing algorithm, and the shooting parameter value is matched with the camera parameter value when the electronic device shoots the second image to be detected. If they are the same or similar, that is, the shooting parameter value matches the camera parameter value, it can be determined that the second image to be detected is an image shot by the electronic device; if they do not match, it can be determined that the image shot by the electronic device has been hijacked and replaced, and the second image to be detected is an injection attack image. By using an image processing algorithm to predict the shooting parameter values of the image to be detected and comparing them with the camera parameter values of the electronic device when shooting, it is possible to further prevent attackers from using changing injection attack videos to simulate the image effects taken by the electronic device based on changing camera parameter values, thereby further improving the security of liveness detection.
[0043] This specification obtains multiple images to be detected for liveness detection taken with different camera parameter values, and compares the similarities between the multiple images to be detected to determine whether the acquired images to be detected change with the change of camera parameter values, thereby identifying whether the images taken by the electronic device during liveness detection are replaced by injection attacks, thereby improving the accuracy of liveness detection.
[0044] Figure 2 Schematic diagram of a liveness detection application scenario using the embodiments of this specification. Figure 2As shown, the application scenario may include: a user 21 to be detected, an electronic device 22 and a server 23. Among them, the electronic device 22 may include a camera 221. After receiving a liveness detection request for the user 21 to be detected, the electronic device 22 collects images to be detected through the camera 221 according to different camera parameter values, and continuously transmits the collected images to be detected to the server 23, so that the server 23 performs a similarity comparison on multiple images to be detected from the electronic device 22, and identifies whether the image to be detected is an image taken by the camera 221 according to the comparison result, so as to determine whether the electronic device 21 is injected with an attack. Of course, the above Figure 2 The application scenario shown is only an exemplary scenario for applying the embodiments of this specification and is not intended to limit this specification. In fact, the application scenario of liveness detection may not include the server 23. After collecting multiple images to be detected, the electronic device 22 can perform similarity comparison on the collected multiple images to be detected based on its own processor, and identify whether the image to be detected is an injection attack image based on the comparison result. This specification does not limit this.
[0045] In the technical solution of this specification, by adjusting the camera parameter values of the image to be detected and performing similarity detection on the images to be detected taken with different camera parameter values, it is possible to determine whether the electronic device has been injected with an attack during the liveness detection process. Figure 3 Detailed description is given. Figure 3 FIG. 1 is a multi-party interaction flow chart of a method for identifying injection attacks for liveness detection according to an exemplary embodiment of this specification. Figure 3 As shown, the interaction process between the user to be detected 21, the electronic device 22 and the server 23 includes the following steps:
[0046] Step 301 : In response to a liveness detection request for a user 21 to be detected, the electronic device 22 collects a plurality of environment images.
[0047] In response to a liveness detection request for the user 21 to be detected, the electronic device 22 takes a plurality of images to be detected within a period of time through the camera 221 according to the default camera parameter values preset by the system.
[0048] Step 302 : The electronic device 22 sends the captured multiple environment images to the server 23 .
[0049] In step 303 , the server 23 compares the similarities of the multiple environment images and determines the shooting interval of the image to be detected.
[0050] After receiving the multiple environmental images sent by the electronic device 22, the server 23 compares the acquired multiple environmental images according to the preset neural network model. If the multiple environmental images taken are similar, it can be determined that the current environment is stable, and the shooting interval of the image to be detected is randomly determined; if the multiple environmental images taken are not similar, it can be determined that the current environment is unstable, and the server 23 can analyze the multiple environmental images obtained, obtain the change interval of the current environment of the user 21 to be detected, and determine that the shooting interval of the image to be detected is less than the environment change interval. For example, if the change interval of the current environment of the user 21 to be detected is 1.5 seconds, the server 23 can determine that the shooting interval of the image to be detected is 0.6 seconds.
[0051] Step 304 : the server 23 sends an instruction for acquiring the image to be detected to the electronic device 22 .
[0052] After determining the shooting interval of the image to be detected, the server 23 may send an instruction for acquiring the image to be detected to the electronic device 22 to instruct the electronic device 22 to shoot the image to be detected according to the determined shooting interval.
[0053] Step 305: the electronic device 22 captures a plurality of images to be detected.
[0054] After receiving the image acquisition instruction sent by the server 23, the electronic device 22 can first shoot the first image to be detected according to the default camera parameter value preset by the system. After waiting for 0.6 seconds, the electronic device 22 randomly selects a camera parameter based on the default camera parameter value and adjusts it to the maximum value, and shoots the second image to be detected. Figure 4a , 4b As shown, Figure 4a is the first image to be detected taken according to the default camera parameter values preset by the system, Figure 4b The second image to be detected is taken after the exposure parameter in the default camera parameter value preset by the system is adjusted to the maximum value.
[0055] Step 306 : The electronic device 22 sends the image to be detected to the server 23 .
[0056] In step 307 , the server 23 compares the acquired multiple images to be detected to determine the similarity of the multiple images to be detected.
[0057] The server 23 may input the acquired first image 4a to be detected and the second image 4b to be detected into a pre-trained neural network model, and obtain the image similarity output by the preset neural network model.
[0058] For example, if the image similarity output by the preset neural network model is 85%, which is greater than the preset similarity threshold of 60%, it is determined that multiple images to be detected are similar, and the first image to be detected and the second image to be detected are determined to be injection attack images, and the electronic device 22 is subjected to an injection attack.
[0059] If the output image similarity is 30%, which is not greater than the preset similarity threshold of 60%, it is determined that the multiple images to be detected are not similar, and the process proceeds to step 309 .
[0060] Step 308: The server 23 estimates the shooting parameter values of the second image to be detected.
[0061] After determining that the first image 4a to be detected and the second image 4b to be detected are not similar, the server 23 can estimate the exposure parameter values of the first image 4a to be detected and the second image 4b to be detected according to a preset image processing algorithm.
[0062] In step 309 , the server 23 matches the shooting parameter values with the camera parameter values to determine whether the image to be detected is an injection attack image.
[0063] Since the electronic device 22 takes the second image 4b to be detected after adjusting the exposure parameter in the camera parameter value to the maximum value after taking the first image 4a to be detected, it can be determined whether the exposure parameter of the second image 4b to be detected is greater than that of the first image 4a to be detected. If so, it can be determined that the first image 4a to be detected and the second image 4b to be detected are living images taken by the electronic device 22 for the user 21 to be detected; if not, it can be determined that the first image 4a to be detected and the second image 4b to be detected are injected attack images.
[0064] Figure 5 is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 5 At the hardware level, the device includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a non-volatile memory 510, and may also include hardware required for other services. One or more embodiments of this specification may be implemented based on software, such as the processor 502 reading the corresponding computer program from the non-volatile memory 510 into the memory 508 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementations, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0065] Please refer to Figure 6 , the injection attack recognition device for liveness detection can be applied to Figure 6The device shown in the figure is used to implement the technical solution of this specification. Among them, the injection attack identification device for liveness detection may include:
[0066] The image acquisition unit 602 is configured to acquire a plurality of images to be detected that are respectively taken by the electronic device according to different camera parameter values in response to a liveness detection request from the user;
[0067] An image comparison unit 604 is configured to compare the multiple images to be detected to determine the similarity of the multiple images to be detected;
[0068] The image determination unit 606 is configured to determine that the multiple images to be detected are living body images taken by the electronic device for the user if they are not similar; and to determine that the multiple images to be detected are injection attack images if they are similar.
[0069] Optionally, the multiple images to be detected include: a first image to be detected taken by the electronic device according to default camera parameter values; and a second image to be detected taken by the electronic device after adjusting at least one camera parameter to other values.
[0070] Optionally, the other value is a maximum value or a minimum value.
[0071] Optionally, the at least one camera parameter is a randomly selected camera parameter.
[0072] Optionally, the multiple images to be detected include a first image to be detected and a second image to be detected, wherein: the second image to be detected is taken by the electronic device after taking the first image to be detected and waiting for a random period of time.
[0073] Optionally, comparing the multiple images to be detected to determine whether the multiple images to be detected are similar includes: inputting the multiple images to be detected into a pre-trained neural network model; obtaining the image similarity output by the neural network model; if the output image similarity is greater than a preset similarity threshold, determining that the multiple images to be detected are similar; if the output image similarity is not greater than a preset similarity threshold, determining that the multiple images to be detected are not similar; wherein the neural network model is obtained by training positive samples and / or negative samples, the positive samples include multiple groups of image pairs shot with the same camera parameter values, and the negative samples include multiple groups of image pairs shot with different camera parameter values.
[0074] Optionally, the above device further comprises:
[0075] An environment image acquisition unit 608 is configured to acquire a plurality of environment images taken by the electronic device according to the same camera parameter values;
[0076] The environment detection unit 610 is configured to determine that the user is in a changed detection environment if the multiple environment images are not similar;
[0077] An environment interval duration acquisition unit 612 is configured to acquire an environment change interval duration of the detection environment;
[0078] The shooting interval duration determining unit 614 is configured to determine the shooting interval duration of the multiple images to be detected according to the environment change interval duration, so that the shooting interval duration of the multiple images to be detected is less than the environment change interval duration.
[0079] Optionally, the above device further comprises:
[0080] A shooting parameter acquisition unit 616 is configured to acquire shooting parameters of any image to be detected among the multiple images to be detected;
[0081] The parameter matching unit 618 is configured to determine that any image to be detected is a living image taken by the electronic device for the user if the shooting parameters match the camera parameter values taken by the electronic device when shooting; if the shooting parameters do not match the camera parameter values taken by the electronic device when shooting, determine that any image to be detected is an injection attack image.
[0082] The systems, devices, modules or units described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device or a combination of any of these devices.
[0083] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0084] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0085] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0086] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0087] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0088] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0089] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0090] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.
Claims
1. A method for identifying injection attacks for liveness detection, the method comprising: In response to a liveness detection request from a user, before acquiring an image to be detected, acquiring a plurality of environment images taken by the electronic device according to the same camera parameter values; If the multiple environment images are not similar, determining that the user is in a changed detection environment; Obtaining the duration of the environmental change interval of the detection environment; Determine the shooting interval duration when acquiring the to-be-detected image according to the environment change interval duration, so that the shooting interval duration of the acquired multiple to-be-detected images is less than the environment change interval duration; Acquire a plurality of images to be detected that are taken by the electronic device according to the shooting interval and different camera parameter values; Comparing the multiple images to be detected to determine the similarity of the multiple images to be detected; If not, determining that the multiple images to be detected are living body images taken by the electronic device for the user; If they are similar, the multiple images to be detected are determined to be injection attack images.
2. According to the method of claim 1, the plurality of images to be detected include: A first image to be detected photographed by the electronic device according to default camera parameter values; as well as The electronic device adjusts at least one camera parameter to another value and then captures a second image to be detected.
3. According to the method described in claim 2, the other value is a maximum value or a minimum value.
4. According to the method of claim 2, the at least one camera parameter is a randomly selected camera parameter.
5. The method according to claim 1, wherein the plurality of images to be detected include a first image to be detected and a second image to be detected, wherein: The second image to be detected is captured by the electronic device after capturing the first image to be detected and waiting for a random period of time.
6. According to the method of claim 1, the comparing the multiple images to be detected to determine whether the multiple images to be detected are similar comprises: Inputting the plurality of images to be detected into a pre-trained neural network model; Obtaining image similarity output by the neural network model; If the output image similarity is greater than a preset similarity threshold, determining that the multiple images to be detected are similar; If the output image similarity is not greater than a preset similarity threshold, determining that the multiple images to be detected are not similar; The neural network model is trained by positive samples and / or negative samples, wherein the positive samples include multiple groups of image pairs shot with the same camera parameter values, and the negative samples include multiple groups of image pairs shot with different camera parameter values.
7. The method according to claim 1, further comprising: Obtaining a shooting parameter value of any image to be detected among the multiple images to be detected; If the shooting parameter value matches the camera parameter value when the electronic device is shooting, determining that any one of the images to be detected is a living body image shot by the electronic device for the user; If the shooting parameter value does not match the camera parameter value of the electronic device when shooting, it is determined that any image to be detected is an injection attack image.
8. A device for identifying injection attacks for liveness detection, the device comprising: The image acquisition unit to be detected is used to respond to a liveness detection request for a user, and before acquiring the image to be detected, acquire multiple environmental images taken by the electronic device according to the same camera parameter value; if the multiple environmental images are not similar, determine that the user is in a changing detection environment; acquire the environmental change interval duration of the detection environment; determine the shooting interval duration when acquiring the image to be detected according to the environmental change interval duration, so that the shooting interval duration of the acquired multiple images to be detected is less than the environmental change interval duration; acquire multiple images to be detected that are taken by the electronic device according to the shooting interval duration and according to different camera parameter values; An image comparison unit, used for comparing the multiple images to be detected to determine the similarity of the multiple images to be detected; an image determination unit, configured to determine, if not similar, that the plurality of images to be detected are living body images taken by the electronic device for the user; If they are similar, the multiple images to be detected are determined to be injection attack images.
9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 7 by running the executable instructions.
10. A computer-readable storage medium having computer instructions stored thereon, characterized in that: When the instruction is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Living body detection method and device and face recognition equipment
CN111460970A