Method and apparatus for detecting facial recognition attack, device, and medium
By dynamically adjusting the position of controls at the front end of the face recognition system and combining it with liveness detection, the problem of face recognition attack detection is solved, improving the reliability and security of face recognition and reducing the burden of backend detection.
Patent Information
- Application Number
- PCT/CN2024/141342
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-08-12
- Filing Date
- 2024-12-23
- Publication Date
- 2026-02-19
AI Technical Summary
Existing technologies are insufficient to effectively detect and block facial recognition attacks, leading to a decline in the reliability of facial recognition. Upgrading backend detection algorithms is difficult and consumes a lot of computing resources.
At the front end of the face recognition system, the positions of the face acquisition preview control and the face detection area are dynamically adjusted by randomly generating control offsets. Combined with face motion trajectory and liveness detection, it is possible to determine whether a face recognition attack exists.
It improves the reliability of facial recognition, reduces the pressure on backend detection, and can effectively intercept synthetic and injection attacks at the front end, thus enhancing the security of facial recognition.
Smart Images

Figure CN2024141342_19022026_PF_FP_ABST
Abstract
Description
Method, device, equipment and medium for detecting face recognition attack
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202411103409.6, filed on August 12, 2024, entitled “Method, device, equipment and medium for detecting face recognition attack”, the entire contents of which are incorporated herein by reference. TECHNICAL FIELD
[0003] The present application belongs to the field of face recognition, and particularly relates to a method, device, equipment and medium for detecting face recognition attack. BACKGROUND
[0004] With the application of identity verification in various fields, face recognition has become the main verification method in identity verification. With the continuous development of artificial intelligence technology, in the process of collecting face data, there are illegal persons who use synthetic attack, injection attack and other means to attack face recognition to affect the face recognition result. For example, using artificial intelligence (AI) synthesis technology, the original portrait features of the user are fitted into a real scene background image, and a responsive action is activated to generate a false biopsy action video, attack the face recognition process, and disturb the face recognition result. For another example, by using an application programming interface (API), real data streams are replaced with attack data to attack the face recognition process and disturb the face recognition result. The above attack methods are difficult to detect in the current face recognition process, resulting in a decrease in the reliability of face recognition. SUMMARY
[0005] The embodiments of the present application provide a method, device, equipment and medium for detecting face recognition attack, which can improve the reliability of face recognition.
[0006] In a first aspect, the embodiments of the present application provide a method for detecting face recognition attack, comprising: randomly generating a control offset, moving a face capture preview control of a user terminal and a face detection area in the face capture preview control according to the control offset, so that the position of the face capture preview control changes and the position of the face detection area remains unchanged; capturing an image frame in the face capture preview control, and identifying a face area from the image frame; determining whether there is a face recognition attack according to the positional relationship between the face area and the face capture preview control.
[0007] In a second aspect, an embodiment of the present application provides a device for detecting face recognition attacks, comprising: an offset module configured to randomly generate a control offset, move a face capture preview control of a user terminal and a face detection area in the face capture preview control according to the control offset, so that the position of the face capture preview control changes while the position of the face detection area remains unchanged; an identification module configured to capture an image frame in the face capture preview control and identify a face area from the image frame; and a processing module configured to determine whether a face recognition attack exists according to the positional relationship between the face area and the face capture preview control.
[0008] In a third aspect, an embodiment of the present application provides a terminal device, comprising a processor and a memory storing computer program instructions; and the processor implements the method for detecting face recognition attacks according to the first aspect when executing the computer program instructions.
[0009] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer program instructions; and the computer program instructions are executed by a processor to implement the method for detecting face recognition attacks according to the first aspect.
[0010] In a fifth aspect, an embodiment of the present application provides a computer program product, which comprises a computer program; and the computer program is executed by a processor to implement the method for detecting face recognition attacks according to the first aspect.
[0011] The embodiments of the present application provide a method, device, equipment and medium for detecting face recognition attacks. A control offset is randomly generated, and a face capture preview control and a face detection area are moved according to the control offset, so that the position of the face capture preview control changes relative to the screen of the terminal device, and the position of the face detection area remains unchanged relative to the screen of the terminal device, that is, the position of the face detection area changes relative to the face capture preview control. Under normal operation of a real user, the real user can adjust his / her own posture or the terminal device to make the face area in his / her own image located in the face detection area. However, the face area in a fake image of a face recognition attack cannot be adjusted in the same way as the real user, and the face area in the fake image of the face recognition attack is not located in the face detection area. The face recognition attack can be determined according to the positional relationship between the face area in the image frame and the face capture preview control. The face recognition attacks such as synthetic attacks and injection attacks can be detected in the front end for processing, thereby improving the reliability of face recognition. BRIEF DESCRIPTION OF DRAWINGS
[0012] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments of the present application will be briefly introduced. Other drawings can also be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0013] FIG. 1 is a flowchart of a method for detecting face recognition attacks according to an embodiment of the present application;
[0014] FIG. 2 is a schematic diagram of an example of a face recognition interface according to an embodiment of the present application;
[0015] FIG. 3 is a schematic diagram of another example of a face recognition interface according to an embodiment of the present application;
[0016] FIG. 4 is a schematic diagram of yet another example of a face recognition interface according to an embodiment of the present application;
[0017] FIG. 5 is a schematic diagram of still another example of a face recognition interface according to an embodiment of the present application;
[0018] FIG. 6 is a flowchart of a method for detecting face recognition attacks according to another embodiment of the present application;
[0019] FIG. 7 is a schematic diagram of an example of a motion trajectory and a standard trajectory according to an embodiment of the present application;
[0020] FIG. 8 is a flowchart of a method for detecting face recognition attacks according to yet another embodiment of the present application;
[0021] FIG. 9 is a flowchart of an example of a face detection process according to an embodiment of the present application;
[0022] FIG. 10 is a schematic diagram of a structure of a device for detecting face recognition attacks according to an embodiment of the present application;
[0023] FIG. 11 is a schematic diagram of a structure of a terminal device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] The features and exemplary embodiments of various aspects of the present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are intended to explain the present application, but not to limit the present application. The present application can be implemented without some of the specific details described below. The following description of the embodiments is merely provided to better understand the present application by showing examples of the present application. It should be noted that the acquisition, storage, use, processing, etc. of information and data in the embodiments of the present application are authorized by the user or relevant institution, and comply with relevant provisions of national laws and regulations.
[0025] With the application of identity verification in various fields, face recognition has become the main verification method in identity verification. With the continuous development of artificial intelligence technology, in the process of collecting face data, there are illegal persons who use synthetic attacks, injection attacks and other means to attack face recognition to affect the face recognition result. For example, using AI synthesis technology, the original portrait features of the user are fitted into a real scene background image, and a responsive action is activated to generate a false biopsy action video, attack the face recognition process, and disturb the face recognition result. For another example, by applying API, the real data stream is replaced with attack data to attack the face recognition process and disturb the face recognition result. At the present stage, it is difficult to detect the above attack means in the face recognition process, which reduces the reliability of face recognition. The interception of these attack means through background detection also brings great pressure to the computing resources of the background, and the background detection is not strong in targeting the above attack means, the interception success rate is low, and the difficulty of upgrading the background detection algorithm is also high.
[0026] The present application provides a face recognition attack detection method, device, equipment, medium and program product, which can be executed in the front end of face recognition. By dynamically preventing non-living pattern attacks through the offset changes of the face collection preview control for collecting face images and the face detection area in the face collection preview control, face recognition attacks that cannot cooperate with the face collection preview control and the movement of the face detection area position are intercepted in the front end, which can improve the reliability of face recognition on the one hand, and reduce the pressure of background detection in face recognition detection on the other hand. It can also further determine face recognition attacks in the front end by combining the motion trajectory of the face and the living action detection of the user, and dynamically, continuously and specifically improve the protection level of the background detection.
[0027] The face recognition attack detection method, device, equipment, medium and program product provided by the present application are described below respectively.
[0028] The first aspect of the present application provides a face recognition attack detection method, which can be applied to a terminal device. The terminal device can be a front-end device for face recognition, and the face recognition attack detection method can be executed by the terminal device. Figure 1 is a flowchart of the face recognition attack detection method provided by an embodiment of the present application. As shown in Figure 1, the face recognition attack detection method can include steps S101 to S103.
[0029] In step S101, a control offset is randomly generated, and the face collection preview control of the user terminal and the face detection area in the face collection preview control are moved according to the control offset, so that the position of the face collection preview control changes and the position of the face detection area remains unchanged.
[0030] The face collection preview control is a control for collecting an image of a user, and the face collection preview control includes a face detection area. The face collection preview control can not be visible to the user, and the face detection area is visible to the user. In the process of face recognition, the user needs to adjust his / her posture or the terminal device so that his / her face image is located in the face detection area. Generally, the face collection preview control is located in a position above the center of the screen of the terminal device, for example, FIG. 2 is a schematic diagram of an example of a face recognition interface provided by an embodiment of the present application, as shown in FIG. 2, because the user's line of sight is more focused on the upper half of the screen in the process of human-computer interaction, the face collection preview control 21 is generally located in a position above the center of the screen, and correspondingly, the face detection area 22 is generally located in the center of the face collection preview control 21; the face detection area 22 can be circular, rectangular or other shapes, which are not limited herein; in the image collection of face recognition, the size of the collected image is consistent with the size of the face collection preview control 21, that is, the terminal device collects the image located in the face collection preview control 21, for example, the size of the face collection preview control 21 is 480*640 (unit: pixel), and the size of the collected image is also 480*640; but the image in the face collection preview control 21 is only the image in the face detection area 22 that is visible to the user, and the image in the area of the face collection preview control 21 other than the face detection area 22 is blocked to the user.
[0031] In the embodiments of the present application, the relative position of the face collection preview control and the screen of the terminal device is changed by dynamically adjusting the position of the face collection preview control and the face detection region, and the relative position of the face collection preview control and the face detection region is changed. The change of the position of the face collection preview control refers to the change of the relative position of the face collection preview control and the screen of the terminal device. The position of the face detection region remains unchanged, which refers to the relative position of the face collection preview control and the face detection region, but the relative position of the face detection region and the screen of the terminal device does not change. In order to further improve the reliability of detection, the change of the relative position of the face collection preview control and the screen of the terminal device and the change of the relative position of the face collection preview control and the face detection region are random. The face collection preview control and the face detection region can be moved according to the randomly generated spatial offset. For example, FIG. 3 is a schematic diagram of another example of a face recognition interface provided by the embodiments of the present application. Compared with FIG. 2, the face collection preview control 21 in FIG. 3 is vertically downwardly offset compared with the face collection preview control 21 in FIG. 2. The face detection region 22 in FIG. 3 has the same position on the screen as the face detection region 22 in FIG. 2, but the position of the face detection region 22 relative to the face collection preview control 21 in FIG. 3 has changed compared with the position of the face detection region 22 relative to the face collection preview control 21 in FIG. 2. The face detection region 22 in FIG. 3 is upwardly moved in the face collection preview control 21 compared with the face detection region 22 in FIG. 2. For another example, FIG. 4 is a schematic diagram of still another example of a face recognition interface provided by the embodiments of the present application. Compared with FIG. 2, the face collection preview control 21 in FIG. 4 is vertically upwardly offset compared with the face collection preview control 21 in FIG. 2. The face detection region 22 in FIG. 4 has the same position on the screen as the face detection region 22 in FIG. 2, but the position of the face detection region 22 relative to the face collection preview control 21 in FIG. 4 has changed compared with the position of the face detection region 22 relative to the face collection preview control 21 in FIG. 2. The face detection region 22 in FIG. 4 is downwardly moved in the face collection preview control 21 compared with the face detection region 22 in FIG. 2. Of course, the face collection preview control can be moved horizontally left and right, or can be moved vertically upward and downward and horizontally left and right in combination, which is not limited herein. The control offset can be determined according to the distance between the face collection preview control and the edge of the screen and the preset offset ratio. In some examples, the face collection preview control is vertically upwardly and downwardly moved, a value a1 is randomly selected from the offset ratio range as the offset ratio, the offset ratio is a positive value and the face collection preview control is upwardly moved, or the offset ratio is a negative value and the face collection preview control is downwardly moved. If the distance between the upper edge of the face collection preview control and the upper edge of the screen is b1, the spatial offset is b1 x a1, the control offset is a positive value and the face collection preview control is upwardly moved, or the control offset is a negative value and the face collection preview control is downwardly moved.
[0032] The face collection preview control moves, and the face detection area also moves accordingly. In order to change the relative position of the face collection preview control and the face detection area, after moving the face collection preview control, the face detection area also needs to be moved separately. In some examples, the face collection preview control can be moved from the original position to the target position according to the control offset; and the face detection area is moved according to the reverse offset of the control offset. The control offset and the reverse offset are opposite numbers, that is, the moving distance of the control offset and the moving distance of the reverse offset are the same, but the moving directions are opposite. If the control offset is an upward distance a2, the reverse offset is a downward distance a2; if the control offset is a downward distance a2, the reverse offset is an upward distance a2; if the control offset is a leftward distance a2, the reverse offset is a rightward distance a2; if the control offset is a rightward distance a2, the reverse offset is a leftward distance a2; a2 is a positive number. For example, the face collection preview control moves up and down in the vertical direction, a displacement ratio of 0.2 can be randomly selected from the displacement ratio range [-0.2, 0.2], and the upper edge of the face collection preview control with a height of 640 pixels is 100 pixels away from the upper edge of the screen with a display size of 1080 pixels. Then, the face collection preview control can be moved upward by 20 pixels, at this time, the face detection area also moves upward by 20 pixels along with the face collection preview control. In order to keep the position of the face detection area relative to the screen unchanged, the face detection area needs to be moved downward by 20 pixels.
[0033] In step S102, an image frame in the face collection preview control is collected, and a face area is identified from the image frame.
[0034] The image frame collected in the face collection preview control not only includes a face, but also includes a background and other parts of a user's body such as a neck and shoulders. The face area can be obtained by identifying the face in the obtained image frame, and the face area can track the face. If the user moves, the position of the face area in the image frame at different times can be different.
[0035] In step S103, whether there is a face recognition attack is determined according to the positional relationship between the face area and the face collection preview control.
[0036] The image of the face recognition attack can only forge a face at a specific position, and cannot complete the corresponding position adjustment action. After the face capture preview control and the face detection area are moved, the face forged by the face recognition attack cannot be adjusted and moved accordingly. Therefore, according to the positional relationship between the face area in the captured image frame and the face capture preview control after being moved, it can be determined whether the current face recognition is a face recognition attack. If the positional relationship between the face area in the captured image frame and the face capture preview control after being moved does not meet the condition of adjustment and movement of a real user, it can be determined that the current face recognition is a face recognition attack and is intercepted; otherwise, it can be determined that the current face recognition is a normal face recognition, and subsequent detection is performed on the image frame, such as living body action detection, dazzle pupil detection, and the like, to further determine whether the current face recognition is a face recognition attack.
[0037] In some examples, the positional relationship between the face area and the face capture preview control can include the positional relationship between the face area and the face detection area. Whether there is a face recognition attack can be determined by whether the face area is located in the face detection area in the face capture preview control. If the face area is located in the face detection area in the face capture preview control, it is determined that there is a face recognition attack. It should be noted that the face area herein located in the face detection area means that the entire face area is in the face detection area, or more than a preset proportion of the face area, such as more than 90% of the face area, is in the face detection area. If only a small amount of the face area is in the face detection area, it is not considered that the face area is located in the face detection area. After the face capture preview control and the face detection area are moved, a real user will adjust his / her own posture or the terminal device to quickly make the face area located in the face detection area when the face area is not in the face detection area. However, the image forged by the synthetic attack and the injection attack cannot make the above adjustment, and the face area in the image forged by the face recognition attack will not be located in the face detection area. Specifically, whether the face area is located in the face detection area can be determined according to whether the pixel position of the face area on the screen of the terminal device falls within the pixel position range of the face detection area; if the pixel position of the face area on the screen of the terminal device falls within the pixel position range of the face detection area, it is determined that the face area is located in the face detection area; and if the pixel position of the face area on the screen of the terminal device does not fall within the pixel position range of the face detection area, it is determined that the face area is located outside the face detection area.
[0038] In some examples, the positional relationship between the face region and the face capture preview control can include a relationship between the face region and a certain position in the face capture preview control. Whether a face recognition attack exists can be determined according to a distance between the face region and a predetermined position in the face capture preview control, and a distance between the face detection region and the predetermined position in the face capture preview control. After the face capture preview control and the face detection region move, the position of the face detection region relative to the face capture preview control changes. If the face recognition is a real user operation, the real user will adjust the posture or the terminal device, so that the face region falls into the face detection region. In this case, the relationship between the face region and the predetermined position in the face capture preview control will tend to be consistent with the relationship between the face detection region and the predetermined position in the face capture preview control. However, a synthetic attack or an injection attack and other face recognition attack images cannot make the above adjustment. The face region in the face recognition attack image will not be in the face detection region, and the deviation between the relationship between the face region and the predetermined position in the face capture preview control and the relationship between the face detection region and the predetermined position in the face capture preview control will be large. Specifically, if the distance between the face region and the predetermined position in the face capture preview control exceeds the first distance by more than a preset normal distance range, it is determined that a face recognition attack exists. The first distance is the distance between the face detection region and the predetermined position in the face capture preview control. It should be noted that the distance between the face region and the predetermined position in the face capture preview control and the first distance have a direction, i.e., the distance between the face region and the predetermined position in the face capture preview control and the first distance have positive and negative values. The preset normal distance range can be set according to the scene, demand, experience, etc., and is not limited herein. The distance between the face region and the predetermined position in the face capture preview control and the first distance within the preset normal distance range indicates that the distance between the face region and the predetermined position in the face capture preview control and the first distance is small, and the face region is in the face detection region. The distance between the face region and the predetermined position in the face capture preview control and the first distance exceeding the preset normal distance range indicates that the distance between the face region and the predetermined position in the face capture preview control and the first distance is large, and the face region is outside the face detection region. The first distance changes with the control offset amount, and the larger the control offset amount, the larger the first distance. The normal operation of the real user will also change the distance between the face region and the predetermined position in the face capture preview control with the change of the control offset amount.For example, FIG. 5 is a schematic diagram of another example of the face recognition interface provided by the embodiments of the present application, and FIG. 5 shows a case where the face region is outside the face detection region, and FIG. 3 shows a case where the face region is inside the face detection region. In FIG. 3 and FIG. 5, point A is the center point of the face region, straight line c1 is the center line of the face capture preview control 21, straight line c1 is the predetermined position of the face capture preview control 21, straight line c2 is the center line of the face detection region 22, straight lines c3 and c4 are the center lines passing through the center point of the face region, d1 is the distance between the center line of the face capture preview control 21 and the center line of the face detection region 22, i.e., the first distance in the above embodiments, d2 is the distance between the face region and the predetermined position of the face capture preview control in the case where the face region is inside the face detection region, and d3 is the distance between the face region and the predetermined position of the face capture preview control in the case where the face region is outside the face detection region. As can be seen from FIG. 3 and FIG. 5, the difference between d1 and d2 in the case where the face region is inside the face detection region can be regarded as the distance between the center line c3 of the face region and the center line c2 of the face detection region 22, and the difference between d1 and d3 in the case where the face region is inside the face detection region can be regarded as the distance between the center line c4 of the face region and the center line c2 of the face detection region 22. The distance between the center line c3 and the center line c2 is much smaller than the distance between the center line c4 and the center line c2, the distance between the center line c3 and the center line c2 is within the preset normal distance range, and the distance between the center line c4 and the center line c2 is beyond the preset normal distance range.
[0039] In the embodiments of the present application, the control offset is randomly generated, and the face capture preview control and the face detection region are moved according to the control offset, so that the position of the face capture preview control relative to the screen of the terminal device changes, and the position of the face detection region relative to the screen of the terminal device remains unchanged, i.e., the position of the face detection region relative to the face capture preview control changes. Under normal operation of a real user, the real user can adjust his / her own posture or the terminal device to make the face region in his / her own image located in the face detection region. However, the face region in the image forged by a face recognition attack is not located in the face detection region. The face recognition attack can be determined by the positional relationship between the face region in the image frame and the face capture preview control. The face recognition attack such as the synthetic attack or the injection attack can be detected at the front end to facilitate processing, thereby improving the reliability of face recognition.
[0040] In some examples, the normal operation of the real user is to change the position of the face region in the image frame, and whether a face recognition attack exists can be further determined in combination with the motion trajectory of the face region in a period of time. FIG. 6 is a flowchart of a method for detecting a face recognition attack according to another embodiment of the present application. The method for detecting a face recognition attack shown in FIG. 6 is different from that shown in FIG. 1 in that the method for detecting a face recognition attack shown in FIG. 6 can further include steps S104 to S106.
[0041] In step S104, a motion trajectory of the face region is obtained according to the image frames collected in a period of time.
[0042] A plurality of image frames can be collected in a period of time, for example, one image frame can correspond to every 50 milliseconds. By connecting the specified positions of the face region in each image frame in time sequence, the motion trajectory of the face region can be obtained. For example, the center point of the face region in the image frame can be connected to obtain the motion trajectory of the face region.
[0043] In step S105, an error parameter of the motion trajectory and a set standard trajectory is calculated.
[0044] The standard trajectory is a trajectory of the face region from an initial point of the face region in the first image frame to a position in the face detection region, and is a normal trajectory of the face region in a non-face recognition attack scenario. In some examples, the standard trajectory can include a connecting line trajectory from a specified position in the face region in the first image frame collected in a period of time to a specified position in the face detection region, that is, the standard trajectory can be a straight line connecting from the initial position of the face region to the specified position in the face detection region; the specified position in the face detection region can be the center point of the face detection region. In other examples, the standard trajectory includes a trajectory fitted based on the motion trajectories of the face regions collected in historical time in a non-face recognition attack scenario. In the case of less historical data, the connecting line trajectory from the specified position in the face region in the first image frame collected in a period of time to the specified position in the face detection region can be used as the standard trajectory first, and after the motion trajectories of the face regions in multiple face recognitions in a non-face recognition attack scenario are accumulated, the standard trajectory is replaced from the original connecting line trajectory to a trajectory fitted based on the motion trajectories of the face regions collected in historical time in a non-face recognition attack scenario.
[0045] By comparing the motion trajectory and the standard trajectory, an error parameter of the motion trajectory and the standard trajectory is obtained, and the error parameter can reflect an error between the motion trajectory and the standard trajectory. The error between the motion trajectory and the standard trajectory in a plurality of image frames can be obtained by an error between a position of a face region in each image frame and a corresponding position in the standard trajectory. In some examples, a first position point of the motion trajectory in each image frame and a second position point corresponding to each image frame in the standard trajectory can be obtained; a horizontal error parameter and a vertical error parameter of the first position point and the second position point are obtained according to a coordinate of the first position point, a coordinate of the second position point and an included angle between the second position point and a horizontal direction in a coordinate system; and the error parameter is calculated according to the horizontal error parameter and the vertical error parameter corresponding to each image frame.
[0046] The first position point can be a center point of the face region in each image frame, and the second position point can be a position point in the standard trajectory corresponding to a time of the image frame. The included angle between the second position point and the horizontal direction in the coordinate system can be regarded as an included angle between a tangent line of the second position point in the standard trajectory and the horizontal direction in the coordinate system. The horizontal direction in the coordinate system can be a horizontal direction of a screen of the terminal device. The horizontal error parameter of the first position point and the second position point represents an error of the first position point and the second position point in the horizontal direction, and the vertical error parameter of the first position point and the second position point represents an error of the first position point and the second position point in the vertical direction. The horizontal error parameter and the vertical error parameter of the first position point and the second position point in each image frame are accumulated to obtain the error parameter of the motion trajectory and the standard trajectory.
[0047] For example, FIG. 7 is a schematic diagram of an example of the motion trajectory and the standard trajectory provided by an embodiment of the present application. As shown in FIG. 7, point P is a center point of the face region 23 in the first image frame, point P' is a center point of the face detection region 22, point P" is a center point of the face region 23 in the last image frame, curve c5 is the motion trajectory, straight line c6 is the standard trajectory, point A1 and point A2 are the first position point and the second position point corresponding to the i-th image frame respectively, the included angle between the tangent line of the second position point A2 on the standard trajectory and the horizontal direction in the coordinate system is θ, the horizontal error parameter and the vertical error parameter of the first position point and the second position point corresponding to the i-th image frame can be obtained according to the following formulas (1) and (2), and the error parameter of the motion trajectory and the standard trajectory can be obtained according to the following formula (3): i = (x-x') (-sin θ) + (y-y') cos θ (1) i = (x-x') cos θ + (y-y') sin θ (2)
[0048] wherein Ed iis a lateral error parameter of the first position point and the second position point corresponding to the i-th image frame; E i is a longitudinal error parameter of the first position point and the second position point corresponding to the i-th image frame; x and y are respectively the horizontal coordinate and the vertical coordinate of the first position point; x' and y' are respectively the horizontal coordinate and the vertical coordinate of the second position point; n is the number of image frames; θ is the angle between the tangent of the second position point on the standard trajectory and the horizontal direction in the coordinate system; E is an error parameter of the motion trajectory and the standard trajectory, and the greater the error parameter, the greater the error between the motion trajectory and the standard trajectory; τ(cosθ, sinθ) is the tangent vector of the second position point; n(-sinθ, cosθ) is the normal vector of the second position point.
[0049] In step S106, if the error parameter is located in the preset attack error range, it is determined that there is a face recognition attack.
[0050] If the error between the motion trajectory and the standard trajectory is too large, the current face recognition is most likely a face recognition attack. The attack error range is the range of error parameters of face recognition attacks, and if the error parameter is located in the attack error range, it indicates that the current face recognition is a face recognition attack. The attack error range can be set according to the scene, demand, experience, etc., and is not limited herein.
[0051] In some embodiments, if the error parameter is located in the preset risk error range, the difficulty level of the background detection in the face recognition detection can be increased. The risk error region is the range of error parameters in which the face recognition has a risk of being a face recognition attack, and can be set according to the scene, demand, experience, etc., and will not be described herein again. In some examples, the upper limit value of the risk error region can be less than or equal to the lower limit value of the attack error range. In the case where the current face recognition is not directly determined to be a face recognition attack but has a risk of being a face recognition attack, the difficulty level of the background detection can be increased. For example, the background detection includes a comparison of the face similarity with a preset threshold, and if the face similarity is higher than the preset threshold, the face recognition passes. In the case where the error parameter is located in the preset risk error range, the preset threshold can be increased to increase the difficulty of the background detection. According to the adjustment of the difficulty level of the background detection according to the error parameter, the current face recognition can be further detected by the background detection in a targeted manner to further improve the reliability of the face recognition attack.
[0052] In some embodiments, in the process of the user performing the live action detection, whether there is a face recognition attack can be further determined by comparing the features of the user's live detection action with the habit features of the user. FIG. 8 is a flowchart of a method for detecting a face recognition attack according to another embodiment of the present application. The difference between FIG. 8 and FIG. 1 is that the method for detecting a face recognition attack shown in FIG. 8 can further include steps S107 and S108.
[0053] In step S107, the image in the face collection preview control in the living body action detection process is used to obtain the living body detection action feature parameter of the user.
[0054] In the living body action detection process, the terminal device gives a user action prompt, prompting the user to make blinking, nodding, shaking, and mouth opening actions, and the image of the user making the above actions can be collected in the living body action detection process. According to the action of the face in the image, the living body detection action feature parameter of the user can be obtained, and the living body detection action feature parameter is used to represent the action feature of the user in the living body action detection process.
[0055] In some examples, the living body detection action feature parameter can include, but is not limited to, one or more of the following: face image size information, face posture angle information, coordinate information of a specified position of a face region relative to a specified position in the face collection preview control, coordinate information of the specified position of the face region relative to a specified position in the face detection region, living body detection action response speed information, living body detection action duration information, and living body detection action matching degree information. The face image size information is used to represent the size of the face image, which can be specifically implemented as the width x height of the pixel size of the face. The face posture angle information is used to represent the face posture angle, which can include three direction angles obtained by a face detection algorithm, and the three direction angles are pitch, yaw, and row. The coordinate information of the specified position of the face region relative to the specified position in the face collection preview control can include the coordinate information of the center point of the face region relative to the lower left corner point of the face collection preview control, and the lower left corner point of the face collection preview control can be used as the coordinate origin. The coordinate information of the specified position of the face region relative to the specified position in the face detection region can include the coordinate information of the center point of the face region relative to the lower left corner point of the face detection region, and the lower left corner point of the face detection region can be used as the coordinate origin. The living body detection action response speed information is used to represent the speed of the user responding to the living body detection action prompt to make the action, which can be represented by the number of image frames, such as the living body detection action response speed information can include the cumulative frame number between the preview frame of the prompt action and the starting image frame of the user making the corresponding action. The living body detection action duration information represents the duration of the user responding to the living body detection action prompt to make the action, which can be represented by the number of image frames, such as the living body detection action duration information can include the duration frame number of the user making the action indicated by the living body detection action prompt, and different actions can be counted separately. The living body detection action matching degree information is used to represent the matching degree of the action of the user in the living body action detection process, and the living body detection action matching degree information can include the average value of the matching degree of the user completing each action, which can be 1 / (1+m), where m is the number of times the user makes other unmatched actions before making the action for a certain living body detection.
[0056] In step S108, it is determined whether there is a face recognition attack based on the live body detection action feature parameter and the user's habit detection action feature parameter.
[0057] The user's habit detection action feature parameter is summarized by data in a historical time with the user as a dimension, and the type of the habit detection action feature parameter corresponds to the type of the live body detection action feature parameter. The habit detection action feature parameter can include a parameter range, for example, the face image size information in the habit detection action feature parameter can include a range in which the width and height are both between 120 pixels and 200 pixels; the face pose angle information in the habit detection action feature parameter can include a range in which the face pose angle is less than 20°; the coordinate information of the designated position of the face region relative to the designated position in the face detection region in the habit detection action feature parameter can include a range in which the horizontal and vertical coordinates of the center point of the face region relative to the lower left corner point in the face detection region are both in [45, 55], and the unit is pixel; the live body detection action response speed information in the habit detection action feature parameter can include a range in which the live body detection action response speed is 1 to 3 frames; the live body detection action duration information in the habit detection action feature parameter can include a range in which the live body detection action duration is 20 to 40 frames; and the live body detection action matching degree information in the habit detection action feature parameter can include a range in which the live body detection action matching degree is greater than 80%. The habit detection action feature parameter can also include the average value of the user's live body detection action feature parameter in the historical time, and other forms of habit detection action feature parameters are also within the protection scope of the present application.
[0058] The closer the user's live body detection action feature parameter is to the user's habit detection action feature parameter, the greater the possibility that the user's face recognition is normal face recognition; similarly, the greater the difference between the user's live body detection action feature parameter and the user's habit detection action feature parameter, the greater the possibility that the user's face recognition is a face recognition attack.
[0059] In some examples, the user's live detection action feature parameters in the long-term statistical process of the historical time can be approximately regarded as a normal distribution. By the deviation of the live detection action feature parameters and the habit detection action feature parameters, the possibility of the current face recognition as a face recognition attack can be determined. According to the live detection action feature parameters and the habit detection action feature parameters, the deviation parameter of the live detection action feature parameters and the habit detection action feature parameters can be obtained. If the deviation parameter is located in the attack deviation parameter range, it is determined that there is a face recognition attack. The attack deviation parameter range is the value range of the deviation parameter of the face recognition as a face recognition attack, which can be set according to the scene, demand, experience, etc., and is not limited herein. If the deviation parameter is located in the risk deviation parameter range, the difficulty level of the background detection in the face recognition detection is improved. The risk deviation parameter range is the value range of the deviation parameter of the face recognition without being directly determined as a face recognition attack but with a risk of face recognition attack, which can be set according to the scene, demand, experience, etc., and is not limited herein. In some examples, the upper limit value of the risk deviation parameter range can be less than or equal to the lower limit value of the attack deviation parameter range. For example, the deviation parameter can be the offset ratio of the live detection action feature parameters relative to the habit detection action feature parameters. The offset ratio can be divided into multiple offset levels in advance, and according to the offset level in which the obtained offset ratio falls, the possibility of the face recognition as a face recognition attack is determined. According to the offset ratio, one offset level is divided every thousandth. The risk deviation parameter range is three thousandths to five thousandths, and the attack deviation parameter range can be greater than five thousandths. That is, if the offset ratio is greater than five thousandths, it is determined that there is a face recognition attack. If the offset ratio is three thousandths to five thousandths, the strategy of the background detection is adjusted, and the difficulty of the background detection is improved.
[0060] In some examples, a pre-trained model can also be used to assist in determining whether a face recognition attack exists. An attack decision model can be trained in advance using sample data, which can include habit detection action feature parameters and liveness detection action feature parameters of a user in a face recognition attack scenario, one of the habit detection action feature parameters and the liveness detection action feature parameters in the face recognition attack scenario being a positive sample and the other being a negative sample, to train the model and obtain the attack decision model. The model can be a perception machine or other model, which is not limited herein, and can be trained in an unsupervised or semi-supervised manner to obtain the attack decision model. The trained attack decision model can output an output result representing the possibility of a face recognition attack according to input data, and then determine whether a face recognition attack exists according to the output result. Specifically, the liveness detection action feature parameters can be normalized according to the liveness detection action feature parameters and sample data, and the sample data includes habit detection action feature parameters; the normalized liveness detection action feature parameters are processed using the attack decision model to obtain an output result, and the attack decision model is trained in advance based on sample data; if the possibility of a face recognition attack represented by the output result is within an attack range, it is determined that a face recognition attack exists; and if the possibility of a face recognition attack represented by the output result is within a risk range, the difficulty level of background detection in face recognition detection is increased. The attack range is an output value range of the attack decision model corresponding to the liveness detection action feature parameters that can be directly determined as a face recognition attack, and the risk range is an output value range of the attack decision model corresponding to the liveness detection action feature parameters that do not reach the degree of directly determining a face recognition attack but have a risk of a face recognition attack. The attack range and the risk range can be determined according to the scene, requirements, experience, etc., which are not limited herein.
[0061] For example, the normalization of the liveness detection action feature parameters can be performed according to the following formula (4):
[0062] where e' is the normalized liveness detection action feature parameters, e is the liveness detection action feature parameters before normalization, μ is the average value of the sample data, and σ is the standard deviation of the sample data.
[0063] In some examples, the output result can be an output score, and the higher the output score, the greater the possibility that the current face recognition is a face recognition attack. The upper limit value of the risk range is less than or equal to the lower limit value of the attack range, and if the output score is within the attack range, it is determined that a face recognition attack exists; and if the output score is within the risk range, the difficulty of background detection can be increased to further detect the current face recognition more strictly and improve the reliability of face recognition.
[0064] For ease of understanding, the face recognition detection process including the face recognition attack detection method applied to the front end in the embodiments of the present application is described below. FIG. 9 is a flowchart of an example of the face detection process provided by the embodiments of the present application, as shown in FIG. 9, the face detection process includes steps f1 to f10.
[0065] In step f1, a randomly generated control offset is obtained.
[0066] In step f2, the face collection preview control and the face detection area are adjusted. For specific content, refer to the related description of step S101 in the above embodiments, which will not be repeated here.
[0067] In step f3, the position of the face area in the image frame is detected. For specific content of this step f3, refer to steps S102, S103 and related specific content in the above embodiments, which will not be repeated here. If the position detection passes, step f4 is executed; if the position detection fails, it is determined that there is a face recognition attack, the face recognition is intercepted, and the process is ended.
[0068] In step f4, the motion trajectory of the face area is obtained.
[0069] In step f5, the action required by the user for live action detection is prompted.
[0070] In step f6, action consistency judgment is performed, that is, whether the action of the face in the collected image is consistent with the prompted action. If the consistency judgment passes, step f7 is executed; if the consistency judgment fails, it is determined that there is a face recognition attack, the face recognition is intercepted, and the process is ended.
[0071] In step f7, glint detection is performed.
[0072] In step f8, deviation evaluation of the moving trajectory and the standard trajectory is performed. For specific content of this step f8, refer to steps S105, S106 and other related specific content in the above embodiments, which will not be repeated here.
[0073] In step f9, portrait evaluation of the user action is performed. For specific content of this step f9, refer to steps S107, S108 and other related specific content in the above embodiments, which will not be repeated here.
[0074] In step f10, background detection is performed. The background detection can be implemented as hack detection of the back end.
[0075] The above steps f1 to f9 can be executed by the front end, and step f10 can be executed by the back end, i.e., the background. For specific content of steps f1 to f10, refer to the related description in the above embodiments, which will not be repeated here.
[0076] The second aspect of the present application provides a device for detecting face recognition attack. FIG. 10 is a structural schematic diagram of the device for detecting face recognition attack according to an embodiment of the present application. As shown in FIG. 10, the device for detecting face recognition attack 300 can include a shift module 301, a recognition module 302 and a processing module 303.
[0077] The shift module 301 can be configured to randomly generate a control shift amount, and move a face capture preview control of a user terminal and a face detection area in the face capture preview control according to the control shift amount, so that the position of the face capture preview control is changed while the position of the face detection area remains unchanged.
[0078] The recognition module 302 can be configured to capture an image frame in the face capture preview control, and recognize a face area from the image frame.
[0079] The processing module 303 can be configured to determine whether there is a face recognition attack according to the positional relationship between the face area and the face capture preview control.
[0080] In some embodiments, the processing module 303 can be specifically configured to: if the face area is located in the face detection area in the face capture preview control, determine that there is a face recognition attack; or if the distance between the face area and a predetermined position in the face capture preview control is beyond a preset normal distance range, determine that there is a face recognition attack, the first distance being the distance between the face detection area and the predetermined position in the face capture preview control.
[0081] In some embodiments, the shift module 301 can be specifically configured to: move the face capture preview control from an original position to a target position according to the control shift amount; and move the face detection area according to the reverse shift amount of the control shift amount.
[0082] In some embodiments, the device for detecting face recognition attack 300 can further include a trajectory comparison module. The trajectory comparison module can be configured to: obtain a motion trajectory of the face area according to image frames captured in a period of time; calculate an error parameter of the motion trajectory and a standard trajectory; and if the error parameter is located in a preset attack error range, determine that there is a face recognition attack.
[0083] In some examples, the trajectory comparison module can be specifically configured to: obtain a first position point of the motion trajectory in each image frame and a second position point of the standard trajectory corresponding to each image frame; obtain a horizontal error parameter and a vertical error parameter of the first position point and the second position point according to the coordinates of the first position point, the coordinates of the second position point and the included angle between the second position point and a horizontal direction in a coordinate system corresponding to the same image frame; and calculate the error parameter according to the horizontal error parameter and the vertical error parameter corresponding to each image frame.
[0084] In some examples, the standard trajectory includes a trajectory of a line connecting a specified position in the face region in a first image frame collected in a period of time to a specified position in the face detection region, or a trajectory fitted based on a motion trajectory of the face region collected in a historical period of time in the absence of the face recognition attack scene.
[0085] In some examples, the trajectory comparison module can be further configured to increase a difficulty level of the background detection in the face recognition detection if the error parameter is within a preset risk error range.
[0086] In some examples, the face recognition attack detection apparatus 300 can further include a motion image detection module. The motion image detection module can be configured to obtain a living body detection motion feature parameter of a user according to an image in the face collection preview control in the living body detection process, and determine whether the face recognition attack exists based on the living body detection motion feature parameter and a habitual detection motion feature parameter of the user.
[0087] In some examples, the motion image detection module can be specifically configured to obtain a deviation parameter of the living body detection motion feature parameter and the habitual detection motion feature parameter according to the living body detection motion feature parameter and the habitual detection motion feature parameter, and determine that the face recognition attack exists if the deviation parameter is within an attack deviation parameter range.
[0088] In some examples, the motion image detection module can be specifically configured to normalize the living body detection motion feature parameter according to the living body detection motion feature parameter and sample data, the sample data including the habitual detection motion feature parameter, process the normalized living body detection motion feature parameter by using an attack decision model to obtain an output result, the attack decision model being pre-trained based on the sample data, and determine that the face recognition attack exists if a possibility of the face recognition attack represented by the output result is within an attack range.
[0089] In some examples, the motion image detection module can be further configured to increase a difficulty level of the background detection in the face recognition detection if the deviation parameter is within a risk deviation parameter range, or increase the difficulty level of the background detection in the face recognition detection if the possibility of the face recognition attack represented by the output result is within a risk range.
[0090] In some examples, the living body detection motion feature parameter includes one or more of the following: face image size information, face posture angle information, coordinate information of a specified position of a face region relative to a specified position in the face collection preview control, coordinate information of the specified position of the face region relative to a specified position in the face detection region, living body detection motion response speed information, living body detection motion duration information, and living body detection motion matching degree information.
[0091] It should be noted that the device 300 for detecting face recognition attack corresponds to the method for detecting face recognition attack, and all implementation manners in the method embodiments are applicable to the device embodiments, and the same technical effects can be achieved.
[0092] The third aspect of the present application provides a terminal device. FIG. 11 is a structural schematic diagram of a terminal device according to an embodiment of the present application. As shown in FIG. 11, the terminal device 400 includes a memory 401, a processor 402, and a computer program stored in the memory 401 and executable on the processor 402.
[0093] In some examples, the processor 402 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement one or more embodiments of the present application.
[0094] The memory 401 can include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Therefore, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software including computer-executable instructions and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method for detecting face recognition attack according to embodiments of the present application.
[0095] The processor 402 runs a computer program corresponding to the executable program code stored in the memory 401 by reading the executable program code, to implement the method for detecting face recognition attack in the above embodiments.
[0096] In some examples, the terminal device 400 can further include a communication interface 403 and a bus 404. As shown in FIG. 11, the memory 401, the processor 402, and the communication interface 403 are connected through the bus 404 and complete communication with each other.
[0097] The communication interface 403 is mainly used to realize the communication between various modules, devices, units, and / or equipment in the embodiments of the present application. Input devices and / or output devices can also be accessed through the communication interface 403.
[0098] Bus 404 includes a hardware, software, or both that couples components of terminal device 400 to each other. As an example and not by way of limitation, bus 404 can include an accelerated graphics port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand (IB) interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-E) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association local (VLB) bus, or another suitable bus or a combination of two or more of these. Where appropriate, bus 404 can include one or more buses. Although this application describes and shows a particular bus, this application contemplates any suitable bus or interconnect.
[0099] A computer readable storage medium is provided in the fourth aspect of the present application, and the computer program instructions stored on the computer readable storage medium can implement the method for detecting face recognition attacks in the above embodiments when executed by a processor, and achieve the same technical effects. To avoid repetition, details are not described here. The computer readable storage medium can include a non-transitory computer readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and the like, which is not limited here.
[0100] A computer program product is provided in the fifth aspect of the present application, and the computer program product includes a computer program that can implement the method for detecting face recognition attacks in the above embodiments when executed by a processor, and achieve the same technical effects. To avoid repetition, details are not described here.
[0101] It should be clarified that the various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. For the device embodiments, equipment embodiments, computer-readable storage medium embodiments, and computer program product embodiments, the relevant parts can be referred to the description section of the method embodiments. This application is not limited to the specific steps and structures described above and shown in the figures. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application. Furthermore, for the sake of brevity, detailed descriptions of known methods and techniques are omitted here.
[0102] The aspects of this application have been described above with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It should be understood that each block in the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, 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, or other programmable data processing apparatus to produce a machine such that these instructions, executable via the processor of the computer or other programmable data processing apparatus, enable the implementation of the functions / actions specified in one or more blocks of the flowchart illustrations and / or block diagrams. Such a processor can be, but is not limited to, a general-purpose processor, a special-purpose processor, a special application processor, or a field-programmable logic circuit. It is also understood that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can also be implemented by dedicated hardware performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0103] Those skilled in the art will understand that the above embodiments are exemplary and not restrictive. Different technical features appearing in different embodiments can be combined to achieve beneficial effects. Based on a study of the drawings, specification, and claims, those skilled in the art should be able to understand and implement other variations of the disclosed embodiments. In the claims, the term "comprising" does not exclude other means or steps; the quantifier "a" does not exclude a plurality; the terms "first" and "second" are used to identify names and not to indicate any particular order. No reference numerals in the claims should be construed as limiting the scope of protection. The functionality of multiple parts appearing in the claims can be implemented by a single hardware or software module. The appearance of certain technical features in different dependent claims does not mean that these technical features cannot be combined to achieve beneficial effects.
Claims
1. A method for detecting face recognition attack, comprising: randomly generating a control offset, moving a face capturing preview control of a user terminal and a face detection area in the face capturing preview control according to the control offset, so that a position of the face capturing preview control is changed while a position of the face detection area remains unchanged; capturing an image frame in the face capturing preview control, and identifying a face area from the image frame; determining whether a face recognition attack exists according to a positional relationship between the face area and the face capturing preview control.
2. The method of claim 1, wherein, The determining whether the face recognition attack exists according to the positional relationship between the face area and the face capturing preview control comprises: if the face area is located in the face detection area in the face capturing preview control, it is determined that the face recognition attack exists; or if a distance between the face area and a predetermined position in the face capturing preview control is beyond a preset normal distance range from a first distance, the first distance being a distance between the face detection area and the predetermined position in the face capturing preview control, it is determined that the face recognition attack exists. The moving the face capturing preview control of the user terminal and the face detection area in the face capturing preview control according to the control offset comprises:
3. The method of claim 1, wherein, moving the face capturing preview control from an original position to a target position according to the control offset; and moving the face detection area according to a reverse offset of the control offset. 4.The method of claim 1, further comprising: obtaining a motion trajectory of the face area according to image frames captured in a period of time; calculating an error parameter of the motion trajectory and a standard trajectory; if the error parameter is located in a preset attack error range, it is determined that the face recognition attack exists. The calculating the error parameter of the motion trajectory and the standard trajectory comprises:
5. The method of claim 4, wherein, obtaining a first position point of the motion trajectory in each image frame and a second position point of the standard trajectory corresponding to each image frame; obtaining a horizontal error parameter and a vertical error parameter of the first position point and the second position point according to a coordinate of the first position point, a coordinate of the second position point, and an included angle between the second position point and a horizontal direction in a coordinate system corresponding to a same image frame; calculating the error parameter according to the horizontal error parameter and the vertical error parameter corresponding to each image frame. The standard trajectory comprises:
6. The method of claim 4, wherein, a connecting line trajectory from a specified position in the face area in a first image frame captured in a period of time to a specified position in the face detection area; or a trajectory fitted based on motion trajectories of the face area captured in a historical period of time in a scenario where no face recognition attack exists. 7.The method of claim 4, further comprising: if the error parameter is located in a preset risk error range, increasing a difficulty level of background detection in face recognition detection. 8.The method of claim 1, further comprising: obtaining a live body detection action feature parameter of a user according to an image in the face capturing preview control in a live body action detection process. Determine whether there is a face recognition attack based on the live body detection action feature parameter and the habit detection action feature parameter of the user.
9. The method of claim 8, wherein, The determination whether there is a face recognition attack based on the live body detection action feature parameter and the habit detection action feature parameter of the user comprises: According to the live body detection action feature parameter and the habit detection action feature parameter, obtain a deviation parameter of the live body detection action feature parameter and the habit detection action feature parameter; if the deviation parameter is within an attack deviation parameter range, it is determined that there is a face recognition attack; Or, According to the live body detection action feature parameter and sample data, perform normalization processing on the live body detection action feature parameter, the sample data comprising the habit detection action feature parameter; process the live body detection action feature parameter after normalization processing by using an attack decision model to obtain an output result, the attack decision model being pre-trained based on the sample data; if the possibility of face recognition attack represented by the output result is within an attack range, it is determined that there is a face recognition attack.
10. The method of claim 9, further comprising: If the deviation parameter is within a risk deviation parameter range, increase the difficulty level of background detection in face recognition detection; Or, If the possibility of face recognition attack represented by the output result is within a risk range, increase the difficulty level of background detection in face recognition detection.
11. The method of any one of claims 8 to 10, wherein, The live body detection action feature parameter comprises one or more of the following: Face image size information, face posture angle information, coordinate information of a specified position of a face region relative to a specified position in the face collection preview control, coordinate information of the specified position of the face region relative to a specified position in the face detection region, live body detection action response speed information, live body detection action duration information, and live body detection action matching degree information.
12. A device for detecting a face recognition attack, comprising: An offset module configured to randomly generate a control offset, move a face collection preview control of a user terminal and a face detection region in the face collection preview control according to the control offset, and change the position of the face collection preview control while keeping the position of the face detection region unchanged; An identification module configured to collect an image frame in the face collection preview control and identify a face region from the image frame; A processing module configured to determine whether there is a face recognition attack according to the positional relationship between the face region and the face collection preview control.
13. A terminal device comprising: A processor and a memory storing computer program instructions; The processor executes the computer program instructions to implement the method for detecting a face recognition attack according to any one of claims 1 to 11.
14. A computer readable storage medium storing computer program instructions, the computer program instructions being executed by a processor to implement the method for detecting a face recognition attack according to any one of claims 1 to 11.
15. A computer program product comprising a computer program which, when executed by a processor, implements the method of detecting face recognition attacks according to any one of claims 1 to 11.
Citation Information
Patent Citations
Living body detection method and equipment
CN111382592A
Face living body detection method and system, computer equipment and storage medium
CN116403261A
Man-machine verification method and device, equipment and medium
CN118070260A
Detection method and device for face recognition attack, equipment and medium
CN119007267A
Image processing device and image processing method
JP2012100183A