A face recognition method and device

By comparing the difference information between face and background content at different image collection locations, the problem of existing face live recognition being unable to identify false users is solved, achieving higher recognition accuracy and security.

CN113177437BActive Publication Date: 2024-09-27ALIBABA GROUP HOLDING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110358438.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-13
Publication Date
2024-09-27
Estimated Expiration
2037-06-13

AI Technical Summary

Technical Problem

Existing facial recognition methods cannot effectively identify fake users. Especially when faced with continuous picture attacks, video playback attacks, and action simulation software attacks, fake users are easily misidentified as real users, resulting in security verification failure and leakage of personal information and property. loss.

Method used

By obtaining the user's first image and the second image collected after adjusting the relative position of the image collection device, comparing the difference information between the face content and the background content in the two images, including area changes and content changes, to determine whether the user is a real or fake user , to prevent attacks by fake users.

Benefits of technology

Effectively identify fake users, improve the accuracy of live face recognition, prevent attacks by fake users, and avoid personal information leakage and property losses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113177437B
    Figure CN113177437B
Patent Text Reader

Abstract

The embodiment of the present application provides a face recognition method and device, the method comprising: acquiring a first image, and obtaining a second image based on the first image; the first image includes face content and background content; comparing the difference information of the face content and the background content in the first image and the second image respectively; the difference information comprises area change information for determining whether the area occupied by the face content and the background content in the first image and the second image is consistent, and / or content change information for determining whether the face content and the background content in the first image and the second image are changed; determining whether the user is a real user or a fake user based on the area change information and / or the content change information. According to the embodiment of the present application, the problem that the current face liveness recognition method cannot identify fake users is solved.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the patent application with application number 201710444122.3, application date 2017.06.13, and invention name "Face recognition method, device and false user identification method and device". Technical Field

[0002] The present application relates to the field of image recognition, and in particular to a face recognition method and a face recognition device. Background Art

[0003] Currently, face liveness recognition has been widely used in the field of security verification. For example, before a user performs a transaction, face liveness recognition is performed on the user. If the user is identified as the real user, rather than a photo or video of the real user displayed by a fake user, the security verification is passed and the user is allowed to perform the transaction.

[0004] When performing face liveness recognition, the face image of the current user can be captured by an image acquisition device, and image analysis can be performed on the face image to identify whether the current user is the real user; or, the user can be instructed to perform a certain action, and then multiple consecutive frames of face images of the current user can be captured by an image acquisition device, and it can be determined based on the multiple frames of face images whether the user has currently performed the instructed action to identify whether the current user is the real user.

[0005] However, for the above-mentioned face recognition method based on image analysis, fake users can use various illegal means such as continuous image attacks, video playback attacks, action simulation software attacks, etc., so that the above-mentioned face recognition method will mistakenly identify the fake users as real users.

[0006] Therefore, the existing face liveness recognition method has the problem of being unable to identify false users. Summary of the invention

[0007] The technical problem to be solved by the embodiments of the present application is to provide a face recognition method and a corresponding face recognition device.

[0008] In order to solve the above problems, the present application provides a face recognition method based on image analysis, the method comprising:

[0009] Acquire a first image; the first image includes face content and background content;

[0010] Adjusting the relative position between the image acquisition device and the user, and acquiring a second image after the relative position is adjusted;

[0011] Comparing difference information of facial content and background content in the first image and the second image respectively; the difference information includes area change information for determining whether the area changes of the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the facial content and the background content in the first image and the second image are changed;

[0012] The user is determined to be a real user or a fake user according to the area change information or the content change information.

[0013] The embodiment of the present application also provides a face recognition device based on image analysis, comprising:

[0014] An image acquisition module, used to acquire a first image, adjust the relative position between the image acquisition device and the user, and acquire a second image after the relative position is adjusted; the first image includes facial content and background content;

[0015] a difference information comparison module, used to compare difference information of facial content and background content in the first image and the second image respectively; the difference information includes area change information for determining whether the area changes of the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the facial content and the background content in the first image and the second image are changed;

[0016] A user determination module is used to determine whether the user is a real user or a fake user according to the area change information or the content change information.

[0017] An embodiment of the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods described above when executing the computer program.

[0018] The embodiment of the present application further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, any of the methods described above is implemented.

[0019] Compared with the prior art, the embodiments of the present application have the following advantages:

[0020] According to the embodiments of the present application, by respectively capturing the first image and the second image before and after adjusting the relative position between the image capture device and the user, and comparing the difference information of the facial content and the background content in the first image and the second image, the real user or the false user is determined based on the difference information. Even if the false user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform face liveness recognition, the false user can still be identified, which solves the problem that the current face liveness recognition method cannot identify false users.

[0021] Furthermore, by selecting background objects with clear boundaries from the background content, comparing the difference information of the facial content and the background objects in the first image and the second image respectively, the user is determined to be a real user or a fake user based on the difference information, thereby avoiding erroneous difference information due to object content with blurred boundaries, and improving the accuracy of identifying real users or fake users.

[0022] Furthermore, after a fake user is identified, a corresponding risk warning is generated to prompt the real user to take corresponding preventive measures, thereby avoiding the leakage of real user personal information and property loss due to continuous image attacks, video playback attacks, and action simulation software attacks by fake users.

[0023] Furthermore, by respectively capturing the first image and the second image of the captured object at the first relative position and the second relative position, difference information of the biometric content and the background content of the captured object in the first image and the second image is obtained, and whether the liveness authentication is passed is determined according to the difference information. Even if the liveness authentication is performed by continuous image attack, video playback attack, action simulation software attack, etc., a non-live user can still be identified, which solves the problem that the current liveness authentication method cannot identify a non-live user. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a flowchart of the steps of a face recognition method based on image analysis in an embodiment of the present application;

[0025] Figure 2 is a flowchart of another face recognition method based on image analysis according to an embodiment of the present application;

[0026] Figure 3 is a flowchart of the steps of a liveness authentication method according to an embodiment of the present application;

[0027] Figure 4 is a structural block diagram of a face recognition device based on image analysis in an embodiment of the present application;

[0028] Figure 5 is a structural block diagram of an identification device according to an embodiment of the present application;

[0029] Figure 6 This is an information interaction diagram in a face recognition process of an embodiment of the present application;

[0030] Figure 7 This is a schematic diagram of a real user identification scenario in an embodiment of the present application;

[0031] Figure 8 It is a schematic diagram of a false user identification scenario in an embodiment of the present application. DETAILED DESCRIPTION

[0032] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0033] First of all, it should be noted that the present application can be specifically an application software, which is used for security monitoring in scenarios such as users conducting electronic transactions, changing account login passwords, viewing personal privacy information, and modifying important data. The function of the application software is to identify the current user as a real user or a fake user based on image analysis. The present application can also be specifically a plug-in for certain software to check the data security of the software or as a basis for identifying software operations. The method provided in the present application can also be implemented in hardware, such as an ASIC chip (Application Specific Integrated Circuit) or an FPGA (Field-Programmable Gate Array).

[0034] In the actual scenario of security verification through face liveness recognition, users may need to use mobile terminals such as mobile phones, tablet computers, desktop computers, etc. to conduct electronic transactions, modify account login passwords, view personal privacy information, and other operations involving user information security and property security. Usually, before performing the above operations, it is necessary to perform security verification of the user's identity, that is, the current user is identified as a real user and the security verification is passed before the user is allowed to perform the above operations; if the security verification is not passed, the above operations are prohibited.

[0035] The user's identity can be safely verified by face liveness recognition. Specifically, the mobile terminal can prompt the current user to face the camera of the mobile terminal for real-time shooting, and the camera can capture an image containing the current user's face content.

[0036] The mobile terminal can perform image analysis on the captured images, for example, recognize faces from the images, extract representative biometric content such as eyes, nose, eyebrows, mouth, etc. for the faces, and identify whether the face in the image is the face of the real user by comparing one or more biometric content with the preset biometric content of the real user, and determine whether the security verification has been passed based on the recognition result.

[0037] In order to prevent false users from using photos to attack the above-mentioned static face liveness recognition method, the mobile terminal can also prompt the current user to perform one or more specified actions such as nodding, shaking head, blinking, opening mouth, etc. during real-time shooting, and take multiple consecutive frames of images when the current user performs the above actions. According to the continuous changes of feature points of the multiple consecutive frames of images, through certain rules or machine learning methods, it is judged that the action performed by the current user is the specified action, and combined with the recognition results of the facial feature points in the image, it is identified whether the current user is a real user.

[0038] However, the applicant has found through research that fake users can attack the above-mentioned face recognition method through a variety of illegal means. For example, in a continuous picture attack, a fake user uses a series of photos of a real user performing a certain action, and simulates the specified action by playing a slide show; in another example, in a video playback attack, a fake user pre-records a video of a real user performing a certain action, and plays back the video during face recognition; in another example, in an action simulation software attack, a fake user obtains the face image of a real user, extracts the face feature points through action simulation software, synthesizes an animation of the real user performing a certain action, and plays the animation during face liveness recognition.

[0039] The above-mentioned attack method will cause the fake user to be mistakenly identified as the real user during face liveness recognition, and pass security verification and allow the fake user to conduct electronic transactions, change account login passwords, view personal privacy information, etc., thereby causing the risk of personal information leakage and property loss of the real user.

[0040] Therefore, in order to address the problem that current face recognition methods are unable to identify fake users, an embodiment of the present application provides a face recognition method based on image analysis to identify real users and fake users.

[0041] In order to facilitate those skilled in the art to have a deeper understanding of the embodiments of the present application, the definitions of various terms will be first introduced below.

[0042] Facial content includes image content containing facial image features. Facial image features can be a complete face, a partial face, or one or more facial organs on the face. For example, facial content can be a complete face in the image, or the upper half of the face in the image, or a combination of one or more facial organs such as eyes, nose, eyebrows, mouth, etc.

[0043] Background content includes image content other than the target object (e.g., face content) currently being photographed in the image. Background content may include one or more background objects, which may be scenery, animals, people, objects, etc. For example, when photographing a target object, there may be tall buildings, passers-by, vehicles, etc. behind the target object.

[0044] Image acquisition devices include devices used to acquire images, such as cameras, cameras on mobile terminals, and external cameras.

[0045] The first image includes an image including facial content and background content that is acquired before the relative position of the user and the image acquisition device is adjusted.

[0046] The second image includes an image including facial content and background content, which is acquired after the relative position between the user and the image acquisition device is adjusted.

[0047] The difference information includes the change in the area occupied and / or content of the face content and / or background content between the first image and the second image. For example, the area occupied by the face content in the first image (the area ratio in the image) is 42%, and the area occupied in the second image is 63%. The area occupied by the face content in the first image and the second image has changed, and the change ratio of the two occupied areas is 63% / 42%=1.5. The change ratio can be used as the difference information of the face content in the first image and the second image. For another example, the area occupied by a certain background content in the first image is 10%, and the area occupied in the second image is still 10%. The change ratio of the two occupied areas is 10% / 10%=1, and the change ratio can be used as the difference information of the background content in the first image and the second image. For another example, the background content in the first image includes background object A and background object B, and the background content in the second image includes background object A and background object C. The content of the background content in the first image and the second image has changed, and the changed content can be used as the difference information of the background content in the first image and the second image.

[0048] Biometric content includes content about the physical features of a specific creature, such as the eyes, nose, eyebrows, mouth, etc. of a human face, or the limbs and torso of a human body.

[0049] Reference Figure 1 , shows a flowchart of a face recognition method based on image analysis in an embodiment of the present application, the method can be specifically applied to a mobile terminal, and the method can specifically include the following steps:

[0050] Step 101, acquiring a first image, adjusting the relative position between an image acquisition device and a user, and acquiring a second image after the relative position is adjusted.

[0051] It should be noted that the embodiments of the present application can be applied to mobile terminals such as mobile phones, tablet computers, and desktop computers. The mobile terminal may include an image acquisition device such as a camera. In actual applications, a camera or an external camera may also be used as an image acquisition device. The mobile terminal may be installed with a recognition application, and the recognition application identifies the real user or the fake user on the image acquired by the image acquisition device.

[0052] In a specific implementation, when a user initiates a face recognition request in a recognition application, the recognition application can call an image acquisition device on a mobile terminal or start an external image acquisition device to capture the face of the current user and the background of the current shot, so as to capture an image containing face content and background content as the above-mentioned first image, and the obtained first image can be processed to obtain a processed second image.

[0053] In one embodiment of the present application, after capturing the first image, the recognition application may instruct the user to adjust the relative position between the image capture device and the current user. In order to adjust the relative position between the image capture device and the user, the object to be adjusted may be the image capture device, such as instructing the user to move the camera of a mobile phone; the object to be adjusted may also be the user himself, such as prompting the user to move relative to the camera.

[0054] There are many ways to adjust the relative position. For example, the relative position can be adjusted in a certain direction on the horizontal line between the image acquisition device and the user; for another example, the relative position can be adjusted in a certain direction perpendicular to the plane between the image acquisition device and the user.

[0055] In practical applications, the relative position may include the relative distance between the image acquisition device and the user, and may also include the relative angle between the image acquisition device and the user.

[0056] Among them, after adjusting the relative position between the image acquisition device and the user, the image acquisition device can shoot the current user's face and the current shooting background again to capture an image containing facial content and background content as the above-mentioned second image.

[0057] Step 102: Compare difference information of facial content and background content in the first image and the second image respectively.

[0058] In a specific implementation, the recognition application may compare the facial content and background content in the first image with the facial content and background content in the second image to determine the difference information between the contents.

[0059] Among them, the difference information may include area change information for determining whether the area occupied by the facial content and the background content in the first image and the second image has changed consistently, and / or content change information for determining whether the facial content and the background content in the first image and the second image have changed.

[0060] Specifically, when the difference information is used to determine the change ratio of the area occupied by the facial content and the background content in the first image and the second image, it can be area change information. For example, the areas occupied by the facial content and the background content in the first image are 24% and 10% respectively; after adjusting the relative position in a certain direction on the horizontal line between the image acquisition device and the user, the areas occupied in the second image are 36% and 15% respectively, and the change ratio of the area occupied by the facial content and the background content in the first image and the second image is 1.5. The change ratio can be used as the difference information of the facial content and the background content in the first image and the second image.

[0061] When the difference information is used to determine the content change of the face content and the background content in the first image and the second image, it can be content change information. For example, the face content in the first image is a complete face, and the background content contains two trees. After adjusting the relative position in a certain direction perpendicular to the plane of the image acquisition device and the user, the face content in the second image is still a complete face, and the background content only contains one tree. The background content has changed in the second image, and the changed content can be used as the difference information of the background content in the first image and the second image.

[0062] Step 103: determine whether the user is a real user or a fake user according to the area change information or the content change information.

[0063] The recognition application can determine whether the current user is a real user or a fake user based on the difference information obtained through the above comparison. In actual applications, different difference information can be used as a basis for judgment according to different relative position adjustment methods.

[0064] With respect to the adjustment method of adjusting the relative position in a certain direction on the horizontal line between the image acquisition device and the user, and the situation where the current user moves to approach or move away from the image acquisition device, the change in the area occupied by the facial content and the background content in the first image and the second image can be used as difference information, and the difference information can be used as a basis for judging whether it is a real user.

[0065] After the real user adjusts the relative position with the image acquisition device in a certain direction on the horizontal line between the image acquisition device and the user, the distance between the real user and the image acquisition device changes, while the distance between the background content and the image acquisition device does not change, thus causing the area occupied by the face content and the background content in the second image to change. Therefore, when the change ratio of the area occupied by the face content and the background content in the first image and the second image is inconsistent, it can be determined that the current user is a real user.

[0066] Figure 7 The upper part of the figure is a scene of the image acquisition device acquiring the first image, and the lower part of the figure is a scene of the image acquisition device acquiring the second image after adjusting the distance.

[0067] In the scene of capturing the first image, it can be seen from the content displayed on the right that there is a certain distance between the current user and the mobile phone camera, and a background object in the background is used as the background content. From the content displayed on the left, it can be seen that in the first image captured by the mobile phone camera for this scene, the face content occupies 42% of the area in the first image, and the background content occupies 7.5% of the area in the first image.

[0068] In the scene of collecting the second image, it can be seen from the content displayed on the right that if the current user is a real user, the current user is close to the mobile phone camera, that is, the distance between the user's face and the mobile phone camera is reduced. The distance between the background content and the mobile phone camera will remain unchanged. From the content displayed on the left, it can be seen that in the second image collected by the mobile phone camera for this scene, the area occupied by the face content in the second image increases to 63%, and the change ratio of the area occupied by the face content in the first image and the second image is 1.5.

[0069] Since the distance between the background content and the mobile phone camera has not changed, the area occupied by the background content in the second image is still 7.5%, and the change ratio of the areas occupied by the background content in the first image and the second image is 1. Since the change ratios of the areas occupied by the face content and the background content in the first image and the second image are inconsistent, it can be determined that the current user is a real user.

[0070] When a fake user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform live face recognition, since both the face content and the background content are displayed on a certain display device, even if the relative position between the display device and the image acquisition device is adjusted in a certain direction of the horizontal line, the face and background displayed on the display device will simultaneously approach or move away from the image acquisition device. In the second image obtained by the image acquisition device for the face and background on the display device, the area occupied by the face content and the background content will remain unchanged, so that the ratio of the area occupied by the face content and the background content in the first image and the second image will not change. Therefore, when the ratio of the occupied area is consistent, the current user can be determined to be a fake user.

[0071] Figure 8 The upper part of the figure is a scene of the image acquisition device acquiring the first image, and the lower part of the figure is a scene of the image acquisition device acquiring the second image after adjusting the distance.

[0072] In the scene of collecting the first image, it can be seen from the content displayed on the right that the current fake user holds the photo for identification, there is a certain distance between the photo and the mobile phone camera, and a background object in the background of the photo is used as the background content. From the content displayed on the left, it can be seen that in the first image collected by the mobile phone camera for this scene, the face content occupies 24% of the area in the first image, and the background content occupies 10% of the area in the first image.

[0073] In the scene of collecting the second image, it can be seen from the content displayed on the right that if the current user is a fake user, after being prompted to adjust the relative position, the fake user moves the photo to a position close to the mobile phone camera, that is, the distance between the face content and the background content in the photo and the mobile phone camera becomes smaller. From the content displayed on the left, it can be seen that in the second image collected by the mobile phone camera for this scene, the area occupied by the face content in the second image increases to 36%, and the change ratio of the area occupied by the face content in the first image and the second image is 1.5.

[0074] Since the distance between the background object in the photo and the mobile phone camera also decreases, the area occupied by the background object in the second image increases to 15%, and the change ratio of the area occupied by the background content in the first image and the second image is 1.5. Since the change ratio of the area occupied by the face content and the background content in the first image and the second image is 1.5, it can be determined that the current user is a fake user.

[0075] It should be noted that in the application scenario where the fake user uses photos, videos, etc. to attack, when the first image is captured, the photo or video blocks the real background content. When the fake user receives the prompt and moves the terminal playing the photo or video away from the image capture device, when the moving distance exceeds a certain range, the photo or video may no longer block the real background content, so that the second image captured by the image capture device may contain some of the actual background content in addition to the background content in the photo or video. The actual background content in the second image may interfere with the accuracy of recognition. For example, if the background content of the photo is similar to the real background content, or if they are located in the same position in the image, the background content of the photo in the first image and the real background content in the second image may be compared in terms of area during recognition, resulting in erroneous difference information.

[0076] Therefore, when capturing the first image, the background content used as the comparison object can be determined. After capturing the second image, for the same background content, the change in the area occupied by the background content in the two images can be compared, thereby avoiding obtaining difference information of different background contents and improving recognition accuracy.

[0077] With respect to the adjustment method of adjusting the relative position in a certain direction perpendicular to the plane of the image acquisition device and the user, the content changes of the facial content and the background content in the first image and the second image can be used as difference information, and the difference information can be used as a basis for judging whether the user is real.

[0078] After the real user adjusts the relative position in a direction perpendicular to the plane of the image acquisition device and the user, the real user may block some content in the background content, thereby causing the background content to change significantly in the second image, while the face content does not change. Therefore, when the face content does not change, but the background content changes, it can be determined that the current user is a real user.

[0079] When a fake user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform live face recognition, since both the face content and the background content are displayed on a certain display device, even if the relative position between the display device and the image acquisition device is moved, the background content in the display device will not be blocked by the face content, so the face content and the background content will not change. Therefore, when neither the face content nor the background content has changed, the current user can be determined to be a fake user.

[0080] In practical applications, for the adjustment method of adjusting the relative position in a certain direction on the horizontal line between the image acquisition device and the user, the content changes of the facial content and the background content in the first image and the second image can also be used as difference information, and the difference information can be used as a basis for judging whether it is a real user. For example, when the current user approaches the image acquisition device and collects the second image, if it is a real user, it may also block part of the background content, thereby causing a large content change of the background content in the second image, while the facial content will not change.

[0081] According to the embodiments of the present application, by respectively capturing the first image and the second image before and after adjusting the relative position between the image capture device and the user, and comparing the difference information of the facial content and the background content in the first image and the second image, the real user or the false user is determined based on the difference information. Even if the false user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform face liveness recognition, the false user can still be identified, which solves the problem that the current face liveness recognition method cannot identify false users.

[0082] Reference Figure 2 , shows a flowchart of another face recognition method based on image analysis in an embodiment of the present application, the method can be specifically applied to a mobile terminal, and the method can specifically include the following steps:

[0083] Step 201: Acquire a first image, where the first image includes facial content and background content.

[0084] Step 202: Adjust the relative position between the image acquisition device and the user.

[0085] In one embodiment of the present application, step 202 may include the following sub-steps:

[0086] Sub-step S11, when the adjustment of the relative position between the image acquisition device and the user is to prompt the user's position, the position of the image acquisition device is adjusted, or the user's position is prompted to be adjusted.

[0087] In a specific implementation, the recognition application installed on the mobile terminal can prompt the user to adjust the position of the image acquisition device relative to the user himself, or can prompt the current user to adjust his own position relative to the image acquisition device, so as to instruct the user to complete the adjustment of the relative position between the image acquisition device and the user.

[0088] After receiving the prompt to adjust the position, the user can make corresponding adjustments according to the prompt. For example, the user can move the image acquisition device from the current position to another position away from or close to the user; or the user can fix the image acquisition device at the original position and move the user from the current position to another position close to or away from the image acquisition device; or the user can lower or raise the image acquisition device vertically and move it horizontally left or right; or the user can lower or raise the image acquisition device vertically and move it horizontally left or right.

[0089] Step 203, prompting to adjust the limited time, and starting the timing after the prompt.

[0090] When prompting to adjust the relative position, a time limit for adjustment can also be prompted, and the current user can complete the adjustment within the time. After the prompt, timing can be started, so that after the timing reaches the limited time, the image acquisition device is triggered to perform image acquisition.

[0091] Step 204: acquiring a second image after adjusting the relative position.

[0092] In one embodiment of the present application, step 204 may include the following sub-steps:

[0093] Sub-step S21, when the timing reaches the adjusted time limit, a second image is captured.

[0094] After the timing reaches the limited time, the image acquisition device can be triggered to perform image acquisition to obtain a second image.

[0095] Step 205 : Compare difference information of facial content and background content in the first image and the second image respectively.

[0096] In one embodiment of the present application, before step 205, the method further includes:

[0097] Selecting a background object with a clear boundary from the background content;

[0098] Step 205 may include the following sub-steps:

[0099] Sub-step S31, comparing difference information of facial content and background objects in the first image and the second image respectively.

[0100] In a specific implementation, you can search for object content with clear boundaries in the background content and select it as the background object. When comparing the difference information between the facial content and the background content in the first image and the second image, you can compare the difference information for a specific background object in the background content, so that you can get more accurate difference information and improve the accuracy of the recognition result, avoiding erroneous difference information due to object content with blurred boundaries, which affects the accuracy of the recognition result. For example, comparing the changes in the proportion of the area occupied by an object in the facial content and the background content in the first image and the second image, compared to determining the area occupied by the entire background content in the image, determining the area occupied by the background object in the image based on the clear boundaries will result in a more accurate occupied area.

[0101] Step 206: Determine whether the user is a real user or a fake user based on the difference information.

[0102] Specifically, the difference information may include area change information for determining whether the area occupied by the facial content and the background content in the first image and the second image is consistent, and / or content change information for determining whether the facial content and the background content in the first image and the second image are changed. The adjustment may include adjustment in at least one direction on the horizontal line between the image acquisition device and the user. In one case, in order to obtain the area change information, the changes in the areas occupied by the facial content and the background content in the first image and the second image may be compared to obtain the change ratio information.

[0103] After obtaining the change ratio information, the change ratio information can be used to determine whether the change ratio of the area occupied by the facial content and the background content in the first image and the second image is consistent; if they are consistent, that is, the change ratio of the area occupied by the facial content in the first image and the second image is consistent with the change ratio of the area occupied by the background content in the first image and the second image, then the user can be determined to be a fake user.

[0104] In a specific implementation, when the adjustment method is that the current user adjusts at least one direction on the horizontal line between the image acquisition device and the user, that is, the user approaches or moves away from the image acquisition device on the horizontal line, when judging whether the user is a real user or a fake user based on the difference information, it can be judged whether the change ratio of the area occupied by the face content and the background content in the first image and the second image is consistent. If they are inconsistent, it indicates that the current user is a real user, so the current user can be judged as a real user; if they are consistent, it indicates that the current user may have used continuous picture attacks, video playback attacks, action simulation software attacks, etc. for identification, so the current user can be judged as a fake user.

[0105] In another case, the adjustment may include adjustment in at least one direction on a plane perpendicular to the image acquisition device and the user. In order to obtain area change information, the content changes of the facial content and the background content in the first image and the second image can be compared respectively to obtain content change information.

[0106] After obtaining the content change information, the content change information can be used to determine whether the facial content and the background content have changed in the first image and the second image; if neither the facial content nor the background content has changed, the user can be determined to be a fake user.

[0107] In a specific implementation, when the adjustment method is an adjustment in at least one direction on a plane perpendicular to the image acquisition device and the user, when determining whether the user is a real user or a false user based on the difference information, the content changes of the facial content and the background content in the first image and the second image can be determined.

[0108] If the face content does not change, but the background content does, it indicates that the current user is a real user, so it can be determined that the current user is a real user. If both the face content and the background content do not change, it indicates that the current user may have used continuous image attacks, video playback attacks, action simulation software attacks, etc. to identify, so it can be determined that the current user is a fake user.

[0109] In one embodiment of the present application, before step 202, the method further includes:

[0110] Adjust the direction of the image acquisition device toward the user.

[0111] In actual applications, after adjustment in at least one direction on the plane perpendicular to the image acquisition device and the user, the facial content of the current user may exceed the shooting range of the image acquisition device. Therefore, the image acquisition device can be adjusted to point its shooting direction in the direction of the user's current position.

[0112] Step 207: If it is determined that the user is a fake user, a risk warning for the fake user is generated.

[0113] In a specific implementation, when the current user is identified as a fake user, the identification application can generate a risk warning for the fake user and display it on the mobile terminal. In actual applications, the risk warning can also be sent to the real user to prompt the real user to take corresponding preventive measures.

[0114] According to an embodiment of the present application, by selecting background objects with clear boundaries from the background content, comparing the difference information of the facial content and the background objects in the first image and the second image respectively, it is determined whether the user is a real user or a false user based on the difference information, thereby avoiding erroneous difference information due to object content with blurred boundaries, and improving the accuracy of identifying real users or false users.

[0115] In order to facilitate those skilled in the art to understand the embodiments of the present application, Figure 6 A specific example is given to illustrate.

[0116] Figure 6 This is an information interaction diagram of a face recognition process in an embodiment of the present application. As can be seen from the figure, the user initiates a face recognition request through the recognition application, and the recognition application calls the camera on the mobile terminal or an external camera to shoot the face and background of the current user, and collects a first image. The recognition application displays information on the screen of the mobile terminal prompting the user to adjust the distance from the camera. The user adjusts the position of himself or the camera according to the prompt information to change the distance between the user and the camera. After adjusting the distance, the recognition application again instructs the camera to shoot the face and background of the current user, and collects a second image. The recognition application determines whether the current user is a real user or a fake user through the difference information of the face content and the background content in the first image and the second image.

[0117] Reference Figure 3 , shows a flowchart of a liveness authentication method according to an embodiment of the present application, which can be specifically applied to a mobile terminal, and the method can specifically include the following steps:

[0118] Step 301, capturing a first image at a first relative position between a capturing device and a captured object; wherein the first image includes biometric content and background content of the captured object.

[0119] In a specific implementation, the first image can be captured by shooting the captured object when the capturing device is in a first relative position with the captured object. The first image can include the biometric content of the captured object and the background content of the background where the captured object is currently located. For example, when authenticating a living user, the user's face can be captured as the biometric content, and the scene where the user is located can be captured as the background content.

[0120] Step 302: Capture a second image at a second relative position between the acquisition device and the object being captured; wherein the second image includes biometric content and background content of the object being captured.

[0121] In a specific implementation, the captured object can be instructed to adjust the position of the capture device and the captured object to a second relative position. After the position is adjusted, the captured object can be photographed again to capture a second image. The second image can include the biometric content of the captured object and the background content of the background where the captured object is currently located.

[0122] In an embodiment of the present application, the relative position includes the relative distance between the acquisition device and the acquired object.

[0123] In a specific implementation, when the distance between the acquisition device and the object to be acquired is a first relative distance, the first image can be acquired. When the distance between the acquisition device and the object to be acquired is a second relative distance, the second image can be acquired. For example, when the acquisition device and the object to be acquired are 1 meter apart, the first image is acquired, and when the distance is 2 meters apart, the second image is acquired.

[0124] In an embodiment of the present application, the relative position includes a relative angle between the acquisition device and the acquired object.

[0125] It should be noted that when the acquisition device is shooting to acquire an image, the line connecting its shooting focus and the acquisition device is the shooting direction of the acquisition device. In actual applications, the captured object may not be in the shooting direction of the acquisition device, so that the captured object and the shooting direction of the acquisition device form a certain angle, that is, there is a certain angle between the captured object and the acquisition device.

[0126] In a specific implementation, when the angle between the acquisition device and the captured object is a first relative angle, the first image can be captured. When the angle between the acquisition device and the captured object is a second relative distance, the second image can be captured. For example, when the relative angle between the acquisition device and the captured object is 10°, the first image is captured, and when the relative angle between the acquisition device and the captured object is 20°, the second image is captured.

[0127] Step 303: Obtain difference information of the biometric content and / or background content in the first image and the second image.

[0128] Step 304, determining whether the liveness authentication is successful.

[0129] In a specific implementation, the difference information between the biometric content and the background content in the first image and the second image can be obtained, or, based on the difference information between the biometric content in the first image and the second image, or based on the difference information between the background content in the first image and the second image, it can be determined whether the liveness authentication is passed.

[0130] In one embodiment of the present application, step 304 may include the following sub-steps:

[0131] Sub-step S41, determining whether the authentication is passed according to the difference information.

[0132] In a preferred embodiment, step 303 may include: obtaining changes in the areas occupied by the biometric content and / or the background content in the first image and the second image;

[0133] Sub-step S41 may include:

[0134] Determining whether the change ratios of the areas occupied by the biometric content and the background content in the first image and the second image are consistent;

[0135] If they are consistent, it is determined that the authentication has not been passed;

[0136] If they are inconsistent, the authentication is considered to be successful.

[0137] In a specific implementation, if the captured object is a living body, when the relative distance changes, the change ratio of the area occupied by the biometric content of the captured object in the first image and the second image, and the change ratio of the area occupied by the background content in the first image and the second image, the change ratio of the two should change and lead to inconsistency. If the captured object is a non-living body such as a picture or video, even if the relative distance changes, the change ratio of the two is consistent. Since the specific examples have been described in the above embodiments, they will not be repeated here.

[0138] In one embodiment of the present application, step 303 may include:

[0139] Acquire content changes of the biometric content and / or the background content in the first image and the second image;

[0140] Sub-step S41 may include:

[0141] If the biometric content and / or the background content do not change, it is determined that the authentication has not been passed;

[0142] If the biometric content and / or the background content changes, it is determined that the authentication is successful.

[0143] In a specific implementation, when the relative distance and / or relative angle changes, in the first image and the second image, the biometric content and the background content change, or the biometric content changes, or the background content changes, it can be determined that the current image is a living body, and thus the authentication can be determined to have been passed. When the biometric content and the background content do not change, or the biometric content does not change, or the background content does not change, it can be determined that the current image is not a living body, and thus the authentication can be determined to have not been passed.

[0144] For example, if the captured object is a living body, the living body moves around the capture device to change the relative angle of the captured image, or the capture device rotates to change the relative angle of the captured image. After the living body changes the relative angle, part of the background content will be blocked, or the shooting direction will change after the capture device changes the relative angle. Both of these situations will cause the background content in the first image and the second image to change. If the captured object is a non-living user such as a picture or video, even if the relative angle is changed, the background content in the picture or video will not change.

[0145] According to the embodiments of the present application, by respectively capturing a first image and a second image of the captured object at a first relative position and a second relative position, difference information between the biometric content and the background content of the captured object in the first image and the second image is obtained, and whether the liveness authentication is passed is determined based on the difference information. Even if liveness authentication is performed using methods such as continuous image attacks, video playback attacks, and motion simulation software attacks, non-live users can still be identified, thereby solving the problem that the current liveness authentication method cannot identify non-live users.

[0146] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.

[0147] Reference Figure 4 , shows a structural block diagram of a face recognition device based on image analysis in an embodiment of the present application, the device can be specifically applied to a mobile terminal, and the device can specifically include the following modules:

[0148] The image acquisition module 401 is used to acquire a first image, adjust the relative position between the image acquisition device and the user, and acquire a second image after the relative position is adjusted; the first image includes facial content and background content;

[0149] The difference information comparison module 402 is used to compare the difference information of the facial content and the background content in the first image and the second image respectively; the difference information includes area change information for determining whether the area changes of the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the facial content and the background content in the first image and the second image are changed;

[0150] The user determination module 403 is used to determine whether the user is a real user or a fake user according to the area change information or the content change information.

[0151] In one embodiment of the present application, the image acquisition module 401 may include the following submodules:

[0152] A first image acquisition submodule, configured to acquire a first image through an image acquisition device, wherein the first image includes a face content and a background content;

[0153] A relative position adjustment submodule, used to adjust the relative position between the image acquisition device and the user;

[0154] The second image acquisition submodule is used to acquire the second image after the relative position is adjusted. ;

[0155] In one embodiment of the present application, the relative position adjustment submodule may include the following units:

[0156] The relative position adjustment unit is used to adjust the position of the image acquisition device, or prompt the user to adjust the position.

[0157] In an embodiment of the present application, the adjustment includes adjustment in at least one direction on a horizontal line between the image acquisition device and the user; the area change information includes change ratio information; and the user determination module 403 may include the following submodules:

[0158] A change ratio information acquisition submodule, used to acquire the change in the area occupied by the facial content and / or the background content in the first image and the second image, and obtain change ratio information;

[0159] a change ratio determination submodule, configured to use the change ratio information to determine whether the change ratios of the areas occupied by the facial content and the background content in the first image and the second image are consistent;

[0160] The first user determination submodule is used to determine that the user is a false user if the change ratio of the area occupied by the facial content in the first image and the second image is consistent with the change ratio of the area occupied by the background content in the first image and the second image.

[0161] In an embodiment of the present application, the adjustment includes adjustment in at least one direction on a horizontal line between the image acquisition device and the user; the user determination module 403 may include the following submodules:

[0162] a content change information acquisition submodule, used to acquire content changes of the face content and / or the background content in the first image and the second image, and obtain content change information;

[0163] a content change determination submodule, configured to use the content change information to determine whether the facial content and the background content have changed in the first image and the second image;

[0164] The second user determination submodule is used to determine that the user is a fake user if there is no content change in the facial content and the background content.

[0165] In an embodiment of the present application, before acquiring the second image after adjusting the relative position, the image acquisition module 401 may further include the following submodules:

[0166] The image acquisition device adjustment submodule is used to adjust the direction in which the image acquisition device points to the user.

[0167] In an embodiment of the present application, before comparing the difference information of the facial content and the background content in the first image and the second image respectively, the apparatus may further include the following modules:

[0168] A background object acquisition module, used to select background objects with clear boundaries from the background content;

[0169] The difference information comparison module 402 may include the following submodules:

[0170] The difference information comparison submodule is used to compare the difference information of the facial content and the background objects in the first image and the second image respectively.

[0171] In an embodiment of the present application, when the relative position between the image acquisition device and the user is adjusted to prompt the user's position, the relative position adjustment submodule may further include the following units:

[0172] The time counting unit is used to prompt the user to adjust the time limit and start counting after the prompt;

[0173] The second image acquisition submodule may include the following units:

[0174] The second image acquisition unit is used to acquire a second image when the timing reaches the adjusted time limit.

[0175] In one embodiment of the present application, the device may further include the following modules:

[0176] The risk warning module is used to generate a risk warning for a fake user if the user is determined to be a fake user.

[0177] According to the embodiments of the present application, by respectively capturing the first image and the second image before and after adjusting the relative position between the image capture device and the user, and comparing the difference information of the facial content and the background content in the first image and the second image, the real user or the false user is determined based on the difference information. Even if the false user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform face liveness recognition, the false user can still be identified, which solves the problem that the current face liveness recognition method cannot identify false users.

[0178] Reference Figure 5 , shows a structural block diagram of a recognition device according to an embodiment of the present application, wherein the recognition device 500 includes an image acquisition device 501, first prompt information 502, and second prompt information 503;

[0179] The image acquisition device 501 is used to acquire a first image and obtain a second image according to the first image; the first image includes a face content and a background content;

[0180] The recognition device 500 is used to compare difference information between facial content and background content in the first image and the second image, respectively, and determine whether the user is a real user or a fake user according to the difference information; the difference information includes area change information for determining whether the area changes occupied by the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the facial content and the background content in the first image and the second image are changed;

[0181] The first prompt information 502 is used to generate a risk prompt for a fake user if the user is determined to be a fake user.

[0182] Wherein, in the process of obtaining the second image according to the first image:

[0183] The image acquisition device 501 is used to acquire a first image;

[0184] The second prompt information 503 is used to prompt the user to adjust the relative position between the image acquisition device and the user;

[0185] The image acquisition device 501 is further used to acquire a second image after the relative position is adjusted.

[0186] According to the embodiments of the present application, by respectively capturing the first image and the second image before and after adjusting the relative position between the image capture device and the user, and comparing the difference information of the facial content and the background content in the first image and the second image, the real user or the false user is determined based on the difference information. Even if the false user uses continuous image attacks, video playback attacks, action simulation software attacks, etc. to perform face liveness recognition, the false user can still be identified, which solves the problem that the current face liveness recognition method cannot identify false users.

[0187] According to the embodiments of the present application, after a fake user is identified, a corresponding risk warning is generated to prompt the real user to take corresponding preventive measures, thereby avoiding the leakage of real user personal information and property loss due to continuous image attacks, video playback attacks, and action simulation software attacks by fake users.

[0188] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0189] An embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a terminal device, the terminal device can execute instructions (instructions) of each method step in the embodiment of the present application.

[0190] In one example, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a method as in an embodiment of the present application when executing the computer program.

[0191] In one example, a computer-readable storage medium is also provided, on which a computer program is stored. When the program is executed by a processor, one or more methods of the embodiments of the present application are implemented.

[0192] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0193] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more machine-readable media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0194] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0197] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.

[0198] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.

[0199] The above is a detailed introduction to a face recognition method and a face recognition device provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technical personnel in this field, according to the idea of ​​the present application, 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 application.

Claims

1. A face recognition method, It is characterized in that include: Acquire a first image; the first image includes face content and background content; Adjusting the relative position between the image acquisition device and the user, and acquiring a second image after the relative position is adjusted; Comparing difference information of facial content and background content in the first image and the second image respectively; the difference information includes area change information for determining whether the changes of the areas occupied by the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the contents of the facial content and the background content in the first image and the second image are changed; wherein the area change information includes change ratio information obtained by comparing the changes of the areas occupied by the facial content and the background content in the first image and the second image respectively; The user is determined to be a real user or a fake user based on the area change information or the content change information; wherein, the user is a fake user when the change ratio of the area occupied by the facial content in the first image and the second image is consistent with the change ratio of the area occupied by the background content in the first image and the second image, or, the user is a fake user when the facial content and the background content have not changed.

2. The method according to claim 1, It is characterized in that The adjusting the relative position between the image acquisition device and the user comprises: Adjust the position of the image acquisition device, or prompt the user to adjust the position.

3. The method according to claim 1, It is characterized in that The adjustment includes adjustment in at least one direction on a horizontal line between the image acquisition device and the user; Determining whether the user is a real user or a fake user according to the area change information includes: Acquire a change in the area occupied by the facial content and / or the background content in the first image and the second image to obtain change ratio information; Using the change ratio information to determine whether the change ratios of the areas occupied by the facial content and the background content in the first image and the second image are consistent; If the change ratio of the area occupied by the facial content in the first image and the second image is consistent with the change ratio of the area occupied by the background content in the first image and the second image, the user is determined to be a fake user.

4. The method according to claim 1, It is characterized in that The adjustment includes adjustment in at least one direction in a plane perpendicular to the image acquisition device and the user; Determining whether the user is a real user or a fake user according to the content change information includes: Acquire content changes of the facial content and / or the background content in the first image and the second image to obtain content change information; Using the content change information to determine whether the facial content and the background content have changed in the first image and the second image; If there is no content change in the facial content and the background content, the user is determined to be a fake user.

5. The method according to claim 1, It is characterized in that Before acquiring the second image after adjusting the relative position, the method further includes: Adjust the direction of the image acquisition device toward the user.

6. The method according to any one of claims 1 to 5, It is characterized in that Before comparing the difference information of the facial content and the background content in the first image and the second image respectively, the method further includes: Selecting a background object with a clear boundary from the background content; The comparing the difference information of the facial content and the background content in the first image and the second image respectively includes: The difference information of the facial content and the background objects in the first image and the second image are compared respectively.

7. The method according to claim 2, It is characterized in that When the relative position between the image acquisition device and the user is adjusted to prompt the user, the method further includes: Prompt to adjust the limited time and start timing after the prompt; The acquiring of the second image after the relative position is adjusted comprises: When the timing reaches the adjusted time limit, the second image is acquired.

8. The method according to claim 1, It is characterized in that The method further comprises: If the user is determined to be a fake user, a risk warning for the fake user is generated.

9. A face recognition device, It is characterized in that include: An image acquisition module, used to acquire a first image, adjust the relative position between the image acquisition device and the user, and acquire a second image after the relative position is adjusted; the first image includes facial content and background content; a difference information comparison module, used for comparing difference information of facial content and background content in the first image and the second image respectively; the difference information includes area change information for determining whether the changes of the areas occupied by the facial content and the background content in the first image and the second image are consistent, and / or content change information for determining whether the contents of the facial content and the background content in the first image and the second image are changed; wherein the area change information includes change ratio information obtained by comparing the changes of the areas occupied by the facial content and the background content in the first image and the second image respectively; A user determination module is used to determine whether the user is a real user or a false user according to the area change information or the content change information; wherein, the user is a false user when the change ratio of the area occupied by the facial content in the first image and the second image is consistent with the change ratio of the area occupied by the background content in the first image and the second image, or the user is a false user when the facial content and the background content have not changed.