Living body detection method, electronic device, storage medium and program product
By calculating the lighting effect data and predicting the lighting sequence, the problem of misjudgment caused by the influence of color channels and ambient light in the liveness detection algorithm is solved, and a higher accuracy of liveness detection is achieved.
Patent Information
- Application Number
- CN202310274105.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-01-20
- Estimated Expiration
- 2043-03-17
AI Technical Summary
Existing liveness detection algorithms are prone to being misjudged as camera hijacking during video capture, resulting in insufficient accuracy.
By acquiring the video to be detected, the illumination sequence reflected by the object to be detected is determined, and the illumination influence data is calculated based on the first and second illumination sequences to predict the third illumination sequence reflected by the object to be detected. Finally, the liveness detection result is determined based on the second and third illumination sequences, taking into account the influence of multiple color channels and ambient light.
It improves the accuracy of liveness detection, avoids misjudgments caused by color channels and ambient light, and provides more accurate liveness detection results.
Smart Images

Figure CN116597522B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of living body detection, and in particular to a living body detection method, an electronic device, a storage medium and a program product. BACKGROUND
[0002] Iridescence light sequence detection is an important part of a living body detection algorithm. A terminal sends out various colors of light according to a delivery strategy when recording a living body detection video. The detection object reflects the various colors of light and is recorded into the living body detection video. By comparing the light sequence sent out and the light sequence reflected by the detection object in the living body detection video, it can be determined whether there is camera hijacking.
[0003] However, in an actual living body detection process, the video collected by the terminal may be misjudged as camera hijacking. Therefore, the accuracy of the living body detection algorithm needs to be improved. SUMMARY
[0004] In view of the above problems, the embodiments of the present application provide a living body detection method, an electronic device, a storage medium and a program product, so as to overcome the above problems or at least partially solve the above problems.
[0005] The first aspect of the embodiments of the present application provides a living body detection method, comprising:
[0006] obtaining a to-be-detected video, the to-be-detected video being a video of a to-be-detected object collected during irradiation of the to-be-detected object according to a first light sequence;
[0007] determining a second light sequence reflected by the to-be-detected object according to the to-be-detected video;
[0008] determining light influence data according to the first light sequence and the second light sequence; wherein the light influence data comprises influence data of a plurality of color channels and / or influence data of ambient light;
[0009] predicting a third light sequence reflected by the to-be-detected object according to the light influence data and the first light sequence;
[0010] determining a living body detection result of the to-be-detected object according to the second light sequence and the third light sequence.
[0011] Optionally, the determining the living body detection result of the to-be-detected object according to the second light sequence and the third light sequence comprises:
[0012] calculating the correlation of the second light sequence and the third light sequence;
[0013] According to the correlation, a living body detection result of the to-be-detected object is determined.
[0014] Optionally, the first illumination sequence includes a plurality of color channels each corresponding to a first illumination sub-sequence, and the second illumination sequence includes the plurality of color channels each corresponding to a second illumination sub-sequence.
[0015] The determining of the illumination influence data according to the first illumination sequence and the second illumination sequence includes:
[0016] For each color channel, illumination influence sub-data corresponding to the color channel is fitted according to the first illumination sub-sequence corresponding to the color channel and the second illumination sub-sequence corresponding to the color channel.
[0017] The combination of the illumination influence sub-data corresponding to the plurality of color channels is determined as the illumination influence data.
[0018] Optionally, the second illumination sequence includes a plurality of color channels each corresponding to a second illumination sub-sequence, and the third illumination sequence includes the plurality of color channels each corresponding to a third illumination sub-sequence.
[0019] The calculating of the correlation of the second illumination sequence and the third illumination sequence includes:
[0020] A sub-correlation coefficient of each of the second illumination sub-sequence and the third illumination sub-sequence in a same color channel is calculated.
[0021] The determining of the living body detection result of the to-be-detected object according to the correlation includes:
[0022] A living body detection result of the to-be-detected object is determined according to a plurality of the sub-correlation coefficients.
[0023] Optionally, the determining of the living body detection result of the to-be-detected object according to a plurality of the sub-correlation coefficients includes:
[0024] A target sub-correlation coefficient with a maximum value in the plurality of the sub-correlation coefficients is determined.
[0025] In a case where the target sub-correlation coefficient is greater than a correlation coefficient threshold, it is determined that the to-be-detected object passes the living body detection.
[0026] Optionally, the second illumination sequence includes a plurality of color channels each corresponding to a second illumination sub-sequence.
[0027] The determining of the second illumination sequence reflected by the to-be-detected object according to the to-be-detected video includes:
[0028] obtaining a plurality of video frames of the to-be-detected video, and obtaining illumination rules of the first illumination sequence;
[0029] determining illumination information corresponding to each video frame in the to-be-detected video according to the illumination rules of the first illumination sequence;
[0030] For each video frame, a second illumination sub-sequence corresponding to each color channel is determined according to the illumination information of the video frame and the color mean value of each color channel of a plurality of pixel points on the video frame.
[0031] Optionally, the plurality of pixel points on the video frame are pixel points of an image region in which the to-be-detected object is located in the video frame.
[0032] Optionally, the first illumination sequence is composed of a plurality of different color illumination elements.
[0033] A second aspect of the embodiments of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory, and the processor executes the computer program to implement the living body detection method according to the first aspect.
[0034] A third aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program / instruction, and the computer program / instruction is executed by a processor to implement the living body detection method according to the first aspect.
[0035] A fourth aspect of the embodiments of the present application provides a computer program product, which includes a computer program / instruction, and the computer program / instruction is executed by a processor to implement the living body detection method according to the first aspect.
[0036] The embodiments of the present application have the following advantages:
[0037] In this embodiment, the illumination influence data is determined according to the first illumination sequence and the second illumination sequence, and the illumination influence data includes influence data of multiple color channels and / or influence data of ambient light. Because, according to the illumination influence data and the first illumination sequence, the third illumination sequence reflected by the to-be-detected object when illuminated according to the first illumination sequence can be predicted. The third illumination sequence is the illumination sequence that the to-be-detected object should theoretically reflect in the case of the influence of multiple color channels and / or the influence of ambient light. Further, according to the second illumination sequence actually reflected by the to-be-detected object and the third illumination sequence that should be theoretically reflected, whether camera hijacking exists can be determined, so as to determine the live detection result of the to-be-detected object. The live detection result of the to-be-detected object is determined according to the second illumination sequence and the third illumination sequence, the influence of multiple color channels and / or the influence of ambient light are considered, the case that the to-be-detected object may be misjudged as camera hijacking due to the influence of multiple color channels and the influence of ambient light is avoided, and thus a more accurate live detection result is obtained. BRIEF DESCRIPTION OF DRAWINGS
[0038] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without creative labor.
[0039] Figure 1 is a step flow chart of a live detection method in an embodiment of the present application;
[0040] Figure 2 is a flowchart of a live detection method in an embodiment of the present application;
[0041] Figure 3 is a structural schematic diagram of a live detection device in an embodiment of the present application;
[0042] Figure 4 is a schematic diagram of an electronic device in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the following will further describe the present application in detail in combination with the drawings and specific embodiments.
[0044] In recent years, important progress has been made in the research of computer vision, deep learning, machine learning, image processing, image recognition and other technologies based on artificial intelligence. Artificial intelligence (AI) is a new science and technology that studies and develops theories, methods, technologies and application systems for simulating and extending human intelligence. Artificial intelligence is a comprehensive discipline that involves chips, big data, cloud computing, the Internet of Things, distributed storage, deep learning, machine learning, neural networks and many other technology categories. Computer vision, as an important branch of artificial intelligence, is specifically to enable machines to recognize the world. Computer vision technology generally includes face recognition, liveness detection, fingerprint recognition and anti-forgery verification, biometric recognition, face detection, pedestrian detection, object detection, pedestrian recognition, image processing, image recognition, image semantic understanding, image retrieval, character recognition, video processing, video content recognition, three-dimensional reconstruction, virtual reality, augmented reality, simultaneous localization and mapping (SLAM), computational photography, robot navigation and positioning, and other technologies. With the research and progress of artificial intelligence technology, this technology has been applied in many fields, such as security and control, city management, traffic management, building management, park management, face passage, face attendance, logistics management, warehouse management, robots, intelligent marketing, computational photography, mobile phone images, cloud services, smart home, wearable devices, driverless vehicles, autonomous driving, intelligent medical care, face payment, face unlocking, fingerprint unlocking, face and certificate verification, smart screens, smart televisions, cameras, mobile Internet, network live streaming, beauty, makeup, medical cosmetology, intelligent temperature measurement, and other fields.
[0045] When performing liveness detection, the similarity between the emitted light sequence (e.g., a rainbow light sequence) and the reflected light sequence of the collected video is compared. When the similarity is lower than a certain threshold, it is considered that the collected video is an attack video directly sent to the server by camera hijacking technology, rather than a video collected by the terminal.
[0046] The inventors of the present application have found that there are many factors that affect the similarity between the emitted light sequence and the reflected light sequence of the collected video. On the one hand, it is affected by the influence between multiple color channels. On the other hand, it is affected by the influence of factors such as screen color display in the actual environment, camera hardware conditions, camera parameters (such as exposure, white balance, etc.), lighting environment, and the like.
[0047] The influence between multiple color channels is that the color change of a certain color channel in the reflected light of the object to be detected in the video is not only related to the light of that color channel in the rainbow light sequence, but also affected by the light of other color channels. For example, the intensity change of the reflected R channel is not only affected by the intensity change of the R channel in the rainbow light sequence, but also affected by the intensity changes of the G and B channels.
[0048] For the influence among multiple color channels, the liveness detection video and the glitter light sequence can be simultaneously mapped to a certain color gamut through a linear mapping relationship, and the correlation among the same channels is calculated under the color gamut. For example, the RGB color gamut is converted to the YUV color gamut or other related color gamut, and a large amount of data is learned to obtain a linear conversion relationship, and then the mean value of the RGB is subtracted from the RGB channel respectively. The correlation of the reflected light sequence and the glitter light sequence in the liveness detection video under each channel is calculated after the color gamut is converted. The learned linear conversion relationship can be referred to as a color conversion coefficient matrix.
[0049] However, the learned color conversion coefficient matrix is fixed. However, in different environments, the influence of each color channel is different. Therefore, the fixed color conversion coefficient matrix has limited effect on improving the accuracy of the liveness detection result.
[0050] In the actual environment, the influence of screen color display, camera hardware conditions, camera parameters (such as exposure, white balance, etc.), lighting environment and other factors is that in different environments, the same light sequence issued to the same to-be-detected object, the reflected light sequence of the to-be-detected object obtained is different.
[0051] For the above technical problems, the inventors of the present application consider that according to the reflection principle, the relationship between the light intensity reflected by the face in the liveness detection video and the issued glitter sequence is linear. And due to the cross-correlation among the RGB channels, this linear relationship should be multi-element. The light of each color channel reflected by the face is also affected by the same factors in the actual environment, such as screen color display, camera hardware conditions, camera parameters (such as exposure, white balance, etc.), lighting environment and other factors. Therefore, the inventors of the present application propose that the light influence data can be obtained through linear fitting, the light influence data includes the influence data of multiple color channels (the influence among multiple color channels) and / or the influence data of the environmental light (the influence of the factors such as screen color display, camera hardware conditions, camera parameters, lighting environment in the actual environment), and then an accurate liveness detection result can be obtained by considering the light influence data.
[0052] Reference Figure 1 As shown in FIG. 1, a step flowchart of a liveness detection method in an embodiment of the present application is shown, as shown in FIG. 2, the liveness detection method includes the following steps: Figure 1 As shown in FIG. 1, a step flowchart of a liveness detection method in an embodiment of the present application is shown, as shown in FIG. 2, the liveness detection method includes the following steps:
[0053] Step S11: acquiring a to-be-detected video, the to-be-detected video is a video of a to-be-detected object collected during irradiation of the to-be-detected object according to a first light sequence;
[0054] Step S12: determining a second light sequence reflected by the to-be-detected object according to the to-be-detected video;
[0055] Step S13: determining illumination influence data according to the first illumination sequence and the second illumination sequence;
[0056] Step S14: predicting a third illumination sequence reflected by the to-be-detected object according to the illumination influence data and the first illumination sequence;
[0057] Step S15: determining a living body detection result of the to-be-detected object according to the second illumination sequence and the third illumination sequence.
[0058] The illumination influence data includes influence data of multiple color channels and / or influence data of ambient light.
[0059] In some embodiments, the first illumination sequence can be issued to the terminal by a background server. The terminal irradiates the to-be-detected object according to the first illumination sequence, and collects a to-be-detected video of the to-be-detected object during the irradiation of the to-be-detected object according to the first illumination sequence. The to-be-detected object is an object collected by a camera of the terminal. The first illumination sequence includes a first illumination sub-sequence corresponding to each of multiple color channels. The multiple color channels can be RGB channels, YUV channels, or other channels. The first illumination sequence is composed of multiple different color illumination elements. Illumination elements of the same color are in the same color channel, for example, red light with an intensity of 0.7 and red light with an intensity of 0.5 are both in the red channel.
[0060] For example, the multiple color channels are a red channel, a green channel, and a blue channel, and the change of the light irradiating the to-be-detected object emitted by the terminal is: red light (intensity 0.7)→red light (intensity 0.5), green light (intensity 0.6)→green light (intensity 0.4), blue light (intensity 0.6)→blue light (intensity 0.8)→blue light (intensity 0.3), red light (intensity 0.8). The first illumination sequence includes: a first illumination sub-sequence of the red channel (0.7, 0.5, 0, 0, 0.8), a first illumination sub-sequence of the green channel (0, 0.6, 0.4, 0, 0), and a first illumination sub-sequence of the blue channel (0, 0, 0.6, 0.8, 0.3). The larger the value, the higher the illumination intensity. The illumination sequence can be determined according to the illumination sub-sequence corresponding to each of the three color channels (the red channel, the green channel, and the blue channel). Each illumination element of the illumination sequence contains information of multiple color channels, and each illumination element of the illumination sequence is determined according to the element at the same position in the illumination sub-sequence corresponding to each color channel.
[0061] The second light sequence corresponding to the to-be-detected object refers to a light sequence reflected by the to-be-detected object, which can be extracted from the to-be-detected video. The irradiation rule of the first light sequence can be obtained, and the irradiation duration corresponding to each element of the first light sequence can be known according to the irradiation rule of the to-be-detected object. According to the irradiation rule of the first light sequence, the light information corresponding to each video frame in the to-be-detected video can be determined.
[0062] For example, the irradiation rule of the first light sequence is that the irradiation duration corresponding to each element is 1 second, and the duration occupied by each two video frames of the to-be-detected video is 1 second. Then, one element in the second light sequence can be determined according to the light reflected by the to-be-detected object in each two video frames of the to-be-detected video.
[0063] When the plurality of video frames of the to-be-detected video are obtained, the time interval between the plurality of video frames can be determined according to the time interval between each two adjacent elements in the first light sequence. For example, the frequency of light switching in the first light sequence is 0.3 seconds / time, and then one video frame can be extracted from the to-be-detected video every 0.3 seconds.
[0064] For example, the irradiation rule of the first light sequence is that the irradiation duration corresponding to each element is 1 second. Then, one video frame can be extracted from the to-be-detected video every 1 second, and one element in the second light sequence can be determined according to the light reflected by the to-be-detected object in each extracted video frame.
[0065] For each video frame, the second light sub-sequence corresponding to each color channel can be determined according to the light information of the video frame and the color mean of the plurality of pixel points on the video frame in each color channel. The second light sequence includes the second light sub-sequences corresponding to the plurality of color channels respectively. The light sequence reflected by the to-be-detected object is irrelevant to the color of the to-be-detected object itself, and is only related to the color and intensity of the light reflected by the to-be-detected object.
[0066] In some embodiments, the plurality of video frames of the to-be-detected video can be obtained, and in each video frame, the mean of each color channel of the plurality of pixel points on the video frame is determined as the value of the color channel, and the second light sub-sequence corresponding to each color channel can be generated according to the value of each color channel in each video frame.
[0067] For example, the means of the plurality of pixel points on the first video frame to the fifth video frame in the red channel are 0.3, 0.6, 0, 0.5, and 0 respectively, and the second light sub-sequence corresponding to the red channel is (0.3, 0.6, 0, 0.5, 0). Similarly, the second light sub-sequences corresponding to other color channels respectively can be obtained, and thus the second light sequence can be obtained.
[0068] On the basis of the above technical solutions, because the to-be-detected video includes the to-be-detected object and the background, and because of the distance, the reflection of the background to the light may be weak. Therefore, when obtaining the mean value of each color channel of a plurality of pixel points on the video frame, only the image region where the to-be-detected object is located in the video frame can be obtained, and the mean value of each color channel of a plurality of pixel points in the image region where the to-be-detected object is located can be obtained, and then the value of each color channel is obtained. The plurality of pixel points in the image region where the to-be-detected object is located can be all the pixel points in the image region where the to-be-detected object is located, or part of the pixel points in the image region where the to-be-detected object is located.
[0069] In some embodiments, if the to-be-detected object is a face, the plurality of pixel points in the image region where the to-be-detected object is located can be a plurality of key pixel points on the face. For example, the plurality of key pixel points on the face can be the corners of the left and right eyes, the tip of the nose, the left and right corners of the lips, and the like.
[0070] In this way, the second light sequence corresponding to the to-be-detected object can be obtained through the to-be-detected video. Moreover, the second light sequence corresponding to the to-be-detected object can be obtained by processing only the pixel points in the image region where the to-be-detected object is located, which has the advantages of simple calculation and accuracy.
[0071] After obtaining the first light sequence and the second light sequence, because the first light sequence and the second light sequence both include a plurality of color channel light sub-sequences, the influence of the plurality of color channels and the influence of the ambient light on each light sub-sequence are the same, and the influence of the plurality of color channels and the influence of the ambient light are linear. Therefore, the light influence data can be obtained by fitting. The light influence data includes the influence data of the plurality of color channels and / or the influence data of the ambient light, and the influence data of the ambient light represents the influence caused by factors such as screen color display in the actual environment, camera hardware conditions, camera parameters (such as exposure, white balance, etc.), light environment, and the like.
[0072] In some embodiments, determining the light influence data according to the first light sequence and the second light sequence can include: for each color channel, fitting the light influence sub-data corresponding to the color channel according to the first light sub-sequence corresponding to the color channel and the second light sub-sequence corresponding to the color channel; and determining the combination of the light influence sub-data corresponding to the plurality of color channels as the light influence data.
[0073] The light influence data can be obtained by ordinary least squares (OLS), or by matlab (mathematical software), a computer, and the like.
[0074] If the first light sequence is:
[0075]
[0076] The second light sequence is:
[0077]
[0078] Wherein, b, g, r respectively represent blue, green, red color channel, x1 represents the first light element in the first light sequence, x2 represents the second light element in the first light sequence, and the others are sequentially similar; x b1 The first value of the first light sub-sequence of the blue channel, and the others are sequentially similar; y1 represents the first light element in the second light sequence, y2 represents the second light element in the second light sequence, and the others are sequentially similar; The index number of the element in the first light sequence of each color channel is the same as the index number of the element in the second light sequence of each color channel, which is N, N>3.
[0079] Because the intensity of the light reflected by the to-be-detected object and the intensity of the light emitted by the terminal exist a linear relationship, and there exists a correlation between RGB colors, there exists a linear mapping f:X→Y. It is expressed by matrix multiplication as y i =x i *W+b. Wherein, i=1, 2, …, N; x i represents the i-th light element in the first light sequence, y i represents the i-th light element in the second light sequence; is the influence data of multiple color channels, is the influence data of ambient light. Because N>3, the values of W and b can be fitted.
[0080] After the light influence data is determined, the third light sequence reflected by the to-be-detected object can be predicted according to the light influence data and the first light sequence.
[0081] The third light sequence is a light sequence in which the light influence data is added to the first light sequence, representing the first light sequence affected by multiple color channels and / or the influence of ambient light, that is, the light sequence that the to-be-detected object should theoretically receive. The third light sequence Y' can be obtained by the following formula: Y'=W'X+b'. Wherein, W' is the determined influence data of multiple color channels, b' is the determined influence data of ambient light, and X is the first light sequence.
[0082] According to the reflection principle, without considering the loss, the light sequence that the to-be-detected object should theoretically receive and the light sequence that the to-be-detected object should theoretically reflect should be equal. Therefore, the living body detection result of the to-be-detected object can be determined according to the second light sequence and the third light sequence.
[0083] Thus, determining the liveness detection result of the target object based on the correlation between the third illumination sequence and the second illumination sequence has higher accuracy compared to determining the liveness detection result based on the correlation between the first illumination sequence and the second illumination sequence, as it takes into account the influence of multiple color channels and ambient light.
[0084] In some implementations, the correlation between the second illumination sequence and the third illumination sequence can be calculated, and the liveness detection result of the object to be detected can be determined based on the correlation. For example, if the correlation between the second illumination sequence and the third illumination sequence is greater than a correlation threshold, the object to be detected is determined to have passed the liveness detection.
[0085] The technical solution of this application determines illumination influence data based on a first illumination sequence and a second illumination sequence. This illumination influence data includes influence data from multiple color channels and / or influence data from ambient light. Because, based on the illumination influence data and the first illumination sequence, a third illumination sequence can be predicted for the object to be detected when illuminated according to the first illumination sequence. The third illumination sequence is the illumination sequence that the object to be detected should theoretically reflect when influenced by multiple color channels and / or ambient light. Furthermore, based on the second illumination sequence actually reflected by the object to be detected and the theoretically reflected third illumination sequence, it can be determined whether camera hijacking exists, thereby determining the liveness detection result of the object to be detected. Determining the liveness detection result of the object to be detected based on the second and third illumination sequences considers the influence of multiple color channels and / or ambient light, avoiding situations where the influence of multiple color channels and ambient light might lead to misjudgments of camera hijacking, thus obtaining a more accurate liveness detection result.
[0086] In some implementations, the solution of this application can be executed by electronic devices such as terminals. For example, during liveness detection, the electronic device generates a first illumination sequence and captures a video of the object to be detected while illuminating it according to the first illumination sequence. Then, the electronic device executes the subsequent liveness detection process based on the first illumination sequence and the video to be detected. Whether the first illumination sequence is issued by the backend server or generated by the electronic device itself, and whether the liveness detection process is executed by the backend server or by the electronic device itself, or even whether some steps in the liveness detection process are executed by the electronic device and some steps are executed by the backend server, can all be set according to actual needs. This application does not limit these aspects, nor will it list all possible implementations.
[0087] Based on the above technical solution, the third illumination sequence also includes multiple third illumination sub-sequences corresponding to each color channel. When calculating the correlation between the third illumination sequence and the second illumination sequence, the sub-correlation coefficients of the second and third illumination sub-sequences within the same color channel can be calculated. Furthermore, when determining the liveness detection result of the target object, the liveness detection result is determined based on multiple sub-correlation coefficients.
[0088] In some implementations, the largest sub-correlation coefficient among multiple sub-correlation coefficients can be determined as the target sub-correlation coefficient. The liveness detection result of the object to be detected is determined based on the target sub-correlation coefficient and a correlation coefficient threshold. Alternatively, if the target sub-correlation coefficient is greater than the correlation coefficient threshold, the liveness detection result of the object to be detected can be determined as passing liveness detection. In some implementations, multiple sub-similarity values can be weighted and averaged to obtain an average similarity. If the average similarity is greater than a similarity threshold, the liveness detection result of the object to be detected can be determined as passing liveness detection.
[0089] Optionally, taking channel B as an example, the second illumination sub-sequence of channel B is Y. b =(y b1 ,y b2 ,..,y bN The third illumination subsequence in channel B is Y'. b =(y' b1 ,y' b2 ,..,y' bN By calculating the Pearson correlation coefficient between the two, the sub-correlation coefficients are determined:
[0090]
[0091] in,
[0092] The sub-correlation coefficients of the remaining channels are calculated using the same principle.
[0093] Optionally, the liveness detection result of the object to be detected can be determined by comparing the mean of the sub-correlation coefficients of multiple color channels with the correlation coefficient threshold.
[0094] Thus, determining the liveness detection result of the object to be detected based on the sub-correlation coefficients of each color channel has the advantage of being more accurate.
[0095] Figure 2This is a schematic flowchart of the liveness detection method in an embodiment of this application. Based on the video to be detected and the distribution strategy, a first illumination sequence and a second illumination sequence can be determined. Based on the first illumination sequence and the second illumination sequence, illumination influence data is determined, and a third illumination sequence is obtained. Based on the third illumination sequence and the second illumination sequence, the liveness detection result can be determined.
[0096] Because the influence of multiple color channels and ambient light is linear, the mapping relationship in the technical solution of this application is also limited to a linear mapping relationship. Therefore, if the video to be detected is a video sent by camera hijacking technology, the fitting of the first illumination sequence and the second illumination sequence corresponding to the object to be detected in the video results in extremely poor illumination influence data. Consequently, the third illumination sequence obtained based on the fitted illumination influence data and the first illumination sequence will also have low correlation with the second illumination sequence.
[0097] When the video to be detected is actually captured by the terminal, since the second illumination sequence is indeed the video captured when the terminal emits light, the influence data of multiple color channels and the influence data of ambient light can be obtained relatively accurately based on the first and second illumination sequences. Furthermore, a third illumination sequence is obtained based on the illumination influence data and the first illumination sequence. The liveness detection result of the object to be detected determined based on the third and second illumination sequences is also relatively accurate.
[0098] The liveness detection method disclosed in this application is mainly used to determine whether camera hijacking exists during the liveness detection process. Therefore, the liveness detection method disclosed in this application can be used in conjunction with other liveness detection methods, which can be liveness detection algorithms used to detect whether the object to be detected is a real face. Then, based on the liveness detection method disclosed in this application and other liveness detection methods, the liveness detection result of the object to be detected is jointly determined.
[0099] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0100] Figure 3 This is a schematic diagram of the structure of a liveness detection device according to an embodiment of this application, as shown below. Figure 3 As shown, the liveness detection device includes a video acquisition module 31, a sequence acquisition module 32, an impact data determination module 33, a sequence prediction module 34, and a determination module 35, wherein:
[0101] Video acquisition module 31 is used to acquire a video to be detected, wherein the video to be detected is a video of the object to be detected collected during the illumination of the object to be detected according to the first illumination sequence;
[0102] The sequence acquisition module 32 is used to determine the second illumination sequence reflected by the object to be detected based on the video to be detected;
[0103] The influence data determination module 33 is used to determine the light influence data based on the first light sequence and the second light sequence; wherein the light influence data includes influence data of multiple color channels and / or influence data of ambient light;
[0104] The sequence prediction module 34 is used to predict the third illumination sequence reflected by the object to be detected based on the illumination influence data and the first illumination sequence;
[0105] The determining module 35 is used to determine the liveness detection result of the object to be detected based on the second illumination sequence and the third illumination sequence.
[0106] Optionally, the determining module 35 includes:
[0107] A computing unit is used to calculate the correlation between the second illumination sequence and the third illumination sequence;
[0108] The determining unit is used to determine the liveness detection result of the object to be detected based on the correlation.
[0109] Optionally, the first illumination sequence includes a first illumination subsequence corresponding to each of the multiple color channels, and the second illumination sequence includes a second illumination subsequence corresponding to each of the multiple color channels;
[0110] The impact data determination module 33 includes:
[0111] The fitting unit is used to fit the illumination influence data corresponding to each color channel based on the first illumination subsequence and the second illumination subsequence corresponding to that color channel.
[0112] The data determination unit is used to determine the combination of the lighting influence sub-data corresponding to the multiple color channels as the lighting influence data.
[0113] Optionally, the second illumination sequence includes a second illumination sub-sequence corresponding to each of the plurality of color channels, and the third illumination sequence includes a third illumination sub-sequence corresponding to each of the plurality of color channels;
[0114] The computing unit includes:
[0115] A calculation subunit is used to calculate the sub-correlation coefficients of the second illumination sub-sequence and the third illumination sub-sequence, each of which is in the same color channel;
[0116] The determining unit includes:
[0117] A subunit is defined for determining the liveness detection result of the object to be detected based on multiple sub-correlation coefficients.
[0118] Optionally, the determining subunit is specifically used to perform:
[0119] Determine the target sub-correlation coefficient with the largest value among the multiple sub-correlation coefficients;
[0120] If the correlation coefficient of the target sub-sub is greater than the correlation coefficient threshold, the object to be detected is determined to have passed the liveness detection.
[0121] Optionally, the second illumination sequence includes a second illumination sub-sequence corresponding to each of the plurality of color channels;
[0122] The sequence acquisition module 32 includes:
[0123] The rule acquisition unit is used to acquire multiple video frames of the video to be detected, and to acquire the illumination rules of the first illumination sequence;
[0124] The illumination information acquisition unit is used to determine the illumination information corresponding to each video frame in the video to be detected according to the illumination rules of the first illumination sequence.
[0125] The subsequence determination unit is used to determine, for each of the video frames, a second illumination subsequence corresponding to each of the multiple color channels based on the illumination information of the video frame and the average color value of multiple pixels in each color channel of the video frame.
[0126] Optionally, the first illumination sequence consists of multiple illumination elements of different colors.
[0127] It should be noted that the device embodiments are similar to the method embodiments, so the description is relatively simple. For relevant details, please refer to the method embodiments.
[0128] This application also provides an electronic device, see embodiments thereof. Figure 4 , Figure 4 This is a schematic diagram of the electronic device proposed in an embodiment of this application. Figure 4 As shown, the electronic device 100 includes a memory 110 and a processor 120. The memory 110 and the processor 120 are connected via a bus for communication. The memory 110 stores a computer program that can run on the processor 120 to implement the steps in the liveness detection method disclosed in the embodiments of this application.
[0129] This application also provides a computer-readable storage medium storing a computer program / instructions thereon, which, when executed by a processor, implements the liveness detection method disclosed in this application.
[0130] This application also provides a computer program product, including a computer program / instructions that, when executed by a processor, implement the liveness detection method disclosed in this application.
[0131] This application also provides a computer program that, when executed, can implement the liveness detection method disclosed in this application.
[0132] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0133] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0134] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, electronic devices, and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0135] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1The function specified in one or more boxes.
[0136] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0137] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0138] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0139] The above provides a detailed description of the liveness detection method, electronic device, storage medium, and program product provided in this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method of detecting living matter, characterized by, The method comprises: obtaining a to-be-detected video, the to-be-detected video being a video of a to-be-detected object collected during irradiation of the to-be-detected object according to a first light sequence; determining, according to the to-be-detected video, a second light sequence reflected by the to-be-detected object; determining, according to the first light sequence and the second light sequence, light influence data, wherein the light influence data comprises influence data of multiple color channels and / or influence data of ambient light; predicting, according to the light influence data and the first light sequence, a third light sequence reflected by the to-be-detected object; determining, according to the second light sequence and the third light sequence, a live body detection result of the to-be-detected object.
2. The method of claim 1, wherein, The determining, according to the second light sequence and the third light sequence, of the live body detection result of the to-be-detected object comprises: calculating a correlation of the second light sequence and the third light sequence; determining, according to the correlation, the live body detection result of the to-be-detected object.
3. The method of claim 1, wherein, The first light sequence comprises first light subsequences corresponding to multiple color channels respectively, and the second light sequence comprises second light subsequences corresponding to the multiple color channels respectively; The determining, according to the first light sequence and the second light sequence, of the light influence data comprises: for each color channel, fitting light influence sub-data corresponding to the color channel according to a first light subsequence corresponding to the color channel and a second light subsequence corresponding to the color channel; combining the light influence sub-data corresponding to the multiple color channels to determine the light influence data.
4. The method of claim 2, wherein, The second light sequence comprises second light subsequences corresponding to the multiple color channels respectively, and the third light sequence comprises third light subsequences corresponding to the multiple color channels respectively; The calculating of the correlation of the second light sequence and the third light sequence comprises: calculating sub-correlation coefficients of the second light subsequences and the third light subsequences in the same color channel respectively; The determining, according to the correlation, of the live body detection result of the to-be-detected object comprises: determining, according to multiple sub-correlation coefficients, the live body detection result of the to-be-detected object.
5. The method of claim 4, wherein, The determining, according to multiple sub-correlation coefficients, of the live body detection result of the to-be-detected object comprises: determining a target sub-correlation coefficient with the maximum value among the multiple sub-correlation coefficients; in a case where the target sub-correlation coefficient is greater than a correlation coefficient threshold, determining that the to-be-detected object passes the live body detection.
6. The method according to any one of claims 1 to 5, characterized in that, The second light sequence comprises second light subsequences corresponding to the multiple color channels respectively; The determining, according to the to-be-detected video, of the second light sequence reflected by the to-be-detected object comprises: obtaining multiple video frames of the to-be-detected video, and obtaining irradiation rules of the first light sequence; determining, according to the irradiation rules of the first light sequence, light information corresponding to each video frame in the to-be-detected video; for each video frame, determining second light subsequences corresponding to multiple color channels according to the light information of the video frame and color means of multiple pixel points on the video frame in each color channel.
7. The method of claim 6, wherein, The plurality of pixel points on the video frame are pixel points of an image region in which the to-be-detected object is located in the video frame.
8. The method according to any one of claims 1 to 5, characterized in that, The first illumination sequence is composed of a plurality of different color illumination elements.
9. An electronic device comprising a memory, a processor, and a computer program stored on the memory, wherein the computer program comprises instructions that, when executed by the processor, cause the electronic device to perform the method of any one of claims 1-8. The processor executes the computer program to implement the living body detection method in any one of claims 1 to 8.
10. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the living body detection method in any one of claims 1 to 8.
11. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the living body detection method in any one of claims 1 to 8. The computer program / instruction is executed by the processor to implement the living body detection method in any one of claims 1 to 8.
Citation Information
Patent Citations
Living body detection method and device and computer readable storage medium
CN113408403A
Spoof detection using illumination sequence randomization
US11126879B1