Target detection method and device
By displaying the array pattern on the display screen and analyzing reflected light signals using the array light source, the problem of poor living body detection in the existing technology is solved, effective defense against two-dimensional and three-dimensional attacks is achieved, and detection accuracy and security are improved. sex.
Patent Information
- Application Number
- CN202310539187.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-12
- Publication Date
- 2024-11-12
AI Technical Summary
The existing live detection technology is poor in preventing deceptive behavior and has high safety risks, especially when facing two-dimensional and three-dimensional attacks, it is difficult to accurately distinguish between real and fake faces.
By displaying the array pattern on the display screen, the light emitted by the array light source forms characteristic reflected light signals on the human face, collecting and analyzing these signals to determine whether the target is a living body, and improving detection accuracy. The method includes displaying different array patterns, collecting corresponding target images, and determining whether the target is a living body through feature extraction and pattern recognition models.
It significantly improves the accuracy of target detection, reduces safety risks, can effectively defend against two-dimensional and three-dimensional attacks, and ensures the accuracy and safety of live detection.
Smart Images

Figure CN118942165A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a target detection method and device. Background Art
[0002] At present, there are security threats in more and more fields, such as financial transactions, unlocking mobile phones, etc. For example, in some attack scenarios, the spoofer wears a mask or head model of the impersonated user to perform face recognition and unlock the impersonated user's mobile phone. For another example, the spoofer replays a video of the impersonated user on the screen for face recognition, thereby unlocking the impersonated user's mobile phone.
[0003] In some solutions, in order to identify fraudulent behavior in the corresponding scenarios, the system will perform liveness detection on the detected target, and determine whether the detected target is a real live person by analyzing the biometric features in the image or audio signal, so as to prevent fraudsters from impersonating legitimate user information to deceive the face identity verification system. However, the current liveness detection solutions usually cannot achieve the detection effect that users want, and there are still high security risks in some scenarios. Summary of the invention
[0004] In order to solve the above technical problems, a target detection method and device are provided. The technical solution provided in this application can improve the accuracy of target detection and reduce the safety risks of the device.
[0005] In order to achieve the above technical objectives, the following technical solutions are provided:
[0006] In a first aspect, a target detection method is provided, which is applied to a first device or a component (such as a chip system) that supports the first device to implement related functions. The first device includes a display screen and a light source, and the method includes: the first device displays an array pattern through the display screen, and the array pattern is a pattern formed on the display screen by the array light emitted by the light source. The first device collects a target image of a target object under the illumination of the array light, and determines whether the target object is a living target based on the target image.
[0007] Considering the different relative positional relationships between different light points in the array light and the detected target (such as a face), after the light from different light points is projected onto the detected target, the characteristics of the target image formed by the reflected light signal (such as the brightness and darkness in the target image, the shape of the imaging area) are different, and the reflection of the array light on targets of different materials will be different. Therefore, the first device can accurately identify whether the detected target is a living target based on the characteristics of the target image of the detected target under the illumination of the array light, thereby improving the accuracy of target detection and reducing safety hazards in the target detection process.
[0008] In a possible design, the array pattern includes a plurality of sub-patterns, and the plurality of sub-patterns include sub-patterns with regular shapes.
[0009] In this method, by displaying an array pattern including regular sub-patterns, the collected target image can be made easier to process, thereby reducing the computational complexity of performing living body detection based on the target image.
[0010] In one possible design, the array pattern includes a plurality of sub-patterns, and the features of the plurality of sub-patterns are the same or different;
[0011] The characteristics of the sub-patterns include at least one of the following: color, shape, size, quantity, and positional relationship between sub-patterns.
[0012] That is to say, the features such as color and shape of the sub-patterns in the same array pattern may be different or the same.
[0013] In some examples, if the sub-patterns in the array pattern have the same features, such as color, shape, size, and spacing, the captured target image can be easier to process, reducing the computational complexity of liveness detection based on the target image.
[0014] In other examples, if the features of each sub-pattern in the array pattern are different, the first device can use the differences between different sub-patterns to improve the accuracy of target detection. For example, the array pattern includes a green circular sub-pattern and a red circular sub-pattern, and the corresponding array light includes green light and red light. The first device can illuminate the target object with array light including green light and red light, and collect a target image of the target object under the illumination of the array light. The target image includes information about the target object reflecting red light and information about the target object reflecting green light, contains richer reflection information, and can improve the accuracy of target detection.
[0015] In a possible design, the array pattern includes a plurality of sub-patterns, and the sub-patterns include circular sub-patterns.
[0016] In this method, when the sub-pattern is a circle, since the circle has characteristics such as rotation invariance, by displaying a circular array pattern to send dot matrix light, the collected face image can be easier to process and the computational complexity of liveness detection based on the face image can be reduced.
[0017] In one possible design, displaying an array pattern through the display screen includes:
[0018] Displaying a first array pattern via the display screen;
[0019] After the duration of displaying the first array pattern reaches a first duration, displaying a second array pattern through the display screen;
[0020] Acquiring a target image of the target object under the illumination of the array light, comprising:
[0021] capturing a first target image of the target object when the first array pattern is displayed;
[0022] A second target image of the target object when the second array pattern is displayed is acquired.
[0023] In this method, the first device collects target images of the target object under the illumination of corresponding array lights by displaying multiple array patterns in a time-sharing manner, and more accurate target detection results can be obtained through multiple target images.
[0024] In a possible design, after the second array pattern is displayed on the display screen, the method further includes:
[0025] After the duration of displaying the second array pattern reaches a second duration, a third array pattern is displayed through the display screen; the first duration is different from the second duration.
[0026] In this method, the display durations of multiple array images may be different, and correspondingly, the illumination durations of multiple array lights are different. For example, the illumination durations of red, green, and blue array lights are 2s, 3s, and 2s, respectively, and correspondingly, the reflected light has corresponding reflection characteristics, such as different durations of red, green, and blue reflected light. In this way, it is possible to prevent attackers from attacking by recording corresponding light feedback videos. In other words, the color of the reflected light in the light video recorded by the attacker may meet the requirements, but since the duration of the corresponding reflected light in the target image does not match the illumination duration of the array light, the purpose of the attack cannot be achieved. For example, in the target image, if the duration of displaying red bright spots, green bright spots, and blue bright spots is not 2s, 3s, or 2s, then the target image does not meet the living body detection conditions, and the first device determines that the target object is likely to be an object in a pre-recorded video, and is not a living body target.
[0027] In one possible design, a feature of a sub-pattern in the first array pattern is different from a feature of a sub-pattern in the second array pattern.
[0028] In this method, the sub-patterns in different array patterns may have different features such as color, shape, and quantity. For example, the color of the sub-pattern in the first array pattern is red, and the color of the sub-pattern in the second array pattern is green. In this way, by using array patterns with different features, the difficulty of attack for attackers can be increased, and the security risks of the first device can be reduced.
[0029] In one possible design, it also includes:
[0030] The first prompt information is displayed to prompt the user that the liveness detection is being performed. In this way, the user can know that the liveness detection is currently being performed according to the prompt information, and cooperate to complete the liveness detection process, thereby improving the success rate of the liveness detection.
[0031] In one possible design, the target object is a user's face.
[0032] In one possible design, it also includes:
[0033] Displaying prompt information, wherein the prompt information is used to prompt the user to adjust the posture;
[0034] The acquiring a target image of the target object under the illumination of the array light comprises: acquiring a first image of the user's face after posture adjustment under the illumination of the array light;
[0035] The first image satisfies at least one of the following conditions: the light intensity corresponding to the first image is within a preset light intensity range, the proportion of the user's face in the first image is within a preset proportion range, the orientation of the user's face in the first image is within a preset orientation range, the occlusion of the user's face in the first image is within a preset occlusion range, and the angle of the user's face in the first image is within a preset angle range.
[0036] In this method, the user can adjust the head posture according to the prompt information so that the collected target image meets the conditions for liveness detection, thereby improving the success rate of liveness detection.
[0037] In one possible design, displaying an array pattern through the display screen includes:
[0038] After determining that the face image after adjusting the head posture meets the condition, displaying the array pattern;
[0039] In one possible design, the method further includes:
[0040] Performing an affine transformation on the target image illuminated by the array light;
[0041] Judging whether the user is a living target according to the target image includes:
[0042] According to the target image after affine transformation, it is determined whether the user is a living target.
[0043] Taking into account that the target object may not be facing the first device, causing the center point of the light spot in the captured target image to be stretched, squeezed, etc., in this method, the target image can be affine processed to reduce the impact of the light spot stretching, squeezing, etc. on liveness detection and improve detection accuracy.
[0044] In a possible design, judging whether the target object is a living target according to the target image includes:
[0045] Extracting the user's facial feature information according to the target image; the facial feature information includes at least one of the following: the position, size, shape, color, brightness of the bright spot formed in the target image after the array light irradiates the target object, the position and color of the facial key points in the target image;
[0046] According to the facial feature information, it is determined whether the user is a living target.
[0047] Compared with related technologies, this method adds feature information such as bright spot features (position, color) and facial key points, which can improve the accuracy of target recognition through richer feature information.
[0048] In a possible design, judging whether the user is a living target according to the facial feature information includes:
[0049] Determining material information and structural information corresponding to the user's face according to the facial feature information;
[0050] Whether the user is a living target is determined according to the material information and the structure information.
[0051] By irradiating the target object with array light, we can obtain richer structural features of the target object, help the target object reconstruct its spatial structure, and effectively defend against high-definition two-dimensional dynamic attacks. At the same time, array light with different characteristics ensures the extraction of material information of the target object, effectively improving the defense effect of three-dimensional mask attacks.
[0052] It can be seen that the first device can more accurately identify the target by combining the structural information and material information of the target object, effectively defend against two-dimensional attacks and three-dimensional attacks, and improve the safety performance of the device.
[0053] In a possible design, judging whether the target object is a living target according to the target image includes:
[0054] Inputting the facial feature information into a target model, and having the target model output a detection result of whether the user is a living target;
[0055] The training samples of the target model include: images of real human faces under the illumination of the array light, and images of non-real human faces under the illumination of the array light.
[0056] In some examples, the target model may be a classifier, or the target model may include a feature extractor and a classifier.
[0057] In a possible design, the array pattern corresponding to the array light is a first array pattern, and the target model is a first model; or, the array pattern corresponding to the array light is a second array pattern, and the target model is a second model.
[0058] In this method, different models can be used to process target images under different array light illumination to obtain the final target detection results and improve the accuracy of target detection. Figure 7 (b), the array light A formed by the array pattern 402a irradiates the target object, the first device collects the target image A of the target object under the irradiation of the array light A, extracts the facial feature information of the target object from the target image A, inputs the facial feature information into the first model, and the first model outputs the detection result A of the target object.
[0059] Optionally, the training samples of the first model include images of real human faces illuminated by array light A and images of non-real human faces illuminated by array light A.
[0060] like Figure 7 (c), the array light B formed by the array pattern 403a irradiates the target object, the first device collects the target image B of the target object under the illumination of the array light B, extracts the facial feature information of the target object from the target image B, inputs the facial feature information into the second model, and the second model outputs the detection result B of the target object. The first device can determine whether the target object is a living target based on the detection result A and the detection result B. For example, if the detection result A and the detection result B both indicate that the target object is a non-living target, the first device determines that the target object is a non-living target.
[0061] Optionally, the training samples of the second model include images of real human faces under the illumination of the array light B and images of non-real human faces under the illumination of the array light B.
[0062] In a possible design, collecting reflected light from the user's face under the illumination of the array light includes:
[0063] The reflected light is collected by a red, green, and blue (RGB) sensor.
[0064] In some examples, the RGB sensor can be set in an RGB camera.
[0065] Alternatively, the RGB sensor can be set independently of the RGB camera. This implementation method can also realize the collection of face images and liveness detection for some devices without RGB cameras.
[0066] In a possible design, the array pattern is composed of sub-patterns of M rows and N columns, where M and N are both positive integers. Figure 7 In (b), the array pattern 402a is composed of sub-patterns of 7 rows and 5 columns.
[0067] In a second aspect, a device is provided, which has the function of implementing the method described in any of the above aspects and any possible implementation thereof. The function can be implemented by hardware, or by hardware executing corresponding software implementation. The hardware or software includes one or more modules corresponding to the above functions.
[0068] In a third aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores a computer program (also referred to as an instruction or code), and when the computer program is executed by an electronic device, the electronic device executes the method of any aspect or any implementation of any aspect.
[0069] According to a fourth aspect, a computer program product is provided. When the computer program product is run on an electronic device, the electronic device executes a method of any aspect or any implementation of any aspect.
[0070] According to a fifth aspect, a circuit system is provided, the circuit system comprising a processing circuit, wherein the processing circuit is configured to execute a method of any aspect or any implementation of any aspect.
[0071] In a sixth aspect, a chip system is provided, comprising at least one processor and at least one interface circuit, wherein the at least one interface circuit is used to perform transceiver functions and send instructions to the at least one processor, and when the at least one processor executes the instructions, the at least one processor executes a method of any aspect or any implementation of any aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0072] Figure 1 is a schematic diagram of a liveness detection method in the related art;
[0073] Figure 2A A schematic diagram of the system architecture provided for an embodiment of the present application;
[0074] Figure 2B A schematic diagram of the hardware structure of the device provided in the embodiment of the present application;
[0075] Figure 3 A schematic diagram of the hardware structure of the device provided in the embodiment of the present application;
[0076] Figure 4 A schematic diagram of an interface provided in an embodiment of the present application;
[0077] Figure 5A schematic diagram of a scenario provided for an embodiment of the present application;
[0078] Figure 6 A schematic diagram of a scenario provided for an embodiment of the present application;
[0079] Figure 7 A schematic diagram of an interface provided in an embodiment of the present application;
[0080] Figure 8 , Fig. 9 A schematic diagram of a flow chart of a scene switching method provided in an embodiment of the present application;
[0081] Fig.10 A schematic diagram of an interface provided in an embodiment of the present application;
[0082] Fig.11 , Fig.12 A schematic diagram of a scenario provided for an embodiment of the present application;
[0083] Fig.13A , Fig. 13B , Fig.14 A schematic diagram of an affine transformation provided in an embodiment of the present application;
[0084] Fig.15 , Fig.16 A schematic diagram of a scenario provided for an embodiment of the present application;
[0085] Fig.17 A schematic diagram of the structure of the device provided in the embodiment of the present application;
[0086] Fig.18 A schematic diagram of the structure of the chip system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0087] The terms "including" and "having" and any variations thereof mentioned in the description of the embodiments of the present application are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may optionally include other steps or units that are not listed, or may optionally include other steps or units that are inherent to these processes, methods, products or devices.
[0088] It should be noted that, in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.
[0089] In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" refers to two or more. The "and / or" in this article is only a description of the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.
[0090] 1. Two-dimensional attack and three-dimensional attack
[0091] At present, common attack scenarios include two-dimensional attack and three-dimensional attack. Two-dimensional attack can be understood as presenting a human face in two dimensions and using the two-dimensional face to attack. Two-dimensional attack is divided into dynamic two-dimensional attack and static two-dimensional attack.
[0092] For example, in a dynamic two-dimensional attack, the attacker can use a video of the person being impersonated to attack. In a static two-dimensional attack, the attacker can use an electronic photo or paper photo of the person being impersonated to attack.
[0093] Videos and electronic photos can be presented through various devices, and the attack effect is related to factors such as the size, resolution, contrast, brightness, frame rate, placement and angle of the device in physical space. The attack effect of paper photos is related to factors such as material, cropping method, and spatial transformation.
[0094] Three-dimensional attacks can include head model attacks and mask attacks. The head model is a three-dimensional facial model of the person being impersonated, and the mask is a three-dimensional facial mask of the person being impersonated.
[0095] The above attack methods and attack effects are related to the facial attributes of the person being impersonated. These facial attributes (or facial features) include skin color, makeup, age, hairstyle, hair color, facial features, expression, angle, position, lighting, decorations (glasses, masks, hats), material, etc.
[0096] 2. Liveness detection
[0097] At present, there are target detection methods for the above-mentioned attack methods, such as silent liveness detection, motion liveness detection, depth-based liveness detection, and light liveness detection.
[0098] As follows, several target detection methods are introduced:
[0099] 2.1 Liveness Detection Based on Image Quality Analysis
[0100] Liveness detection based on image quality analysis includes silent liveness detection and action liveness detection. In this target detection method, the user records a face video or takes a face image, and performs liveness verification by capturing facial micro-expressions, screen moiré, complete prescribed movements, bright spots, etc.
[0101] This target detection method, due to the hardware capability limitations of the shooting equipment and other factors, makes the captured face images or face videos have a certain degree of distortion compared to the real face, and this distortion can be detected by the image quality analysis method. This target detection method has good generalization ability, fast response speed, and low computational overhead. However, for different attack methods, different classifiers need to be trained, and different image features usually need to be used together to ensure classification performance.
[0102] 2.1.1 Silent liveness detection
[0103] In the silent object detection method, the system does not require the user to perform specific actions to pass the detection.
[0104] 2.1.2 Motion liveness detection
[0105] Considering that fraudsters may further enhance the screen hardware to eliminate reflections and moiré patterns, or use a larger screen so that the camera cannot capture the border, in this case, moiré patterns and other information cannot be detected. The system can require users to perform specific actions to pass the detection during liveness detection. Since people in the video or image cannot interact with the system in real time, the system can judge that the detected target is not alive.
[0106] For liveness detection based on image quality analysis, when the resolution of the face image used by the attacker is higher than that of the liveness detection device (such as a mobile phone), or when the face image is realistic enough, the distortion is very slight, which will cause the liveness detection device to be unable to detect the attacker's deception. In addition, this method performs liveness detection by detecting the face information in a two-dimensional image or video, and cannot effectively defend against three-dimensional attacks such as mask attacks or head model attacks.
[0107] 2.2 Depth-based liveness detection
[0108] Considering that real faces contain rich three-dimensional depth information, the device can determine whether the detected face is a three-dimensional face by obtaining the depth features of the detected face to prevent two-dimensional attacks. Depth-based liveness detection includes the following methods:
[0109] 2.2.1 Three-dimensional projection method
[0110] This method mainly detects two-dimensional attacks by calculating geometric invariant features. During liveness detection, users are asked to change the angle of their faces in the video. When the face changes its posture in the video, the projection invariant features of the real face will change significantly with the different face angles, while the corresponding features of the planar attack medium will not change much.
[0111] 2.2.2 Defocusing method
[0112] This method adjusts the focal length of the camera to obtain images of the detected face under different focus parameters, and calculates the focus level of the pixels in the images with different focus parameters. For the areas outside the focus area in the image, since the blur affects the frequency domain information, the energy histogram can reflect the structural information of the object.
[0113] 2.2.3 Light Field Camera Method
[0114] The method estimates the depth information in the original light field image collected from the light field camera, wherein the original light field image contains multiple microlens images, which are not affected by the focal plane and can represent the distribution of different light rays.
[0115] Depth-based object detection methods can effectively resist two-dimensional attacks, but depth features often make it difficult to distinguish three-dimensional masks / head models from real faces, resulting in low detection accuracy for three-dimensional mask / head model attacks. In addition, this method has low robustness and has high requirements for image quality. In addition, additional hardware devices such as light field cameras need to be introduced, which increases the cost and volume of the equipment.
[0116] 2.3 Light liveness detection
[0117] In this method, a device emits light and collects a facial image of a detected face under the light, and determines whether the detected face is a living face based on the facial image.
[0118] 2.3.1 Photoelectric plethysmography (PPG)
[0119] In this method, a volume tracing of a human organ (such as a blood vessel) can be obtained by optical means, and the volume description diagram is used to characterize the volume of the organ. The device can determine the volume change of the human organ through the volume description diagram, calculate key physiological characteristics of the human body such as the pulse signal, and judge whether the detected target is alive based on this.
[0120] In some examples, a pulse oximeter can be used to illuminate the skin and measure changes in light absorption to calculate a corresponding pulse signal.
[0121] In some examples, human physiological signals caused by pulse in the detected video can be detected, and the corresponding pulse signal can be inferred based on this.
[0122] 2.3.2 Liveness Detection Based on Laser Structured Light
[0123] In this method, the device can emit laser through a laser transmitter, and collect the reflected light of the detected face under laser irradiation through a laser receiver, and judge whether the detected face is a living face based on the reflected light of the detected face.
[0124] 2.3.3 Colorful liveness detection
[0125] In this method, the device can emit colored light through the screen. The reflection of the colored light on targets of different materials will be different. By identifying the reflection characteristics, it can be determined whether the target to be tested is a target with human skin.
[0126] For example, Figure 1 Figure 2 shows an example of the interface during colorful liveness detection. Figure 1 In (a), the mobile phone emits light of color A through the screen, forming a picture of color A on the screen. The light of color A is projected onto the user's face, and the mobile phone collects the facial image of the user's face under the illumination of the light of color A. Then, as Figure 1 In (b), the mobile phone emits light of color B through the screen, forming a picture of color B on the screen. The light of color B is projected onto the user's face, and the mobile phone collects the facial image of the user's face under the light of color B. Similarly, the mobile phone emits light of different colors through the screen, collects facial images of the user under the light of different colors, and determines whether the user is alive based on multiple facial images.
[0127] In this type of method, the attacker can launch an attack by recording the corresponding light feedback video. The device cannot distinguish the light in the video from the reflected light of a real face, resulting in the inability to detect the attacker's deceptive behavior.
[0128] To solve the above problems, the embodiments of the present application propose a target detection method and device. The method can be applied to various scenarios that require liveness detection. The scenarios include but are not limited to financial scenarios, attendance scenarios, and security verification scenarios. In the method, the device can display a dot matrix pattern on the screen, and the dot matrix light corresponding to the dot matrix pattern is projected onto the detected target, and the electronic device collects the reflected light signal of the detected target under the irradiation of the dot matrix light. Considering that the relative position relationship between different light-emitting points (such as pixel points) and the detected target in the dot matrix light source is different, after the light emitted by different light-emitting points is projected onto the detected target, the characteristics of the reflected light signal (such as the brightness of the image, the shape of the imaging area) are different, and the reflection characteristics of the signal emitted by the dot matrix light source on different materials will be different. Therefore, the device can identify whether the detected target is a live target based on the characteristics of the reflected light signal of the detected target under the irradiation of the dot matrix light source, thereby improving the accuracy of target detection.
[0129] In a possible implementation, the embodiment of the present application can be applied to a living body detection system. The system can be as follows: Figure 2AThe system includes a device 120 .
[0130] Optionally, the device 120 may be a personal computer (PC), a mobile phone, a tablet computer (Pad), a laptop computer, a desktop computer, a laptop computer, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, a wearable device, a vehicle-mounted device, and other terminal devices. The embodiment of the present application does not impose any special restrictions on the specific form of the device.
[0131] The device 120 can emit dot matrix light, collect multiple images of the detected target under the illumination of the dot matrix light, and determine whether the detected target is a living body based on the multiple images to prevent attackers from using non-living detected targets to attack.
[0132] Optional, such as Figure 2A The device 120 may include a dot matrix light source signal generating unit 1201, an image acquisition unit 1202, a dot matrix light source structure information extraction unit 1203, a dot matrix light source material information extraction unit 1204 and a dot matrix light source color sequence matching unit 1205.
[0133] The dot matrix light source signal generating unit 1201 can be used to drive the pixels of the display screen of the device 120 to emit light, thereby forming a dot matrix pattern displayed on the display screen. Figure 4 (b), the pixels of the display screen of the mobile phone emit light, forming a dot pattern 402a. The dot pattern 402a includes 7 rows and 5 columns of dots. Each dot may correspond to one or more luminous pixels.
[0134] The light-emitting pixels corresponding to the dot matrix pattern 402 a may constitute a dot matrix light source, and the light forming the dot matrix pattern 402 a may be referred to as dot matrix light.
[0135] In the embodiment of the present application, the dot matrix light can continuously illuminate the detected target (such as a face) for a period of time.
[0136] The image acquisition unit 1202 may be used to capture an image of a detected target (such as a face image) under the illumination of dot matrix light.
[0137] The dot matrix light source structure information extraction unit 1203 can be used to extract feature information related to the structure of the detected target (such as facial structure) from the image of the detected target under the illumination of the dot matrix light. The feature information can be used to determine whether the detected target is a three-dimensional target.
[0138] Optionally, the feature information related to the facial structure includes but is not limited to at least one of the following information: the position of the bright spot in the facial image, the shape of the bright spot, the size of the bright spot, and the color of the bright spot.
[0139] Considering that the reflection modes of plane targets (also called two-dimensional targets) and stereo targets (also called three-dimensional targets) to dot matrix light are different, accordingly, the imaging features of two-dimensional targets under dot matrix light illumination are different from those of three-dimensional targets under dot matrix light illumination, and different imaging features reflect different structural information. The dot matrix light source structural information extraction unit 1203 can extract feature information related to the facial structure from the facial image illuminated by the dot matrix light.
[0140] For example, Figure 5 ,The mobile phone emits dot matrix light through the screen and projects it onto the three-dimensional face. The mobile phone collects the face image under the dot matrix light, such as Figure 5 As shown in (a), the face image includes the face image and bright spots, which are formed by the dot matrix light reflected by the face. Figure 5 (b) shows a detailed example of bright spots in a face image. Based on the characteristics of the reflected light of the three-dimensional face to the dot matrix light, the face image includes irregular bright spots (in Figure 5 (b) is shown as an irregular circle), and the colors of different bright spots may be different. For example, the area corresponding to the cheekbones in the face image (the irregular circular area without a slash mark) is brighter, indicating that the intensity of the reflected light of the lattice light from the cheekbones is higher. For another example, Figure 5 In (b), the irregular circular area marked with diagonal lines has a darker color of the bright spot. It can be seen that due to the different degrees of concavity and convexity of different parts of the three-dimensional face, multiple bright spots with different brightness and darkness can be formed in the three-dimensional face image illuminated by the dot matrix light, and the shapes of the multiple bright spots may be different.
[0141] like Figure 6 , the attacker uses the face in the video for face recognition, and the dot matrix light is projected onto the face of the person being detected in the video, and the mobile phone collects the face image under the dot matrix light. Based on the characteristics of the reflected light of the two-dimensional face to the dot matrix light, the image includes bright spots with regular shapes, and the colors of different bright spots tend to be consistent.
[0142] In the embodiments of the present application, a regularly shaped figure may refer to a figure with a regular shape, such as a centrally symmetrical figure or an axially symmetrical figure.
[0143] Exemplarily, triangles, rectangles, circles, ellipses, etc. can be used as the regularly shaped figures or patterns.
[0144] Irregular shape can refer to figures with irregular shapes, for example, figures obtained by distorting various regular figures.
[0145] In the embodiments of the present application, there is no limitation on the division method of regular graphics and irregular graphics.
[0146] Figure 6 The facial image of the embodiment of the present application only shows the bright spots, and does not show the information of the facial contour (i.e., the information of the facial contour is omitted). It should be understood that the facial image should also include relevant information such as the facial contour. Similarly, the facial image of the embodiment of the present application only shows the bright spots, and can also include information such as Figure 5 The image of the face shown in (a) is not limited to only bright spots.
[0147] It can be seen that, since the imaging characteristics of two-dimensional targets and three-dimensional targets under the illumination of dot matrix light are different, the imaging characteristics of the detected target under the illumination of dot matrix light (including but not limited to the shape of the bright spot) can be used to characterize the structure of the target (such as depth of field). Subsequently, the device 120 can determine whether the detected target is a three-dimensional target based on these characteristic information characterizing the target structure, and determine whether the detected target is a living body based on this. For example, whether the detected target is a three-dimensional target is determined based on whether the shape of the bright spot is regular and the position of the bright spot.
[0148] As a possible implementation manner, the dot matrix light source structure information extraction unit 1203 constructs a first pattern recognition model, and uses the first pattern recognition model to extract feature information related to the face structure from the face image.
[0149] The dot matrix light source material information extraction unit 1204 can be used to extract feature information related to the face material from the image of the face illuminated by the dot matrix light.
[0150] Optionally, the feature information related to the facial material includes but is not limited to the color of the bright spots in the facial image.
[0151] Considering that the same dot matrix light can obtain different reflection patterns when irradiating targets of different materials. Different dot matrix lights (such as dot matrix lights of different colors) irradiating the same material can also have different reflection patterns. Accordingly, targets of different materials have different imaging features under the irradiation of dot matrix light. The dot matrix light source material information extraction unit 1204 can extract feature information related to the material of the face from the image of the face irradiated by the dot matrix light.
[0152] As a possible implementation, the dot matrix light source material information extraction unit 1204 constructs a second pattern recognition model according to the color of the dot matrix light and the shape of the screen pattern corresponding to the dot matrix light, and uses the second pattern recognition model to extract feature information related to the face material. For example, for the dot matrix light whose color is color 1 and whose screen pattern is pattern 1, the dot matrix light source material information extraction unit 1204 uses pattern recognition model 1 to extract feature information. For the dot matrix light whose color is color 1 and whose screen pattern is pattern 2, the dot matrix light source material information extraction unit 1204 uses pattern recognition model 2 to extract feature information.
[0153] Alternatively, the dot matrix light source material information extraction unit 1204 uses the same pattern recognition model to extract feature information.
[0154] The dot matrix light source color sequence matching unit 1205 is used to determine whether the detected face is a living face based on the face features extracted by the dot matrix light source material information extraction unit 1204 and the face features extracted by the dot matrix light source structure information extraction unit 1203.
[0155] As a possible implementation, the dot matrix light source color sequence matching unit 1205 determines whether these facial features are consistent with the physiological characteristics of a real face based on the facial feature information extracted from the face image. If they are consistent with the physiological characteristics of a real face, it is determined that the detected face is a live face; if they are not consistent with the physiological characteristics of a real face, it is determined that the detected face is not a live face.
[0156] As a possible implementation, the dot matrix light source color sequence matching unit 1205 can also perform consistency comparison on the reflected light sequence of the detected face under the illumination of the dot matrix light. The consistency comparison includes but is not limited to: the color of the reflected light, the spatial relationship between the light points of the reflected light, and the time interval of the change of the reflected light sequence.
[0157] For example, the device uses red, green, and blue dot matrix lights to illuminate the detected face in turn, and the received reflected light should be red, green, and blue light in turn.
[0158] For example, the exposure time of red, green, and blue dot matrix lights is 2s, 3s, and 2s respectively. Correspondingly, the reflected light has corresponding reflection characteristics, such as different durations of red, green, and blue reflected light. In this way, attackers can be prevented from attacking by recording corresponding light feedback videos. In other words, the color of the reflected light in the light video recorded by the attacker may meet the requirements, but because the duration of the reflected light does not match the exposure time of the dot matrix light, the attack purpose cannot be achieved.
[0159] For another example, if the light spots of the dot matrix light satisfy a certain spatial relationship (such as a dot matrix with equal spacing), the reflected light has a corresponding matching reflection feature. When the reflected light of the detected face does not have the matching reflection feature of the dot matrix light, it is determined that the detected face is not a live face.
[0160] Optionally, the system may further include a device 110. The device 110 may be used to train the above one or more models. Optionally, the device 110 may be any device with computing capabilities. Exemplarily, the device 110 is a server.
[0161] In other embodiments, the above one or more models may also be obtained by training by the device 120 .
[0162] Alternatively, in other embodiments, the one or more models described above may be jointly trained by device 110 and device 120 .
[0163] Figure 2B The hardware structure diagram of the device provided in the embodiment of the present application is shown. The device may be the device 110 and / or the device 120 described above. The device includes at least one processor 201, a memory 203 and at least one communication interface 204. The memory 203 may also be included in the processor 201.
[0164] The processor 201 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0165] A communication link may include a pathway for transmitting information between the above-mentioned components.
[0166] The communication interface 204 is used to communicate with other devices. In the embodiment of the present application, the communication interface can be a module, a circuit, a bus, an interface, a transceiver or other device capable of realizing a communication function, and is used to communicate with other devices. Optionally, when the communication interface is a transceiver, the transceiver can be an independently arranged transmitter, which can be used to send information to other devices, and the transceiver can also be an independently arranged receiver, which is used to receive information from other devices. The transceiver can also be a component that integrates the functions of sending and receiving information, and the embodiment of the present application does not limit the specific implementation of the transceiver.
[0167] The memory 203 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile memory may be a read-only memory (ROM), a programmable ROM (PROM), an erasable programmable ROM (EPROM), an electrically erasable programmable ROM (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM) and direct rambus RAM (DR RAM) or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but not limited to this. The memory can be independent and connected to the processor 201 through a communication line. The memory 203 can also be integrated with the processor 201.
[0168] The memory 203 is used to store computer-executable instructions for implementing the solution of the present application, and the execution is controlled by the processor 201. The processor 201 is used to execute the computer-executable instructions stored in the memory 203, thereby implementing the method provided in the following embodiments of the present application.
[0169] Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application code, instructions, computer program or other names, which are not specifically limited in the embodiments of the present application.
[0170] In a specific implementation, as an embodiment, the processor 201 may include one or more CPUs, such as Figure 2B CPU0 and CPU1 in.
[0171] In a specific implementation, as an embodiment, the device may include multiple processors, such as Figure 2B 201 and processor 205 in the embodiment of the present invention. Each of these processors may be a single-CPU processor or a multi-CPU processor. The processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0172] Optional, such as Figure 2B The device may further include a display screen 202, which is used to display images, videos, etc. In the embodiment of the present application, the display screen 202 may be used to display an array pattern. The array pattern is a pattern formed on the display screen 202 by the array light emitted by the light source.
[0173] Optional, such as Figure 2B The device may further include an image acquisition device 206. The image acquisition device 206 may be used to acquire a target image of the detected target under the illumination of the array light, and the device may determine whether the detected target is a living target based on the target image.
[0174] The above-mentioned device can be a general device or a special device, and the embodiment of the present application does not limit the type of device.
[0175] It is understood that any structure illustrated in the embodiments of the present application does not constitute a specific limitation on the device 120. In other embodiments of the present application, the device 120 may include more or fewer components than those illustrated in any structure, or combine some components, or split some components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0176] In the embodiment of the present application, the device 120 is described as a mobile phone, but this does not constitute a limitation on the form, function, etc. of the device. Figure 3 , is a schematic diagram of the structure of a mobile phone provided in an embodiment of the present application. The methods in the following embodiments can be implemented in a mobile phone having the above hardware structure.
[0177] like Figure 3As shown, the mobile phone may include a processor 111, an external memory interface 122, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a camera 193, and a display screen 194. Optionally, the mobile phone may also include a mobile communication module 150, etc.
[0178] The processor 111 may include one or more processing units, for example, the processor 111 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0179] The controller can be the nerve center and command center of the mobile phone. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.
[0180] The processor 111 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 111 is a cache memory. The memory may store instructions or data that the processor 111 has just used or cyclically used. If the processor 111 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 111, and thus improves the efficiency of the system.
[0181] In some embodiments, the processor 111 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a USB interface, etc.
[0182] The charging management module 140 is used to receive charging input from the charger. While the charging management module 140 is charging the battery 142, it can also power the mobile phone through the power management module 141. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 111. The power management module 141 can also receive input from the battery 142 to power the mobile phone.
[0183] The wireless communication function of the mobile phone can be realized through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor.
[0184] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.
[0185] When the mobile phone includes a mobile communication module 150, the mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the mobile phone. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 111. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 111.
[0186] The modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to a speaker 170A, a receiver 170B, etc.), or displays an image or video through a display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 111 and be set in the same device as the mobile communication module 150 or other functional modules.
[0187] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as Wi-Fi networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), NFC, infrared technology (IR), etc., which are applied to mobile phones. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and filters it, and sends the processed signal to the processor 111. The wireless communication module 160 can also receive the signal to be sent from the processor 111, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0188] In some embodiments, the antenna 1 of the mobile phone is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the mobile phone can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).
[0189] In the embodiment of the present application, the sensor module 180 may include a red, green, blue (RGB) sensor. The RGB sensor can be used to capture RGB light signals, convert the RGB light signals into electrical signals, and output corresponding color images. For example, the mobile phone emits red dot matrix light through the pixels of the screen, and the dot matrix light is projected onto the detected target. The mobile phone can capture the reflected light of the detected target to the dot matrix light through the RGB sensor, convert the reflected light into electrical signals, and output the corresponding image.
[0190] The mobile phone realizes the display function through GPU, display screen 194, and application processor, etc. GPU is a microprocessor for image processing, connecting display screen 194 and application processor. Processor 111 may include one or more GPUs, which execute program instructions to generate or change display information.
[0191] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-OLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the mobile phone may include 1 or N display screens 194, where N is a positive integer greater than 1. In some embodiments of the present application, the mobile phone can drive the pixels of the display screen 194 to emit light and control the brightness and color of the display screen to display images.
[0192] In the embodiment of the present application, a plurality of pixel points of the display screen 194 may constitute a dot matrix light source. The dot matrix light emitted by the dot matrix light source forms a dot matrix pattern (also referred to as an array pattern) on the display screen 194. The dot matrix pattern may include a plurality of sub-patterns. Each sub-pattern may serve as a point in the dot matrix, so that a plurality of sub-patterns form a dot matrix pattern. For example, Figure 4 In (b), the mobile phone displays a dot pattern 402a on the display screen, and the dot pattern 402a includes a plurality of circular sub-patterns.
[0193] After the dot matrix light emitted by the dot matrix light source is projected onto the target to be detected, the mobile phone can collect the image of the target to be detected under the illumination of the dot matrix light source through the RGB sensor.
[0194] Here, pixel points are used as an example of light source for explanation. In other embodiments, the light source emitting dot matrix light can also be other devices. The embodiments of the present application do not limit the type and specific implementation method of the light source.
[0195] The mobile phone can realize the shooting function through the ISP, the camera 193, the video codec, the GPU, the display screen 194 and the application processor, etc. In some embodiments, the mobile phone can include 1 or N cameras 193, where N is a positive integer greater than 1.
[0196] Optionally, the camera 193 may include an RGB camera, which may also be referred to as a color camera.
[0197] In other embodiments of the present application, the mobile phone can capture the image of the detected target under the illumination of the dot matrix light through the camera 193.
[0198] The external memory interface 122 can be used to connect an external memory card to expand the storage capacity of the mobile phone. The external memory card communicates with the processor 111 through the external memory interface 122 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.
[0199] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 111 executes various functional applications and data processing of the mobile phone by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0200] The mobile phone can realize audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.
[0201] The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be arranged in the processor 111, or some functional modules of the audio module 170 can be arranged in the processor 111.
[0202] The speaker 170A, also called a "speaker", is used to convert an audio electrical signal into a sound signal. The terminal 100 can listen to music or listen to a hands-free call through the speaker 170A.
[0203] The receiver 170B, also called a "handset", is used to convert audio electrical signals into sound signals. When the terminal 100 receives a call or voice message, the voice can be received by placing the receiver 170B close to the ear.
[0204] Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. When making a call or sending a voice message, the user can make a sound by putting his mouth close to microphone 170C to input the sound signal into microphone 170C. Terminal 100 may be provided with at least one microphone 170C. In other embodiments, terminal 100 may be provided with two microphones 170C, which can not only collect sound signals but also realize noise reduction function. In other embodiments, terminal 100 may also be provided with three, four or more microphones 170C to realize collection of sound signals, noise reduction, identification of sound source, realization of directional recording function, etc.
[0205] As follows, we take the example of a mobile phone performing liveness detection through face recognition in a payment scenario.
[0206] like Figure 4 (a), the mobile phone may display a payment interface 401. The payment interface 401 may include a payment confirmation button 401a. When the user clicks the payment confirmation button 401a, the mobile phone may display the following Figure 4 Interface 402 is shown in (b). Interface 402 includes a dot pattern 402a. The dot pattern 402a includes dots in 7 rows and 5 columns. Optionally, the dots in the dot pattern 402a have the same color. The multiple luminous pixel points corresponding to the dot pattern 402a constitute a dot light source. The light emitted by the dot light source can be projected onto the face of the person being detected, and the mobile phone can collect the face image under the illumination of the dot light source through the RGB sensor.
[0207] Figure 5 The figure shows a face image captured by an RGB sensor under the illumination of a dot matrix light source. Among them, due to the different relative positional relationships (such as distance and direction) between different pixels in the dot matrix light source and the face, different reflectivity and absorption rates of light in different parts of the face, and different degrees of concavity and convexity in different parts of the face, the characteristics of the reflected light (such as direction and color) reflected by different parts of the face from the dot matrix light source are different. Accordingly, the characteristics of the imaging (or bright spot) corresponding to the reflected light in the face image may be different. In some cases, the characteristics of the reflected light from different pixels in the same part of the face are different, and accordingly, the characteristics of the imaging corresponding to the reflected light in the face image may be different.
[0208] for example Figure 5 In the figure, dots represent the corresponding imaging of reflected light from some parts of the face in the face image. It can be seen that the imaging characteristics of reflected light from different parts of the face are different. The imaging area of reflected light from some parts is larger, the imaging area of reflected light from some parts is not a regular circle, and the imaging area of reflected light from some parts is brighter.
[0209] Optionally, the interface 402 may further include a detection frame 402b. The mobile phone may display the face image collected by the RGB sensor in the detection frame 402b.
[0210] Optionally, the mobile phone can also prompt the user in the detection box 402b that "liveness detection is in progress". Optionally, the mobile phone can also use voice to prompt the user "liveness detection is in progress, please do not leave". In this way, the user can be prompted that liveness detection is in progress through different prompting methods, so that the user performs liveness detection according to the prompt.
[0211] The phone displays Figure 4 After the duration of the interface 402 shown in (b) reaches a certain length of time, the mobile phone may display the following Figure 4 Interface 403 shown in (c) includes dot pattern 403a. Optionally, the colors of the dots in dot pattern 403a are consistent. The colors of the dots in dot pattern 403a are different from the colors of the dots in dot pattern 402a. The light emitted by the dot matrix light source corresponding to dot matrix pattern 403a can be projected onto the face of the person, and the mobile phone can collect the face image under the illumination of the dot matrix light source through the RGB sensor.
[0212] Similarly, the phone displays Figure 4 When the duration of the dot pattern 403a shown in (c) reaches a certain duration, other dot patterns can be displayed on the screen, and facial images illuminated by the dot light source corresponding to the dot pattern can be collected. In this way, the mobile phone can display different dot patterns in sequence and collect multiple facial images illuminated by the corresponding dot light source. Afterwards, the mobile phone can determine whether the detected face is a live face based on the multiple facial images illuminated by the dot light source.
[0213] In some examples, if the detected face is a live face and the detected face is the face of a legitimate user, the phone can jump to a function such as Figure 4 The payment interface 601 shown in (d) is used to complete the payment. In this method, since the mobile phone performs liveness detection and identity detection on the detected face, it can ensure that the user who pays this time is a real and legal user, thereby improving the security of the payment process.
[0214] Optionally, the display durations of different dot matrix patterns may be the same or different.
[0215] In this method, considering the different relative positional relationships between different light-emitting points (such as pixels) in the dot matrix light source and the detected face, after the light emitted by different light-emitting points is projected onto the detected face, the characteristics of the reflected light signal (such as the brightness of the image and the shape of the imaging area) are different. Therefore, the mobile phone can extract the structural information of the detected face based on the characteristics of the reflected light signal of the detected face under the illumination of the dot matrix light source, and determine whether the detected face is a flat face or a three-dimensional face based on the structural information of the detected face. In this way, it is possible to prevent attackers from using flat faces (such as photographs) to perform face recognition attacks.
[0216] Furthermore, considering that the reflection of the RGB light signal emitted by the dot matrix light source on different materials will be different, the mobile phone can identify whether the detected face is a face with human skin based on the characteristics of the reflected light signal of the detected face under the illumination of the dot matrix light source. When the detected face is a three-dimensional face with human skin, the mobile phone determines that the detected face is a live face.
[0217] It can be seen that the method of the embodiment of the present application, by actively emitting dot matrix light to illuminate the detected face through a dot matrix light source, and processing and analyzing the reflected light signal of the detected face, can not only extract rich structural information of the detected face, which is helpful to reconstruct the spatial structure of the detected face, but also extract material information of the detected face. Furthermore, based on the structural information and material information of the detected face, it can accurately identify whether the detected face is a live face, thereby effectively improving the defense capability against non-live attacks during the liveness detection process.
[0218] In the above, the sub-patterns in the dot pattern are all circles. In the embodiments of the present application, there are no restrictions on the shape, color, size, shape, size, color, positional relationship between the sub-patterns in the dot pattern, and other features. As long as the dot light formed by the dot pattern can illuminate the detected target, liveness detection can be performed. Figure 7 As shown in (b), the dot pattern 402a includes 7 rows and 5 columns of circles. The colors of the circles in the top 4 rows are the same (for example, color 1), the colors of the circles in the bottom 3 rows are the same (for example, color 2), and the colors of the circles in the top 4 rows are different from those in the bottom 3 rows. Figure 7 (c), the dot pattern 403a includes 7 rows and 5 columns of circles. The colors of the circles in the upper 4 rows are the same (for example, color 2), the colors of the circles in the lower 3 rows are the same (for example, color 1), and the colors of the circles in the upper 4 rows are different from those in the lower 3 rows.
[0219] In some examples, if the detected face is a live face and the detected face is the face of a legitimate user, the phone can jump to a function such as Figure 4 The payment is completed by clicking on the payment interface 601 shown in (d).
[0220] Take the example of mobile phone liveness detection through face recognition. Figure 8 FIG. 2 shows an exemplary process of the target detection method of an embodiment of the present application. Figure 8 , the method may include the following steps:
[0221] S101. The mobile phone emits dot matrix light through the display screen.
[0222] In some embodiments, the mobile phone can emit dot matrix light through a light emitting element. Optionally, the light emitting element includes but is not limited to a display screen. By emitting light in this way, there is no need to modulate the light through hardware such as a modulator, which can reduce hardware costs.
[0223] Alternatively, the mobile phone can drive the display screen to emit dot matrix light in other ways, and the embodiments of the present application do not limit the specific implementation of emitting dot matrix light.
[0224] For example, Figure 4 (a), the user clicks the confirm payment button 401a. To ensure payment security, the mobile phone can start the liveness detection process and determine whether the current paying user is a legitimate user through the liveness detection process. As a possible implementation method, the mobile phone starts the liveness detection process and drives the pixels of the display screen to emit dot matrix light, thereby displaying the following on the display screen: Figure 4 The dot pattern 402a shown in (b).
[0225] Optionally, the color of the dot light changes over time. For example, Figure 4 In (b), the color of the dots in the dot pattern 402a formed by the dot light is Figure 4 The colors of the dots in the dot pattern 403a of (c) are different.
[0226] Optionally, the number of point light sources included in the dot matrix light source is greater than one.
[0227] Optionally, multiple sub-patterns in the same dot matrix pattern may be the same or different. Figure 4 In the example, the sub-patterns in the dot matrix pattern are all circles of the same size, but this does not constitute a limitation on the shape and size of each sub-pattern.
[0228] When the sub-pattern is a circle, since the circle has characteristics such as rotation invariance, by displaying a circular array pattern to send dot matrix light, the collected face image can be easier to process and the computational complexity of liveness detection based on the face image can be reduced.
[0229] Optionally, the sub-patterns in the dot matrix pattern displayed at different times may be the same or different. For example, the sub-patterns in the dot matrix pattern displayed at a certain time are all circles of the same size and red color (larger size). The sub-patterns in the dot matrix pattern displayed at the next time are all circles of smaller size, the same size, and green color.
[0230] Optionally, the multiple sub-patterns in the dot matrix pattern are arranged at equal intervals in the horizontal and vertical directions of the display screen.
[0231] By displaying a regular, equally spaced dot pattern to send dot light, the collected face images can be made easier to process and the computational complexity of liveness detection based on face images can be reduced.
[0232] As a possible implementation, Figure 7 (a), it is detected that the user clicks the payment confirmation button 401a, and the mobile phone emits dot matrix light through the display screen, forming the following on the display screen Figure 7 In addition, the mobile phone displays a detection frame 402c, which includes a face image captured by the mobile phone under the illumination of the dot matrix light.
[0233] In some examples, the mobile phone may display prompt information in the detection frame 402c. Optionally, the prompt information includes but is not limited to at least one of the following information: prompting the user to look at the screen, prompting the user to adjust the head posture, and prompting the user to show the front face (to avoid the influence of occlusion on face recognition). Adjusting the head posture includes adjusting the angle of the head relative to the mobile phone.
[0234] The user can make adjustments according to the above prompt information to ensure that the illumination intensity, face ratio, face orientation, occlusion and other conditions of the face image under the dot matrix light meet the conditions of the liveness detection process.
[0235] The facial image after adjusting the head posture satisfies at least one of the following conditions: the light intensity corresponding to the facial image is within a preset light intensity range, the proportion of the face in the facial image is within a preset proportion range, the orientation of the face in the facial image is within a preset orientation range, the occlusion of the face in the facial image is within a preset occlusion range, and the angle of the face in the facial image is within a preset angle range.
[0236] As another possible implementation, Fig.10 , when it is detected that the user clicks the payment confirmation button 401a, the mobile phone can collect the face image and display prompt information based on the collected face image to guide the user to make corresponding adjustments (such as adjusting the head posture) so that the face image collected by the mobile phone meets the conditions for liveness detection (such as the angle of the head relative to the mobile phone meets a certain angle range). Fig. 9After determining that the face image captured by the mobile phone (the face image under natural light) meets the conditions for liveness detection, the mobile phone emits dot matrix light and collects the face image under the dot matrix light.
[0237] For example, Fig.10 (a), it is detected that the user clicks the payment confirmation button 401a, and the mobile phone first displays the following Fig.10 The detection frame 402c shown in (b) is shown, and a prompt message (such as "Please adjust the face to the center of the detection frame") is displayed in the detection frame 402c. Fig.10 (c), when the user adjusts the posture, if the face image captured by the mobile phone under natural light meets the conditions for liveness detection, such as the face proportion and size in the face image are appropriate, the mobile phone emits dot matrix light through the display screen to form a dot matrix pattern 402a on the display screen.
[0238] In this method, before emitting dot matrix light, the mobile phone can prompt the user to adjust the posture so that the collected face image meets the requirements of liveness detection. In this way, it can ensure as much as possible that the face image illuminated by the dot matrix light can include more information required for liveness detection, thereby improving the accuracy of liveness detection.
[0239] S102, the mobile phone collects a face image under the illumination of dot matrix light.
[0240] As a possible implementation method, the mobile phone emits dot matrix light through the display screen and calls the front color camera to collect the face image under the dot matrix light.
[0241] As another possible implementation method, the mobile phone emits dot matrix light through the display screen and calls the RGB sensor to collect the face image under the dot matrix light. This implementation method can also realize the collection of face images and perform liveness detection for some devices without cameras.
[0242] Optionally, the mobile phone writes the collected facial image data into a storage space, and the mobile phone can save the facial image data for a period of time.
[0243] S103. The mobile phone determines whether the detected face is a live face based on the face image illuminated by the dot matrix light.
[0244] As a possible implementation, Fig.11 The mobile phone can extract multiple facial feature information from the face image illuminated by the dot matrix light, and input the multiple facial feature information into the classifier, and the classifier outputs the face detection result, such as outputting information about whether the detected face is a living face.
[0245] Optionally, the facial feature information (or facial feature information) includes but is not limited to at least one of the following information: the shape of the bright spot in the face image, the size of the bright spot, the position of the bright spot, the color of the bright spot, and the brightness of the bright spot. Some information in the facial features can be used to calculate the structure of the detected face, and some information can be used to calculate the material of the detected face. For example, due to the three-dimensional contour characteristics of a three-dimensional face, the shape of the bright spot in the three-dimensional face image under the illumination of dot matrix light may be irregular, and the mobile phone can judge whether the detected face is a three-dimensional face based on this. For another example, since the skin of a real face is different from the characteristics of the reflective surface of other targets, the color of the bright spot in the image of a real face under the illumination of dot matrix light has the characteristics corresponding to the real face and conforms to the physiological characteristics of the real face. The mobile phone can judge whether the detected face is a face with real skin based on this to prevent head model attacks.
[0246] The following is an introduction to the training process of the classifier involved in the embodiment of the present application. Fig.12 As shown, training a classifier for identifying live faces requires N (N is a positive integer) samples, which include feature information of a three-dimensional face image under dot-matrix light illumination and feature information of a two-dimensional face image under dot-matrix light illumination. Optionally, the sample may also include a label of the face image. The label corresponding to the face image is used to characterize whether the face in the face image is a live face. A classifier is obtained by training multiple samples.
[0247] Optionally, before training the classifier, data such as feature information may be processed, such as by smoothing or normalizing.
[0248] Optionally, in order to improve the recognition accuracy of the classifier, the classifier can be evaluated and tested. When the recognition rate of the classifier reaches a certain threshold, it means that the classifier has been trained. When the recognition rate of the classifier is low, the classifier can be trained until the recognition accuracy of the classifier reaches a certain threshold.
[0249] Optionally, the training process of the classifier can be performed on the terminal side (such as a mobile phone or other terminal) or the cloud side (such as a server). The training can be offline training or online training. Subsequently, the trained classifier can output whether the detected face in the corresponding face image is a live face based on the feature information of the input face image.
[0250] Optionally, the classifier can be a multi-layer fully connected layer model.
[0251] Optionally, a deep learning operator is used to construct a feature extractor. Alternatively, the method for training a feature extractor can refer to the method for training a classifier.
[0252] Optionally, a feature extractor is trained using methods such as back propagation and gradient descent. Optionally, a classifier is trained using methods such as back propagation and gradient descent. The present application embodiment does not limit the training method of the feature extractor and the classifier.
[0253] Considering that the detected face may not be facing the mobile phone, the center point of the light spot in the collected face image may be stretched or squeezed. In order to improve the detection accuracy, the embodiment of the present application processes the face image to reduce the influence of the light spot stretching and squeezing on the liveness detection. As a possible implementation method, the mobile phone can perform an affine transformation on the face image and calibrate the position of the center point of the light spot in the face image after the affine transformation.
[0254] like Fig.13A , the mobile phone collects the face image A under the dot matrix light, and detects the center point position of each bright spot in the face image. After that, the mobile phone performs affine transformation on the face image to obtain the face image B after affine transformation.
[0255] Afterwards, if Fig. 13B , the mobile phone calibrates and adjusts the positions of the center points of the light spots in the face image after affine transformation, so that the center points of the light spots are arranged at equal intervals in the horizontal and vertical directions. Fig. 13B In the horizontal direction, the spacing between the center points of the light spots is a, and in the vertical direction, the spacing between the center points of the light spots is b.
[0256] Optionally, pixels in the area around the center of the spot are displaced in the same way. For example, during the calibration of the center position, Fig. 13B The center point A of the light spot with coordinates (x1, y1) is displaced to (x2, y2), and the points in the surrounding area of the center point A are also displaced by the same distance. In this way, by calibrating the positions of the center points of each light spot in the face image, it is possible to avoid deviation of the center point of the light spot, thereby preventing the accuracy of liveness detection from being affected by the center point offset of the light spot.
[0257] In this method, the facial image is processed through affine transformation and position calibration of the center point of the light spot, which can reduce the deviation of the center point of the light spot and the influence of factors such as the face not facing the mobile phone, thereby improving the accuracy of subsequent feature extraction of the facial image.
[0258] Fig. 13B The figure shows the process of affine transformation of a 3D face and calibration of the center point of the light spot. It can be seen that based on the reflection or scattering characteristics of the 3D face to the dotted light, the affine transformation and calibration of the center point of the light spot will result in a distorted face image. Among them, the shape of the bright spot in the face image is mostly irregular. For another example, after the calibration of the center point of the light spot, the edge of the face image will be smoothed, such as Fig. 13B, the regular area 1501 is transformed into the irregular area 1502 after the spot center point position calibration processing.
[0259] For example, Fig.14 The affine transformation process of a two-dimensional face (such as a face in a video or picture) under the illumination of dot matrix light is shown. It can be seen that based on the reflection or scattering characteristics of the two-dimensional face to the dot matrix light, the affine transformation will obtain a face image with low distortion or no distortion. Among them, the shape of the bright spots in the face image is mostly regular graphics.
[0260] In the present application embodiment, Fig.15 , the mobile phone can transform the face image after affine transformation (such as Fig. 13B The face image B) is down-sampled to obtain a face image matrix A (for example, a 4N*4M*3 matrix), and the face image matrix can be used to represent the face image after affine transformation.
[0261] Optionally, the mobile phone can also calibrate the face image after the center point of the light spot is calibrated (for example Fig. 13B The face image C) is sampled to obtain the face image matrix B.
[0262] Optionally, the sampling may be upsampled or downsampled. For example, the position information of multiple center points forms a 10*10 matrix, which is downsampled to obtain a 4*4 matrix B.
[0263] Optionally, the mobile phone can also use the affine transformed face image (such as Fig. 13B The face image B) is obtained, the distance between the center points of each spot in the face image is calculated, and the obtained multiple distance information is sampled to obtain a center point distance matrix. For example, multiple distance information constitutes a 2*2 matrix, and after upsampling, the sampling points are increased to obtain a 4*4 center point distance matrix. The elements in the matrix are the distances between the corresponding center points.
[0264] For example, if the number of the center points of the light spot is 3*3, a 2*2 center point spacing matrix can be obtained.
[0265] Optionally, the mobile phone can also calculate the color values of multiple pixels in the face image based on the face image after affine transformation, and sample the multiple color values to obtain a color matrix. Optionally, the multiple pixels include pixels where bright spots are located. For example, the color value information of multiple pixels constitutes a 3*3 matrix, and a 4*4 color value matrix is obtained after upsampling. The elements in the matrix are the color values of the corresponding pixels. Optionally, the mobile phone can calculate one or more other parameters related to the color based on the color value, such as the brightness value, and use these parameters as elements of matrix A, and use matrix A to replace the color matrix.
[0266] Due to the different degrees of concavity and reflectivity of different parts of a 3D face, the brightness of the bright spots formed in the face image after the 3D face reflects the dot matrix light is different from the brightness of the bright spots formed by the 2D face reflecting the dot matrix light. The mobile phone can determine whether the detected face is a 3D face based on the brightness value of the bright spots in the collected face image.
[0267] After obtaining the matrix A corresponding to the face image after affine transformation, the matrix B corresponding to the face image after the spot center point position calibration, the center point spacing matrix, and the brightness value matrix, the mobile phone can concatenate (or aggregate concat) the matrix A, the matrix B, the center point spacing matrix, and the brightness value matrix. The aggregated matrix is called the feature matrix. Among them, the matrix A, the matrix B, the center point spacing matrix, and the brightness value matrix are aligned, or it can be understood that the number of rows and columns of the matrix A, the matrix B, the center point spacing matrix, and the brightness value matrix are the same.
[0268] After that, the mobile phone can input the feature matrix corresponding to the face image into the feature extractor, which extracts the face feature information and inputs the extracted face feature information into the classifier. The classifier performs pattern recognition based on the input to determine whether the detected face is a living face. The classifier can identify the structure and material of the detected face based on the feature matrix containing rich and refined face feature information. Fig.16 , the mobile phone can determine whether the detected face is a living face based on the structure and material of the detected face.
[0269] For example, if the face image is Figure 5 As shown in (b), if the shape of the bright spot is irregular, the classifier can determine that the detected face is a three-dimensional face and the detected face is a face with real facial skin based on the feature matrix extracted from the face image, and then determine that the detected face is a live face. On the contrary, if the classifier determines that the detected face is not a three-dimensional face or a face with real facial skin based on the feature matrix, the classifier can output a recognition result of a non-live face.
[0270] Of course, the mobile phone can also calculate other feature matrices and input the feature matrices into the subsequent feature extractor. Optionally, the facial feature information can also include the position of facial key points in the face image and the color of facial key points. Correspondingly, the feature matrix can also include a key point position matrix. The key points in the face image can include points corresponding to the facial features (eyes, nose, mouth, etc.). Because the position of the facial features of a three-dimensional face in the face and the distance between the facial features are different from the position of the facial features of a two-dimensional face and the distance between the facial features. The mobile phone can determine whether the detected face is a three-dimensional face based on the position of the key points in the collected face image.
[0271] In the above, a dot matrix pattern including M rows and N columns of sub-patterns is taken as an example. In other embodiments, the dot matrix pattern may also be a pattern formed by arranging multiple sub-patterns in other forms. The embodiments of the present application do not limit this. As long as the pattern displayed on the screen can capture a facial image for liveness detection, the pattern can be used as the dot matrix pattern in this article.
[0272] The above one or more interfaces are exemplary, and there may be other interface design methods. This application does not limit the specific design method of the interface. For the introduction of some interfaces in the drawings, please refer to the relevant descriptions in similar drawings. For example, Figure 7 (a) Figure 7 For an introduction to (d), see Figure 4 Related description.
[0273] The technical solution of the embodiment of the present application is not only applicable to faces, but also can recognize other three-dimensional targets.
[0274] It should be noted that the above-mentioned multiple embodiments can be combined and the combined scheme can be implemented. Optionally, some operations in the process of each method embodiment are optionally combined, and / or the order of some operations is optionally changed. In addition, the execution order between the steps of each process is only exemplary and does not constitute a limitation on the execution order between the steps. There can also be other execution orders between the steps. It is not intended to indicate that the execution order is the only order in which these operations can be performed. A person of ordinary skill in the art will think of a variety of ways to reorder the operations described herein. In addition, it should be noted that the process details involved in a certain embodiment of this article are also applicable to other embodiments in a similar manner, or different embodiments can be used in combination.
[0275] In addition, some steps in the method embodiment may be equivalently replaced by other possible steps. Alternatively, some steps in the method embodiment may be optional and may be deleted in certain usage scenarios. Alternatively, other possible steps may be added to the method embodiment.
[0276] Furthermore, the above method embodiments may be implemented separately or in combination.
[0277] Some other embodiments of the present application provide a device, which may be the first device described above. The device may include: a display screen, a memory, and one or more processors. The display screen, the memory, and the processor are coupled. The memory is used to store computer program code, and the computer program code includes computer instructions. When the processor executes the computer instructions, the device may perform various functions or steps in the above method embodiments. The structure of the device may refer to Fig.17 The electronic device (device) shown.
[0278] The core structure of the device can be expressed as Fig.17 As shown in the structure, the device includes: a processing module 1301, an input module 1302, a storage module 1303 and a display module 1304.
[0279] The processing module 1301 may include at least one of a central processing unit (CPU), an application processor (AP) or a communication processor (CP). The processing module 1301 may perform operations or data processing related to the control and / or communication of at least one of the other elements of the user electronic device. Specifically, the processing module 1301 may be used to control the content displayed on the main screen according to certain trigger conditions. The processing module 1301 is also used to process the input instructions or data and determine the display style according to the processed data.
[0280] The input module 1302 is used to obtain the instructions or data input by the user and transmit the obtained instructions or data to other modules of the electronic device. Specifically, the input mode of the input module 1302 may include touch, gesture, approaching the screen, etc., or voice input. For example, the input module may be the screen of the electronic device, obtain the user's input operation and generate an input signal according to the obtained input operation, and transmit the input signal to the processing module 1301.
[0281] The storage module 1303 may include a volatile memory and / or a non-volatile memory. The storage module is used to store at least one instruction or data related to other modules of the user equipment device.
[0282] The display module 1304 may include, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a micro-electromechanical system (MEMS) display, or an electronic paper display, and is used to display content (e.g., text, images, videos, icons, symbols, etc.) that can be viewed by a user.
[0283] Optionally, a communication module 1305 is also included to support personal devices (via a communication network) to communicate with other personal devices. For example, the communication module can be connected to a network via wireless communication or wired communication to communicate with other personal devices or network servers. Wireless communication can use at least one of cellular communication protocols, such as long-term evolution (LTE), advanced long-term evolution (LTE-A), code division multiple access (CDMA), wideband code division multiple access (WCDMA), universal mobile telecommunications system (UMTS), wireless broadband (WiBro) or global mobile communication system (GSM). Wireless communication may include, for example, short-range communication. Short-range communication may include at least one of wireless fidelity (Wi-Fi), Bluetooth, near field communication (NFC), magnetic stripe transmission (MST) or GNSS.
[0284] It should be noted that each functional module of the device can execute one or more steps in the above method embodiment.
[0285] The present application also provides a chip system, such as Fig.18 As shown, the chip system includes at least one processor 1401 and at least one interface circuit 1402. The processor 1401 and the interface circuit 1402 can be interconnected via lines. For example, the interface circuit 1402 can be used to receive signals from other devices (such as a memory of an electronic device). For another example, the interface circuit 1402 can be used to send signals to other devices (such as processor 1401). Exemplarily, the interface circuit 1402 can read instructions stored in the memory and send the instructions to the processor 1401. When the instruction is executed by the processor 1401, the electronic device can execute the various steps in the above embodiments. Of course, the chip system can also include other discrete devices, which are not specifically limited in the embodiments of the present application.
[0286] An embodiment of the present application also provides a computer-readable storage medium, which includes computer instructions. When the computer instructions are executed on the above-mentioned electronic device, the electronic device executes each function or step in the above-mentioned method embodiment.
[0287] The embodiment of the present application also provides a computer program product. When the computer program product is run on a computer, the computer executes each function or step executed by the mobile phone in the above method embodiment.
[0288] Through the description of the above implementation methods, technical personnel in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0289] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0290] The units described as separate components may or may not be physically separated, and the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place or distributed in multiple different places. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0291] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0292] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium, including several instructions to enable a device (which can be a single-chip microcomputer, chip, etc.) or a processor (processor) to perform all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), disk or optical disk and other media that can store program code.
[0293] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A target detection method, characterized in that: Applied to a first device, the first device includes a display screen and a light source, and the method includes: Displaying an array pattern through the display screen, wherein the array pattern is a pattern formed on the display screen by the array light emitted by the light source; Acquire a target image of the target object under the illumination of the array light; It is determined whether the target object is a living target according to the target image.
2. The method according to claim 1, characterized in that: The array pattern includes a plurality of sub-patterns, and the plurality of sub-patterns include sub-patterns having regular shapes.
3. The method according to claim 1 or 2, characterized in that: The array pattern includes a plurality of sub-patterns, and the features of the plurality of sub-patterns are the same or different; The characteristics of the sub-patterns include at least one of the following: color, shape, size, quantity, and positional relationship between sub-patterns.
4. The method according to any one of claims 1 to 3, characterized in that: The array pattern includes a plurality of sub-patterns, and the sub-patterns include circular sub-patterns.
5. The method according to any one of claims 1 to 4, characterized in that: Displaying an array pattern through the display screen includes: Displaying a first array pattern via the display screen; After the duration of displaying the first array pattern reaches a first duration, displaying a second array pattern through the display screen; Acquiring a target image of the target object under the illumination of the array light, comprising: capturing a first target image of the target object when the first array pattern is displayed; A second target image of the target object when the second array pattern is displayed is acquired.
6. The method according to claim 5, characterized in that After the second array pattern is displayed on the display screen, the method further includes: After the duration of displaying the second array pattern reaches a second duration, a third array pattern is displayed through the display screen; the first duration is different from the second duration.
7. The method according to claim 5 or 6, characterized in that: A feature of a sub-pattern in the first array pattern is different from a feature of a sub-pattern in the second array pattern.
8. The method according to any one of claims 1 to 7, characterized in that: The target object is a user's face.
9. The method according to any one of claim 8, characterized in that: Also includes: Displaying prompt information, wherein the prompt information is used to prompt the user to adjust the posture; The acquiring a target image of the target object under the illumination of the array light comprises: acquiring a first image of the user's face after posture adjustment under the illumination of the array light; The first image satisfies at least one of the following conditions: the light intensity corresponding to the first image is within a preset light intensity range, the proportion of the user's face in the first image is within a preset proportion range, the orientation of the user's face in the first image is within a preset orientation range, the occlusion of the user's face in the first image is within a preset occlusion range, and the angle of the user's face in the first image is within a preset angle range.
10. The method according to claim 8 or 9, characterized in that: Judging whether the target object is a living target according to the target image includes: Extracting the user's facial feature information according to the target image; the facial feature information includes at least one of the following: the position, size, shape, color, brightness of the bright spot formed in the target image after the array light irradiates the target object, the position and color of the facial key points in the target image; According to the facial feature information, it is determined whether the user is a living target.
11. The method according to claim 10, characterized in that Judging whether the user is a living target according to the facial feature information includes: Determining material information and structural information corresponding to the user's face according to the facial feature information; Whether the user is a living target is determined according to the material information and the structure information.
12. The method according to claim 10 or 11, characterized in that: Judging whether the target object is a living target according to the target image includes: Inputting the facial feature information into a target model, and having the target model output a detection result of whether the user is a living target; The training samples of the target model include: images of real human faces under the illumination of the array light, and images of non-real human faces under the illumination of the array light.
13. The method according to claim 12, characterized in that The array pattern corresponding to the array light is a first array pattern, and the target model is a first model; or, the array pattern corresponding to the array light is a second array pattern, and the target model is a second model.
14. A computer-readable storage medium, characterized in that: The method comprises a program or an instruction. When the program or the instruction is executed, the method according to any one of claims 1 to 13 is implemented.
15. An electronic device, characterized in that: The access device includes a processor and a memory; The memory is used to store computer-executable instructions. When the electronic device is running, the processor executes the computer-executable instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 13.
