A method and device for detecting living body, and a computer-readable storage medium

By performing feature point detection and region construction on face images, extracting contour and texture features, and performing live body detection, the problem of poor live body detection results in the existing technology is solved, and the accuracy and security of identity verification are improved.

CN110765924BActive Publication Date: 2024-08-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910996307.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-18
Publication Date
2024-08-27
Estimated Expiration
2039-10-18

AI Technical Summary

Technical Problem

In the existing identity verification system based on face recognition, the liveness detection effect is poor, which affects the accuracy and security of identity verification.

Method used

By acquiring the face image of the object to be detected, detecting key feature points, constructing the first detection area and the second detection area, extracting image contour features and texture features, performing live body detection based on the preset live body detection model, and determining that the object to be detected is Living or inanimate.

Benefits of technology

It improves the accuracy and security of identity verification, enables non-sensory live body detection, and effectively identifies counterfeit live bodies, such as photos or pieces of paper, reducing the possibility of successful attacks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN110765924B
    Figure CN110765924B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a liveness detection method, device and computer-readable storage medium, wherein the liveness detection method comprises: obtaining a face image of an object to be detected, the face image comprising a face area; performing key feature point detection on the face image to obtain a feature point set corresponding to the face image; constructing a first detection area and a second detection area on the face image according to the feature point set, the second detection area being located in the face area and being included in the first detection area; extracting image contour features of the first detection area, and extracting image texture features of the second detection area; performing liveness detection on the face image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected. The liveness detection method can improve the accuracy and security of identity authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a living body detection method, device and computer-readable storage medium. Background Art

[0002] In recent years, identity authentication technologies, such as fingerprint recognition, eye pattern recognition, iris recognition, and face recognition, have been greatly developed. Among them, face recognition technology is the most prominent, and it has been more and more widely used in various identity authentication systems.

[0003] Existing identity authentication systems based on face recognition can include face verification and liveness detection. Among them, liveness detection is mainly used to confirm that the collected face images and other data are from the user himself, rather than playback videos or forged materials. However, the existing liveness detection schemes are not effective, which greatly affects the accuracy and security of identity authentication. Summary of the invention

[0004] The embodiments of the present invention provide a living body detection method, device and computer-readable storage medium, which can improve the accuracy and security of identity authentication.

[0005] An embodiment of the present invention provides a living body detection method, comprising:

[0006] Acquire a facial image of an object to be detected, wherein the facial image includes a facial area;

[0007] Performing key feature point detection on the face image to obtain a set of feature points corresponding to the face image;

[0008] Constructing a first detection area and a second detection area on the face image according to the feature point set, respectively, wherein the second detection area is located in the face area, and the second detection area is included in the first detection area;

[0009] Extracting image contour features of the first detection area, and extracting image texture features of the second detection area;

[0010] Based on the image contour features and the image texture features, liveness detection is performed on the face image to obtain a liveness detection result of the object to be detected.

[0011] Accordingly, an embodiment of the present invention further provides a living body detection device, comprising:

[0012] An acquisition module, used for acquiring a face image of an object to be detected, wherein the face image includes a face area;

[0013] A first detection module is used to detect key feature points of the face image to obtain a set of feature points corresponding to the face image;

[0014] A construction module, configured to construct a first detection area and a second detection area on the face image according to the feature point set, wherein the second detection area is located in the face area and is included in the first detection area;

[0015] A first extraction module, used to extract image contour features of the first detection area;

[0016] A second extraction module, used to extract image texture features of the second detection area;

[0017] The second detection module is used to perform liveness detection on the face image based on the image contour features and image texture features to obtain a liveness detection result of the object to be detected.

[0018] Optionally, in some embodiments of the present invention, the building blocks include:

[0019] A construction unit, configured to select a plurality of reference feature points for living body detection from the feature point set;

[0020] A calculation unit, used to calculate a central feature point corresponding to the multiple reference feature points;

[0021] A construction unit is used to construct a first detection area and a second detection area on the face image based on the central feature point and multiple reference feature points.

[0022] Optionally, in some embodiments of the present invention, the construction unit is specifically used for:

[0023] Acquire a plurality of image boundary points of the face image;

[0024] Taking the central feature point as the center, constructing a first detection area including a plurality of reference feature points and some image boundary points on the face image according to a first preset ratio;

[0025] Taking the central feature point as the center, a second detection area including a plurality of reference feature points is constructed on the face area according to a second preset ratio.

[0026] Optionally, in some embodiments of the present invention, the first extraction module is specifically used to:

[0027] Remove the face area from the first detection area to obtain a contour area;

[0028] Extracting image contour features of the first contour area.

[0029] Optionally, in some embodiments of the present invention, the second detection module includes:

[0030] An acquisition unit, used to acquire a preset living body detection model;

[0031] The detection unit is used to perform liveness detection on the face image based on the image contour features and image texture features through a preset liveness detection model to obtain a liveness detection result of the object to be detected.

[0032] Optionally, in some embodiments of the present invention, the preset living body detection model includes a first sub-model and a second sub-model, the first sub-model is connected to the second sub-model in a cascade manner, and the detection unit includes:

[0033] A first recognition unit is used to identify the type of pixels in the first detection area based on the image contour feature by using a first sub-model in a preset living body detection model to obtain a first recognition result;

[0034] A first determining unit, configured to determine a probability that the object to be detected in the first detection area is a living body according to the first recognition result, to obtain a first living body probability;

[0035] a second recognition unit, configured to, when the first liveness probability is greater than a first threshold, identify the type of pixels in the second detection area based on the image texture feature by using a second sub-model in a preset liveness detection model to obtain a second recognition result;

[0036] A second determining unit, configured to determine a probability that the object to be detected in the second detection area is a living body according to the second recognition result, to obtain a second living body probability;

[0037] The third determining unit is configured to determine that the object to be detected corresponding to the face image is a living body when the second living body probability is greater than a second threshold.

[0038] Optionally, in some embodiments of the present invention, the second detection area includes a plurality of sub-areas, and the second identification unit is specifically used to:

[0039] Based on the image texture features, the pixel type of each sub-region is identified by using the second sub-model in the preset living body detection model to obtain the identification result of each sub-region;

[0040] The recognition results of each sub-region are fused to obtain a second recognition result.

[0041] Optionally, in some embodiments of the present invention, the second determining unit is specifically configured to:

[0042] Extracting the probability that the object to be detected in each sub-region is a living body from the second recognition result to obtain a plurality of third living body probabilities;

[0043] Obtaining a weight corresponding to each sub-region from the second recognition result, the weight indicating the importance of the corresponding sub-region when the second detection region is used for living body detection;

[0044] Based on the weight corresponding to each sub-region and the multiple third living body probabilities, the probability that the object to be detected in the second detection area is a living body is calculated to obtain a second living body probability.

[0045] Optionally, in some embodiments of the present invention, the detection unit further includes:

[0046] The fourth determination unit is used to determine that the object to be detected corresponding to the face image is non-living when the first liveness probability is less than or equal to a first threshold, or; when the first liveness probability is greater than the first threshold and the second liveness probability is less than or equal to a second threshold, determine that the object to be detected corresponding to the face image is non-living.

[0047] Optionally, in some embodiments of the present invention, the preset living body detection model includes a first sub-model and a second sub-model, the first sub-model is connected to the second sub-model in parallel, and the detection unit is specifically used for:

[0048] Based on the image contour feature, the pixel type in the first detection area is identified by using a first sub-model in a preset living body detection model to obtain a first identification result;

[0049] Determine the probability that the object to be detected in the first detection area is a living body according to the first recognition result, and obtain a first living body probability;

[0050] Based on the image texture feature, the type of pixels in the second detection area is identified by using a second sub-model in a preset living body detection model to obtain a second identification result;

[0051] Determine the probability that the object to be detected in the second detection area is a living body according to the second recognition result, and obtain a second living body probability;

[0052] When the first living body probability is greater than a first threshold value, and when the second living body probability is greater than a second threshold value, it is determined that the object to be detected corresponding to the face image is a living body.

[0053] Optionally, in some embodiments of the present invention, the detection unit is further used for:

[0054] When the first liveness probability is less than or equal to a first threshold, and / or the second liveness probability is less than or equal to a second threshold, it is determined that the object to be detected corresponding to the face image is a non-live object.

[0055] Optionally, in some embodiments of the present invention, a training module is further included, and the training module is specifically used to:

[0056] Collecting a training sample set, wherein the training sample set includes a plurality of images marked as living objects and a plurality of images marked as non-living objects;

[0057] Determine a sample currently being processed from the training sample set to obtain a current processing object;

[0058] Inputting the current processing object into the detection model to obtain a live body prediction value of the current processing object;

[0059] Acquire the real value of the living body of the currently processed object;

[0060] The detection model is converged based on the liveness true value and the liveness predicted value to obtain a liveness detection model.

[0061] In the embodiment of the present invention, after obtaining a face image of an object to be detected, the face image includes a face area; key feature point detection is performed on the face image to obtain a feature point set corresponding to the face image; then, a first detection area and a second detection area are respectively constructed on the face image according to the feature point set, the second detection area is located in the face area, and the second detection area is included in the first detection area; then, the image contour feature of the first detection area is extracted, and the image texture feature of the second detection area is extracted, and finally, based on the image contour feature and the image texture feature, liveness detection is performed on the face image to obtain a liveness detection result of the object to be detected. The embodiment of the present invention belongs to non-interactive liveness detection, that is, no user cooperation is required, and it is imperceptible to the user. Moreover, when an attacker attacks through a forged live body such as a photo, video or paper, this solution can detect the forged live body by detecting the image contour feature of the first detection area and the image texture feature of the second detection area, thereby determining that the forged live body is non-live, thereby improving the accuracy and security of identity authentication. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0063] Figure 1a This is a schematic diagram of a first scenario of a liveness detection method provided by an embodiment of the present invention;

[0064] Figure 1bis a flow chart of a liveness detection method provided by an embodiment of the present invention;

[0065] Figure 1c is a schematic diagram of a second scenario of the living body detection method provided by an embodiment of the present invention;

[0066] Figure 1d is a schematic diagram of a third scenario of the living body detection method provided by an embodiment of the present invention;

[0067] Figure 1e is a schematic diagram of a first structure of a liveness detection model in a liveness detection method provided in an embodiment of the present invention;

[0068] Figure 1f is a second structural schematic diagram of a liveness detection model in the liveness detection method provided in an embodiment of the present invention;

[0069] Figure 2a is another schematic flow chart of the liveness detection method provided by an embodiment of the present invention;

[0070] Figure 2b is a schematic diagram of a fourth scenario of the living body detection method provided by an embodiment of the present invention;

[0071] Figure 2c 1 is a schematic diagram of a scenario under screen attack of a liveness detection method provided by an embodiment of the present invention;

[0072] Figure 2d 1 is a schematic diagram of a scenario under a paper attack of a liveness detection method provided by an embodiment of the present invention;

[0073] Figure 2e is a schematic diagram of a fifth scenario of the living body detection method provided by an embodiment of the present invention;

[0074] Figure 2f is a sixth scenario schematic diagram of the living body detection method provided by an embodiment of the present invention;

[0075] Figure 3a is a structural schematic diagram of a first implementation manner of a living body detection device provided by an embodiment of the present invention;

[0076] Figure 3b is a structural schematic diagram of a second implementation manner of a living body detection device provided in an embodiment of the present invention;

[0077] Figure 4 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0078] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0079] First, the terms mentioned in the embodiments of the present invention are explained accordingly:

[0080] Image texture features: Texture includes the texture of an object in the usual sense (that is, the uneven grooves on the surface of the object), and also includes the colored patterns on the smooth surface of the object, which we usually call patterns. For patterns, it means drawing colored patterns or designs on the surface of the object, and the surface of the object after the texture is generated remains smooth. For grooves, it is actually necessary to draw colored patterns or designs on the surface, and at the same time, it is required to give people a sense of unevenness visually. In an embodiment of the present invention, image texture refers to the texture of the image in the detection area, and the image texture feature is used to characterize the properties of the global features of the detection area, that is, the image texture feature describes the surface properties of the scene corresponding to the detection area.

[0081] Image contour feature: The contour can be simply interpreted as a curve connecting all consecutive points (along the boundary) with the same color or intensity. The contour is a useful tool for shape analysis and object detection and recognition. It can be understood that in the embodiment of the present invention, the image contour refers to the image contour of the detection area, and the image contour feature is used to characterize the boundary characteristics of the detection area.

[0082] The embodiments of the present invention provide a living body detection method and device.

[0083] The liveness detection device can be integrated into a computer device, such as Figure 1a As shown, for example, it can be installed in a computer device in the form of a client, such as a mobile phone, a tablet computer, a personal computer (PC) or a door access control machine.

[0084] When it is necessary to perform liveness detection on the object to be detected, the computer device where the liveness detection device is located can obtain the face image of the object to be detected, and then perform key feature point detection on the face image to obtain a feature point set corresponding to the face image, and then, according to the feature point set, respectively construct a first detection area and a second detection area on the face image, wherein the second detection area is located in the face area, and the second detection area is included in the first detection area, and then, extract the image contour features of the first detection area, and extract the image texture features of the second detection area, and finally, perform liveness detection on the face image according to the image contour features and the image texture features to obtain the liveness detection result of the object to be detected.

[0085] For example, specifically, the liveness detection device can be integrated into an access control machine. When the user clicks a trigger button for liveness detection, such as clicking a "verification" control button on the access control machine, the access control machine can obtain the object to be detected in front of the camera through the camera of the access control machine. Then, key feature point detection can be performed on the face image to obtain a feature point set corresponding to the face image. Then, the access control machine constructs a first detection area and a second detection area on the face image according to the feature point set, wherein the second detection area is located in the face area, and the second detection area is included in the first detection area. Then, the first detection area is extracted respectively. The image contour features of the area, and the image texture features of the second detection area are extracted. Finally, liveness detection is performed on the face image according to the image contour features and the image texture features to obtain the liveness detection result of the object to be detected. When the liveness detection result of the object to be detected indicates that the object to be detected is alive, the access control machine can perform the next operation based on the preset instructions, such as allowing the object to be detected to pass; when the liveness detection result of the object to be detected indicates that the object to be detected is not alive, the access control machine can perform the next operation based on the preset instructions, such as prohibiting the object to be detected from passing. The specific settings are made according to the actual situation.

[0086] The following are detailed descriptions respectively. It should be noted that the description order of the following embodiments is not intended to limit the priority order of the embodiments.

[0087] A liveness detection method comprises: obtaining a face image of an object to be detected, performing key feature point detection on the face image to obtain a feature point set corresponding to the face image, constructing a first detection area and a second detection area on the face image according to the feature point set, extracting image contour features of the first detection area, and extracting image texture features of the second detection area, performing liveness detection on the face image based on the image contour features and the image texture features, and obtaining a liveness detection result of the object to be detected.

[0088] See also Figure 1b , Figure 1b: is a flow chart of a liveness detection method provided by an embodiment of the present invention. The specific flow of the liveness detection method may be as follows:

[0089] 101. Obtain a face image of an object to be detected.

[0090] Among them, the face image includes the face area, and the face image of the object to be detected can be a frame image in the video stream, or it can be multiple consecutive frames of images in the video stream. For example, specifically, the face image of the object to be detected taken by the camera device in the detection system can be obtained, or one frame image can be selected from the video stream of the object to be detected taken by the camera device in the detection system as the current frame image, and then, the face image of the object to be detected is obtained from the current frame image. The specific setting is performed according to the actual situation and will not be repeated here.

[0091] 102. Perform key feature point detection on the face image to obtain a set of feature points corresponding to the face image.

[0092] Specifically, the geometric features of the face can be used to extract facial feature points with size, rotation and displacement invariance, such as the key feature points of the eyes, nose and lips. For example, 9 feature points of the face are selected, and the distribution of these feature points is angle-invariant, namely 2 eyeball center points, 4 eye corner points, the midpoints of the two nostrils and 2 mouth corner points. Of course, all feature points of the face can also be selected, such as eyebrows, facial contours, lips, eyes and nose, etc.

[0093] 103. Construct a first detection area and a second detection area on the face image according to the feature point set.

[0094] Among them, the second detection area is located in the face area, and the second detection area is included in the first detection area, that is, on the face image, there are two scales of detection areas: the first detection area and the second detection area, the size of the first detection area is larger than the size of the second detection area, for example, specifically, 5 reference feature points for liveness detection can be selected from the feature point set, and these 5 reference feature points can include 2 eyeball center points, the midpoints of the two nostrils and 2 mouth corner points, of course, it is also possible to select 9 reference feature points for liveness detection from the feature point set, these 9 reference feature points can include 2 eyeball center points, 4 eye corner points, the midpoints of the two nostrils and 2 mouth corner points, which are specifically set according to actual conditions, and then, the central feature points corresponding to the multiple reference feature points are calculated, and then, the first detection area and the second detection area are respectively constructed on the face image, that is, in some embodiments, the step of "constructing the first detection area and the second detection area on the face image according to the feature point set" can specifically include:

[0095] (11) selecting a plurality of reference feature points for liveness detection from the feature point set;

[0096] (12) Calculating the central feature points corresponding to the multiple reference feature points;

[0097] (13) Based on the central feature point and multiple reference feature points, a first detection area and a second detection area are constructed on the face image respectively.

[0098] For details, please refer to Figure 1c , select 5 feature points for liveness detection from the feature point set, and these 5 feature points include feature point A, feature point B, feature point C, feature point D and feature point E. For example, a two-dimensional coordinate axis of a face image can be constructed, and then the coordinates of each reference feature point on this two-dimensional coordinate axis are obtained respectively, and the coordinates of feature point A are obtained as (2, 5), the coordinates of feature point B are obtained as (8, 5), the coordinates of feature point C are obtained as (5, 3), the coordinates of feature point D are obtained as (3, 2) and the coordinates of feature point A are obtained as (6, 2). Then, the average of the horizontal coordinates corresponding to the 5 reference feature points is calculated, and the average of the vertical coordinates corresponding to the 5 reference feature points is calculated to obtain the central coordinates (4.8, 3.4). Then, the central feature point corresponding to multiple reference feature points is determined according to the central coordinates (4.8, 3.4). Finally, based on the central feature point and multiple reference feature points, a first detection area and a second detection area are constructed on the face image.

[0099] In some embodiments, when the face image is a screen attack (such as a mobile phone attack or a tablet attack, etc.), the screen attack image will include the border of the electronic device. Therefore, the first detection area can be constructed by the image boundary points and the central feature points of the face image. When the face image is a paper attack, the texture of the face image must be quite different from the real face. Therefore, the second detection area can be constructed in the face area to facilitate the acquisition of the texture features of the second detection area. That is, in some embodiments, the step of "constructing the first detection area and the second detection area on the face image based on the central feature point and multiple reference feature points respectively" can specifically include:

[0100] (21) obtaining a plurality of image boundary points of the face image;

[0101] (22) constructing a first detection area including a plurality of reference feature points and a portion of image boundary points on the face image according to a first preset ratio with the central feature point as the center;

[0102] (23) With the central feature point as the center, a second detection area including a plurality of reference feature points is constructed on the face area according to a second preset ratio.

[0103] For details, please refer to Figure 1d First, a plurality of image boundary points of the face image can be obtained, and then, with the central feature point as the center, a first detection area is constructed on the face image according to a first preset ratio. For example, the first preset ratio can be a 3*3 ratio, with the central feature point U as the center point of the first detection area, the horizontal coordinate of the central feature point is enlarged by 3 times, and the vertical coordinate of the central feature point is reduced by 3 times to obtain the first boundary point U1, the horizontal coordinate of the central feature point is enlarged by 3 times, and the vertical coordinate of the central feature point is enlarged by 3 times to obtain the second boundary point U2, the horizontal coordinate of the central feature point is reduced by 3 times, and the vertical coordinate of the central feature point is enlarged by 3 times to obtain the third boundary point U3, the horizontal coordinate of the central feature point is reduced by 3 times, and the vertical coordinate of the central feature point is reduced by 3 times to obtain the fourth boundary point U4, and then, based on the image information and the plurality of reference feature points, a first detection area is constructed on the face image, wherein the boundary points U1, U2, U3 and U4 are used as boundary points of the first detection area. Of course, the first preset ratio can also be other ratios, which are set according to actual conditions.

[0104] The method of constructing the second detection area is similar to the method of constructing the first detection area, and will not be repeated here. It should be noted that, in some embodiments, the first preset ratio is greater than the second preset ratio. For example, the first preset ratio is 5*5, then the second preset ratio is 3*3 or 2*2.

[0105] After the first detection area and the second detection area are constructed, step 104 may be performed.

[0106] 104. Extract image contour features of the first detection area, and extract image texture features of the second detection area.

[0107] The first detection area and the second detection area can be respectively feature extracted using a preset liveness detection model to obtain image contour features of the first detection area and image texture features of the second detection area. After obtaining the image contour features of the first detection area and the image texture features of the second detection area, step 105 can be executed.

[0108] It should be noted that, in order to improve the effectiveness of feature extraction, image contour features of the contour area of ​​the face image may be extracted to make the liveness detection result more accurate. That is, in some embodiments, the step of “extracting image contour features of the first detection area” may specifically include:

[0109] (31) removing the face region in the first detection region to obtain a contour region;

[0110] (32) Extract image contour features of the first contour area.

[0111] 105. Perform liveness detection on the face image based on image contour features and image texture features to obtain a liveness detection result of the object to be detected.

[0112] Among them, based on the image contour features and the image texture features, liveness detection can be performed on the face image through a preset liveness detection model to obtain a liveness detection result of the object to be detected. That is, in some embodiments, the step of "performing liveness detection on the face image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected" can specifically include:

[0113] (41) Obtaining a preset liveness detection model;

[0114] (42) Based on the image contour features and image texture features, liveness detection is performed on the face image through a preset liveness detection model to obtain the liveness detection result of the object to be detected.

[0115] Among them, it is possible to determine whether the facial image is a screen-type attack image through the image contour features of the first detection area, and it is possible to determine whether the facial image is a paper-type attack image through the image texture features of the second detection area. When the image contour features of the first detection area meet the first preset condition, it can be determined that the facial image is not a screen-type attack image; when the image texture features of the second detection area meet the second preset condition, it can be determined that the facial image is not a paper-type attack image. Therefore, when the image contour features of the first detection area meet the first preset condition and the image texture features of the second detection area meet the second preset condition, it is determined that the object to be detected corresponding to the facial image is a living body.

[0116] Furthermore, based on the image contour feature, a first liveness probability can be obtained by using a first sub-model in a preset liveness detection model, and based on the image texture feature, a second liveness probability can be obtained by using a second sub-model in a preset liveness detection model, wherein the first liveness probability represents the probability that the object to be detected in the first detection area is live, and the second liveness probability represents the probability that the object to be detected in the second detection area is live. Optionally, in some embodiments, the preset liveness detection model includes a first sub-model and a second sub-model, and the first sub-model is connected to the second sub-model in a cascade manner, such as Figure 1e As shown, that is, the step of "performing liveness detection on the face image based on the image contour features and the image texture features by using a preset liveness detection model to obtain a liveness detection result of the object to be detected" may specifically include:

[0117] (51) Based on the image contour feature, the pixel type in the first detection area is identified by using a first sub-model in a preset living body detection model to obtain a first identification result;

[0118] (52) determining a probability that the object to be detected in the first detection area is a living body according to the first recognition result, and obtaining a first living body probability;

[0119] (53) when the first liveness probability is greater than a first threshold, based on the image texture feature, identifying the type of pixels in the second detection area by using a second sub-model in a preset liveness detection model to obtain a second identification result;

[0120] (54) determining a probability that the object to be detected in the second detection area is a living body according to the second recognition result, and obtaining a second living body probability;

[0121] (55) When the second living body probability is greater than the second threshold, it is determined that the object to be detected corresponding to the face image is a living body.

[0122] For example, the pixel type in the first detection area can be identified by the fully connected layer of the first sub-model in the preset liveness detection model and the activation function of the first sub-model to obtain a first identification result, and then the first identification result is mapped into the probability that the object in the first detection area is a live body to obtain a first live body probability. When the first live body probability is greater than the first threshold, the pixel type in the second detection area can be identified by the fully connected layer of the second sub-model in the preset liveness detection model and the activation function of the second sub-model to obtain a second identification result. Then, the second identification result can be mapped into the probability that the object in the second detection area is a live body to obtain a second live body probability. When the second live body probability is greater than the second threshold, it is determined that the object to be detected corresponding to the face image is a live body, wherein the first threshold and the second threshold can be equal, or the first threshold and the second threshold can be unequal, and are set according to actual conditions. In some embodiments, in order to improve the real person pass rate, for example, the first threshold can be set to 0.1 or 0.3, and the second threshold can be set to 0.5.

[0123] Among them, when the acquired facial image includes multiple continuous frame images, the pixel type in the second detection area corresponding to each frame image can be identified. Since the facial image includes multiple continuous frame images, if the object to be detected corresponding to the facial image is a living body, it can be identified by the pixel type of a specific area in each second detection area, so as to obtain the biological information corresponding to the object to be detected, such as the blinking of eyes and the opening and closing of lips, etc. For example, specifically, when the environment corresponding to a certain frame image is dark, the area other than the eye area in the second detection area is blurred. At this time, it can be identified by the pixel type of the eye area in each second detection area, so as to obtain the second recognition result.

[0124] For another example, when the size of the face area in the face image is small, at this time, the image texture features of the second detection area may not truly reflect the texture corresponding to the object to be detected in the second detection area, thereby causing inaccurate liveness detection results. Therefore, the pixel type can be identified for certain sub-areas of the second detection area, such as the facial features of the eyes, lips, and ears, and liveness detection is performed through the image texture features of these sub-areas, that is, through local image texture features. That is, in some embodiments, the second detection area includes multiple sub-areas, and the step of "based on the image texture features, the pixel type in the second detection area is identified by the second sub-model in the preset liveness detection model to obtain a second recognition result" can specifically include:

[0125] (61) Based on the image texture features, the pixel type of each sub-region is identified by using the second sub-model in the preset living body detection model to obtain the identification result of each sub-region;

[0126] (62) The recognition results of each sub-region are integrated to obtain a second recognition result.

[0127] It should be noted that the probability that the object to be detected in each sub-area is a living body can be obtained through the second recognition result, and then the probability that the object to be detected in the second detection area is a living body is calculated based on the weight corresponding to each sub-area. That is, in some embodiments, the step of "determining the probability that the object to be detected in the second detection area is a living body according to the second recognition result to obtain the second living body probability" can specifically include:

[0128] (71) extracting the probability that the object to be detected in each sub-region is a living body from the second recognition result, and obtaining a plurality of third living body probabilities;

[0129] (72) obtaining a weight corresponding to each sub-region from the second recognition result;

[0130] (73) Based on the weight corresponding to each sub-region and the multiple third living body probabilities, the probability that the object to be detected in the second detection area is alive is calculated to obtain the second living body probability.

[0131] Among them, the weight represents the importance of the corresponding sub-region when the second detection area is used for liveness detection. For example, in multiple consecutive frame images, the confidence of each frame image for liveness detection can be determined by the environmental information corresponding to each frame image, and then, according to the confidence of each frame image, the corresponding weight of each sub-region is assigned; for example, in each frame image, the weight corresponding to each sub-region can be determined according to the size of the sub-region. The specific setting can be based on the actual situation, which will not be repeated here.

[0132] In addition, when the first living body probability is less than or equal to the first threshold, it can be determined that the object to be detected corresponding to the face image is non-living. That is, in some embodiments, it can also specifically include:

[0133] When the first live body probability is less than or equal to the first threshold, the object to be detected corresponding to the face image is determined to be non-live; or, when the first live body probability is greater than the first threshold and the second live body probability is less than or equal to the second threshold, the object to be detected corresponding to the face image is determined to be non-live. It should be noted that when the first live body probability is less than or equal to the first threshold, it is not necessary to identify the type of pixels in the second detection area, so the amount of calculation of the model can be reduced.

[0134] Optionally, in some embodiments, the first sub-model may also be connected to the second sub-model in parallel, such as Figure 1f As shown, that is, the step of "performing liveness detection on the face image based on the image contour features and the image texture features by using a preset liveness detection model to obtain a liveness detection result of the object to be detected" may specifically include:

[0135] (81) Based on the image contour feature, the pixel type in the first detection area is identified by using a first sub-model in a preset living body detection model to obtain a first identification result;

[0136] (82) determining a probability that the object to be detected in the first detection area is a living body according to the first recognition result, and obtaining a first living body probability;

[0137] (83) Based on the image texture feature, the type of pixels in the second detection area is identified by using a second sub-model in the preset living body detection model to obtain a second identification result;

[0138] (84) determining a probability that the object to be detected in the second detection area is a living body according to the second recognition result, and obtaining a second living body probability;

[0139] (85) When the first liveness probability is greater than the first threshold value and the second liveness probability is greater than the second threshold value, it is determined that the object to be detected corresponding to the face image is a live object.

[0140] When the first sub-model is connected with the second sub-model in parallel, the first liveness probability and the second liveness probability can be calculated respectively, thereby reducing the model calculation time and improving the efficiency of liveness detection.

[0141] Optionally, in some embodiments, it may specifically include: when the first liveness probability is less than or equal to a first threshold, and / or the second liveness probability is less than or equal to a second threshold, determining that the object to be detected corresponding to the face image is non-live.

[0142] The liveness detection model may be pre-established, and the liveness detection model is obtained by training multiple liveness images and multiple non-liveness images, that is, in some embodiments, it may further include:

[0143] (91) collecting training sample sets;

[0144] (92) determining a sample currently being processed from the training sample set to obtain a current processing object;

[0145] (93) inputting the current processing object into the detection model to obtain a liveness prediction value of the current processing object;

[0146] (94) Obtaining the actual value of the living body of the current processing object;

[0147] (95) The detection model is converged based on the true liveness value and the liveness prediction value to obtain a liveness detection model.

[0148] The training sample set includes a plurality of images marked as live and a plurality of images marked as non-live. For example, specifically, a plurality of live images and a plurality of non-live images can be collected through a plurality of ways. The plurality of live images can include a plurality of different human faces, and also include different forms of the same human face, such as frowning, pursing lips or closing eyes. The plurality of non-live images can include a plurality of different types of paper, a three-dimensional mask with different textures from real people, and a human face image containing a specific frame. The specific frame can be a mobile phone frame, a computer screen frame, and a tablet frame, etc. Then, a sample image is input into the first sub-model of the detection model to obtain the image contour feature of the first detection area of ​​the sample image. Then, based on the image contour feature, the pixel type in the first detection area of ​​the sample image is identified by the first sub-model in the preset live detection model to obtain the live prediction value of the sample image. Finally, based on the live true value of the sample image and the live prediction value of the sample image, the first sub-model of the detection model is converged to obtain the first sub-model of the live detection model. Similarly, the same method can also be used for the second sub-model of the live detection model, which will not be repeated here.

[0149] Among them, the preset liveness detection model can be set according to the needs of actual applications. The preset detection model can be two connected sub-network models, namely the first sub-model and the second sub-model. The two sub-network models can be the same or different, and are set according to actual conditions. For example, the two sub-network models are the same model, wherein a sub-network model may include four convolutional layers and one fully connected layer.

[0150] Convolution layer: mainly used for feature extraction of input images (such as training samples or images to be recognized), wherein the convolution kernel size can be determined according to the actual application. For example, the convolution kernel sizes from the first convolution layer to the fourth convolution layer can be (7, 7), (5, 5), (3, 3), (3, 3) respectively; optionally, in order to reduce the complexity of calculation and improve the calculation efficiency, in this embodiment, the convolution kernel sizes of the four convolution layers can be set to (3, 3), the activation function all adopts "relu (rectified linear unit)", and the padding (padding refers to the space between the element border and the element content defined by the attribute) mode is set to "same". The "same" filling mode can be simply understood as filling the edge with 0, and the number of 0s on the left (top) is the same as or one less than the number of 0s on the right (bottom). Optionally, the convolutional layers can be directly connected to each other to speed up the network convergence. In order to further reduce the amount of calculation, downsampling (pooling) operations can be performed in all layers from the second to the fourth convolutional layers or in any 1 to 2 layers. The downsampling operation is basically the same as the convolution operation, except that the downsampled convolution kernel only takes the maximum value (maxpooling) or the average value (average pooling) of the corresponding position. For the convenience of description, in the embodiments of the present invention, downsampling operations are performed in the second convolutional layer and the third convolutional layer, and the downsampling operation is specifically max pooling. For example, the downsampling operation is described.

[0151] It should be noted that, for the convenience of description, in an embodiment of the present invention, the layer where the activation function is located and the downsampling layer (also called the pooling layer) are both included in the convolution layer. It should be understood that the structure can also be considered to include a convolution layer, a layer where the activation function is located, a downsampling layer (i.e., a pooling layer) and a fully connected layer. Of course, it can also include an input layer for inputting data and an output layer for outputting data, which will not be repeated here.

[0152] Fully connected layer: It can map the learned features to the sample label space. It mainly plays the role of "classifier" in the entire convolutional neural network. Each node of the fully connected layer is connected to all nodes output by the previous layer (such as the downsampling layer in the convolutional layer). Among them, a node in the fully connected layer is called a neuron in the fully connected layer. The number of neurons in the fully connected layer can be determined according to the needs of the actual application. For example, in the upper and lower branch networks of the twin neural network model, the number of neurons in the fully connected layer can be set to 512, or 128, etc. Similar to the convolutional layer, in the fully connected layer, nonlinear factors can be added by adding activation functions. For example, the activation function sigmoid (S-type function) can be added.

[0153] It should be noted that in order to distinguish the first sub-model from the second sub-model, when constructing negative samples, the samples of the first sub-model can be face images containing specific borders, and the samples of the second sub-model can be different types of paper and three-dimensional masks with different textures from real people.

[0154] After acquiring the facial image of the object to be detected, the embodiment of the present invention performs key feature point detection on the facial image to obtain a feature point set corresponding to the facial image, and then constructs a first detection area and a second detection area on the facial image according to the feature point set, then extracts the image contour features of the first detection area, and extracts the image texture features of the second detection area, and finally, performs liveness detection on the facial image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected. The embodiment of the present invention belongs to non-interactive liveness detection, that is, it does not require user cooperation, and is imperceptible to the user. Moreover, when an attacker attacks through a forged live body such as a photo, video or paper, this solution can perform liveness detection on the forged live body by detecting the image contour features and the image texture features, thereby determining that the forged live body is non-live, thereby improving the accuracy and security of identity authentication.

[0155] The method described in the embodiment will be further described in detail below with examples.

[0156] In this embodiment, the living body detection device is specifically integrated into a door access control machine as an example for description.

[0157] See also Figure 2a as well as Figure 2b , a liveness detection method, the specific process can be as follows:

[0158] 201. The access control machine obtains a facial image of the object to be detected.

[0159] For example, the access control machine can use its own camera to photograph the object to be detected, thereby obtaining a facial image of the object to be detected.

[0160] 202. The access control machine detects key feature points of the face image to obtain a set of feature points corresponding to the face image.

[0161] Specifically, the access control machine can use the geometric features of the face to extract the facial feature points with size, rotation and displacement invariance, such as the key feature points of the eyes, nose and lips. For example, 9 feature points of the face are selected, and the distribution of these feature points is angle-invariant, namely 2 eyeball center points, 4 eye corner points, the midpoint of the two nostrils and 2 mouth corner points. Of course, all the feature points of the face can also be selected, such as eyebrows, facial contours, lips, eyes and nose, etc.

[0162] 203. The access control machine constructs a first detection area and a second detection area on the face image according to the feature point set.

[0163] Specifically, the access control machine can select 5 reference feature points for liveness detection from the feature point set. These 5 reference feature points may include 2 eye center points, the midpoints of the two nostrils and 2 mouth corners. Then, the central feature point corresponding to these 5 reference feature points is calculated, and then the first detection area and the second detection area are constructed on the face image respectively.

[0164] For example, when the face image is a screen attack (such as a mobile phone attack or a tablet attack), the screen attack image will include the border of the electronic device, such as Figure 2c As shown, therefore, the access control machine can construct a first detection area on the face image through the image boundary points and central feature points of the face image. When the face image is a paper attack, such as Figure 2d As shown, there must be a large difference between the texture of the face image and the real face. Therefore, the access control machine can construct a second detection area in the face area to facilitate the acquisition of texture features of the second detection area.

[0165] 204. The access control machine extracts image contour features of the first detection area, and extracts image texture features of the second detection area.

[0166] When the access control machine obtains the image contour features of the first detection area and the image texture features of the second detection area, step 205 can be executed. When the access control machine does not obtain the image contour features of the first detection area and / or the image texture features of the second detection area, the access control machine can display a prompt message of "Please aim at the camera", such as Figure 2e As shown, the user is informed to perform liveness verification again.

[0167] Specifically, the access control machine can use the first sub-model in the preset liveness detection model to extract image contour features of the first detection area to obtain the image contour features of the first detection area, and the access control machine can use the second sub-model in the preset liveness detection model to extract image texture features of the second detection area to obtain the image texture features of the second detection area.

[0168] 205. The access control machine performs liveness detection on the face image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected.

[0169] When the liveness detection result of the object to be detected indicates that the object to be detected is alive, the access control machine can display "Recognition successful", such as Figure 2fAs shown, the access control machine can perform the next operation according to the preset instructions, such as allowing the user to enter the designated area; when the liveness detection result of the object to be detected indicates that the object to be detected is non-live, the access control machine can display "non-live", and the access control machine can perform the next operation according to the preset instructions, such as displaying an alarm message to inform the illegal user using the attack image.

[0170] After acquiring the facial image of the object to be detected, the access control machine of the embodiment of the present invention performs key feature point detection on the facial image to obtain a set of feature points corresponding to the facial image. Then, the access control machine constructs a first detection area and a second detection area on the facial image according to the set of feature points. Next, the access control machine extracts the image contour features of the first detection area and extracts the image texture features of the second detection area. Finally, the access control machine performs liveness detection on the facial image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected. The embodiment of the present invention belongs to non-interactive liveness detection, that is, no user cooperation is required, and it is imperceptible to the user. Moreover, when an attacker attacks through a forged live body such as a photo, video or paper, the access control machine of the embodiment of the present invention can perform liveness detection on the forged live body by detecting the image contour features and the image texture features, thereby determining that the forged live body is non-live, thereby improving the accuracy and security of identity verification.

[0171] To facilitate better implementation of the liveness detection method provided in the embodiment of the present invention, the embodiment of the present invention also provides a liveness detection device based on the above (hereinafter referred to as the detection device). The meanings of the terms are the same as those in the liveness detection method, and the specific implementation details can refer to the description in the method embodiment.

[0172] See also Figure 3a , Figure 3a A schematic diagram of the structure of a liveness detection device provided in an embodiment of the present invention, wherein the detection device may include an acquisition module 301, a first detection module 302, a construction module 303, a first extraction module 304, a second extraction module 305 and a second detection module 306, which may be specifically as follows:

[0173] The acquisition module 301 is used to acquire the face image of the object to be detected.

[0174] The first detection module 302 is used to detect key feature points of the face image to obtain a set of feature points corresponding to the face image.

[0175] Specifically, the first detection module 302 can use the geometric features of the face to extract the face feature points with size, rotation and displacement invariance, such as the key feature point positions of the eyes, nose and lips. For example, 9 feature points of the face are selected, and the distribution of these feature points has angle invariance, which are 2 eyeball center points, 4 eye corner points, the midpoints of the two nostrils and 2 mouth corner points. Of course, all the feature points of the face can also be selected, such as eyebrows, facial contours, lips, eyes and nose, etc.

[0176] The construction module 303 is used to construct a first detection area and a second detection area on the face image according to the feature point set.

[0177] Among them, the second detection area is located in the face area, and the second detection area is included in the first detection area. For example, the construction module 303 can select 5 reference feature points for liveness detection from the feature point set. The 5 reference feature points can include 2 eyeball center points, the midpoints of the two nostrils, and 2 mouth corner points. Of course, 9 reference feature points for liveness detection can also be selected from the feature point set. The 9 reference feature points can include 2 eyeball center points, 4 eye corner points, the midpoints of the two nostrils, and 2 mouth corner points. Then, the central feature points corresponding to the multiple reference feature points are calculated, and then the first detection area and the second detection area are respectively constructed on the face image. That is, in some embodiments, the construction module 303 can specifically include:

[0178] A construction unit, used for selecting a plurality of reference feature points for living body detection from a feature point set;

[0179] A calculation unit, used for calculating a central feature point corresponding to a plurality of reference feature points;

[0180] The construction unit is used to construct a first detection area and a second detection area on the face image based on the central feature point and multiple reference feature points.

[0181] Optionally, in some embodiments, the construction unit is specifically used to: obtain multiple image boundary points of the facial image, construct a first detection area including multiple reference feature points and partial image boundary points on the facial image according to a first preset ratio with the central feature point as the center, and construct a second detection area including multiple reference feature points on the facial area according to a second preset ratio with the central feature point as the center.

[0182] The first extraction module 304 is used to extract the image contour features of the first detection area.

[0183] Optionally, in some embodiments, the first extraction module is specifically used to: remove the face area in the first detection area to obtain a contour area, and extract image contour features of the first contour area.

[0184] The second extraction module 305 is used to extract image texture features of the second detection area.

[0185] The second detection module 306 is used to perform liveness detection on the face image based on the image contour feature and the image texture feature to obtain the liveness detection result of the object to be detected.

[0186] The second detection module 306 may perform liveness detection on the face image based on the image contour feature and the image texture feature through a preset liveness detection model to obtain a liveness detection result of the object to be detected. Optionally, in some embodiments, the second detection module 306 may specifically include:

[0187] An acquisition unit, used to acquire a preset living body detection model;

[0188] The detection unit is used to perform liveness detection on the face image based on image contour features and image texture features through a preset liveness detection model to obtain a liveness detection result of the object to be detected.

[0189] Optionally, in some embodiments, the preset living body detection model includes a first sub-model and a second sub-model, the first sub-model is connected to the second sub-model in a cascade manner, and the detection unit may specifically include:

[0190] A first determining unit, configured to determine a probability that the object to be detected in the first detection area is a living body according to the first recognition result, and obtain a first living body probability;

[0191] A second recognition unit is used to identify the type of pixels in the second detection area by using a second sub-model in a preset liveness detection model based on image texture features when the first liveness probability is greater than a first threshold, so as to obtain a second recognition result;

[0192] A second determination unit is used to determine the probability that the object to be detected in the second detection area is a living body according to the second recognition result, so as to obtain a second living body probability;

[0193] The third determining unit is used to determine that the object to be detected corresponding to the face image is a living body when the second living body probability is greater than a second threshold.

[0194] Optionally, in some embodiments of the present invention, the second detection area includes multiple sub-areas, and the second recognition unit is specifically used to: based on image texture features, identify the pixel type of each sub-area through a second sub-model in a preset liveness detection model to obtain recognition results for each sub-area, and fuse the recognition results for each sub-area to obtain a second recognition result.

[0195] Optionally, in some embodiments, the second determination unit is specifically used to: extract the probability that the object to be detected in each sub-region is alive from the second recognition result to obtain multiple third live probabilities, obtain the weight corresponding to each sub-region from the second recognition result, the weight indicating the importance of the corresponding sub-region when the second detection area is used for liveness detection, and calculate the probability that the object to be detected in the second detection area is alive based on the weight corresponding to each sub-region and the multiple third live probabilities to obtain the second liveness probability.

[0196] Optionally, in some embodiments, the detection unit further includes:

[0197] The fourth determination unit is used to determine that the object to be detected corresponding to the face image is non-living when the first liveness probability is less than or equal to the first threshold, or; when the first liveness probability is greater than the first threshold and the second liveness probability is less than or equal to the second threshold, determine that the object to be detected corresponding to the face image is non-living.

[0198] Optionally, in some embodiments, the preset liveness detection model includes a first sub-model and a second sub-model, the first sub-model is connected to the second sub-model in parallel, and the detection unit is specifically used to: based on the image contour feature, identify the type of pixel points in the first detection area through the first sub-model in the preset liveness detection model to obtain a first recognition result, determine the probability that the object to be detected in the first detection area is alive according to the first recognition result, and obtain a first liveness probability; based on the image texture feature, identify the type of pixel points in the second detection area through the second sub-model in the preset liveness detection model to obtain a second recognition result, determine the probability that the object to be detected in the second detection area is alive according to the second recognition result, and obtain a second liveness probability; when the first liveness probability is greater than the first threshold value and the second liveness probability is greater than the second threshold value, determine that the object to be detected corresponding to the face image is alive.

[0199] Optionally, in some embodiments, the detection unit may be specifically configured to: determine that the object to be detected corresponding to the face image is non-living when the first liveness probability is less than or equal to a first threshold, and / or the second liveness probability is less than or equal to a second threshold.

[0200] Optionally, in some embodiments, see Figure 3bThe detection device may also include a training module 307, which is specifically used to: collect a training sample set, the training sample set includes multiple images marked as living things and multiple images marked as non-living things, determine the sample currently being processed from the training sample set, and obtain the current processing object; input the current processing object into the detection model to obtain the liveness prediction value of the current processing object, obtain the liveness true value of the current processing object, converge the detection model based on the liveness true value and the liveness prediction value, and obtain the liveness detection model.

[0201] After the acquisition module 301 of the embodiment of the present invention acquires the face image of the object to be detected, the first detection module 302 performs key feature point detection on the face image to obtain a feature point set corresponding to the face image, and then the construction module 303 constructs a first detection area and a second detection area on the face image according to the feature point set, then the first extraction module 304 extracts the image contour features of the first detection area, and the second extraction module 305 extracts the image texture features of the second detection area, and finally, the second detection module 306 performs liveness detection on the face image based on the image contour features and the image texture features to obtain the liveness detection result of the object to be detected. The embodiment of the present invention belongs to non-interactive liveness detection, that is, no user cooperation is required, and it is imperceptible to the user. Moreover, when the attacker attacks through a forged live body such as a photo, video or paper, the second detection module 306 can perform liveness detection on the forged live body by detecting the image contour features and the image texture features, thereby determining that the forged live body is non-live, thereby improving the accuracy and security of identity authentication.

[0202] Accordingly, an embodiment of the present invention further provides a computer device, such as Figure 4 As shown, the computer device may include a radio frequency (RF) circuit 401, a memory 402 including one or more computer-readable storage media, an input unit 403, a display unit 404, a sensor 405, an audio circuit 406, a wireless fidelity (WiFi) module 407, a processor 408 including one or more processing cores, and a power supply 409. Those skilled in the art will appreciate that Figure 4 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0203] The RF circuit 401 can be used for receiving and sending signals during information transmission or calls. In particular, after receiving the downlink information of the base station, it is handed over to one or more processors 408 for processing; in addition, the data related to the uplink is sent to the base station. Usually, the RF circuit 401 includes but is not limited to an antenna, at least one amplifier, a tuner, one or more oscillators, a subscriber identity module (SIM) card, a transceiver, a coupler, a low noise amplifier (LNA), a duplexer, etc. In addition, the RF circuit 401 can also communicate with the network and other devices through wireless communication. The wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile Communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0204] The memory 402 can be used to store software programs and modules. The processor 408 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device (such as audio data, a phone book, etc.), etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 408 and the input unit 403 with access to the memory 402.

[0205] The input unit 403 can be used to receive input digital or character information, and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control. Specifically, in a specific embodiment, the input unit 403 may include a touch-sensitive surface and other input devices. The touch-sensitive surface, also known as a touch display screen or a touch pad, can collect the user's touch operations on or near it (such as the user's operation on or near the touch-sensitive surface using any suitable object or accessory such as a finger, a stylus, etc.), and drive the corresponding connection device according to a pre-set program. Optionally, the touch-sensitive surface may include a touch detection device and a touch controller. Among them, the touch detection device detects the user's touch orientation, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 408, and can receive and execute the command sent by the processor 408. In addition, the touch-sensitive surface can be implemented using multiple types such as resistive, capacitive, infrared and surface acoustic waves. In addition to the touch-sensitive surface, the input unit 403 may also include other input devices. Specifically, other input devices may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.

[0206] The display unit 404 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the computer device, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 404 may include a display panel. Optionally, the display panel may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc. Further, the touch-sensitive surface may cover the display panel. When the touch-sensitive surface detects a touch operation on or near it, it is transmitted to the processor 408 to determine the type of touch event. Subsequently, the processor 408 provides a corresponding visual output on the display panel according to the type of touch event. Although in Figure 4 In the embodiment, the touch-sensitive surface and the display panel are used as two independent components to realize input and output functions, but in some embodiments, the touch-sensitive surface and the display panel can be integrated to realize input and output functions.

[0207] The computer device may also include at least one sensor 405, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel according to the brightness of the ambient light, and the proximity sensor may turn off the display panel and / or backlight when the computer device is moved to the ear. As a type of motion sensor, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary. It can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that can also be configured in the computer device, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be repeated here.

[0208] The audio circuit 406, the speaker, and the microphone can provide an audio interface between the user and the computer device. The audio circuit 406 can transmit the electrical signal converted from the received audio data to the speaker, which is converted into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 406 and converted into audio data, and then the audio data is output to the processor 408 for processing, and then sent to another computer device through the RF circuit 401, or the audio data is output to the memory 402 for further processing. The audio circuit 406 may also include an earphone jack to provide communication between an external headset and the computer device.

[0209] WiFi is a short-range wireless transmission technology. Computer devices can help users send and receive emails, browse web pages, and access streaming media through WiFi module 407. It provides users with wireless broadband Internet access. Figure 4 A WiFi module 407 is shown, but it is understandable that it is not an essential component of the computer device and can be omitted as needed without changing the essence of the invention.

[0210] Processor 408 is the control center of the computer device, which uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in memory 402, and calling data stored in memory 402, it executes various functions of the computer device and processes data, thereby monitoring the mobile phone as a whole. Optionally, processor 408 may include one or more processing cores; preferably, processor 408 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into processor 408.

[0211] The computer device also includes a power supply 409 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 408 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 409 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators, and other arbitrary components.

[0212] Although not shown, the computer device may also include a camera, a Bluetooth module, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 408 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 408 will run the application programs stored in the memory 402 to implement various functions:

[0213] A facial image of an object to be detected is obtained, key feature point detection is performed on the facial image to obtain a set of feature points corresponding to the facial image, a first detection area and a second detection area are respectively constructed on the facial image according to the set of feature points, image contour features of the first detection area are extracted, and image texture features of the second detection area are extracted, liveness detection is performed on the facial image based on the image contour features and the image texture features, and a liveness detection result of the object to be detected is obtained.

[0214] After acquiring the facial image of the object to be detected, the embodiment of the present invention performs key feature point detection on the facial image to obtain a feature point set corresponding to the facial image, and then constructs a first detection area and a second detection area on the facial image according to the feature point set, then extracts the image contour features of the first detection area, and extracts the image texture features of the second detection area, and finally, performs liveness detection on the facial image based on the image contour features and the image texture features to obtain a liveness detection result of the object to be detected. The embodiment of the present invention belongs to non-interactive liveness detection, that is, it does not require user cooperation, and is imperceptible to the user. Moreover, when an attacker attacks through a forged live body such as a photo, video or paper, this solution can perform liveness detection on the forged live body by detecting the image contour features and the image texture features, thereby determining that the forged live body is non-live, thereby improving the accuracy and security of identity authentication.

[0215] Embodiment 5

[0216] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0217] To this end, an embodiment of the present invention provides a computer-readable storage medium, in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any one of the living body detection methods provided in the embodiments of the present invention. For example, the instructions can execute the following steps:

[0218] A facial image of an object to be detected is obtained, key feature point detection is performed on the facial image to obtain a set of feature points corresponding to the facial image, a first detection area and a second detection area are respectively constructed on the facial image according to the set of feature points, image contour features of the first detection area are extracted, and image texture features of the second detection area are extracted, liveness detection is performed on the facial image based on the image contour features and the image texture features, and a liveness detection result of the object to be detected is obtained.

[0219] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0220] Since the instructions stored in the storage medium can execute the steps in any liveness detection method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any liveness detection method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0221] The above is a detailed introduction to a liveness detection method, device, computer-readable storage medium and computer equipment provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A method for detecting a living body, characterized in that: include: Acquire a facial image of an object to be detected, wherein the facial image includes a facial area; Performing key feature point detection on the face image to obtain a set of feature points corresponding to the face image; Constructing a first detection area and a second detection area on the face image according to the feature point set, respectively, wherein the second detection area is located in the face area, and the second detection area is included in the first detection area; Extracting image contour features of the first detection area, and extracting image texture features of the second detection area; Obtain a preset liveness detection model, wherein the preset liveness detection model includes a first sub-model and a second sub-model, and the first sub-model is connected to the second sub-model in a cascade manner; based on the image contour feature, the pixel point type in the first detection area is identified by the first sub-model in the preset liveness detection model to obtain a first identification result; according to the first identification result, determine the probability that the object to be detected in the first detection area is a live body to obtain a first liveness probability; when the first liveness probability is greater than a first threshold, based on the image texture feature, the pixel point type in the second detection area is identified by the second sub-model in the preset liveness detection model to obtain a second identification result; extract the probability that the object to be detected in each sub-area of ​​the second detection area is a live body from the second identification result to obtain multiple third liveness probabilities; obtain the weight corresponding to each sub-area of ​​the second detection area from the second identification result, and the weight represents the importance of the corresponding sub-area when the second detection area is used for liveness detection; Based on the weight corresponding to each sub-area of ​​the second detection area and multiple third living body probabilities, the probability that the object to be detected in the second detection area is alive is calculated to obtain a second living body probability; when the second living body probability is greater than a second threshold, it is determined that the object to be detected corresponding to the face image is alive.

2. The method according to claim 1, characterized in that The step of constructing a first detection area and a second detection area on the face image according to the feature point set comprises: Selecting a plurality of reference feature points for living body detection from the feature point set; Calculating a central feature point corresponding to the multiple reference feature points; Based on the central feature point and a plurality of reference feature points, a first detection area and a second detection area are respectively constructed on the face image.

3. The method according to claim 2, characterized in that The step of constructing a first detection area and a second detection area on the face image based on the central feature point comprises: Acquire a plurality of image boundary points of the face image; Taking the central feature point as the center, constructing a first detection area including a plurality of reference feature points and some image boundary points on the face image according to a first preset ratio; Taking the central feature point as the center, a second detection area including a plurality of reference feature points is constructed on the face area according to a second preset ratio.

4. The method according to claim 1, characterized in that: The extracting of the image contour feature of the first detection area includes: Remove the face area from the first detection area to obtain a contour area; The image contour features of the contour area are extracted.

5. The method according to claim 1, characterized in that The second detection area includes a plurality of sub-areas, and based on the image texture feature, the pixel type in the second detection area is identified by using a second sub-model in a preset living body detection model to obtain a second identification result, including: Based on the image texture features, the pixel type of each sub-region is identified by using the second sub-model in the preset living body detection model to obtain the identification result of each sub-region; The recognition results of each sub-region are fused to obtain a second recognition result.

6. The method according to claim 1, characterized in that Also includes: When the first living body probability is less than or equal to a first threshold, determining that the object to be detected corresponding to the face image is a non-living body, or; When the first liveness probability is greater than a first threshold and the second liveness probability is less than or equal to a second threshold, it is determined that the object to be detected corresponding to the face image is a non-live object.

7. The method according to claim 1, characterized in that Also includes: Collecting a training sample set, wherein the training sample set includes a plurality of images marked as living objects and a plurality of images marked as non-living objects; Determine a sample currently being processed from the training sample set to obtain a current processing object; Inputting the current processing object into the detection model to obtain a live body prediction value of the current processing object; Acquire the real value of the living body of the currently processed object; The detection model is converged based on the liveness true value and the liveness predicted value to obtain a liveness detection model.

8. A living body detection device, characterized in that: include: An acquisition module, used for acquiring a face image of an object to be detected, wherein the face image includes a face area; A first detection module is used to detect key feature points of the face image to obtain a set of feature points corresponding to the face image; A construction module, configured to construct a first detection area and a second detection area on the face image according to the feature point set, wherein the second detection area is located in the face area and is included in the first detection area; A first extraction module, used to extract image contour features of the first detection area; A second extraction module, used to extract image texture features of the second detection area; A second detection module is used to obtain a preset liveness detection model, wherein the preset liveness detection model includes a first sub-model and a second sub-model, and the first sub-model is connected to the second sub-model in a cascade manner; based on the image contour feature, the pixel point type in the first detection area is identified by the first sub-model in the preset liveness detection model to obtain a first recognition result; according to the first recognition result, the probability that the object to be detected in the first detection area is a live body is determined to obtain a first liveness probability; when the first liveness probability is greater than a first threshold, based on the image texture feature, the pixel point type in the second detection area is identified by the second sub-model in the preset liveness detection model to obtain a second recognition result; the probability that the object to be detected in each sub-area of ​​the second detection area is a live body is extracted from the second recognition result to obtain multiple third liveness probabilities; and the weight corresponding to each sub-area of ​​the second detection area is obtained from the second recognition result, and the weight represents the importance of the corresponding sub-area when the second detection area is used for liveness detection; Based on the weight corresponding to each sub-area of ​​the second detection area and multiple third living body probabilities, the probability that the object to be detected in the second detection area is alive is calculated to obtain a second living body probability; when the second living body probability is greater than a second threshold, it is determined that the object to be detected corresponding to the face image is alive.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps in any one of claims 1 to 6 of the living body detection method.

10. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the living body detection method according to any one of claims 1 to 6 are implemented.