Living body detection method, device and electronic equipment

By collecting images under different light conditions and analyzing the pixel values ​​of the iris and other areas, it solves the problem of relying on infrared cameras in the existing technology, achieves efficient and low-cost living body detection, and enhances the safety and applicability of face recognition. scope.

CN111160235BActive Publication Date: 2024-08-27LENOVO (BEIJING) LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201911377492.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-12-27
Publication Date
2024-08-27
Estimated Expiration
2040-08-27

AI Technical Summary

Technical Problem

Existing living body detection methods rely on high-performance infrared cameras, which are costly and cannot be applied to spectrum-adjusted image analysis. They cannot effectively solve the security issues of face recognition technology in applications such as financial payment fields.

Method used

By acquiring two images of the object to be detected in different light states, extracting pixel values ​​of the iris area and other body parts, and using feature vector analysis to determine the identity of the living body, this avoids dependence on high-cost infrared cameras and realizes detection of different light states. Image analysis below.

Benefits of technology

It improves the accuracy and scope of application of live body detection, reduces hardware costs, avoids spectral constraints, and enhances the security of face recognition technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111160235B
    Figure CN111160235B
Patent Text Reader

Abstract

The present application provides a method, device and electronic device for detecting a living body. By changing the light state of an object to be detected, a first image and a second image of the object to be detected in different light states and with a collection time interval less than a first threshold are obtained, so as to extract a first area and a second area (both including an iris area) corresponding to the same body part of the object to be detected, and a third area and a fourth area corresponding to the same body part, thereby using the pixel values ​​of the four extracted areas to determine whether the object to be detected is a living body. There is no need to configure an infrared camera with higher performance, which saves costs, is not constrained by the spectrum, and improves the scope of application of living body detection. Compared with the method of directly extracting features from a pair of images (with or without light) to achieve living body detection, the accuracy of living body detection is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application mainly relates to the field of image analysis technology, and more specifically to a living body detection method, device and electronic equipment. Background Art

[0002] Face recognition is a biometric detection technology that has developed rapidly in recent years. It detects and tracks faces in images or video streams collected by image acquisition devices, and performs face recognition on the detected face areas to achieve identity recognition of the collected objects.

[0003] In actual applications, in order to improve the reliability and security of user identity recognition based on face recognition technology, liveness detection is usually used first to determine whether the detected face is a real face or a fake face attack, such as a legitimate user photo, a video taken in advance, etc., to ensure that the subsequent face image analysis object is a real face, reduce the technical risks of face recognition technology, especially in the field of financial payment, and improve the security of user property.

[0004] However, existing liveness detection methods usually use high-performance infrared cameras instead of ordinary RGB cameras for image acquisition, and use the differences in absorption and reflection intensity of real faces and non-living carriers in the near-infrared band to achieve liveness detection. However, this method is not suitable for image analysis after spectral adjustment, and the hardware cost is relatively high. Summary of the invention

[0005] In view of this, the present application provides a living body detection method, the method comprising:

[0006] Acquire a first image and a second image of an object to be detected, wherein a time interval between the acquisition of the first image and the second image is less than a first specific value, and the first image and the second image are generated when the object to be detected is in different light conditions;

[0007] Extracting a first area and a second area in the first image, and a third area and a fourth area in the second image, wherein the first area and the third area correspond to the same body part of the object to be detected and include an iris area, and the second area and the fourth area correspond to the same body part of the object to be detected;

[0008] Whether the object to be detected is a living body is determined based on the pixel values ​​of the corresponding positions of the first area and the third area, and the pixel values ​​of the corresponding positions of the second area and the fourth area.

[0009] In some embodiments, determining whether the object to be detected is a living body according to the pixel values ​​of the first area and the corresponding positions of the third area, and the pixel values ​​of the second area and the corresponding positions of the fourth area, comprises:

[0010] Obtaining pixel values ​​of the first area, the second area, the third area, and the fourth area;

[0011] Calculating pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector;

[0012] Calculating pixel values ​​at corresponding positions of the second region and the fourth region to obtain a second feature vector;

[0013] Merging the first feature vector and the second feature vector to obtain a liveness detection feature vector;

[0014] The liveness detection feature vector and the attack sample feature vector are used to determine whether the object to be detected is a live body.

[0015] In some embodiments, using the liveness detection feature vector and the attack sample feature vector to determine whether the object to be detected is live includes:

[0016] The liveness detection feature vector is input into a liveness classification model to obtain a classification result of whether the object to be detected is alive. The classification model is obtained by classifying and training the liveness detection feature vector of the detection object sample and the attack sample feature vector of the attack sample.

[0017] In some embodiments, determining whether the object to be detected is a living body based on the pixel values ​​of the first area and the corresponding positions of the third area, and the pixel values ​​of the second area and the corresponding positions of the fourth area, further includes:

[0018] Reorganizing the pixel values ​​of the first region, the second region, the third region, and the fourth region with the first resolution to obtain the first region and the third region with the second resolution, and the second region and the fourth region with the third resolution;

[0019] The second resolution and the third resolution are both smaller than the first resolution.

[0020] In some embodiments, acquiring the first image and the second image of the object to be detected includes:

[0021] In response to a start instruction for the instantaneous light source, a first image of the object to be detected when the instantaneous light source is turned on and a second image of the object to be detected after the instantaneous light source is turned off are acquired;

[0022] Wherein, the object to be detected is located within the light irradiation range of the instantaneous light source.

[0023] In some embodiments, acquiring the first image and the second image of the object to be detected includes:

[0024] Acquire a first image of the object to be detected illuminated by the screen of the electronic device at a first brightness;

[0025] In response to the screen brightness adjustment instruction, controlling the screen of the electronic device to adjust from a first brightness to a second brightness;

[0026] Acquire a second image of the object to be detected when the electronic device screen is adjusted from the first brightness to the second brightness.

[0027] In some embodiments, the process of performing calculations using pixel values ​​at corresponding positions in different regions to obtain feature vectors includes:

[0028] Renormalize the pixel values ​​at corresponding positions in different regions to obtain a pixel matrix;

[0029] Vectorizing the pixel matrix, and sorting the obtained one-dimensional vector elements;

[0030] According to the sorting result, the first number of elements with larger element values ​​are selected to form feature vectors corresponding to the different regions.

[0031] The present application also proposes a living body detection device, the device comprising:

[0032] An image acquisition module, used for acquiring a first image and a second image of an object to be detected, wherein a time interval between the acquisition of the first image and the second image is less than a first specific value, and the first image and the second image are generated when the object to be detected is in different light conditions;

[0033] a region extraction module, configured to extract a first region and a second region in the first image, and a third region and a fourth region in the second image, wherein the first region and the third region correspond to the same body part of the object to be detected and include an iris region, and the second region and the fourth region correspond to the same body part of the object to be detected;

[0034] The living body detection module is used to determine whether the object to be detected is a living body according to the pixel values ​​of the corresponding positions of the first area and the third area, and the pixel values ​​of the corresponding positions of the second area and the fourth area.

[0035] The present application also proposes a storage medium on which a program is stored. The program is executed by a processor to implement the above-mentioned living body detection method.

[0036] The present application also proposes an electronic device, comprising: at least one memory and at least one processor, wherein:

[0037] The memory is used to store a program for implementing the above-mentioned living body detection method;

[0038] The processor is used to load and execute the program stored in the memory to implement the various steps of the living body detection method as described above.

[0039] It can be seen that compared with the prior art, the present application provides a method, device and electronic device for detecting a living body. In the process of acquiring images of an object to be detected, by changing the light state of the object to be detected, a first image and a second image of the object to be detected in different light states and with an acquisition time interval less than a first threshold are obtained, so that the iris region features of the object to be detected (when it is a living body) in the two images are greatly changed, while the features of other facial regions remain basically unchanged, which can be reflected in the pixel values ​​of the corresponding positions. Therefore, the present application can extract the first region and the second region (both including the iris region) corresponding to the same body part of the object to be detected, and the third region and the fourth region corresponding to the same body part from the two images obtained under different light states, so as to determine whether the object to be detected is a living body by using the pixel values ​​of the four extracted regions, without the need to configure a higher-performance infrared camera, saving costs, and not being constrained by the spectrum, thereby improving the scope of application of liveness detection; and compared with the method of directly extracting features from an image (with or without illumination) to achieve liveness detection, the accuracy of liveness detection is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.

[0041] Figure 1 A schematic diagram of a scenario of the liveness detection method proposed in this application is shown;

[0042] Figure 2 A schematic diagram showing an optional example of a liveness detection method proposed in the present application;

[0043] Figure 3 A schematic flow chart showing another optional example of the liveness detection method proposed in the present application is shown;

[0044] Figure 4A schematic flow chart showing another optional example of the liveness detection method proposed in the present application is shown;

[0045] Figure 5 A schematic flow chart showing another optional example of the liveness detection method proposed in the present application is shown;

[0046] Figure 6 A schematic diagram of a scenario flow of the liveness detection method proposed in this application is shown;

[0047] Figure 7 A schematic structural diagram of an optional example of a living body detection device proposed in the present application is shown;

[0048] Figure 8 A schematic structural diagram of another optional example of the living body detection device proposed in the present application is shown;

[0049] Fig. 9 A schematic structural diagram of another optional example of the living body detection device proposed in the present application is shown;

[0050] Fig.10 A schematic structural diagram of another optional example of the living body detection device proposed in the present application is shown;

[0051] Fig.11 A schematic diagram of the hardware structure of an electronic device proposed in an embodiment of the present application is shown;

[0052] Fig.12 A schematic diagram of the hardware structure of an electronic device proposed in yet another embodiment of the present application is shown. DETAILED DESCRIPTION

[0053] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0054] It should be noted that, for the convenience of description, only the parts related to the relevant invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0055] It should be understood that the "system", "device", "unit" and / or "module" used in this application is a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the word can be replaced by other expressions.

[0056] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "a kind" and / or "the" do not refer to the singular, but also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of clearly identified steps and elements, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements. The elements defined by the sentence "includes a..." do not exclude the existence of other identical elements in the process, method, commodity or device that includes the elements.

[0057] Among them, in the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "multiple" refers to two or more than two. The following terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features.

[0058] In addition, flow charts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, the various steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.

[0059] Computer vision technology is a commonly used artificial intelligence technology. It refers to the use of cameras and computers to replace human eyes to identify, track and measure target objects, and further perform graphic processing to make computer processing into images that are more suitable for human observation or transmission to instruments for detection. Among them, face recognition, as a biometric recognition technology of artificial intelligence computer vision technology, has been widely used in many fields. In face recognition applications, liveness detection controls an important part of authentication security, such as remote identity verification of banks, face payment by WeChat, remote authentication of Didi drivers, and community access control systems.

[0060] In response to the technical problems described in the background technology section, this application hopes to use image information collected by ordinary cameras (such as cameras built into electronic devices) to achieve reliable liveness detection without replacing high-cost infrared cameras, depth cameras, etc.

[0061] Specifically, refer to Figure 1The scene schematic diagram applicable to the liveness detection method proposed in the present application is shown. The electronic device can obtain a first image and a second image of the object to be detected in different light conditions. For example, when the electronic device turns on the flash, the corresponding images collected before and after the flash is turned on (i.e., during the period when the flash is turned on) can be obtained, which are recorded as the first image and the second image respectively. Afterwards, since the characteristics of the iris area (such as pixel values) of the real user, i.e., the living body, will change greatly before and after the light state changes, while the characteristics of the images in other areas change very little; and before and after the light state of the attack sample such as a photo changes, the characteristics of each area change very little. Therefore, the present application can determine whether the object to be detected is a living body by analyzing the changes in pixel values ​​of the areas corresponding to the same body part in the first image and the second image (at least one area includes the iris).

[0062] Among them, Figure 1 As shown, the implementation process of the liveness detection method proposed in the present application can be implemented by the electronic device itself. According to needs, the electronic device can also collect the first image and the second image and send them to other electronic devices with data processing capabilities (such as servers or other terminal devices) for analysis. After obtaining the liveness detection result, it is fed back to the electronic device, or other devices in the environment where the object to be detected is located, such as Figure 1 It can be seen that the electronic device for implementing the liveness detection method in this application can be a terminal device, such as a laptop computer, a mobile phone, a desktop computer, a smart home device, etc., or a server, etc. This application does not limit the product type of the electronic device, and Figure 1 This is only an illustration of the application scenario of the liveness detection method proposed in this application, and does not limit Figure 1 The application scenarios shown can be flexibly adjusted according to actual needs.

[0063] Reference Figure 2 , shows a flow chart of an optional example of the liveness detection method proposed in the present application, which can be applied to electronic devices such as Figure 2 As shown, the method may include:

[0064] Step S11, acquiring a first image and a second image of the object to be detected;

[0065] It should be noted that the acquisition time interval between the first image and the second image in this embodiment is less than the first specific value, and the first image and the second image are generated when the object to be detected is in different lighting conditions. The specific generation method and acquisition method are not limited. This application does not limit the numerical value of the first specific value, which is usually a very small value, so that the posture of the object to be detected in the first image and the second image remains basically unchanged.

[0066] In some embodiments, in combination with the above analysis, the camera of the electronic device can be used to turn on the flash to obtain a first image of the object to be detected during the process of turning on the front flash, and then obtain a second image of the object to be detected after a certain interval (such as 300ms). Usually, when the second image is collected, the object to be detected is not in a light state, and when the first image is collected, the object to be detected is in a light state, so that the object to be detected in the first image and the second image is in different light states.

[0067] It can be seen that the above-mentioned different light states can be different light intensity states. The present application does not limit the method of generating different light states, and is not limited to the above-mentioned generation by using the front flash of the electronic device. For electronic devices without a front flash, the flash can be simulated by instantaneously adjusting the brightness of the electronic device screen to generate different light states, so as to obtain the first image and the second image of the object to be detected in different light states.

[0068] Of course, the present application can also use independent lighting equipment to adjust the light conditions of the environment in which the object to be detected is located to obtain the above-mentioned first image and second image. The present application does not describe the specific implementation process of step S11 in detail.

[0069] In practical applications, since liveness detection is usually applied to scenarios requiring user identity verification, if the scenario uses face recognition technology to realize user identity recognition, the first image and the second image obtained in the above step S11 can be face images of the object to be detected.

[0070] Step S12, extracting the first area and the second area in the first image, and the third area and the fourth area in the second image;

[0071] It should be noted that the first area and the third area extracted in this embodiment correspond to the same body part of the object to be detected and include the iris area, and the extracted second area and the fourth area correspond to the same body part of the object to be detected. This application does not limit the body parts of the object to be detected corresponding to these areas, and can be determined based on the body parts of the object to be detected contained in the first image and the second image.

[0072] In a possible implementation, the first area may be the eye area of ​​the object to be detected in the first image, the third area may be the eye area of ​​the object to be detected in the second image, the second area may be the face area of ​​the object to be detected in the first image, and the fourth area may be the face area of ​​the object to be detected in the second image. As analyzed above, the body part areas of the object to be detected represented by the first area, the second area, the third area, and the fourth area are not limited to the contents described in this paragraph and can be flexibly determined according to actual needs to improve the flexibility of liveness detection.

[0073] This embodiment does not limit the implementation method of how to extract a region from an image, and can be implemented using a feature extraction algorithm, that is, after determining the contents of the first region, the second region, the third region, and the fourth region, feature extraction can be performed on the corresponding first image or the second image to obtain a corresponding regional image, such as extracting the eye region in the first image as the first region, and the face region as the second region, etc. The specific implementation process is not described in detail.

[0074] Step S13, determining whether the object to be detected is a living body according to the pixel values ​​at the corresponding positions of the first area and the third area, and the pixel values ​​at the corresponding positions of the second area and the fourth area.

[0075] Combined with the above analysis of the inventive concept of the present application, since the first area and the third area include the iris area of ​​the object to be detected, if the object to be detected is a living body, there is a large difference in the pixel values ​​of the iris area collected under different lighting conditions, while the pixel values ​​of other areas in the face are relatively small. Therefore, this embodiment can determine whether the object to be detected is a living body by changing the pixel values ​​of the first area and the third area, and the pixel values ​​of the second area and the fourth area.

[0076] It should be noted that the present application does not limit the analysis method of the pixel value changes of the area corresponding to the same body part collected under different light conditions, that is, the specific implementation method of step S13 is not limited.

[0077] To sum up, in this embodiment, in order to realize liveness detection, when capturing images of the object to be detected, the light state of the object to be detected can be changed, and a first image and a second image of the object to be detected in different light states and with a short acquisition time interval are obtained, so that the iris area features of the object to be detected (if it is a living object) in the two images are greatly changed, while other regional features of the face remain basically unchanged, which can be reflected in the pixel values ​​at the corresponding positions.

[0078] In this way, this embodiment can extract the first area and the second area (both including the iris area) corresponding to the same body part of the object to be detected, and the third area and the fourth area corresponding to the same body part from two images obtained under different lighting conditions, and use the pixel values ​​of the four areas to determine whether the object to be detected is a living body. There is no need to configure a high-configuration camera such as an infrared camera with higher performance and higher price, which saves hardware costs, is not constrained by the spectrum, and improves the scope of application of living body detection.

[0079] In addition, compared with the traditional liveness detection method of directly extracting features from an image collected under a fixed light state (with or without light) to achieve liveness detection, the method of the present application that achieves liveness detection based on the analysis results of the images of the object to be detected under different light states greatly improves the accuracy of liveness detection.

[0080] Reference Figure 3 , shows a flow chart of another optional example of the liveness detection method proposed in the present application, which may be a refined implementation of the liveness detection described in the above embodiment, such as Figure 3 As shown, the detailed implementation methods proposed in this embodiment may include:

[0081] Step S21, acquiring a first image and a second image of the object to be detected;

[0082] Step S22, extracting the first area and the second area in the first image, and the third area and the fourth area in the second image;

[0083] Regarding the specific implementation process of step S21 and step S22, reference may be made to the description of the corresponding parts of the above embodiment, which will not be repeated in this embodiment.

[0084] Step S23, obtaining pixel values ​​of the first area, the second area, the third area and the fourth area;

[0085] Step S24, calculating pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector;

[0086] Step S25, calculating pixel values ​​at corresponding positions of the second area and the fourth area to obtain a second feature vector;

[0087] In practical applications, feature extraction is a concept in computer vision and image processing, which refers to using computers to extract image information and determine whether each image point belongs to an image feature. The result of feature extraction can be to divide the points on the image into different subsets, which often belong to isolated points, continuous curves or continuous regions. In this implementation, the pixel points of each of the multiple regions can be used as the feature points of the corresponding region to form the feature vector of the region.

[0088] In the present application, for the process of extracting feature vectors of different regional images, according to actual needs, you can choose to use the HOG (Histogram of Oriented Gradient) feature extraction method to obtain the features of the regional images corresponding to different body parts of the object to be detected to form the corresponding feature vectors; for the feature extraction of regional images, you can use the LBP (Local Binary Pattern) feature extraction method or the Haar-like feature extraction method to implement it, which will not be described in detail in this application.

[0089] Based on the above analysis, in the actual application of this embodiment, after obtaining the pixel values ​​of the first area, the second area, the third area and the fourth area respectively, the pixel values ​​of the two areas of the same body part can be used to form a two-dimensional pixel matrix, and then converted into a one-dimensional feature vector. The specific implementation process is not limited.

[0090] Of course, in order to improve the efficiency of image processing, the present application can also convert the obtained color first image and second image into corresponding grayscale images. According to the above method, after determining the first area and the second area in the first grayscale image, and the third area and the fourth area in the second grayscale image, the grayscale values ​​of the pixels contained in each of these areas are used to perform binarization processing on the area to obtain a two-dimensional grayscale matrix, which is then converted into a one-dimensional feature vector.

[0091] Based on the above analysis, in a possible implementation, the present application may adopt Figure 4 The first eigenvector and the second eigenvector are obtained in the manner shown. Since the first eigenvector and the second eigenvector are obtained in a similar manner, this application will not describe them one by one in detail. Figure 4 As shown, the process proposed in the present application of using pixel values ​​at corresponding positions in different regions to perform calculations to obtain feature vectors may include but is not limited to the following steps:

[0092] Step A1, renormalizing the pixel values ​​at corresponding positions in different regions to obtain a pixel matrix;

[0093] It should be noted that the different areas in step A1 refer to the areas corresponding to the same body part in the first image and the second image, such as the first area and the third area, or the second area and the fourth area. For the convenience of description, if the image captured under good lighting conditions is the first image, such as the first image of the object to be detected captured under the illumination of a flash, the image captured under poor lighting conditions is the second image, such as the second image of the object to be detected captured without the illumination of a flash, the pixel value contained in the area belonging to the first image is recorded as S_f, and the pixel value contained in the area belonging to the second image can be recorded as S_b, where the pixel value can be the brightness value of the corresponding pixel point.

[0094] Afterwards, the pixel values ​​at corresponding positions in different regions can be renormalized according to the calculation formula F=(S_f-S_b) / (S_f+S_b) to obtain a pixel matrix. F can represent the elements in the pixel matrix. From the formula, it can be seen that the elements at different positions in the pixel matrix can be calculated from the pixel values ​​at corresponding positions in the first region and the third region, or from the pixel values ​​at corresponding positions in the second region and the fourth region.

[0095] Step A2, vectorizing the pixel matrix and sorting the obtained one-dimensional vector elements;

[0096] Step A3, according to the sorting result, select the first number of elements with larger element values ​​to form a feature vector corresponding to the different regions.

[0097] In this embodiment, based on the method of obtaining the pixel matrix described above, it can be known that the number of rows and columns of the pixel matrix can be determined according to the number of rows and columns of pixel points contained in any of the above-mentioned different areas, and the vectorization of the pixel matrix can be to concatenate the ends of each row vector in the pixel matrix to obtain a one-dimensional vector, or to concatenate the ends of each column vector in the pixel matrix to obtain a one-dimensional vector, that is, to perform dimensionality reduction processing on the high-dimensional pixel matrix to obtain a one-dimensional vector.

[0098] Among them, since any area obtained from the first image or the second image usually contains a large number of pixel points, the number of vector elements contained in the one-dimensional vector obtained by vectorizing the pixel matrix will also be very large. If the one-dimensional vector is directly used as the feature vector corresponding to the corresponding different areas, the processing efficiency and reliability of subsequent living body detection will be reduced. In this regard, the present embodiment can select one-dimensional vector elements that can better reflect the feature changes of the corresponding different areas to constitute the feature vectors corresponding to the different areas.

[0099] Specifically, since the larger the value of a one-dimensional vector element, the more obvious its feature is, and thus the more helpful it is to achieve liveness detection, the present embodiment can select elements whose values ​​reach a specific value of the element, or select the first number of elements with a larger value from the obtained one-dimensional vector elements, to form a feature vector corresponding to the corresponding different regions. The present application does not limit the implementation method for selecting the feature vector, which may be a sorting selection method as described in the present embodiment, or may be implemented in other ways, which the present application does not describe in detail one by one.

[0100] Therefore, this application can refer to Figure 4 The described method for acquiring feature vectors processes the pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector, and processes the pixel values ​​at corresponding positions of the second region and the fourth region to obtain a second feature vector. The specific implementation process will not be repeated here.

[0101] Step S26, merging the first feature vector and the second feature vector to obtain a liveness detection feature vector;

[0102] Step S27, using the liveness detection feature vector and the attack sample feature vector, determine whether the object to be detected is a live body.

[0103] Following the above analysis, the first eigenvector can represent the characteristic changes of the body parts corresponding to the first and third areas of the object to be detected during the change of light state, especially the image characteristic changes of the iris area during the change of light intensity. Similarly, the second eigenvector represents the characteristic changes of the body parts corresponding to the second and fourth areas of the object to be detected during the change of light state, which may include image characteristic changes of other areas of the object to be detected except the iris area. In this way, the first eigenvector and the second eigenvector are combined to obtain the liveness detection feature vector, which can represent the image characteristic changes represented by the above-mentioned first eigenvector and the second eigenvector.

[0104] Among them, the attack sample feature vector can be a feature vector obtained by processing the corresponding attack sample (such as a photo) in the above manner, that is, the feature vector obtained after replacing the object to be detected in the above step with the corresponding attack sample for processing. The specific acquisition process will not be repeated here.

[0105] As analyzed above, since the corresponding feature vectors obtained from the living body and the attack sample are quite different, especially the vector elements corresponding to the first feature vector they contain, usually, the elements of the first feature vector corresponding to the living body are larger than the elements of the first feature vector corresponding to the attack sample, and the elements of the second feature vector corresponding to the living body are also relatively large. Therefore, this embodiment can determine whether the object to be detected is a living body by comparing the liveness detection feature vector and the attack sample feature vector.

[0106] In one possible implementation, after obtaining the liveness detection feature vector, it can be input into a pre-trained liveness classification model to obtain a classification result of whether the object to be detected is alive. The liveness classification model can be obtained by classifying and training the liveness detection feature vector of the detection object sample and the attack sample feature vector of the attack sample. The present application does not describe in detail the training process of the liveness classification model.

[0107] In summary, in this embodiment, different images are obtained by acquiring the object to be detected under different lighting conditions, which are recorded as the first image and the second image. Afterwards, the present application does not directly perform feature extraction to obtain a feature vector, but extracts different areas corresponding to the same body part from the two images respectively, where a group of different areas includes the iris area of ​​the object to be detected, and then uses the changes in pixel values ​​at corresponding positions of different areas to obtain corresponding feature vectors, which are then merged to obtain the liveness detection feature vector to achieve reliable and high-speed liveness detection.

[0108] Reference Figure 5 , shows a flow chart of another optional example of the liveness detection method proposed in the present application, which may be another optional refinement of the liveness detection method described in the above embodiment, such as Figure 5 As shown, the detailed implementation methods proposed in this embodiment may include:

[0109] Step S31, in response to a start instruction for the instantaneous light source, acquiring a first image of the object to be detected when the instantaneous light source is turned on, and a second image of the object to be detected after the instantaneous light source is turned off;

[0110] Among them, the object to be detected is located within the light irradiation range of the instantaneous light source, and this application does not limit the instantaneous light source and its light irradiation range.

[0111] In combination with the description of the process of acquiring the first image and the second image in the above embodiment, in another optional implementation, the process of acquiring the first image and the second image of the object to be detected may include:

[0112] Acquire a first image of the object to be detected illuminated by the screen of the electronic device at a first brightness; respond to the screen brightness adjustment instruction, control the screen of the electronic device to adjust from the first brightness to the second brightness; acquire a second image of the object to be detected during the process of adjusting the screen of the electronic device from the first brightness to the second brightness, wherein the first brightness is greater than the second brightness. It can be seen that in this implementation, the screen light of the electronic device is used as an instantaneous light source, but it is not limited to the control of screen illumination.

[0113] From the above analysis, it can be seen that the pixel value of each pixel in the first image must be greater than the pixel value of the pixel at the corresponding position in the second image, and the specific numerical value of the specific pixel value is not limited.

[0114] Step S32, extracting the first area and the second area in the first image, and the third area and the fourth area in the second image;

[0115] For the specific implementation of step S32, reference may be made to the description of the corresponding part of the above embodiment.

[0116] As analyzed above, in order to improve data processing efficiency, Figure 6 In the scene diagram shown, the first area and the third area can be the eye area of ​​the object to be detected, and the second area and the fourth area can be the face area of ​​the area to be detected (the area except the eyes), but it is not limited to this. For example, the second area and the fourth area can be the entire face area of ​​the object to be detected, and so on.

[0117] Step S33, respectively reorganizing the pixel values ​​of the first region, the second region, the third region, and the fourth region with the first resolution to obtain the first region and the third region with the second resolution, and the second region and the fourth region with the third resolution;

[0118] It should be noted that the second resolution and the third resolution are both smaller than the first resolution. The present embodiment does not limit the specific values ​​of the first resolution, the second resolution and the third resolution. The second resolution and the third resolution may be the same or different. Normally, since the first area and the third area include the iris area, in order to ensure reliable extraction of iris features, the second resolution of the present embodiment may be greater than the third resolution.

[0119] It can be seen that in this embodiment, before processing the regional image, its resolution can be reduced to improve the image processing efficiency. This application does not elaborate on the implementation process of how to reduce the resolution of the image. It should be understood that if the second area and the fourth area are the entire face area of ​​the object to be detected, since the iris area contained therein accounts for a small proportion of the entire face area, after the resolution of the entire face area image is reduced, the features of the iris area may not be very obvious. In the subsequent feature extraction process, the features of the iris area may be ignored, and only the features of the larger face area are extracted.

[0120] Step S34, obtaining pixel values ​​of the first area, the second area, the third area and the fourth area;

[0121] It should be understood that, in this embodiment, the pixel values ​​corresponding to each region, such as the brightness value of each pixel point contained in each region, are obtained after completing the above-mentioned resolution reduction process.

[0122] Step S35, calculating pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector;

[0123] Step S36, calculating the pixel values ​​at corresponding positions of the second area and the fourth area to obtain a second feature vector;

[0124] Step S37, merging the first feature vector and the second feature vector to obtain a liveness detection feature vector;

[0125] The implementation process of step S34 to step S37 may be implemented according to the description of the corresponding parts of the above embodiment and will not be repeated here.

[0126] Combination Figure 6 In the scene shown, the feature vector of the iris area, when the instantaneous light source is turned on, the iris area of ​​the living body will produce a light spot, while the iris area of ​​the attack sample in the photo will not produce a light spot, which makes the first feature vectors of the living body and the attack sample different, and can specifically realize liveness detection.

[0127] Similarly, when the instantaneous light source is turned on, the feature changes at different positions in the face area of ​​the living body are more obvious, while the feature changes at different positions in the face area of ​​the attack sample are very small, such as Figure 6 As shown, the present application can utilize this area to implement liveness detection.

[0128] Based on the above analysis, in order to improve the accuracy of liveness detection, this application will merge the first feature vector and the second feature vector obtained in the above manner as the liveness detection feature vector to implement liveness detection. The specific process of obtaining the liveness detection feature vector is not described in detail.

[0129] Step S38, inputting the liveness detection feature vector into the liveness classification model to obtain a classification result of whether the object to be detected is a live body;

[0130] The liveness classification model may be obtained by performing classification training on liveness detection feature vectors of detection object samples and attack sample feature vectors of attack samples, and the specific training process will not be described in detail.

[0131] Step S39: executing corresponding preset operations according to the classification result.

[0132] In this embodiment, the content of the preset operation can be determined based on the application scenario of liveness detection. The preset operation corresponding to the classification result that the object to be detected is a live body may include starting the operating system of the electronic device, completing the payment of virtual resources, controlling the running of specific applications, controlling the opening of access control devices, etc. This application does not limit the content of the preset operation.

[0133] In summary, when the object to be detected is within the light irradiation range of the instantaneous light source, the instantaneous light source is controlled to turn on to obtain images of the object to be detected at different brightnesses, that is, a first image under illumination and a second image without illumination. Different areas corresponding to the same body part are selected from the two images, and the obtained areas are processed with reduced resolution to improve the efficiency of subsequent image processing. Thereafter, corresponding feature vectors are generated using changes in pixel values ​​of different areas corresponding to the same body part. Feature vectors corresponding to different body parts are then merged to obtain a liveness detection feature vector, which is input into a liveness classification model to quickly and accurately obtain a classification result of whether the object to be detected is alive, so as to execute corresponding preset operations to meet user needs, such as improving the safety of electronic equipment use.

[0134] Reference Figure 7 , shows a schematic diagram of the structure of an optional example of a living body detection device proposed in the present application, which can be applied to electronic devices such as Figure 7 As shown, the living body detection device may include:

[0135] An image acquisition module 11 is used to acquire a first image and a second image of the object to be detected;

[0136] The time interval between the acquisition of the first image and the second image is less than a first specific value, and the first image and the second image are generated when the object to be detected is in different light conditions.

[0137] A region extraction module 12, configured to extract a first region and a second region in the first image, and a third region and a fourth region in the second image;

[0138] In this embodiment, the first area and the third area correspond to the same body part of the object to be detected and include an iris area, and the second area and the fourth area correspond to the same body part of the object to be detected.

[0139] The living body detection module 13 is used to determine whether the object to be detected is a living body according to the pixel values ​​at the corresponding positions of the first area and the third area, and the pixel values ​​at the corresponding positions of the second area and the fourth area.

[0140] In some embodiments, Figure 8 As shown, the above-mentioned living body detection module 13 may include:

[0141] A pixel value acquisition unit 131 is used to acquire pixel values ​​of the first region, the second region, the third region and the fourth region respectively;

[0142] A first feature vector obtaining unit 132 is used to calculate the pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector;

[0143] A first feature vector obtaining unit 133 is used to calculate the pixel values ​​at corresponding positions of the second region and the fourth region to obtain a second feature vector;

[0144] In some embodiments, the process of obtaining a feature vector by performing calculations using pixel values ​​at corresponding positions of different regions, that is, the first feature vector obtaining unit 132 and the second feature vector obtaining unit 133 may include:

[0145] A pixel matrix obtaining unit is used to renormalize the pixel values ​​at corresponding positions of different regions to obtain a pixel matrix;

[0146] A dimensionality reduction processing unit, used for vectorizing the pixel matrix and sorting the obtained one-dimensional vector elements;

[0147] The feature vector construction unit is used to select the first number of elements with larger element values ​​according to the sorting result to construct the feature vectors corresponding to the different regions.

[0148] A feature vector merging unit 134, configured to merge the first feature vector and the second feature vector to obtain a liveness detection feature vector;

[0149] The liveness detection unit 135 is used to determine whether the object to be detected is a live body by using the liveness detection feature vector and the attack sample feature vector.

[0150] In a possible implementation, the living body detection unit 135 may specifically include:

[0151] The liveness classification unit is used to input the liveness detection feature vector into a liveness classification model to obtain a classification result of whether the object to be detected is alive. The classification model is obtained by classifying and training the liveness detection feature vector of the detection object sample and the attack sample feature vector of the attack sample.

[0152] In one possible implementation, Figure 8 As shown, the above-mentioned living body detection module 13 may also include:

[0153] An image resolution adjustment unit 136, configured to reorganize the pixel values ​​of the first region, the second region, the third region, and the fourth region having the first resolution, respectively, to obtain the first region and the third region having the second resolution, and the second region and the fourth region having the third resolution;

[0154] The second resolution and the third resolution are both smaller than the first resolution.

[0155] In some embodiments, Fig. 9 As shown, the above-mentioned image acquisition module 11 may include:

[0156] A light source on instruction corresponding unit 111 is used to respond to an on instruction for an instantaneous light source, obtain a first image of the object to be detected when the instantaneous light source is on, and a second image of the object to be detected after the instantaneous light source is off;

[0157] Wherein, the object to be detected is located within the light irradiation range of the instantaneous light source.

[0158] In some other embodiments, Fig.10 As shown, the image acquisition module 11 may also include:

[0159] A first image acquisition unit 112 is used to acquire a first image of the object to be detected illuminated by the screen of the electronic device at a first brightness;

[0160] The brightness adjustment unit 113 is used to control the screen of the electronic device to adjust from a first brightness to a second brightness in response to a screen brightness adjustment instruction;

[0161] The second image acquisition unit 114 is used to acquire a second image of the object to be detected when the screen of the electronic device is adjusted from the first brightness to the second brightness.

[0162] It should be noted that the various modules, units, etc. in the above-mentioned device embodiments can be stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to implement the corresponding functions. For the functions implemented by each program module and its combination, as well as the technical effects achieved, please refer to the description of the corresponding parts of the above-mentioned method embodiments, which will not be repeated in this embodiment.

[0163] The present application also provides a storage medium on which a program can be stored. The program can be called and loaded by a processor to implement the various steps of the liveness detection method described in the above embodiment. The specific implementation process can refer to the description of the corresponding part of the above method embodiment.

[0164] Reference Fig.11 , is a schematic diagram of the hardware structure of an electronic device proposed in an embodiment of the present application. The electronic device may be a terminal device or a server, etc. The present application does not limit the product type of the electronic device. For example, Fig.11 As shown, the electronic device may include: at least one memory 21 and at least one processor 22, wherein:

[0165] The memory 21 and the processor 22 can exchange data via a communication bus, and the specific communication process will not be described in detail.

[0166] In this embodiment, the memory 21 can be used to store a program for implementing the liveness detection method described in the above method embodiment; the processor 22 can be used to load and execute the program stored in the memory 21 to implement the various steps of the liveness detection method described in the above method embodiment. The specific implementation process can refer to the description of the corresponding part of the above method embodiment, which will not be repeated in this embodiment.

[0167] In some embodiments, the memory 21 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device or other volatile solid-state storage device. The processor 22 may be a central processing unit (CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices.

[0168] In one possible implementation, the memory 21 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as an image processing function), a program for implementing the liveness detection method proposed in the present application, etc.; the data storage area may store data generated during the use of the electronic device, such as a first image and a second image of the object to be detected, a liveness detection feature vector, etc.

[0169] It should be understood that Fig.11 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application. Fig.11 The structure of the electronic device shown does not constitute a limitation on the electronic device in the embodiment of the present application. In practical applications, the electronic device may include Fig.11 More or fewer components than shown, or combinations of certain components.

[0170] If the electronic terminal equipment, such as smart phones, tablet computers, wearable devices, ultra-mobile personal computers (UMPC), netbooks, desktop computers, bank self-service equipment, etc., refer to Fig.12The electronic device proposed in this application may also include a communication interface, an antenna, a sensor module, a power module, a touch sensing unit for sensing touch events on a touch display panel, at least one of input devices such as a keyboard, a mouse, a camera, and a microphone, and at least one of output devices such as a display, a speaker, a vibration mechanism, and a lamp. This application does not limit the specific composition structure of the terminal device. Fig.12 This is just an optional example.

[0171] Finally, it should be noted that the various embodiments in this specification are described in a progressive or parallel manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0172] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for detecting a living body, the method comprising: include: Acquire a first image and a second image of an object to be detected, wherein a time interval between the acquisition of the first image and the second image is less than a first specific value, and the first image and the second image are generated when the object to be detected is in different light conditions; Extracting a first area and a second area in the first image, and a third area and a fourth area in the second image, wherein the first area and the third area correspond to the same body part of the object to be detected and include an iris area, and the second area and the fourth area correspond to the same body part of the object to be detected; Determining whether the object to be detected is a living body according to the pixel values ​​of the first area and the corresponding positions of the third area, and the pixel values ​​of the second area and the corresponding positions of the fourth area; Wherein, determining whether the object to be detected is a living body according to the pixel values ​​at the corresponding positions of the first area and the third area, and the pixel values ​​at the corresponding positions of the second area and the fourth area, includes: Obtaining pixel values ​​of the first area, the second area, the third area, and the fourth area; Calculating pixel values ​​at corresponding positions of the first region and the third region to obtain a first feature vector; Calculating pixel values ​​at corresponding positions of the second region and the fourth region to obtain a second feature vector; Merging the first feature vector and the second feature vector to obtain a liveness detection feature vector; The liveness detection feature vector and the attack sample feature vector are used to determine whether the object to be detected is a live body.

2. The method according to claim 1, using the liveness detection feature vector and the attack sample feature vector to determine whether the object to be detected is live, include: The liveness detection feature vector is input into a liveness classification model to obtain a classification result of whether the object to be detected is alive. The classification model is obtained by classifying and training the liveness detection feature vector of the detection object sample and the attack sample feature vector of the attack sample.

3. The method according to claim 1, wherein the determining whether the object to be detected is a living body is based on the pixel values ​​of the corresponding positions of the first area and the third area, and the pixel values ​​of the corresponding positions of the second area and the fourth area, and further include: Reorganizing the pixel values ​​of the first region, the second region, the third region, and the fourth region with the first resolution to obtain the first region and the third region with the second resolution, and the second region and the fourth region with the third resolution; The second resolution and the third resolution are both smaller than the first resolution.

4. The method according to any one of claims 1 to 3, wherein the first image and the second image of the object to be detected are obtained. include: In response to a start instruction for the instantaneous light source, a first image of the object to be detected when the instantaneous light source is turned on and a second image of the object to be detected after the instantaneous light source is turned off are acquired; Wherein, the object to be detected is located within the light irradiation range of the instantaneous light source.

5. The method according to any one of claims 1 to 3, wherein the first image and the second image of the object to be detected are obtained. include: Acquire a first image of the object to be detected illuminated by the screen of the electronic device at a first brightness; In response to the screen brightness adjustment instruction, controlling the screen of the electronic device to adjust from a first brightness to a second brightness; Acquire a second image of the object to be detected when the electronic device screen is adjusted from the first brightness to the second brightness.

6. The method according to any one of claims 1 to 3, wherein the pixel values ​​at corresponding positions in different regions are used to perform calculations to obtain feature vectors. include: Renormalize the pixel values ​​at corresponding positions in different regions to obtain a pixel matrix; Vectorizing the pixel matrix, and sorting the obtained one-dimensional vector elements; According to the sorting result, elements whose element values ​​reach the element specific value are selected to form feature vectors corresponding to the different regions.

7. A living body detection device, the device include: An image acquisition module, used for acquiring a first image and a second image of an object to be detected, wherein a time interval between the acquisition of the first image and the second image is less than a first specific value, and the first image and the second image are generated when the object to be detected is in different light conditions; a region extraction module, configured to extract a first region and a second region in the first image, and a third region and a fourth region in the second image, wherein the first region and the third region correspond to the same body part of the object to be detected and include an iris region, and the second region and the fourth region correspond to the same body part of the object to be detected; A living body detection module, used for determining whether the object to be detected is a living body according to the pixel values ​​of the corresponding positions of the first area and the third area, and the pixel values ​​of the corresponding positions of the second area and the fourth area; Among them, determining whether the object to be detected is a living body based on the pixel values ​​of the corresponding positions of the first area and the third area, and the pixel values ​​of the corresponding positions of the second area and the fourth area, includes: obtaining the pixel values ​​of the first area, the second area, the third area and the fourth area respectively; performing operations on the pixel values ​​of the corresponding positions of the first area and the third area to obtain a first feature vector; performing operations on the pixel values ​​of the corresponding positions of the second area and the fourth area to obtain a second feature vector; merging the first feature vector and the second feature vector to obtain a liveness detection feature vector; and using the liveness detection feature vector and the attack sample feature vector to determine whether the object to be detected is a living body.

8. A storage medium having a program stored thereon, wherein the program is executed by a processor to implement the living body detection method according to any one of claims 1 to 6.

9. An electronic device, include: at least one memory and at least one processor, wherein: The memory is used to store a program for implementing the liveness detection method according to any one of claims 1 to 6; The processor is used to load and execute the program stored in the memory to implement each step of the living body detection method according to any one of claims 1 to 6.