WO2022205643A1 - Living body detection method and apparatus, and device and computer storage medium - Google Patents

Living body detection method and apparatus, and device and computer storage medium Download PDF

Info

Publication number
WO2022205643A1
WO2022205643A1 PCT/CN2021/103167 CN2021103167W WO2022205643A1 WO 2022205643 A1 WO2022205643 A1 WO 2022205643A1 CN 2021103167 W CN2021103167 W CN 2021103167W WO 2022205643 A1 WO2022205643 A1 WO 2022205643A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
living body
inspected
detection
preset
Prior art date
Application number
PCT/CN2021/103167
Other languages
French (fr)
Chinese (zh)
Inventor
方倩
胥鹏
张捷
Original Assignee
上海商汤智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 上海商汤智能科技有限公司 filed Critical 上海商汤智能科技有限公司
Publication of WO2022205643A1 publication Critical patent/WO2022205643A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/5866Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, manually generated location and time information
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive

Definitions

  • the present disclosure relates to the technical field of living body detection, and in particular, to a living body detection method, apparatus, device, and computer storage medium.
  • face brushing occupies an important position in the security of the entire face recognition system due to its convenient operation, rapidity and high discrimination of image authenticity.
  • face check-in face payment
  • face unlock face authentication
  • the system first needs to perform liveness detection during the "face brushing" process, that is, it needs to confirm whether the verifier is a legitimate creature. Living body, whether it is a living, on-site, real person.
  • the related art generally has the problems of large network bandwidth occupation and long detection period when performing liveness detection, resulting in low detection efficiency.
  • Embodiments of the present disclosure provide a method, apparatus, device, and computer storage medium for detecting a living body.
  • Embodiments of the present disclosure provide a method for detecting a living body, including:
  • i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1; in response to the i-th image to be inspected meeting a preset quality condition, perform live detection on the i-th image to be inspected process to obtain the target detection result.
  • the acquiring the i-th image to be inspected from the video data collected by the image sensor includes: extracting an initial image from the video data collected by the image sensor; pre-formatting the initial image according to preset configuration parameters. processing to obtain a processed image; and determining the processed image as the i-th image to be inspected.
  • An embodiment of the present disclosure provides a device for detecting a living body, including an acquisition module and a first processing module,
  • the acquisition module is configured to acquire the i-th image to be inspected from the video data collected by the image sensor; wherein, the i is an integer greater than 1;
  • the first processing module is configured to, in response to the i-th image to be inspected meeting a preset quality condition, perform in vivo detection processing on the i-th image to be inspected to obtain a target detection result.
  • An embodiment of the present disclosure provides a living body detection device, including: a processor and a memory storing instructions executable by the processor, and when the instructions are executed by the processor, the above-mentioned living body detection method is implemented.
  • An embodiment of the present disclosure provides a computer-readable storage medium storing a program, and when the program is executed by a processor, the above-mentioned method for detecting a living body is implemented.
  • An embodiment of the present disclosure provides a computer program, including computer-readable codes, and when the computer-readable codes are executed in an electronic device and executed by a processor in the electronic device, the above-mentioned living body detection is realized method.
  • the living body detection device first obtains the i-th image to be inspected from the video data collected by the image sensor; and then responds that the i-th image to be inspected meets the preset quality condition, Liveness detection processing is performed to obtain target detection results.
  • the detection process is based on continuous images in the process of living body detection.
  • the network bandwidth is less occupied, and timely feedback of the detection results can be realized, and the quality detection process is added before the subsequent living body detection, which effectively ensures the detection. data quality in the process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
  • FIG. 1 is a schematic diagram of the structure of a living body detection method in the related art
  • FIG. 2 is a schematic diagram 1 of the implementation flow of the live detection method proposed by the embodiment of the present disclosure
  • FIG. 3 is a schematic diagram 2 of the implementation flow of the method for detecting a living body provided in an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram 3 of the implementation flow of the method for detecting a living body proposed by an embodiment of the present disclosure
  • FIG. 5 is a fourth schematic diagram of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure
  • FIG. 6 is a schematic diagram 5 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • FIG. 7 is a sixth schematic diagram of the implementation process of the living body detection method provided by the embodiment of the present disclosure.
  • FIG. 8 is a schematic diagram 7 of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure
  • FIG. 9 is a schematic diagram 8 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram 9 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • FIG. 11 is a schematic diagram ten of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure
  • FIG. 12 is a schematic diagram of an application scenario of the living body detection method proposed by the embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of the execution flow of the live detection method proposed by the embodiment of the present disclosure.
  • FIG. 14 is a schematic diagram of the composition and structure of a living body detection device proposed by an embodiment of the present disclosure.
  • FIG. 15 is a schematic diagram of the composition and structure of a living body detection device provided by an embodiment of the present disclosure.
  • first ⁇ second ⁇ third is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that “first ⁇ second ⁇ third” Where permitted, the specific order or sequence may be interchanged to enable the embodiments of the disclosure described herein to be practiced in sequences other than those illustrated or described herein.
  • face brushing as a crucial item in face recognition technology, occupies an important position in the security of the entire face recognition system due to its convenient operation, rapidity and high discrimination of image authenticity.
  • face check-in face payment
  • face unlock face authentication
  • identity authentication is required, such as identity authentication through face recognition.
  • face recognition attackers often use static photos, face models or face masks to conduct security intrusion attacks. Therefore, in the process of "swiping face", the system first needs to perform live detection, that is, it needs to confirm the verification first. Whether the person is a legitimate living organism, whether it is a living, on-site, real person.
  • FIG. 1 is a schematic diagram of the architecture of a living body detection method in the related art.
  • the front end of the system collects video data by calling a camera, and then transmits the collected video data to the back end.
  • the back end uses a living body detection module, based on The relevant algorithm performs live detection on the received video data, and after obtaining the detection result, the living body detection result is fed back to the front end.
  • the living body detection scheme in the related art has the following defects: firstly, video data is used. Since the video data is generally between 5 and 20M, there is a problem that the network bandwidth is occupied; secondly, the back-end The detection results can be fed back only after the video data is subjected to silent live video detection. The duration is generally about 3 to 5 seconds, and the detection period is relatively long. In the third aspect, the data quality during the detection process cannot be guaranteed, which may affect the duration of the entire detection period.
  • the living video detection in the related art generally has the problems of large network bandwidth occupation and long detection period, resulting in low detection efficiency.
  • the content to be discussed in the embodiments of the present disclosure how to achieve high-efficiency detection of living bodies will be described below with reference to the following specific embodiments.
  • Embodiments of the present disclosure provide a method, device, device, and computer storage medium for living body detection.
  • detection is performed based on continuous images.
  • the network bandwidth is occupied less, and the detection result can be timely.
  • Feedback, and adding a quality detection process before subsequent live detection effectively guarantees the data quality in the detection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
  • the living body detection method provided by the embodiments of the present disclosure is applied to a living body detection device. Exemplary applications of the liveness detection device provided by the embodiments of the present disclosure are described below.
  • the liveness detection device provided by the embodiments of the present disclosure can be implemented as mobile phones, notebook computers, tablet computers, desktop computers, smart TVs, in-vehicle devices, wearable devices, industrial equipment, etc.
  • FIG. 2 is a schematic diagram 1 of the implementation flow of the method for detecting a living body proposed in an embodiment of the present disclosure.
  • a living body detection device executes The method of detection may include the following steps:
  • the living body detection device may first acquire the i-th image to be inspected from the video data collected by the image sensor.
  • the image sensor is an image acquisition device, that is, a camera, configured on the living body detection device.
  • the living body detection device is a smartphone
  • the smartphone includes a front camera and a rear camera, and the image sensor can be the front camera; when the living body detection device is a laptop, the image sensor is the The front camera of the computer.
  • the video data is the video stream of the detection object collected by the living body detection device using the above-mentioned image sensor.
  • the living body detection device may trigger the activation of the camera based on the user's touch operation, and then collect video data in real time through the camera.
  • the identity verification process when opening a bank account on a mobile phone.
  • the mobile phone can receive the SMS reminder sent by the bank to the customer to open an account through the unified SMS marketing tool.
  • the page on the mobile phone used to display the content of the SMS message is an H5 page.
  • the external link to the bank's official website, that is, H5 jumps to the external link.
  • the mobile phone detects the trigger operation input by the user, controls the camera to turn on and collects image data in real time, and obtains the video stream.
  • the image to be inspected refers to a picture frame to be inspected.
  • the living body detection device may select a picture frame from the video stream obtained by collection; wherein, the living body detection device may select a picture frame according to a preset time interval.
  • the i-th image to be inspected refers to the picture frame selected from the video stream for the i-th time during the current live detection.
  • the living body detection device sets a timer, the timer duration is 100ms, and the living body detection device extracts a picture frame from the video stream collected by the camera every 100ms as the image to be checked.
  • the living body detection device no longer performs live body detection on the video data for the detection object, but selects images to be inspected from the video data according to time intervals, and then performs live body detection based on the images to be inspected, which reduces the occupation of network bandwidth.
  • the living body detection device may determine that the i-th image to be inspected satisfies the preset quality condition, Liveness detection is performed on the i-th image to be inspected.
  • the preset quality condition refers to a quality requirement for an image to be inspected that is preset by the living body detection device, such as a requirement for a detection object, a requirement for the quality of a human face, and the like.
  • the living body detection device may first perform a preliminary screening based on quality requirements on the image to be inspected, so as to determine an image to be inspected whose quality meets the standard.
  • the living body detection device can first determine the time parameter corresponding to the i-th image to be inspected, and judge whether the image to be inspected satisfies the initial detection condition based on the time parameter; if it is determined that the initial detection condition is met, the living body detection device can continue to target
  • the image to be inspected is subjected to face detection, and in the case that the face detection result is that there are facial features, the quality detection value of the image is determined according to the image parameters of the image to be inspected, and then based on the quality detection value, the image to be inspected is determined whether the i-th image meets the requirements. Preset quality conditions for judgment. Further, in the case of determining that the image to be inspected satisfies the preset quality condition, a living body detection process is performed, and a detection result is obtained.
  • the living body detection processing refers to detecting whether there is a legitimate living body in the i-th image to be checked.
  • the legal living body here refers to an individual with real life characteristics in the natural environment, rather than non-living characteristics such as photos or videos.
  • the living body detection device may integrate a living body detection network, and in the case of determining that the i-th image to be inspected satisfies the preset quality conditions, call the living body detection network to judge whether there is a legitimate living body in the i-th image to be inspected , to obtain the liveness detection result of the i-th image to be inspected.
  • the living body detection result of the i-th image to be inspected may be that there is a living body; it may also be that there is no living body.
  • the living body detection device may store the living body detection result of each image to be inspected, and perform a number accumulation process in the case where the living body detection result is the presence of a living body to obtain a number accumulated value.
  • the in vivo detection result may update the current cumulative value based on the in vivo detection result of the i-th image to be inspected, and then determine the above-mentioned target detection result based on the updated cumulative value.
  • the target detection result may be that the in vivo verification is passed, or it may be that the in vivo verification is not passed.
  • the live detection method provided by the embodiments of the present disclosure performs detection based on continuous images during the live detection process. Compared with video live detection, the network bandwidth is occupied less, and timely feedback of the detection results can be realized. The quality detection process is added before the live detection, which effectively ensures the data quality in the detection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
  • FIG. 3 is a second schematic diagram of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • the living body detection device The method for obtaining the i-th image to be inspected from the video data collected by the image sensor may include the following steps:
  • S101a extracting an initial image from video data collected by an image sensor.
  • S101b Perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image.
  • the living body detection device may select an image to be inspected from images that have undergone format preprocessing.
  • the living body detection device may first select from the collected video data according to time intervals The initial image is then subjected to format conversion processing according to the actual detection requirements, so that the processed image that meets the detection requirements is determined as the image to be inspected.
  • the mobile phone selects an image to be inspected every 100ms.
  • the initial image can be resized, and the resized image can be compressed according to the preset compression ratio. , so that the compressed image is determined as the third image to be inspected.
  • the living body detection device first selects an initial image from the video data collected by the image sensor, then performs format preprocessing, and determines the image obtained after processing as the i-th image to be inspected . In this way, the custom configuration of images can be realized in the process of living body detection to meet the detection requirements.
  • FIG. 4 is a schematic diagram 3 of the implementation flow of the living body detection method proposed by the embodiment of the present disclosure.
  • the in vivo detection process is performed on the i-th image to be inspected, and before the target detection result is obtained, that is, before step 102, The method also includes the following steps:
  • S103 Determine a time parameter corresponding to the i-th image to be inspected, and determine whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter.
  • the living body detection device in order to avoid the life detection period being too long and the power consumption of the device being wasted, the living body detection device can set an initial detection condition that meets the detection requirements, and then judge whether the detection times out and whether the image is repeated based on the initial detection condition. .
  • the living body detection device may first determine a time parameter corresponding to the image to be inspected, and determine whether the time parameter satisfies the initial detection condition.
  • the time parameter refers to the time difference between the timestamp of the first image to be inspected and the timestamp of the current image to be inspected, that is, the detection duration from the start of detection to the present.
  • the time parameter may be the time interval between the first image to be inspected and the i-th image to be inspected.
  • the initial detection condition may include a detection timeout duration threshold preset by the living body detection device, and the detection is determined based on the time interval between the first to-be-detected image and the current i-th to-be-detected image.
  • the living body detection device may compare the detection duration with a preset duration threshold, and then judge whether the initial detection condition is currently satisfied based on the comparison result.
  • the initial detection condition may further include an image repetition condition preset by the living body detection device, and the living body detection device determines the image repetition condition based on the time interval from the first to-be-detected image to the current i-th to-be-detected image.
  • the image repetition judgment can also be performed based on the image repetition condition, that is, the similarity between the current i-th image to be inspected and the historical multi-frame images to be inspected so far is compared, and then combined with the comparison result of the detection time length and The image similarity comparison result judges whether the current initial detection condition is satisfied.
  • FIG. 5 is a fourth schematic diagram of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • the living body detection device is in the process between the first to-be-checked image to the i-th to-be-checked image.
  • the method for judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter may include the following steps:
  • the living body detection device determines the detection duration from the start of detection to the present, that is, the time interval from the first image to be inspected to the i-th image to be inspected is less than or equal to the preset detection duration threshold, it indicates that the current If the detection timeout does not occur, the living body detection device can continue to perform repeated judgment of the image to be inspected.
  • the preset duration threshold is 10s
  • the time interval between the first image to be inspected and the current i-th image to be inspected is 9s
  • the time interval is less than the preset duration threshold, indicating that there is currently no detection timeout.
  • the detection object may be a legal living organism, there is a difference between the adjacent images to be inspected selected according to the time interval. Repeat the same.
  • the living body detection device may associate and store the historical images to be inspected and the corresponding detection results.
  • the storage may be performed according to the chronological order and the preset storage amount. For example, the first 10 frames of images to be inspected and their corresponding historical inspection results can be stored.
  • the living body detection device can read multiple frames of pre-stored historical images to be inspected, such as the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected. image, and compare the similarity between the current i-th image to be inspected and the k historical images to be inspected, if the obtained comparison result is that the i-th image to be inspected and at least one image to be inspected in the k historical If the same, it indicates that the detection object has dynamic changes and may be a legitimate living body. At this time, it is determined that the i-th image to be inspected satisfies the initial detection conditions.
  • the living body detection device determines that the current image to be inspected is not the same as 3 frames of images in the previous 5 frames of images to be inspected in history , that is, there is a dynamic change in the detection object, indicating that the current image to be inspected is not a duplicate image and meets the initial detection conditions.
  • FIG. 6 is a schematic diagram 5 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • the living body detection device is converting the first to-be-checked image to the i-th to-be-checked image.
  • the method for judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter may include the following steps:
  • the living body detection device determines the detection duration from the start of detection to the present, that is, the time interval from the first to-be-detected image to the i-th to-be-detected image is greater than the preset detection duration threshold, it indicates that a detection timeout currently occurs happening.
  • the preset duration threshold is 10s
  • the time interval between the first image to be inspected and the current i-th image to be inspected is 12s, the time interval is greater than the preset duration threshold, indicating that the current detection is overtime.
  • the living body detection device may generate a first prompt message of the detection timeout, and display the prompt message.
  • the living body detection device can also generate a prompt message of the detection timeout, and at the same time terminate the current living body detection process. For example, after the liveness detection is triggered by clicking the H5 jump link for bank account opening attached to the SMS content, if it is determined that the detection times out, the mobile phone can jump back to the initial SMS content interface, and the user can click the H5 jump link again. Trigger the next liveness detection.
  • the living body detection device does not need to wait for the subsequent live body detection result to fail before reminding the user, but sends a prompt message to the user in a timely manner through the display interface of the device in the case of a detection timeout, which improves the detection efficiency.
  • FIG. 7 is a schematic diagram 6 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • the method when the time parameter of the living body detection device is less than or equal to the preset duration threshold , after reading the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, that is, after S103b1, the method further includes the following steps:
  • the living body detection device uses the similarity comparison between the i-th image to be inspected and the k historical images to be inspected to realize the repeated judgment of the image to be inspected, the comparison result is the i-th image to be inspected.
  • the image to be inspected is the same as the k historical images to be inspected, it indicates that there is no dynamic change in the detected object, and it cannot be a legitimate living body.
  • the living body detection device determines that the current image to be inspected is the same as the previous five frames of images to be inspected, it indicates that the current image to be inspected belongs to Repeated image, does not meet the initial detection conditions.
  • the living body detection device may generate a second prompt message for detection retry, and display the prompt message.
  • the multiple images to be checked are repeated. If it is determined that the initial detection conditions are not met, a prompt message for detection retry can be generated, and the user can adjust the detection object in time to place the real face within the range captured by the camera.
  • the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the device display interface in a timely manner when it is determined that the image is repeated, which improves the detection efficiency.
  • the live detection device determines that the detection has not timed out and the image to be inspected is not repeated, in order to avoid the problem that the detection object is not a human face when the image to be inspected is directly detected, the living body detection The device can continue to perform face detection processing on the i-th image to be checked.
  • the liveness detection device may integrate a face detection network.
  • the i-th image to be inspected can be input into the face detection network to determine whether there is a person in the image to be inspected based on some characteristics of the face (such as the position of the face, the pose of the face, and the size of the face, etc.) through the algorithm network.
  • the face is judged, and then the face detection result is obtained.
  • the living body detection device obtains the face detection result through the face detection network
  • the living body detection device may analyze the image parameters of the i-th image to be inspected to determine whether the image to be inspected meets the quality requirements.
  • the image parameter refers to a parameter pre-defined by the living body detection device and used to characterize the image quality, including at least one of light, occlusion, sharpness, and angle of the image.
  • the light of the image can be the light of the environment where the face is located
  • the occlusion degree can be the occlusion degree of the face
  • the clarity can be the clarity of the face
  • the angle can be the face relative to the camera collection direction deflection angle.
  • the living body detection device can perform quality detection processing on the light of the environment where the face is located in the image to be inspected, the clarity of the face, the degree of occlusion, and the deflection angle, and then obtain the quality scoring results of each parameter, and perform weighted calculation on each scoring result. And operation processing, the quality detection value of the image to be inspected can be obtained.
  • the quality detection value is greater than or equal to the preset quality threshold, determine that the i-th image to be inspected satisfies the preset quality condition.
  • the preset quality threshold may be the quality threshold of the whole face that meets the quality condition pre-defined by the living body detection device, where the quality threshold may be the light threshold of the environment where the face is located, the degree of occlusion of the face Threshold after weighted summation of threshold, face sharpness threshold, and face deflection angle threshold.
  • the living body detection device can compare the light of the environment where the face is located with the preset light threshold, and obtain a score representing the light according to the difference between the two; compare the occlusion degree of the face with the preset occlusion degree threshold , obtain a score representing the degree of occlusion according to the degree of difference between the two; compare the sharpness of the face with the preset sharpness threshold, and obtain a score representing the sharpness according to the degree of difference between the two; The deflection angle is compared with the preset deflection angle threshold, and a score representing the degree of occlusion is obtained according to the difference between the two.
  • the weighted sum operation is performed on the above scores to obtain the quality detection value of the i-th image to be inspected.
  • the living body detection device compares the quality detection value obtained after the weighted summation with a preset quality threshold, and when it is determined that the quality detection value obtained by the weighted summation is greater than or equal to the preset quality threshold, the first i The image to be inspected meets the preset quality conditions.
  • the quality judgment processing is performed on the image, so as to perform the living body detection on the to-be-detected image that meets the preset quality condition, which effectively ensures the quality of the data in the detection process and improves the performance of the detection process. detection efficiency.
  • FIG. 8 is a schematic diagram 7 of the implementation flow of the living body detection method provided by the embodiments of the present disclosure. As shown in FIG. The image to be inspected is subjected to face detection processing, and after the face detection result is obtained, that is, after S104, the method further includes the following steps:
  • the living body detection device determines that the face detection result of the i-th image to be checked is that there is no face Features, that is, when the current detection object is not a human face, the living body detection device can read the face detection results of the historical multi-frame images to be inspected, such as the n corresponding to the (i-n)th to (i-1)th images to be inspected. The historical face detection results, and then the accuracy of the face detection results is determined according to the n historical face detection results.
  • the living body detection device can generate a human face.
  • the third prompt message of the face detection failure is displayed, and the prompt message is displayed.
  • n 10
  • the living body detection device determines that there are no facial features in the current image to be inspected and the previous 10 frames of images to be inspected, then the detected object may not be a human face, and it will prompt that no face has been detected. .
  • the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the display interface of the device in a timely manner when the face detection fails, which improves the detection efficiency.
  • FIG. 9 is a schematic diagram 8 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure.
  • the living body detection device is performing quality inspection according to the image parameters corresponding to the ith image to be checked
  • the method further includes the following steps:
  • the quality detection value is less than the preset quality threshold, read the m historical quality detection values corresponding to the (i-m)th to (i-1)th images to be checked in the history; wherein, m is an integer greater than 1 and less than i ;
  • the living body detection device determines that the quality detection value of the i-th image to be inspected is less than the quality threshold, that is, the i-th image to be inspected does not meet the preset quality conditions, in order to improve the accuracy of quality detection, the living body The detection device can read the quality detection values of the historical multi-frame images to be inspected, such as the m historical quality detection values corresponding to the (i-m)th to (i-1)th images to be inspected, and then combine the m historical quality detection values to determine The accuracy of the quality judgment results.
  • the living body detection device generates a fourth prompt message of quality detection failure to remind the user to timely Adjust the current shooting posture.
  • the living body detection device determines that the quality detection value of the current image to be inspected and the quality inspection value of the previous 5 frames of images to be inspected are both less than the threshold, indicating that the data quality of the image to be inspected is poor, then the quality inspection is prompted. fail.
  • the user when the user receives a notification message that the quality detection failed to be generated by the living body detection device, he can adjust the current shooting posture, including adjusting the shooting light; adjust the degree of face occlusion, such as removing obstacles such as eyes; For example, bring the face close to the camera; adjust the shooting angle, such as facing the camera, so that the living body detection device can collect images for subsequent living body detection after adjusting the posture.
  • the current shooting posture including adjusting the shooting light; adjust the degree of face occlusion, such as removing obstacles such as eyes; For example, bring the face close to the camera; adjust the shooting angle, such as facing the camera, so that the living body detection device can collect images for subsequent living body detection after adjusting the posture.
  • the above-mentioned letters k, n, and m may be set to the same numerical value, or may be set to different numerical values respectively.
  • the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the display interface of the device in a timely manner when the quality detection fails, which improves the detection efficiency.
  • FIG. 10 is a schematic diagram 9 of the implementation flow of the living body detection method proposed in the embodiment of the present disclosure.
  • the method for obtaining target detection results includes the following steps:
  • S102a Determine the current living body detection result corresponding to the i-th image to be checked based on a preset living body detection network.
  • the living body detection device may determine the living body detection result corresponding to the i-th image to be checked by using the integrated living body detection network.
  • the living body detection device may input the i-th image to be inspected into the living body detection network, so as to analyze the image to be inspected based on the characteristics of the legitimate living body through the algorithm network to obtain a probability value for characterizing the living body.
  • the living body detection device may predefine a probability threshold, and the preset probability threshold may be used to characterize the probability threshold that the current detection object is a legitimate living body.
  • the living body detection device may compare the living body probability value obtained through the living body detection network with the preset legal living body probability threshold value, and then determine the living body detection result of the i-th image to be checked according to the comparison result.
  • the living body detection device can determine that the current detection object is a legal living body, that is, the living body detection result is the existence of a living body; when the living body probability value is less than the probability of a legal living body In the case of the threshold, the living body detection device determines that the current detection object is an illegal living body, which may be a face mask, or a video recorded and played in advance, that is, the living body detection result is that there is no living body.
  • the preset probability threshold may be used to represent the probability threshold that the currently detected object is an attack object.
  • the living body detection device may compare the living body probability value obtained through the living body detection network with the preset probability threshold of the attacking object, and then determine the living body detection result of the i-th image to be checked according to the comparison result.
  • the living body detection device may determine that the living body detection result is the existence of a living body, that is, the current detection object is a legitimate living body; when the living body probability value is greater than or equal to the preset In the case of the probability threshold of the attacking object, the living body detection device determines that the current detection object does not exist a living body, that is, the detection object is an illegal living body, which may be a face mask, or a video recorded and played in advance, that is, the living body detection result. for the absence of living organisms.
  • the living body detection device is pre-configured with a counting function module, such as a counter, for counting the living body detection results corresponding to the images to be checked, and then determining the target detection result according to the counting results.
  • a counting function module such as a counter
  • the target detection result does not refer to the in vivo detection result corresponding to the i-th image to be inspected, but the target detection result obtained by accumulating the in vivo detection results of multiple frames of images to be inspected.
  • the preset result threshold is the accumulated value when the living body exists in the living body detection result of the multi-frame images to be inspected that meets the living body verification pass condition pre-defined by the living body detection device.
  • the living body detection device determines that the living body detection result of the i-th image to be inspected is the presence of a living body
  • the living body detection device performs accumulation processing on the cases where the living body detection results of the multiple frames of images to be inspected are the presence of a living body through a counter, and obtains the existence of a living body.
  • the accumulated value of the detection result the living body detection device can compare the accumulated value with the preset result threshold, and then determine the target result according to the comparison result.
  • the living body detection device may determine that the target detection result is the verification pass.
  • the preset number threshold is 5, and in the case where the living body detection result of the current i-th image to be inspected is that there is a living body, the updated detection result is the cumulative value of the number of living bodies. If the updated cumulative value is greater than or equal to 5, then Indicates that the living body verification pass conditions are met, and the target detection result at this time is the living body verification pass.
  • the method further includes:
  • the living body detection device can timely feed back the status of the living body verification to the user, wherein a prompt message of the living body verification passing can be generated and displayed to the user.
  • FIG. 11 is a schematic diagram 11 of the implementation flow of the living body detection method proposed by the embodiment of the present disclosure.
  • the living body detection device performs the existence of living body counting processing, and after obtaining the counting result, that is, S102b After that, the method also includes the following steps:
  • the living body detection device may determine that the target detection result is the verification failure.
  • the preset number threshold is 5.
  • the updated detection result is the cumulative value of the number of living bodies. If the updated cumulative value is less than 5, it indicates that there is no living body.
  • the living body verification pass condition is met, and the target detection result is that the living body verification fails.
  • the method further includes;
  • the living body detection device can timely feed back to the user that the living body verification fails, wherein a prompt message for detection retry can be generated and displayed to the user.
  • the living body detection device can feed back a prompt message to the user after obtaining the living body detection result based on the multi-frame to-be-detected images, and does not need to wait for the completion of the living body video detection before feeding back the detection result, which improves the detection performance. efficiency.
  • FIG. 12 is a schematic diagram of an application scenario of the living body detection method proposed by the embodiment of the present disclosure.
  • the terminal includes a front-end module and a back-end module; among them, the front-end module is mainly responsible for calling the camera to collect video data, and cyclically extracts image frames from the collected video data according to time intervals through the frame acquisition module, and extracts image frames through the image compression module.
  • the image frame is preprocessed by the format of picture compression, and then the image to be inspected is obtained, and then the image to be inspected is transmitted to the back-end module.
  • the back-end module is mainly responsible for judging the quality of the images to be inspected through the quality detection module, including detection overtime judgment, image repetition judgment, face detection, face quality judgment, etc.
  • the module performs living body detection processing to determine whether the detection object is a legitimate living body.
  • a series of other detection processes can also be performed on the images to be inspected that meet the quality conditions through the replay attack detection module and the Track id detection module. , to achieve high-efficiency in vivo detection.
  • the living body detection solution proposed by the embodiments of the present disclosure mainly includes a front-end data acquisition module, a data transmission module, a back-end processing module, and a data processing module.
  • the data acquisition module is mainly used to call the camera based on http access to collect video data in the hijacking defense mode, and use Content-Security-Policy (CSP), anti-xss attack, code obfuscation, etc. Obtain the image to be inspected from the video data.
  • CSP Content-Security-Policy
  • the data transmission module is mainly used to transmit the acquired image to be inspected to the back-end processing module through the protocol/communication method of https encryption, digital watermarking and parameter encryption; the back-end processing module includes the application layer and the algorithm engine layer.
  • the application layer is mainly used to perform security verification processes such as gateway authentication, interface authentication, wipe monitoring, service isolation, log security, intrusion prevention, interface current limiting, code scanning, distributed storage, and framework security.
  • the inspection image is transmitted to the back-end algorithm engine layer;
  • the back-end algorithm engine layer is mainly used for Track id detection, living body detection and summary information algorithm (Message-Digest Algorithm 5, MD5) detection of the image to be inspected through the application layer;
  • MD5 Message-Digest Algorithm 5
  • the data can be stored in accordance with the storage requirements in the manner of privatization deployment, data desensitization, data permission, and data backup, thereby effectively ensuring the safe and efficient implementation of the living body detection scheme.
  • FIG. 13 is a schematic diagram of the execution flow of the living body detection method proposed by the embodiment of the present disclosure.
  • the method for performing living body detection by a living body detection device includes the following steps:
  • the current detection result is updated to be the cumulative value of the number of living bodies.
  • the living body detection device performs detection based on continuous images in the living body detection process. Compared with video living body detection, the network bandwidth is occupied less, and timely feedback of the detection results can be realized.
  • the quality inspection process is added before the inspection, which effectively ensures the data quality in the inspection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
  • FIG. 14 is a schematic diagram of the composition and structure of a living body detection device proposed in an embodiment of the present disclosure.
  • the living body detection device 10 includes an acquisition module 11 , a first a processing module 12, a determination module 13, a judgment module 14, a second processing module 15, a third processing module 16, a generating module 17 and a reading module 18,
  • the acquisition module 11 is configured to acquire the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1;
  • the first processing module 12 is configured to, in response to the i-th image to be inspected meeting a preset quality condition, perform in vivo detection processing on the i-th image to be inspected to obtain a target detection result.
  • the acquiring module 11 is configured to extract an initial image from the video data collected by the image sensor; and perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image; and The processed image is determined as the i-th image to be inspected.
  • the determining module 13 is configured to determine a time parameter corresponding to the i-th image to be inspected after acquiring the i-th image to be inspected from the video data collected from the image sensor.
  • the judging module 14 is configured to judge, according to the time parameter, whether the i-th image to be inspected satisfies the initial detection condition.
  • the second processing module 15 is configured to, if it is determined that the initial detection conditions are met, perform face detection processing on the i-th image to be checked through a preset face detection network to obtain a face Test results.
  • the third processing module 16 is configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be inspected, if the face detection result is that there is a face feature, to obtain a quality inspection value.
  • the determining module 13 is further configured to determine that the i-th image to be inspected satisfies the preset quality condition if the quality detection value is greater than or equal to a preset quality threshold.
  • the determining module 13 is configured to determine a time interval between the first image to be inspected and the i-th image to be inspected as the time parameter.
  • the judging module 14 is configured to read the k historical pending images corresponding to the (i-k)th to (i-1)th images to be inspected if the time parameter is less than or equal to a preset duration threshold. wherein, k is an integer greater than 1 and less than i; and if at least one of the k historical images to be inspected is different from the i-th image to be inspected, it is determined that the initial detection is satisfied condition.
  • the generating module 17 is configured to, after determining the time interval from the first image to be inspected to the i-th image to be inspected as the time parameter, if the time parameter is greater than the If the preset duration threshold is set, a first prompt message for detecting timeout is generated.
  • the generating module 17 is further configured to, after reading the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, if the k historical images to be inspected If the images are all the same as the i-th image to be inspected, a second prompt message for retrying the inspection is generated.
  • the reading module 18 is configured to perform face detection processing on the i-th image to be inspected through a preset face detection network to obtain a face detection result, if the face detection The result is that there is no face feature, then read the n historical face detection results corresponding to the (i-n)th to (i-1)th images to be checked; wherein, n is an integer greater than 1 and less than i.
  • the generating module 17 is further configured to generate a third prompt message that the face detection fails if the n historical face detection results are all without face features.
  • the reading module 18 is further configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be inspected to obtain a quality detection value, if the quality detection value is less than the predetermined value If the quality threshold is set, m historical quality detection values corresponding to the (i-m)th to (i-1)th historical images to be inspected are read; where m is an integer greater than 1 and less than i.
  • the generating module 17 is further configured to generate a fourth prompt message that the quality detection fails if the m historical quality detection values are all smaller than the preset quality threshold.
  • the first processing module 12 is configured to determine a current living body detection result corresponding to the i-th image to be checked based on a preset living body detection network; and if the current living body detection result is that there is a living body, then Counting of living bodies is performed to obtain a count result; if the count result is greater than or equal to a preset number threshold, it is determined that the target detection result is verified.
  • the first processing module 12 is further configured to input the i-th image to be inspected into the preset living body detection network to obtain a living body probability value; and if the living body probability value is greater than or equal to a predetermined value If a probability threshold is set, it is determined that the current living body detection result is the presence of a living body; and if the living body probability value is less than the preset probability threshold, it is determined that the current living body detection result is that there is no living body.
  • the first processing module 12 is further configured to, after performing the live body counting process and obtaining the counting result, if the counting result is less than a preset number threshold, determine that the target detection result is not verified. pass.
  • the generating module 17 is further configured to, after performing a living body detection process on the i-th image to be inspected and obtaining a target detection result, in response to the target detection result being that the verification is passed, generate a successful living body detection and in response to the target detection result being that the verification fails, generating a second prompt message for detection retry.
  • the image parameters include at least one of light, occlusion, sharpness, and angle.
  • FIG. 15 is a schematic diagram of the composition structure of the living body detection device proposed by the embodiment of the present disclosure.
  • the living body detection device 20 proposed by the embodiment of the present disclosure may further include a processor 21 , a memory 22 storing executable instructions of the processor 21 , further, the living body detection device 20 may further include a communication interface 23 , and a bus 24 for connecting the processor 21 , the memory 22 and the communication interface 23 .
  • the above-mentioned processor 21 may be an application specific integrated circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD) ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field Prog RAMmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor at least one of them.
  • ASIC application specific integrated circuit
  • DSP Digital Signal Processor
  • DSPD digital signal processing device
  • PLD Programmable Logic Device
  • Field Programmable Gate Array Field Prog RAMmable Gate Array
  • FPGA Field Prog RAMmable Gate Array
  • CPU Central Processing Unit
  • controller microcontroller, microprocessor at least one of them.
  • the living body detection device 20 may also include a memory 22, which may be connected to the processor 21, wherein the memory 22 is used to store executable program codes, which include computer operating instructions, and the memory 22 may include high-speed RAM memory, or may Also included is non-volatile memory, eg, at least two disk drives.
  • the bus 24 is used to connect the communication interface 23 , the processor 21 and the memory 22 and the mutual communication among these devices.
  • the memory 22 is used to store instructions and data.
  • the above-mentioned processor 21 is configured to obtain the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1; in response to the i-th image to be inspected If the image satisfies the preset quality condition, the i-th image to be inspected is subjected to in vivo detection processing to obtain a target detection result.
  • the above-mentioned memory 22 may be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and send it to the processor 15 Provide instructions and data.
  • volatile memory such as a random access memory (Random-Access Memory, RAM)
  • non-volatile memory such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and send it to the processor 15 Provide instructions and data.
  • each functional module in this embodiment may be integrated into one, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
  • the integrated unit is implemented in the form of software function modules and is not sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this embodiment is essentially or correct. Part of the contribution made by the prior art or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.
  • An embodiment of the present disclosure provides a living body detection device, which can first obtain an i-th image to be inspected from video data collected by an image sensor; The i-th image to be inspected is subjected to live detection processing to obtain a target detection result.
  • the detection process is based on continuous images in the process of living body detection.
  • the network bandwidth is less occupied, and timely feedback of the detection results can be realized, and the quality detection process is added before the subsequent living body detection, which effectively ensures the detection. data quality in the process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
  • An embodiment of the present disclosure provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, implements the above-mentioned method for detecting a living body.
  • a program instruction corresponding to a living body detection method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • a storage medium such as an optical disk, a hard disk, a U disk, etc.
  • a living body detection process is performed on the i-th image to be inspected to obtain a target detection result.
  • an embodiment of the present disclosure further provides a computer program product, wherein the computer program product includes computer-executable instructions, and the computer-executable instructions are used to implement the steps in the living body detection method provided by the embodiment of the present disclosure.
  • embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
  • These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions
  • An apparatus implements the functions specified in a flow or flows of the implementation flow diagram and/or a block or blocks of the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the implementing flow diagram and/or the block or blocks of the block diagram.
  • the i-th image to be inspected is determined from the video data collected by the image sensor; in response to the i-th image to be inspected meeting a preset quality condition, a living body detection process is performed on the i-th image to be inspected to obtain a target detection result .
  • High-efficiency in vivo detection is achieved.

Abstract

The present disclosure relates to a living body detection method and apparatus, and a device and a computer storage medium. The living body detection method comprises: determining an ith image under test from video data collected by an image sensor; and in response to the ith image under test satisfying a preset quality condition, performing living body detection processing on the ith image under test to obtain a target detection result. By means of the present disclosure, high-efficiency living body detection is realized.

Description

活体检测方法及装置、设备、计算机存储介质Living body detection method and device, equipment, computer storage medium
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202110346603.7、申请日为2021年03月31日、申请名称为“活体检测方法及装置、设备、计算机存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on the Chinese patent application with the application number of 202110346603.7, the application date of March 31, 2021, and the application title of "living detection method and device, equipment, computer storage medium", and claims the priority of the Chinese patent application, The entire contents of this Chinese patent application are hereby incorporated by reference into the present disclosure.
技术领域technical field
本公开涉及活体检测技术领域,尤其涉及一种活体检测方法及装置、设备、计算机存储介质。The present disclosure relates to the technical field of living body detection, and in particular, to a living body detection method, apparatus, device, and computer storage medium.
背景技术Background technique
随着人脸识别技术的快速发展,人脸识别系统越来越多的应用于安防。“刷脸”作为人脸识别技术中至关重要的一项,以其操作方便、快捷性以及图像真伪的高辨别度在整个人脸识别系统的安全性方面占据重要地位。如刷脸签到、刷脸支付、刷脸解锁以及刷脸认证等。With the rapid development of face recognition technology, more and more face recognition systems are used in security. As a crucial item in face recognition technology, "face brushing" occupies an important position in the security of the entire face recognition system due to its convenient operation, rapidity and high discrimination of image authenticity. Such as face check-in, face payment, face unlock and face authentication.
由于攻击者经常使用静态照片、人脸模型或者人脸面具等方式进行安全侵入攻击,因此,“刷脸”过程中,系统首先需要进行活体检测,即需要先确认验证者是否为一个合法的生物活体,是否为有生命的、在现场的、真实的人。Since attackers often use static photos, face models, or face masks to conduct security intrusion attacks, the system first needs to perform liveness detection during the "face brushing" process, that is, it needs to confirm whether the verifier is a legitimate creature. Living body, whether it is a living, on-site, real person.
然而,相关技术在进行活体检测时,普遍存在网络带宽占用较大、检测周期较长的问题,使得检测效率较低。However, the related art generally has the problems of large network bandwidth occupation and long detection period when performing liveness detection, resulting in low detection efficiency.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供一种活体检测方法及装置、设备、计算机存储介质。Embodiments of the present disclosure provide a method, apparatus, device, and computer storage medium for detecting a living body.
本公开的技术方案是这样实现的:The technical solution of the present disclosure is realized as follows:
本公开实施例提供一种活体检测方法,包括:Embodiments of the present disclosure provide a method for detecting a living body, including:
从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数;响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。Obtain the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1; in response to the i-th image to be inspected meeting a preset quality condition, perform live detection on the i-th image to be inspected process to obtain the target detection result.
上述方法中,所述从图像传感器采集的视频数据中获取第i待检图像,包括;从所述图像传感器采集的视频数据中提取初始图像;根据预设配置参数对所述初始图像进行格式预处理,获得处理后图像;将所述处理后图像确定为所述第i待检图像。In the above method, the acquiring the i-th image to be inspected from the video data collected by the image sensor includes: extracting an initial image from the video data collected by the image sensor; pre-formatting the initial image according to preset configuration parameters. processing to obtain a processed image; and determining the processed image as the i-th image to be inspected.
本公开实施例提供一种活体检测装置,包括获取模块以及第一处理模块,An embodiment of the present disclosure provides a device for detecting a living body, including an acquisition module and a first processing module,
所述获取模块,配置为从图像传感器采集的视频数据中获取第i待检图像;其中,所述i为大于1的整数;The acquisition module is configured to acquire the i-th image to be inspected from the video data collected by the image sensor; wherein, the i is an integer greater than 1;
所述第一处理模块,配置为响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。The first processing module is configured to, in response to the i-th image to be inspected meeting a preset quality condition, perform in vivo detection processing on the i-th image to be inspected to obtain a target detection result.
本公开实施例提供一种活体检测设备,包括:处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如上所述的活体检测方法。An embodiment of the present disclosure provides a living body detection device, including: a processor and a memory storing instructions executable by the processor, and when the instructions are executed by the processor, the above-mentioned living body detection method is implemented.
本公开实施例提供一种计算机可读存储介质,存储有程序,所述程序被处理器执行时,实现如上所述的活体检测方法。An embodiment of the present disclosure provides a computer-readable storage medium storing a program, and when the program is executed by a processor, the above-mentioned method for detecting a living body is implemented.
本公开实施例提供一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行,被所述电子设备中的处理器执行的情况下,实现如上所述的活体检测方法。An embodiment of the present disclosure provides a computer program, including computer-readable codes, and when the computer-readable codes are executed in an electronic device and executed by a processor in the electronic device, the above-mentioned living body detection is realized method.
本公开实施例提供的技术方案,活体检测设备先从图像传感器采集的视频数据中获取第i待检图像;然后响应于该第i待检图像满足预设质量条件,对该第i待检图像进行活体检测处理,以获得目标检测结果。如此,在活体检测过程中是基于连续图像进行检测的,相较于视频活体检测,网络带宽占用小,可实现检测结果的及时反馈,并且在后续活体检测之前添加质量检测过程,有效保证了检测过程中的数据质量。可见,本公开实施例提出的活体检测方案有效解决了网络带宽占用大以及检测周期长的问题,实现了高效率的活体检测。According to the technical solution provided by the embodiments of the present disclosure, the living body detection device first obtains the i-th image to be inspected from the video data collected by the image sensor; and then responds that the i-th image to be inspected meets the preset quality condition, Liveness detection processing is performed to obtain target detection results. In this way, the detection process is based on continuous images in the process of living body detection. Compared with video living body detection, the network bandwidth is less occupied, and timely feedback of the detection results can be realized, and the quality detection process is added before the subsequent living body detection, which effectively ensures the detection. data quality in the process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
附图说明Description of drawings
图1为相关技术中活体检测方法的架构示意图;FIG. 1 is a schematic diagram of the structure of a living body detection method in the related art;
图2为本公开实施例提出的活体检测方法的实现流程示意图一;FIG. 2 is a schematic diagram 1 of the implementation flow of the live detection method proposed by the embodiment of the present disclosure;
图3为本公开实施例提供的活体检测方法的实现流程示意图二;FIG. 3 is a schematic diagram 2 of the implementation flow of the method for detecting a living body provided in an embodiment of the present disclosure;
图4为本公开实施例提出的活体检测方法的实现流程示意图三;FIG. 4 is a schematic diagram 3 of the implementation flow of the method for detecting a living body proposed by an embodiment of the present disclosure;
图5为本公开实施例提供的活体检测方法的实现流程示意图四;FIG. 5 is a fourth schematic diagram of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure;
图6为本公开实施例提供的活体检测方法的实现流程示意图五;FIG. 6 is a schematic diagram 5 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure;
图7为本公开实施例提供的活体检测方法的实现流程示意图六;FIG. 7 is a sixth schematic diagram of the implementation process of the living body detection method provided by the embodiment of the present disclosure;
图8为本公开实施例提供的活体检测方法的实现流程示意图七;FIG. 8 is a schematic diagram 7 of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure;
图9为本公开实施例提供的活体检测方法的实现流程示意图八;FIG. 9 is a schematic diagram 8 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure;
图10为本公开实施例提供的活体检测方法的实现流程示意图九;FIG. 10 is a schematic diagram 9 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure;
图11为本公开实施例提供的活体检测方法的实现流程示意图十;FIG. 11 is a schematic diagram ten of the implementation flow of the method for detecting a living body provided by an embodiment of the present disclosure;
图12为本公开实施例提出的活体检测方法的应用场景示意图;FIG. 12 is a schematic diagram of an application scenario of the living body detection method proposed by the embodiment of the present disclosure;
图13为本公开实施例提出的活体检测方法的执行流程示意图;FIG. 13 is a schematic diagram of the execution flow of the live detection method proposed by the embodiment of the present disclosure;
图14为本公开实施例提出的活体检测装置的组成结构示意图;FIG. 14 is a schematic diagram of the composition and structure of a living body detection device proposed by an embodiment of the present disclosure;
图15为本公开实施例提出的活体检测设备的组成结构示意图。FIG. 15 is a schematic diagram of the composition and structure of a living body detection device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开作进一步地详细描述,所描述的实施例不应视为对本公开的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present disclosure, and those skilled in the art will not All other embodiments obtained under the premise of creative work fall within the protection scope of the present disclosure.
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same or a different subset of all possible embodiments, and Can be combined with each other without conflict.
在以下的描述中,所涉及的术语“第一\第二\第三”仅仅是是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本公开实施例能够以除了在这里图示或描述的以外的顺序实施。In the following description, the term "first\second\third" is only used to distinguish similar objects, and does not represent a specific ordering of objects. It is understood that "first\second\third" Where permitted, the specific order or sequence may be interchanged to enable the embodiments of the disclosure described herein to be practiced in sequences other than those illustrated or described herein.
除非另有定义,本文所使用的所有的技术和科学术语与属于本公开的技术领域的技术人员通常理解的含义相同。本文中所使用的术语只是为了描述本公开实施例的目的,不是旨在限制本公开。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing the embodiments of the present disclosure only and is not intended to limit the present disclosure.
目前,“刷脸”作为人脸识别技术中至关重要的一项,以其操作方便、快捷性以及图像真伪的高辨别度在整个人脸识别系统的安全性方面占据重要地位。如刷脸签到、刷脸支付、刷脸解锁以及刷脸认证等。At present, "face brushing", as a crucial item in face recognition technology, occupies an important position in the security of the entire face recognition system due to its convenient operation, rapidity and high discrimination of image authenticity. Such as face check-in, face payment, face unlock and face authentication.
当用户使用在浏览器上运行各种超文本(HyperText Markup Language 5,H5)页面时,需要身份认证,例如通过人脸识别进行身份认证。由于在人脸识别时,经常存在攻击者使用静态照片、人脸模型或者人脸面具等方式进行安全侵入攻击,因此,“刷脸”过程中,系统首先需要进行活体检测,即需要先确认验证者是否为一个合法的生物活体,是否为有生命的、在现场的、真实的人。When users use various hypertext (HyperText Markup Language 5, H5) pages to run on the browser, identity authentication is required, such as identity authentication through face recognition. In face recognition, attackers often use static photos, face models or face masks to conduct security intrusion attacks. Therefore, in the process of "swiping face", the system first needs to perform live detection, that is, it needs to confirm the verification first. Whether the person is a legitimate living organism, whether it is a living, on-site, real person.
然而,相关技术在进行活体检测时,普遍方式为系统前端调用摄像头进行视频采集并传输至后端,随之后端接收视频并进行活体检测,且在视频检测完成后再反馈结果至前端。例如,图1为相关技术中活体检测方法的架构示意图,如图1所示,系统前端通过调用摄像头进行视频数据采集,然后将采集的视频数据传输至后端,后端利用活体检测模块、基于相关算法对接收到的视频数据进行活体检测,获得检测结果之后,将活体检测结果反馈至前端。However, when performing live detection in the related art, a common method is that the front end of the system calls a camera to capture video and transmit it to the back end, then the back end receives the video and performs live body detection, and after the video detection is completed, the result is fed back to the front end. For example, Figure 1 is a schematic diagram of the architecture of a living body detection method in the related art. As shown in Figure 1, the front end of the system collects video data by calling a camera, and then transmits the collected video data to the back end. The back end uses a living body detection module, based on The relevant algorithm performs live detection on the received video data, and after obtaining the detection result, the living body detection result is fed back to the front end.
可以理解的是,相关技术中的活体检测方案存在以下缺陷:第一方面采用视频数据,由于视频数据一般在5至20M之间,因此存在网络带宽占用较大的问题;第二方面后端对视频数据进行静默活体视频检测后才可以反馈检测结果,时长一般在3至5秒左右,检测周期较长;第三方面检测过程中的数据质量无法保证,可能会影响整个检测周期时长。It can be understood that the living body detection scheme in the related art has the following defects: firstly, video data is used. Since the video data is generally between 5 and 20M, there is a problem that the network bandwidth is occupied; secondly, the back-end The detection results can be fed back only after the video data is subjected to silent live video detection. The duration is generally about 3 to 5 seconds, and the detection period is relatively long. In the third aspect, the data quality during the detection process cannot be guaranteed, which may affect the duration of the entire detection period.
综上所述,相关技术中的活体视频检测普遍存在网络带宽占用较大、检测周期较长的问题,使得检测效率较低。鉴于此,如何实现高效率的活体检测,为本公开实施例所要讨论的内容,下面将结合以下具体实施例进行阐述。To sum up, the living video detection in the related art generally has the problems of large network bandwidth occupation and long detection period, resulting in low detection efficiency. In view of this, the content to be discussed in the embodiments of the present disclosure how to achieve high-efficiency detection of living bodies will be described below with reference to the following specific embodiments.
本公开实施例提供一种活体检测方法及装置、设备、计算机存储介质,在活体检测过程中是基于连续图像进行检测的,相较于视频活体检测,网络带宽占用小,可实现检测结果的及时反馈,并且在后续活体检测之前添加质量检测过程,有效保证了检测过程中的数据质量。可见,本公开实施例提出的活体 检测方案有效解决了网络带宽占用大以及检测周期长的问题,实现了高效率的活体检测。Embodiments of the present disclosure provide a method, device, device, and computer storage medium for living body detection. In the living body detection process, detection is performed based on continuous images. Compared with video living body detection, the network bandwidth is occupied less, and the detection result can be timely. Feedback, and adding a quality detection process before subsequent live detection, effectively guarantees the data quality in the detection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
本公开实施例提供的活体检测方法应用于活体检测设备中。下面说明本公开实施例提供的活体检测设备的示例性应用,本公开实施例提供的活体检测设备可以实施为手机、笔记本电脑,平板电脑,台式计算机,智能电视、车载设备、可穿戴设备、工业设备等。The living body detection method provided by the embodiments of the present disclosure is applied to a living body detection device. Exemplary applications of the liveness detection device provided by the embodiments of the present disclosure are described below. The liveness detection device provided by the embodiments of the present disclosure can be implemented as mobile phones, notebook computers, tablet computers, desktop computers, smart TVs, in-vehicle devices, wearable devices, industrial equipment, etc.
下面,将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述。Below, the technical solutions in the embodiments of the present disclosure will be clearly and completely described with reference to the accompanying drawings in the embodiments of the present disclosure.
本公开一实施例提供了一种活体检测方法,图2为本公开实施例提出的活体检测方法的实现流程示意图一,如图2所示,在本公开的实施例中,活体检测设备执行活体检测的方法可以包括以下步骤:An embodiment of the present disclosure provides a method for detecting a living body. FIG. 2 is a schematic diagram 1 of the implementation flow of the method for detecting a living body proposed in an embodiment of the present disclosure. As shown in FIG. 2 , in the embodiment of the present disclosure, a living body detection device executes The method of detection may include the following steps:
S101、从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数。S101. Acquire an i-th image to be inspected from video data collected by an image sensor; wherein, i is an integer greater than 1.
在本公开实施例中,活体检测设备可以先从图像传感器采集的视频数据中获取第i待检图像。In the embodiment of the present disclosure, the living body detection device may first acquire the i-th image to be inspected from the video data collected by the image sensor.
在一些实施例中,图像传感器为活体检测设备上配置的图像采集装置,即摄像头。例如,在活体检测设备为智能手机的情况下,该智能手机包括前置摄像头和后置摄像头,图像传感器可以为其中的前置摄像头;在活体检测设备为笔记本电脑的情况下,图像传感器为该电脑的前置摄像头。In some embodiments, the image sensor is an image acquisition device, that is, a camera, configured on the living body detection device. For example, in the case where the living body detection device is a smartphone, the smartphone includes a front camera and a rear camera, and the image sensor can be the front camera; when the living body detection device is a laptop, the image sensor is the The front camera of the computer.
相应的,视频数据为活体检测设备利用上述图像传感器采集到的检测对象的视频流。Correspondingly, the video data is the video stream of the detection object collected by the living body detection device using the above-mentioned image sensor.
在一些实施例中,活体检测设备可以基于用户的触摸操作触发摄像头的开启,进而通过该摄像头实时进行视频数据的采集。In some embodiments, the living body detection device may trigger the activation of the camera based on the user's touch operation, and then collect video data in real time through the camera.
例如,手机进行银行开户时的身份核验过程。这里手机可以接收到银行通过统一的短信营销工具发送给客户开户的短信信息提醒,手机中用于展示该短信信息内容的页面即为一H5页面,该短信内容上附有针对开户的能够跳转至银行官网的外部链接,即H5跳转外链,用户针对该外链进行点击操作之后,手机检测到用户输入的触发操作,控制摄像头开启并实时进行图像数据采集,获得视频流。For example, the identity verification process when opening a bank account on a mobile phone. Here, the mobile phone can receive the SMS reminder sent by the bank to the customer to open an account through the unified SMS marketing tool. The page on the mobile phone used to display the content of the SMS message is an H5 page. The external link to the bank's official website, that is, H5 jumps to the external link. After the user clicks on the external link, the mobile phone detects the trigger operation input by the user, controls the camera to turn on and collects image data in real time, and obtains the video stream.
在一些实施例中,待检图像指待检的图片帧。这里,活体检测设备可以从采集获得的视频流中进行图片帧的选取;其中,活体检测设备可以按照预设时间间隔进行图片帧的选取。其中,第i待检图像指当前活体检测时,第i次从视频流中选取的图片帧。In some embodiments, the image to be inspected refers to a picture frame to be inspected. Here, the living body detection device may select a picture frame from the video stream obtained by collection; wherein, the living body detection device may select a picture frame according to a preset time interval. Wherein, the i-th image to be inspected refers to the picture frame selected from the video stream for the i-th time during the current live detection.
例如,活体检测设备设置定时器,该定时器的定时时长为100ms,活体检测设备每100ms从摄像头采集获得的视频流中提取一帧图片帧作为待检图像。For example, the living body detection device sets a timer, the timer duration is 100ms, and the living body detection device extracts a picture frame from the video stream collected by the camera every 100ms as the image to be checked.
可见,活体检测设备不再是针对检测对象进行视频数据的活体检测,而是从视频数据中按照时间间隔选取待检图像,进而基于待检图像进行活体检测,减少了网络带宽的占用。It can be seen that the living body detection device no longer performs live body detection on the video data for the detection object, but selects images to be inspected from the video data according to time intervals, and then performs live body detection based on the images to be inspected, which reduces the occupation of network bandwidth.
S102、响应于第i待检图像满足预设质量条件,对第i待检图像进行活体检测处理,获得目标检测结果。S102. In response to the i-th image to be inspected meeting a preset quality condition, perform a living body detection process on the i-th image to be inspected to obtain a target detection result.
在本公开的实施例中,活体检测设备在从图像传感器采集的视频数据中选取到第i待检图像之后,活体检测设备可以在确定该第i待检图像满足预设质量条件的情况下,对第i待检图像进行活体检测。In the embodiment of the present disclosure, after the living body detection device selects the i-th image to be inspected from the video data collected by the image sensor, the living body detection device may determine that the i-th image to be inspected satisfies the preset quality condition, Liveness detection is performed on the i-th image to be inspected.
在一些实施例中,预设质量条件指活体检测设备预先设置的针对待检图像的质量需求,如检测对象需求、人脸质量需求等。In some embodiments, the preset quality condition refers to a quality requirement for an image to be inspected that is preset by the living body detection device, such as a requirement for a detection object, a requirement for the quality of a human face, and the like.
这里,在选取出第i待检图像之后,活体检测设备可以先对该待检图像进行基于质量需求的初步筛选,以确定出质量达标的待检图像。Here, after selecting the ith image to be inspected, the living body detection device may first perform a preliminary screening based on quality requirements on the image to be inspected, so as to determine an image to be inspected whose quality meets the standard.
其中,活体检测设备可以先确定第i待检图像对应的时间参数,并基于该时间参数对待检图像是否满足初始检测条件进行判断;在确定满足初始检测条件的情况下,活体检测设备可以继续针对待检图像进行人脸检测,并在人脸检测结果为存在人脸特征的情况下,根据待检图像的图像参数确定图像的质量检测值,进而基于质量检测值对第i待检图像是否满足预设质量条件进行判断。进而在确定待检图像满足预设质量条件的情况下进行活体检测处理,进而得到检测结果。Wherein, the living body detection device can first determine the time parameter corresponding to the i-th image to be inspected, and judge whether the image to be inspected satisfies the initial detection condition based on the time parameter; if it is determined that the initial detection condition is met, the living body detection device can continue to target The image to be inspected is subjected to face detection, and in the case that the face detection result is that there are facial features, the quality detection value of the image is determined according to the image parameters of the image to be inspected, and then based on the quality detection value, the image to be inspected is determined whether the i-th image meets the requirements. Preset quality conditions for judgment. Further, in the case of determining that the image to be inspected satisfies the preset quality condition, a living body detection process is performed, and a detection result is obtained.
其中,活体检测处理指对第i待检图像中是否存在合法的生命活体进行检测。此处合法的生命活体指自然环境下的,具有真实生命特征的个体,而非照片或者视频等非生命特征的物质。The living body detection processing refers to detecting whether there is a legitimate living body in the i-th image to be checked. The legal living body here refers to an individual with real life characteristics in the natural environment, rather than non-living characteristics such as photos or videos.
在一些实施例中,活体检测设备可以集成活体检测网络,在确定第i待检图像满足预设质量条件的情况下,调用活体检测网络对第i待检图像中是否存在合法的生命活体进行判断,以获得第i待检图像的活体检测结果。In some embodiments, the living body detection device may integrate a living body detection network, and in the case of determining that the i-th image to be inspected satisfies the preset quality conditions, call the living body detection network to judge whether there is a legitimate living body in the i-th image to be inspected , to obtain the liveness detection result of the i-th image to be inspected.
其中,第i待检图像的活体检测结果可能为存在活体;也可能为不存在活体。Wherein, the living body detection result of the i-th image to be inspected may be that there is a living body; it may also be that there is no living body.
在本公开实施例的一实施方式中,活体检测设备可以对每一个待检图像的活体检测结果进行存储,并对其中活体检测结果为存在活体的情况进行数量累计处理,获得数量累计值。当确定出第i待检图像的活体检测结果之后,活体检测结果可以基于其第i待检图像的活体检测结果更新当前数量累计值,进而基于更新后的累计值确定出上述目标检测结果。In one implementation of the embodiments of the present disclosure, the living body detection device may store the living body detection result of each image to be inspected, and perform a number accumulation process in the case where the living body detection result is the presence of a living body to obtain a number accumulated value. After the in vivo detection result of the i-th image to be inspected is determined, the in vivo detection result may update the current cumulative value based on the in vivo detection result of the i-th image to be inspected, and then determine the above-mentioned target detection result based on the updated cumulative value.
这里,目标检测结果可以为活体验证通过,也可以为活体验证不通过。Here, the target detection result may be that the in vivo verification is passed, or it may be that the in vivo verification is not passed.
由此可见,本公开实施例提供的活体检测方法,在活体检测过程中是基于连续图像进行检测的,相较于视频活体检测,网络带宽占用小,可实现检测结果的及时反馈,并且在后续活体检测之前添加质量 检测过程,有效保证了检测过程中的数据质量。可见,本公开实施例提出的活体检测方案有效解决了网络带宽占用大以及检测周期长的问题,实现了高效率的活体检测。It can be seen that the live detection method provided by the embodiments of the present disclosure performs detection based on continuous images during the live detection process. Compared with video live detection, the network bandwidth is occupied less, and timely feedback of the detection results can be realized. The quality detection process is added before the live detection, which effectively ensures the data quality in the detection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
需要说明的是,本公开实施例所指的各类网络均可采用神经网络来实现,可是由多个神经网络构成的模型,或是包括了多个子网络,在此不予限定。It should be noted that various types of networks referred to in the embodiments of the present disclosure can be implemented by using neural networks, but a model composed of multiple neural networks or including multiple sub-networks is not limited herein.
基于上述实施例,在本公开的再一实施例中,图3为本公开实施例提供的活体检测方法的实现流程示意图二,如图3所示,在本公开的实施例中,活体检测设备从图像传感器采集的视频数据中获取第i待检图像的方法可以包括以下步骤:Based on the above embodiment, in yet another embodiment of the present disclosure, FIG. 3 is a second schematic diagram of the implementation flow of the living body detection method provided by the embodiment of the present disclosure. As shown in FIG. 3 , in the embodiment of the present disclosure, the living body detection device The method for obtaining the i-th image to be inspected from the video data collected by the image sensor may include the following steps:
S101a、从图像传感器采集的视频数据中提取初始图像。S101a, extracting an initial image from video data collected by an image sensor.
S101b、根据预设配置参数对初始图像进行格式预处理,获得处理后图像。S101b. Perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image.
S101c、将处理后图像确定为第i待检图像。S101c, determining the processed image as the i-th image to be inspected.
在本公开实施例中,活体检测设备在进行待检图像的选取过程中,可以是从经过格式预处理后的图像中选取待检图像。In this embodiment of the present disclosure, in the process of selecting an image to be inspected, the living body detection device may select an image to be inspected from images that have undergone format preprocessing.
在一些实施例中,由于进行活体检测时,输入活体检测网络的图像格式可能存在图像数据量和图像尺寸大小的特定需求,因此,活体检测设备可以先从采集的视频数据中按照时间间隔选取出初始图像,然后根据实际检测需求,对该初始图像进行格式的转换处理,从而将处理后的、符合检测需求的图像确定为待检图像。In some embodiments, since the image format input to the living body detection network may have specific requirements on the amount of image data and the size of the image when performing living body detection, the living body detection device may first select from the collected video data according to time intervals The initial image is then subjected to format conversion processing according to the actual detection requirements, so that the processed image that meets the detection requirements is determined as the image to be inspected.
例如,手机每100ms选取一个待检图像。其中,手机在第300ms即第三次从手机摄像头采集的视频流中选取到初始图像之后,可以对该初始图像进行尺寸大小的调整,以及对尺寸调整后的图像按照预设压缩比例进行压缩处理,从而将压缩后图像确定为第3待检图像。For example, the mobile phone selects an image to be inspected every 100ms. Among them, after the mobile phone selects the initial image from the video stream collected by the camera of the mobile phone for the third time at 300 ms, the initial image can be resized, and the resized image can be compressed according to the preset compression ratio. , so that the compressed image is determined as the third image to be inspected.
由此可见,本公开实施例提供的活体检测方法,活体检测设备首先从图像传感器采集的视频数据中选取出初始图像,然后进行格式预处理,将处理后获得的图像确定为第i待检图像。如此,在活体检测过程中可实现图像的自定义配置,满足检测需求。It can be seen that, in the living body detection method provided by the embodiment of the present disclosure, the living body detection device first selects an initial image from the video data collected by the image sensor, then performs format preprocessing, and determines the image obtained after processing as the i-th image to be inspected . In this way, the custom configuration of images can be realized in the process of living body detection to meet the detection requirements.
基于上述实施例,在本公开的再一实施例中,图4为本公开实施例提出的活体检测方法的实现流程示意图三,如图4所示,活体检测设备在从图像传感器采集的视频数据中获取第i待检图像之后,即步骤101之后,且响应于第i待检图像满足预设质量条件,对第i待检图像进行活体检测处理,获得目标检测结果之前,即步骤102之前,所述方法还包括以下步骤:Based on the above-mentioned embodiment, in yet another embodiment of the present disclosure, FIG. 4 is a schematic diagram 3 of the implementation flow of the living body detection method proposed by the embodiment of the present disclosure. As shown in FIG. After the i-th image to be inspected is acquired in , i.e. after step 101, and in response to the i-th image to be inspected meeting the preset quality condition, the in vivo detection process is performed on the i-th image to be inspected, and before the target detection result is obtained, that is, before step 102, The method also includes the following steps:
S103、确定第i待检图像对应的时间参数,并根据时间参数判断第i待检图像是否满足初始检测条件。S103: Determine a time parameter corresponding to the i-th image to be inspected, and determine whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter.
在本公开实施例中,为了避免活体检测周期过长,浪费设备功耗,活体检测设备可以设置满足检测要求的初始检测条件,进而基于该初始检测条件实现对检测是否超时、图像是否重复进行判断。In the embodiment of the present disclosure, in order to avoid the life detection period being too long and the power consumption of the device being wasted, the living body detection device can set an initial detection condition that meets the detection requirements, and then judge whether the detection times out and whether the image is repeated based on the initial detection condition. .
在一些实施例中,活体检测设备在得到第i待检图像之后,可以先确定待检图像对应的时间参数,并判断该时间参数是否满足初始检测条件。In some embodiments, after obtaining the i-th image to be inspected, the living body detection device may first determine a time parameter corresponding to the image to be inspected, and determine whether the time parameter satisfies the initial detection condition.
其中,时间参数指首张待检图像的时间戳与当前待检图像的时间戳的时间差值,即从检测开始至今的检测时长。这里时间参数可以为第一待检图像至第i待检图像之间的时间间隔。The time parameter refers to the time difference between the timestamp of the first image to be inspected and the timestamp of the current image to be inspected, that is, the detection duration from the start of detection to the present. Here, the time parameter may be the time interval between the first image to be inspected and the i-th image to be inspected.
在本公开实施例的一实施方式中,初始检测条件可以包括活体检测设备预先设置的检测超时的时长阈值,在基于第一待检图像至当前第i待检图像之间的时间间隔确定出检测开始至今的检测时长之后,活体检测设备可以将检测时长与预设时长阈值进行比较,进而基于比较结果对当前是否满足初始检测条件进行判断。In an implementation of the embodiment of the present disclosure, the initial detection condition may include a detection timeout duration threshold preset by the living body detection device, and the detection is determined based on the time interval between the first to-be-detected image and the current i-th to-be-detected image. After starting the detection duration so far, the living body detection device may compare the detection duration with a preset duration threshold, and then judge whether the initial detection condition is currently satisfied based on the comparison result.
在本公开实施例的另一实施方式中,初始检测条件还可以包括活体检测设备预先设置的图像重复条件,活体检测设备在基于第一待检图像至当前第i待检图像的时间间隔确定出检测开始至今的检测时长之后,还可以基于图像重复条件进行图像重复判断,即对当前第i待检图像与检测至今的历史多帧待检图像进行相似度比较,进而结合检测时长的比较结果和图像相似度比较结果对当前是否满足初始检测条件进行判断。In another implementation of the embodiment of the present disclosure, the initial detection condition may further include an image repetition condition preset by the living body detection device, and the living body detection device determines the image repetition condition based on the time interval from the first to-be-detected image to the current i-th to-be-detected image. After the detection time since the detection started, the image repetition judgment can also be performed based on the image repetition condition, that is, the similarity between the current i-th image to be inspected and the historical multi-frame images to be inspected so far is compared, and then combined with the comparison result of the detection time length and The image similarity comparison result judges whether the current initial detection condition is satisfied.
在本公开的一些实施例中,图5为本公开实施例提供的活体检测方法的实现流程示意图四,如图5所示,活体检测设备在将第一待检图像至第i待检图像之间的时间间隔确定为时间参数(S103a)之后,根据时间参数判断第i待检图像是否满足初始检测条件的方法可以包括以下步骤:In some embodiments of the present disclosure, FIG. 5 is a fourth schematic diagram of the implementation flow of the living body detection method provided by the embodiment of the present disclosure. As shown in FIG. 5 , the living body detection device is in the process between the first to-be-checked image to the i-th to-be-checked image. After the time interval is determined as the time parameter (S103a), the method for judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter may include the following steps:
S103b1、若时间参数小于或者等于预设时长阈值,则读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像;其中,k为大于1且小于i的整数。S103b1, if the time parameter is less than or equal to the preset duration threshold, read the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected; wherein, k is an integer greater than 1 and less than i .
S103b2、若k个历史待检图像中的至少一个待检图像与第i待检图像不相同,则确定满足初始检测条件。S103b2: If at least one image to be inspected among the k historical images to be inspected is different from the i-th image to be inspected, determine that the initial detection condition is satisfied.
在本公开实施例的一实施方式中,如果活体检测设备确定检测开始至今的检测时长,即第1待检图像至第i待检图像的时间间隔小于或者等于预设检测时长阈值,表明当前并未出现检测超时情况,那么 活体检测设备可以继续进行待检图像重复判断。In an implementation of the embodiments of the present disclosure, if the living body detection device determines the detection duration from the start of detection to the present, that is, the time interval from the first image to be inspected to the i-th image to be inspected is less than or equal to the preset detection duration threshold, it indicates that the current If the detection timeout does not occur, the living body detection device can continue to perform repeated judgment of the image to be inspected.
例如,假定预设时长阈值为10s,在第一待检图像与当前第i待检图像之间的时间间隔为9s的情况下,时间间隔小于预设时长阈值,表明当前并未检测超时。For example, assuming that the preset duration threshold is 10s, and the time interval between the first image to be inspected and the current i-th image to be inspected is 9s, the time interval is less than the preset duration threshold, indicating that there is currently no detection timeout.
可以理解的是,合法的生命活体至少是存在动态变化的,因此,在检测对象可能为合法的生命活体的情况下,按照时间间隔选取的相邻待检图像之间是存在差异的,并不是重复相同的。It is understandable that legal living organisms at least have dynamic changes. Therefore, in the case that the detection object may be a legal living organism, there is a difference between the adjacent images to be inspected selected according to the time interval. Repeat the same.
在一些实施例中,活体检测设备在执行完历史待检图像的活体检测处理之后,可以对历史待检图像以及对应的检测结果进行关联存储。其中,可以是按照时间先后顺序以及预设存储量进行存储。例如,可以存储历史前10帧待检图像及其对应的历史检测结果。In some embodiments, after performing the living body detection processing of the historical images to be inspected, the living body detection device may associate and store the historical images to be inspected and the corresponding detection results. Wherein, the storage may be performed according to the chronological order and the preset storage amount. For example, the first 10 frames of images to be inspected and their corresponding historical inspection results can be stored.
这里,活体检测设备在进行待检图像的重复判断时,可以读取预先存储的多帧历史待检图像,如第(i-k)至第(i-1)待检图像对应的k个历史待检图像,并将当前第i待检图像与k个历史待检图像分别进行相似度比较,如果获得的比较结果为第i待检图像与k个历史待检图像中的至少一个待检图像并不相同,表明检测对象存在动态变化,可能为合法的生命活体,此时,确定第i待检图像满足初始检测条件。Here, when performing the repeated judgment of the image to be inspected, the living body detection device can read multiple frames of pre-stored historical images to be inspected, such as the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected. image, and compare the similarity between the current i-th image to be inspected and the k historical images to be inspected, if the obtained comparison result is that the i-th image to be inspected and at least one image to be inspected in the k historical If the same, it indicates that the detection object has dynamic changes and may be a legitimate living body. At this time, it is determined that the i-th image to be inspected satisfies the initial detection conditions.
例如,在检测未超时的情况下,假定k等于5,在进行待检图像的重复判断时,如果活体检测设备确定当前待检图像与历史前5帧待检图像中的3帧图像并不相同,即检测对象存在动态变化,表明当前待检图像并不属于重复图像,满足初始检测条件。For example, in the case where the detection does not time out, assuming that k is equal to 5, when performing repeated judgment of the image to be inspected, if the living body detection device determines that the current image to be inspected is not the same as 3 frames of images in the previous 5 frames of images to be inspected in history , that is, there is a dynamic change in the detection object, indicating that the current image to be inspected is not a duplicate image and meets the initial detection conditions.
在本公开的另一些实施例中,图6为本公开实施例提供的活体检测方法的实现流程示意图五,如图6所示,活体检测设备在将第一待检图像至第i待检图像之间的时间间隔确定为时间参数(S103a)之后,根据时间参数判断第i待检图像是否满足初始检测条件的方法可以包括以下步骤:In other embodiments of the present disclosure, FIG. 6 is a schematic diagram 5 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure. As shown in FIG. 6 , the living body detection device is converting the first to-be-checked image to the i-th to-be-checked image. After the time interval between is determined as the time parameter (S103a), the method for judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter may include the following steps:
S103b3、若时间参数大于预设时长阈值,则生成检测超时的第一提示消息。S103b3. If the time parameter is greater than the preset duration threshold, generate a first prompt message for detecting timeout.
在本公开实施例的一实施方式中,如果活体检测设备确定检测开始至今的检测时长,即第一待检图像至第i待检图像的时间间隔大于预设检测时长阈值,表明当前出现检测超时情况。In one implementation of the embodiment of the present disclosure, if the living body detection device determines the detection duration from the start of detection to the present, that is, the time interval from the first to-be-detected image to the i-th to-be-detected image is greater than the preset detection duration threshold, it indicates that a detection timeout currently occurs Happening.
例如,假定预设时长阈值为10s,在第一待检图像与当前第i待检图像之间的时间间隔为12s的情况下,时间间隔大于预设时长阈值,表明当前检测超时。For example, assuming that the preset duration threshold is 10s, when the time interval between the first image to be inspected and the current i-th image to be inspected is 12s, the time interval is greater than the preset duration threshold, indicating that the current detection is overtime.
这里,为了及时向用户反馈检测超时的情况,活体检测设备可以生成检测超时的第一提示消息,并对该提示消息进行显示。Here, in order to timely feedback the detection timeout to the user, the living body detection device may generate a first prompt message of the detection timeout, and display the prompt message.
可以理解的是,活体检测设备也可以在确定检测超时之后,生成检测超时的提示消息的同时,终止当前活体检测流程。例如,在通过点击短信内容上附有针对银行开户的H5跳转外链而触发活体检测之后,如果确定检测超时,手机可以跳转回初始的短信内容界面,用户可以重新点击H5跳转外链触发下一次活体检测。It can be understood that, after determining the detection timeout, the living body detection device can also generate a prompt message of the detection timeout, and at the same time terminate the current living body detection process. For example, after the liveness detection is triggered by clicking the H5 jump link for bank account opening attached to the SMS content, if it is determined that the detection times out, the mobile phone can jump back to the initial SMS content interface, and the user can click the H5 jump link again. Trigger the next liveness detection.
由此可见,活体检测设备不用在等待后续活体检测结果失败后才提醒用户,而是在检测超时的情况下通过设备的显示界面及时的向用户发送提示消息,提高了检测效率。It can be seen that the living body detection device does not need to wait for the subsequent live body detection result to fail before reminding the user, but sends a prompt message to the user in a timely manner through the display interface of the device in the case of a detection timeout, which improves the detection efficiency.
在本公开的另一些实施例中,图7为本公开实施例提供的活体检测方法的实现流程示意图六,如图7所示,活体检测设备在时间参数小于或者等于预设时长阈值的情况下,读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像之后,即S103b1之后,方法还包括以下步骤:In other embodiments of the present disclosure, FIG. 7 is a schematic diagram 6 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure. As shown in FIG. 7 , when the time parameter of the living body detection device is less than or equal to the preset duration threshold , after reading the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, that is, after S103b1, the method further includes the following steps:
S103b4、若k个历史待检图像均与第i待检图像相同,则生成检测重试的第二提示消息。S103b4. If the k historical images to be inspected are all the same as the i-th image to be inspected, generate a second prompt message for detection retry.
在本公开实施例的一实施方式中,如果活体检测设备在利用对第i待检图像与k个历史待检图像进行相似度比较以实现待检图像的重复判断时,在比较结果为第i待检图像与k个历史待检图像均相同的情况下,表明检测对象不存在动态变化,不可能为合法的生命活体。In an implementation of the embodiment of the present disclosure, if the living body detection device uses the similarity comparison between the i-th image to be inspected and the k historical images to be inspected to realize the repeated judgment of the image to be inspected, the comparison result is the i-th image to be inspected. When the image to be inspected is the same as the k historical images to be inspected, it indicates that there is no dynamic change in the detected object, and it cannot be a legitimate living body.
例如,在检测未超时的情况下,假定k等于5,在进行待检图像的重复判断时,如果活体检测设备确定当前待检图像与历史前5帧待检图像相同,表明当前待检图像属于重复图像,不满足初始检测条件。For example, in the case where the detection does not time out, assuming that k is equal to 5, during the repeated judgment of the image to be inspected, if the living body detection device determines that the current image to be inspected is the same as the previous five frames of images to be inspected, it indicates that the current image to be inspected belongs to Repeated image, does not meet the initial detection conditions.
这里,为了及时向用户反馈不存在合法生命活体的检测情况,活体检测设备可以生成检测重试的第二提示消息,并对该提示消息进行显示。Here, in order to timely feedback to the user that there is no detection of a legitimate living body, the living body detection device may generate a second prompt message for detection retry, and display the prompt message.
例如,通过手机进行银行开户时的身份验证,如果进行图像数据采集时,摄像头没有对准人脸,而是对准一静态物或者静态图片,那么多张待检图像都是重复的,此时确定不满足初始检测条件,可以生成检测重试的提示消息,用户可以及时调整检测对象,将真实的人脸处于摄像头采集范围内。For example, in the identity verification when opening a bank account through a mobile phone, if the camera is not aimed at a face, but at a static object or a static picture when collecting image data, the multiple images to be checked are repeated. If it is determined that the initial detection conditions are not met, a prompt message for detection retry can be generated, and the user can adjust the detection object in time to place the real face within the range captured by the camera.
由此可见,活体检测设备不用在等待后续活体检测结果失败后才提醒用户,而是在确定图像重复的情况下及时的通过设备显示界面向用户发送提示消息,提高了检测效率。It can be seen that the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the device display interface in a timely manner when it is determined that the image is repeated, which improves the detection efficiency.
S104、若判定满足初始检测条件,则通过预设人脸检测网络对第i待检图像进行人脸检测处理,获得人脸检测结果。S104. If it is determined that the initial detection conditions are met, perform face detection processing on the i-th image to be checked through a preset face detection network to obtain a face detection result.
在本公开的实施例中,在活体检测设备确定检测未超时且待检图像未重复的情况下,为了避免直接对待检图像进行活体检测时,造成的检测对象不是人脸的问题产生,活体检测设备可以继续对第i待检 图像进行人脸检测处理。In the embodiment of the present disclosure, in the case where the live detection device determines that the detection has not timed out and the image to be inspected is not repeated, in order to avoid the problem that the detection object is not a human face when the image to be inspected is directly detected, the living body detection The device can continue to perform face detection processing on the i-th image to be checked.
在一些实施例中,活体检测设备可以集成人脸检测网络。可以将第i待检图像输入该人脸检测网络,以通过算法网络基于人脸的一些特性(如,人脸的位置、人脸的姿态以及人脸的大小等)对待检图像中是否存在人脸进行判断,进而获得人脸检测结果。In some embodiments, the liveness detection device may integrate a face detection network. The i-th image to be inspected can be input into the face detection network to determine whether there is a person in the image to be inspected based on some characteristics of the face (such as the position of the face, the pose of the face, and the size of the face, etc.) through the algorithm network. The face is judged, and then the face detection result is obtained.
在本公开的实施例中,活体检测设备在通过人脸检测网络得到人脸检测结果包括两种情况,其中一种为存在人脸特征时,即待检图像中的检测对象为人脸;另外一种为不存在人脸特征时,即待检图像中的检测对象不为人脸。In the embodiment of the present disclosure, when the living body detection device obtains the face detection result through the face detection network, there are two cases, one of which is when there is a face feature, that is, the detection object in the image to be inspected is a human face; When there is no face feature, that is, the detection object in the image to be checked is not a face.
S105、若人脸检测结果为存在人脸特征,则根据第i待检图像对应的图像参数进行质量检测处理,获得质量检测值。S105. If the face detection result is that there is a face feature, perform quality detection processing according to the image parameters corresponding to the i-th image to be checked to obtain a quality detection value.
在本公开实施例的一实施方式中,活体检测设备在确定检测对象为人脸之后,可以对第i待检图像的图像参数进行分析,确定待检图像是否满足质量需求。In an implementation of the embodiments of the present disclosure, after determining that the detection object is a human face, the living body detection device may analyze the image parameters of the i-th image to be inspected to determine whether the image to be inspected meets the quality requirements.
在一些实施例中,图像参数指活体检测设备预先定义的用于表征图像质量的参数,包括图像的光线、遮挡度、清晰度、角度中的至少一项。In some embodiments, the image parameter refers to a parameter pre-defined by the living body detection device and used to characterize the image quality, including at least one of light, occlusion, sharpness, and angle of the image.
其中,在检测对象为人脸的情况下,图像的光线可以为人脸所处环境的光线,遮挡度可以为人脸的遮挡程度,清晰度可以为人脸的清晰度,角度可以为人脸相对于摄像头采集方向的偏转角度。Wherein, when the detection object is a face, the light of the image can be the light of the environment where the face is located, the occlusion degree can be the occlusion degree of the face, the clarity can be the clarity of the face, and the angle can be the face relative to the camera collection direction deflection angle.
这里,活体检测设备可以对待检图像中人脸所处环境的光线、人脸的清晰度、遮挡程度以及偏转角度进行质量检测处理,进而获得各个参数的质量打分结果,对各个打分结果进行加权求和运算处理,便可获得待检图像的质量检测值。Here, the living body detection device can perform quality detection processing on the light of the environment where the face is located in the image to be inspected, the clarity of the face, the degree of occlusion, and the deflection angle, and then obtain the quality scoring results of each parameter, and perform weighted calculation on each scoring result. And operation processing, the quality detection value of the image to be inspected can be obtained.
S106、若质量检测值大于或者等于预设质量阈值,则确定第i待检图像满足预设质量条件。S106. If the quality detection value is greater than or equal to the preset quality threshold, determine that the i-th image to be inspected satisfies the preset quality condition.
在本公开的一些实施例中,预设质量阈值可以为活体检测设备预先定义符合质量条件的人脸整体的质量阈值,其中,该质量阈值可以为人脸所处环境的光线阈值、人脸遮挡程度阈值、人脸清晰度阈值以及人脸偏转角度阈值加权求和之后的阈值。In some embodiments of the present disclosure, the preset quality threshold may be the quality threshold of the whole face that meets the quality condition pre-defined by the living body detection device, where the quality threshold may be the light threshold of the environment where the face is located, the degree of occlusion of the face Threshold after weighted summation of threshold, face sharpness threshold, and face deflection angle threshold.
这里,活体检测设备可以将人脸所处环境的光线与预设光线阈值进行比较,根据两者的差异程度得到一个表征光线的分值;将人脸的遮挡程度与预设遮挡程度阈值进行比较,根据两者的差异程度得到一个表征遮挡程度的分值;将人脸的清晰度与预设清晰度阈值进行比较,根据两者的差异程度得到一个表征清晰度的分值;将人脸的偏转角度与预设偏转角度阈值进行比较,根据两者的差异度得到一个表征遮挡程度的分值。并将上述各项分值进行加权求和运算,得到第i待检图像的质量检测值。Here, the living body detection device can compare the light of the environment where the face is located with the preset light threshold, and obtain a score representing the light according to the difference between the two; compare the occlusion degree of the face with the preset occlusion degree threshold , obtain a score representing the degree of occlusion according to the degree of difference between the two; compare the sharpness of the face with the preset sharpness threshold, and obtain a score representing the sharpness according to the degree of difference between the two; The deflection angle is compared with the preset deflection angle threshold, and a score representing the degree of occlusion is obtained according to the difference between the two. The weighted sum operation is performed on the above scores to obtain the quality detection value of the i-th image to be inspected.
在一些实施例中,活体检测设备将加权求和后获得的质量检测值与预设质量阈值进行比较,在确定加权求和得到的质量检测值均大于或者等于预设质量阈值的情况下,第i待检图像满足预设质量条件。In some embodiments, the living body detection device compares the quality detection value obtained after the weighted summation with a preset quality threshold, and when it is determined that the quality detection value obtained by the weighted summation is greater than or equal to the preset quality threshold, the first i The image to be inspected meets the preset quality conditions.
由此可见,本公开实施例在进行后续活体检测之前,先对图像进行质量判断处理,以对满足预设质量条件的待检图像进行活体检测,有效保证了检测过程中数据的质量,提高了检测效率。It can be seen that, in the embodiment of the present disclosure, before the subsequent living body detection is performed, the quality judgment processing is performed on the image, so as to perform the living body detection on the to-be-detected image that meets the preset quality condition, which effectively ensures the quality of the data in the detection process and improves the performance of the detection process. detection efficiency.
在本公开实施例的另一些实施方式中,图8为本公开实施例提供的活体检测方法的实现流程示意图七,如图8所示,活体检测设备在通过预设人脸检测网络对第i待检图像进行人脸检测处理,获得人脸检测结果之后,即S104之后,方法还包括以下步骤:In other implementations of the embodiments of the present disclosure, FIG. 8 is a schematic diagram 7 of the implementation flow of the living body detection method provided by the embodiments of the present disclosure. As shown in FIG. The image to be inspected is subjected to face detection processing, and after the face detection result is obtained, that is, after S104, the method further includes the following steps:
S107、若人脸检测结果为不存在人脸特征,则读取第(i-n)至第(i-1)待检图像对应的n个历史人脸检测结果;其中,n为大于1且小于i的整数;S107, if the face detection result is that there is no face feature, then read the n historical face detection results corresponding to the (i-n)th to (i-1)th images to be checked; wherein, n is greater than 1 and less than i the integer;
S108、若n个历史人脸检测结果均为不存在人脸特征,则生成人脸检测失败的第三提示消息。S108. If the n historical face detection results are all without face features, generate a third prompt message that the face detection fails.
在本公开实施例中,由于检测过程中可能存在人脸晃动出摄像头以外的情况,为了保证人脸检测的准确性,在活体检测设备确定第i待检图像的人脸检测结果为不存在人脸特征,即当前检测对象不为人脸的情况下,活体检测设备可以读取历史多帧待检图像的人脸检测结果,如第(i-n)至第(i-1)待检图像对应的n个历史人脸检测结果,然后根据这n个历史人脸检测结果确定人脸检测结果的准确性。In the embodiment of the present disclosure, since the face may shake out of the camera during the detection process, in order to ensure the accuracy of the face detection, the living body detection device determines that the face detection result of the i-th image to be checked is that there is no face Features, that is, when the current detection object is not a human face, the living body detection device can read the face detection results of the historical multi-frame images to be inspected, such as the n corresponding to the (i-n)th to (i-1)th images to be inspected. The historical face detection results, and then the accuracy of the face detection results is determined according to the n historical face detection results.
这里,如果n个历史人脸检测结果也均为不存在人脸特征,即表明当前检测对象并非人脸,那么为了及时的将未检测到人脸的情况反馈给用户,活体检测设备可以生成人脸检测失败的第三提示消息,并对该提示消息进行显示。Here, if the n historical face detection results also all have no face features, it means that the current detection object is not a face, then in order to timely feedback the undetected face to the user, the living body detection device can generate a human face. The third prompt message of the face detection failure is displayed, and the prompt message is displayed.
例如,假定n等于10,如果活体检测设备确定当前待检图像与历史前10帧待检图像中均不存在人脸特征,那么存在检测对象可能并不是人脸,此时提示未检测到人脸。For example, assuming that n is equal to 10, if the living body detection device determines that there are no facial features in the current image to be inspected and the previous 10 frames of images to be inspected, then the detected object may not be a human face, and it will prompt that no face has been detected. .
由此可见,活体检测设备不用在等待后续活体检测结果失败后才提醒用户,而是在人脸检测失败的情况下及时的通过设备的显示界面向用户发送提示消息,提高了检测效率。It can be seen that the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the display interface of the device in a timely manner when the face detection fails, which improves the detection efficiency.
在本公开的另一些实施例中,图9为本公开实施例提供的活体检测方法的实现流程示意图八,如图9所示,活体检测设备在根据第i待检图像对应的图像参数进行质量检测处理,获得质量检测值之后,即S105之后,方法还包括以下步骤:In other embodiments of the present disclosure, FIG. 9 is a schematic diagram 8 of the implementation flow of the living body detection method provided by the embodiment of the present disclosure. As shown in FIG. 9 , the living body detection device is performing quality inspection according to the image parameters corresponding to the ith image to be checked In the detection process, after the quality detection value is obtained, that is, after S105, the method further includes the following steps:
S109、若质量检测值小于预设质量阈值,则读取历史第(i-m)至第(i-1)待检图像对应的m个历 史质量检测值;其中,m为大于1且小于i的整数;S109. If the quality detection value is less than the preset quality threshold, read the m historical quality detection values corresponding to the (i-m)th to (i-1)th images to be checked in the history; wherein, m is an integer greater than 1 and less than i ;
S110、若m个历史质量检测值均小于预设质量阈值,则生成质量检测失败的第四提示消息。S110. If the m historical quality detection values are all smaller than the preset quality threshold, generate a fourth prompt message that the quality detection fails.
在本公开实施例中,在活体检测设备确定第i待检图像的质量检测值小于质量阈值,即第i待检图像不满足预设质量条件的情况下,为了提高质量检测的准确性,活体检测设备可以读取历史多帧待检图像的质量检测值,如第(i-m)至第(i-1)待检图像对应的m个历史质量检测值,然后结合这m个历史质量检测值确定质量判断结果的准确性。In this embodiment of the present disclosure, in the case where the living body detection device determines that the quality detection value of the i-th image to be inspected is less than the quality threshold, that is, the i-th image to be inspected does not meet the preset quality conditions, in order to improve the accuracy of quality detection, the living body The detection device can read the quality detection values of the historical multi-frame images to be inspected, such as the m historical quality detection values corresponding to the (i-m)th to (i-1)th images to be inspected, and then combine the m historical quality detection values to determine The accuracy of the quality judgment results.
这里,如果m个历史质量检测值均小于预设质量阈值,即表明当前摄像采集的图像数据均不满足质量条件,此时,活体检测设备生成质量检测失败的第四提示消息,以提醒用户及时调整当前的拍摄姿态。Here, if the m historical quality detection values are all smaller than the preset quality threshold, it means that none of the image data collected by the current camera meets the quality conditions. At this time, the living body detection device generates a fourth prompt message of quality detection failure to remind the user to timely Adjust the current shooting posture.
例如,假定m等于5,如果活体检测设备确定当前待检图像的质量检测值与历史前5帧待检图像的质量检测值均小于阈值,表明待检图像的数据质量较差,那么提示质量检测失败。For example, assuming that m is equal to 5, if the living body detection device determines that the quality detection value of the current image to be inspected and the quality inspection value of the previous 5 frames of images to be inspected are both less than the threshold, indicating that the data quality of the image to be inspected is poor, then the quality inspection is prompted. fail.
例如,用户接收到活体检测设备生成质量检测失败的提示消息的情况下,可以调整当前的拍摄姿态,包括调整拍摄光线;调整人脸遮挡程度,如去掉眼睛等遮挡物;调整拍摄的清晰度,如将人脸靠近摄像头;调整拍摄的角度,如将人脸正对着摄像头,以便活体检测设备在调整姿态后采集到用于后续活体检测的图像。For example, when the user receives a notification message that the quality detection failed to be generated by the living body detection device, he can adjust the current shooting posture, including adjusting the shooting light; adjust the degree of face occlusion, such as removing obstacles such as eyes; For example, bring the face close to the camera; adjust the shooting angle, such as facing the camera, so that the living body detection device can collect images for subsequent living body detection after adjusting the posture.
在一些实施例中,上述字母k、n、m可以设置为相同的数值,也可以分别设置为不同的数值。In some embodiments, the above-mentioned letters k, n, and m may be set to the same numerical value, or may be set to different numerical values respectively.
由此可见,活体检测设备不用在等待后续活体检测结果失败后才提醒用户,而是在质量检测失败的情况下通过设备的显示界面及时的向用户发送提示消息,提高了检测效率。It can be seen that the living body detection device does not need to wait for the subsequent living body detection result to fail before reminding the user, but sends a prompt message to the user through the display interface of the device in a timely manner when the quality detection fails, which improves the detection efficiency.
基于上述实施例,在本公开的在一实施例中,图10为本公开实施例提出的活体检测方法的实现流程示意图九,如图10所示,活体检测设备对第i待检图像进行活体检测处理,获得目标检测结果的方法包括以下步骤:Based on the above embodiments, in an embodiment of the present disclosure, FIG. 10 is a schematic diagram 9 of the implementation flow of the living body detection method proposed in the embodiment of the present disclosure. As shown in FIG. Detection processing, the method for obtaining target detection results includes the following steps:
S102a、基于预设活体检测网络确定第i待检图像对应的当前活体检测结果。S102a. Determine the current living body detection result corresponding to the i-th image to be checked based on a preset living body detection network.
在本公开实施例中,活体检测设备可以利用集成的活体检测网络确定第i待检图像对应的活体检测结果。In the embodiment of the present disclosure, the living body detection device may determine the living body detection result corresponding to the i-th image to be checked by using the integrated living body detection network.
这里,活体检测设备可以将第i待检图像输入活体检测网络,以通过该算法网络基于合法生命活体的特性对待检图像进行分析,得到用于表征活体的概率值。Here, the living body detection device may input the i-th image to be inspected into the living body detection network, so as to analyze the image to be inspected based on the characteristics of the legitimate living body through the algorithm network to obtain a probability value for characterizing the living body.
在一些实施例中,活体检测设备可以预先定义概率阈值,该预设概率阈值可以用于表征当前检测对象为合法生命活体的概率阈值。In some embodiments, the living body detection device may predefine a probability threshold, and the preset probability threshold may be used to characterize the probability threshold that the current detection object is a legitimate living body.
这里,活体检测设备可以将通过活体检测网络得到的活体概率值与预设的合法生命活体的概率阈值进行比较,进而根据比较结果确定出第i待检图像的活体检测结果。Here, the living body detection device may compare the living body probability value obtained through the living body detection network with the preset legal living body probability threshold value, and then determine the living body detection result of the i-th image to be checked according to the comparison result.
其中,在活体概率值大于或者等于合法生命活体的概率阈值的情况下,活体检测设备可以确定当前检测对象为合法生命活体,即活体检测结果为存在活体;在活体概率值小于合法生命活体的概率阈值的情况下,活体检测设备确定当前检测对象为不合法的生命活体,可能是人脸面具、或者提前录制并播放的一段视频,即活体检测结果为不存在活体。Wherein, when the probability value of the living body is greater than or equal to the probability threshold of a legal living body, the living body detection device can determine that the current detection object is a legal living body, that is, the living body detection result is the existence of a living body; when the living body probability value is less than the probability of a legal living body In the case of the threshold, the living body detection device determines that the current detection object is an illegal living body, which may be a face mask, or a video recorded and played in advance, that is, the living body detection result is that there is no living body.
在另一些实施例中,预设概率阈值可以用于表征当前检测对象为攻击对象的概率阈值。In other embodiments, the preset probability threshold may be used to represent the probability threshold that the currently detected object is an attack object.
这里,活体检测设备可以将通过活体检测网络得到的活体概率值与预设的攻击对象的概率阈值进行比较,进而根据比较结果确定出第i待检图像的活体检测结果。Here, the living body detection device may compare the living body probability value obtained through the living body detection network with the preset probability threshold of the attacking object, and then determine the living body detection result of the i-th image to be checked according to the comparison result.
这里,在活体概率值小于预设的攻击对象的概率阈值的情况下,活体检测设备可以确定活体检测结果为存在活体,即当前检测对象为合法生命活体;在活体概率值大于或者等于预设的攻击对象的概率阈值的情况下,活体检测设备确定当前检测对象为不存在活体,即检测对象为不合法的生命活体,可能是人脸面具、或者提前录制并播放的一段视频,即活体检测结果为不存在活体。Here, in the case that the living body probability value is less than the preset probability threshold of the attacking object, the living body detection device may determine that the living body detection result is the existence of a living body, that is, the current detection object is a legitimate living body; when the living body probability value is greater than or equal to the preset In the case of the probability threshold of the attacking object, the living body detection device determines that the current detection object does not exist a living body, that is, the detection object is an illegal living body, which may be a face mask, or a video recorded and played in advance, that is, the living body detection result. for the absence of living organisms.
S102b、若当前活体检测结果为存在活体,则进行存在活体计数处理,获得计数结果。S102b, if the current living body detection result is that there is a living body, perform a living body counting process to obtain a counting result.
S102c、若计数结果大于或者等于预设数量阈值,则确定目标检测结果为验证通过。S102c, if the count result is greater than or equal to the preset number threshold, determine that the target detection result is verified as passed.
在一些实施例中,活体检测设备预先配置有计数功能模块,如计数器,用于对待检图像对应的活体检测结果进行统计,进而根据计数结果确定目标检测结果。In some embodiments, the living body detection device is pre-configured with a counting function module, such as a counter, for counting the living body detection results corresponding to the images to be checked, and then determining the target detection result according to the counting results.
这里,目标检测结果不是指第i待检图像对应的活体检测结果,而是将多帧待检图像的活体检测结果累计后的目标检测结果。Here, the target detection result does not refer to the in vivo detection result corresponding to the i-th image to be inspected, but the target detection result obtained by accumulating the in vivo detection results of multiple frames of images to be inspected.
其中,预设结果阈值为活体检测设备预先定义的满足活体验证通过条件的、多帧待检图像的活体检测结果为存在活体时的累计值。Wherein, the preset result threshold is the accumulated value when the living body exists in the living body detection result of the multi-frame images to be inspected that meets the living body verification pass condition pre-defined by the living body detection device.
这里,在活体检测设备确定第i待检图像的活体检测结果为存在活体的情况下,活体检测设备通过计数器对多帧待检图像的活体检测结果为存在活体的情况进行累加处理,获得存在活体这一检测结果的累计值,活体检测设备可以对该累计值与预设结果阈值进行比较,进而根据比较结果确定出目标结果。Here, in the case where the living body detection device determines that the living body detection result of the i-th image to be inspected is the presence of a living body, the living body detection device performs accumulation processing on the cases where the living body detection results of the multiple frames of images to be inspected are the presence of a living body through a counter, and obtains the existence of a living body. The accumulated value of the detection result, the living body detection device can compare the accumulated value with the preset result threshold, and then determine the target result according to the comparison result.
在一些实施例中,在检测结果为存在活体的累计值大于或者等于预设数量阈值的情况下,表明满足活体验证通过条件,那么活体检测设备可以确定目标检测结果为验证通过。In some embodiments, if the detection result is that the accumulated value of living bodies is greater than or equal to the preset number threshold, it indicates that the living body verification pass condition is satisfied, and the living body detection device may determine that the target detection result is the verification pass.
例如,预设数量阈值为5,在当前第i待检图像的活体检测结果为存在活体的情况下,更新检测结果为存在活体的数量累计值,如果更新后的累计值大于或者等于5,则表明满足活体验证通过条件,此时目标检测结果为活体验证通过。For example, the preset number threshold is 5, and in the case where the living body detection result of the current i-th image to be inspected is that there is a living body, the updated detection result is the cumulative value of the number of living bodies. If the updated cumulative value is greater than or equal to 5, then Indicates that the living body verification pass conditions are met, and the target detection result at this time is the living body verification pass.
在一些实施例中,活体检测设备在确定出目标检测结果为验证通过之后,方法还包括:In some embodiments, after the living body detection device determines that the target detection result is verified, the method further includes:
S102d、生成活体验证通过的第五提示消息。S102d, generating a fifth prompt message that the living body verification is passed.
这里,活体检测设备可以及时向用户反馈活体验证通过的情况,其中,可以生成活体验证通过的提示消息,并显示给用户。Here, the living body detection device can timely feed back the status of the living body verification to the user, wherein a prompt message of the living body verification passing can be generated and displayed to the user.
在本公开的一些实施例中,图11为本公开实施例提出的活体检测方法的实现流程示意图十一,如图11所示,活体检测设备进行存在活体计数处理,获得计数结果之后,即S102b之后,方法还包括以下步骤:In some embodiments of the present disclosure, FIG. 11 is a schematic diagram 11 of the implementation flow of the living body detection method proposed by the embodiment of the present disclosure. As shown in FIG. 11 , the living body detection device performs the existence of living body counting processing, and after obtaining the counting result, that is, S102b After that, the method also includes the following steps:
S102e、若计数结果小于预设数量阈值,则确定目标检测结果为验证不通过。S102e. If the count result is less than a preset number threshold, determine that the target detection result is that the verification fails.
在一些实施例中,在检测结果为存在活体的累计值小于预设数量阈值的情况下,表明满足活体验证未通过条件,那么活体检测设备可以确定目标检测结果为验证未通过。In some embodiments, if the detection result is that the accumulated value of living bodies is less than the preset number threshold, it indicates that the living body verification failure condition is satisfied, and the living body detection device may determine that the target detection result is the verification failure.
例如,预设数量阈值为5,在当前第i待检图像的活体检测结果为存在活体的情况下,更新检测结果为存在活体的数量累计值,如果更新后的累计值小于5,则表明不满足活体验证通过条件,此时目标检测结果为活体验证未通过。For example, the preset number threshold is 5. In the case where the current i-th image to be inspected has a living body detection result, the updated detection result is the cumulative value of the number of living bodies. If the updated cumulative value is less than 5, it indicates that there is no living body. The living body verification pass condition is met, and the target detection result is that the living body verification fails.
在一些实施例中,活体检测设备在确定出目标检测结果为验证不通过之后,方法还包括;In some embodiments, after the living body detection device determines that the target detection result is that the verification fails, the method further includes;
S102f、生成检测重试的第二提示消息。S102f. Generate a second prompt message for detection retry.
这里,活体检测设备可以及时向用户反馈活体验证未通过的情况,其中,可以生成检测重试的提示消息,并显示给用户。Here, the living body detection device can timely feed back to the user that the living body verification fails, wherein a prompt message for detection retry can be generated and displayed to the user.
由此可见,本公开实施例中,活体检测设备是在基于多帧待检图像得到活体检测结果之后便可向用户反馈提示消息,不用等待活体视频检测完成之后,再反馈检测结果,提高了检测效率。It can be seen that, in the embodiment of the present disclosure, the living body detection device can feed back a prompt message to the user after obtaining the living body detection result based on the multi-frame to-be-detected images, and does not need to wait for the completion of the living body video detection before feeding back the detection result, which improves the detection performance. efficiency.
基于上述实施例,在本公开的在一实施例中,图12为本公开实施例提出的活体检测方法的应用场景示意图,如图12所示,为活体检测设备为终端时的示例性应用,终端包括前端模块和后端模块;其中,前端模块主要负责调用摄像头进行视频数据的采集、并通过取帧模块从采集的视频数据中按照时间间隔循环提取图像帧,以及通过图像压缩模块对提取到的图像帧进行图片压缩的格式预处理,进而得到待检图像,之后将待检图像传输至后端模块。后端模块主要负责通过质量检测模块对待检图像进行质量判断,包括检测超时的判断、图像重复判断、人脸检测、人脸质量判断等多项,然后对满足质量条件的待检图像通过活体检测模块进行活体检测处理,以确定出检测对象是否为合法生命活体。另外还可以对满足质量条件的待检图像通过重放攻击检测模块以及Track id检测模块进行一系列其他的检测处理等,其中,后端模块可实时将质量检测结果或者活体检测结果反馈至前端模块,以实现高效率的活体检测。Based on the above-mentioned embodiment, in an embodiment of the present disclosure, FIG. 12 is a schematic diagram of an application scenario of the living body detection method proposed by the embodiment of the present disclosure. As shown in FIG. 12 , it is an exemplary application when the living body detection device is a terminal, The terminal includes a front-end module and a back-end module; among them, the front-end module is mainly responsible for calling the camera to collect video data, and cyclically extracts image frames from the collected video data according to time intervals through the frame acquisition module, and extracts image frames through the image compression module. The image frame is preprocessed by the format of picture compression, and then the image to be inspected is obtained, and then the image to be inspected is transmitted to the back-end module. The back-end module is mainly responsible for judging the quality of the images to be inspected through the quality detection module, including detection overtime judgment, image repetition judgment, face detection, face quality judgment, etc. The module performs living body detection processing to determine whether the detection object is a legitimate living body. In addition, a series of other detection processes can also be performed on the images to be inspected that meet the quality conditions through the replay attack detection module and the Track id detection module. , to achieve high-efficiency in vivo detection.
一般来说,为了保证方案的准确性,本公开实施例针对整个活体检测方法的执行过程设置了一些列的安全校验手段。本公开实施例提出的活体检测方案主要包括前端数据获取模块,数据传输模块、后端处理模块以及数据处理模块。其中,数据获取模块,主要用于基于http访问方式调用摄像头在挟持防御模式下进行视频数据的采集,并通过内容安全策略(Content-Security-Policy,CSP)、防xss攻击、代码混淆诸等方式从视频数据中获取待检图像。数据传输模块,主要用于将获取到的待检图像通过https加密、数字水印以及参数加密的协议/通讯方式传输至后端处理模块;后端处理模块包括应用层和算法引擎层。应用层主要用于进行网关认证、接口鉴权、拂去监控、服务隔离、日志安全、入侵防范、接口限流、代码扫描、分布式存储以及框架安全等安全验证过程,在验证通过后将待检图像传输至后端算法引擎层;后端算法引擎层,主要用于对通过应用层的待检图像进行Track id检测、活体检测以及摘要信息算法(Message-Digest Algorithm 5,MD5)检测等;检测完成之后,可按照存储需求对数据按照私有化部署、数据脱敏、数据权限以及数据备份等方式进行存储,进而有效保证活体检测方案的安全高效执行。Generally speaking, in order to ensure the accuracy of the solution, the embodiments of the present disclosure provide a series of security verification means for the execution process of the entire living body detection method. The living body detection solution proposed by the embodiments of the present disclosure mainly includes a front-end data acquisition module, a data transmission module, a back-end processing module, and a data processing module. Among them, the data acquisition module is mainly used to call the camera based on http access to collect video data in the hijacking defense mode, and use Content-Security-Policy (CSP), anti-xss attack, code obfuscation, etc. Obtain the image to be inspected from the video data. The data transmission module is mainly used to transmit the acquired image to be inspected to the back-end processing module through the protocol/communication method of https encryption, digital watermarking and parameter encryption; the back-end processing module includes the application layer and the algorithm engine layer. The application layer is mainly used to perform security verification processes such as gateway authentication, interface authentication, wipe monitoring, service isolation, log security, intrusion prevention, interface current limiting, code scanning, distributed storage, and framework security. The inspection image is transmitted to the back-end algorithm engine layer; the back-end algorithm engine layer is mainly used for Track id detection, living body detection and summary information algorithm (Message-Digest Algorithm 5, MD5) detection of the image to be inspected through the application layer; After the detection is completed, the data can be stored in accordance with the storage requirements in the manner of privatization deployment, data desensitization, data permission, and data backup, thereby effectively ensuring the safe and efficient implementation of the living body detection scheme.
基于上述实施例,在本公开的在一实施例中,图13为本公开实施例提出的活体检测方法的执行流程示意图,如图13所示,活体检测设备执行活体检测的方法包括以下步骤:Based on the above embodiments, in an embodiment of the present disclosure, FIG. 13 is a schematic diagram of the execution flow of the living body detection method proposed by the embodiment of the present disclosure. As shown in FIG. 13 , the method for performing living body detection by a living body detection device includes the following steps:
S201、从摄像头采集的视频流中确定第i待检图像;其中,i为大于1的整数。S201. Determine the i-th image to be inspected from the video stream collected by the camera; wherein, i is an integer greater than 1.
S202、检测是否超时?若否,执行S203;若是,跳转执行S204。S202. Does the detection time out? If no, execute S203; if yes, jump to execute S204.
S203、图像是否重复?若否,执行S205;若是,跳转执行S206;其中,k为大于1且小于i的整数。S203. Are the images repeated? If no, execute S205; if yes, jump to execute S206; wherein, k is an integer greater than 1 and less than i.
S204、提示检测超时。S204, prompting that the detection times out.
S205、进行人脸检测处理。S205, performing face detection processing.
S206、提示检测重试。S206. Prompt to retry the detection.
S207、是否为存在人脸?若是,执行S208;若否,跳转执行S209。S207. Is there a human face? If yes, execute S208; if not, jump to execute S209.
S208、进行质量检测处理,获得质量检测值。S208, performing quality detection processing to obtain a quality detection value.
S209、提示检测不到人脸。S209, prompting that the face cannot be detected.
S210、质量检测值是否大于或等于预设质量阈值?若是,执行S211;若不是,跳转执行S212。S210. Is the quality detection value greater than or equal to a preset quality threshold? If yes, execute S211; if not, jump to execute S212.
S211、进行活体检测。S211, performing live detection.
S212、提示质量检测失败。S212, prompting that the quality detection fails.
S213、若为活体,则确定活体的数量累计值。S213: If it is a living body, determine the cumulative value of the number of living bodies.
在第i待检图像的活体检测结果为存在活体的情况下,更新当前检测结果为存在活体的数量累计值。In a case where the living body detection result of the i-th image to be inspected is that there is a living body, the current detection result is updated to be the cumulative value of the number of living bodies.
S214、累计值是否大于预设数量阈值?若是,执行S215;若否,执行S216。S214. Is the accumulated value greater than the preset number threshold? If yes, go to S215; if not, go to S216.
S215、提示活体验证通过。S215 , prompting that the in vivo verification is passed.
S216、提示活体验证不通过。S216 , prompting that the in vivo verification fails.
由此可见,基于上述S201至S216,活体检测设备在活体检测过程中是基于连续图像进行检测的,相较于视频活体检测,网络带宽占用小,可实现检测结果的及时反馈,并且在后续活体检测之前添加质量检测过程,有效保证了检测过程中的数据质量。可见,本公开实施例提出的活体检测方案有效解决了网络带宽占用大以及检测周期长的问题,实现了高效率的活体检测。It can be seen that, based on the above S201 to S216, the living body detection device performs detection based on continuous images in the living body detection process. Compared with video living body detection, the network bandwidth is occupied less, and timely feedback of the detection results can be realized. The quality inspection process is added before the inspection, which effectively ensures the data quality in the inspection process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
基于上述实施例,在本公开的在一实施例中,图14为本公开实施例提出的活体检测装置的组成结构示意图,如图14所示,所述活体检测装置10包括获取模块11、第一处理模块12、确定模块13、判断模块14、第二处理模块15、第三处理模块16、生成模块17以及读取模块18,Based on the above-mentioned embodiment, in an embodiment of the present disclosure, FIG. 14 is a schematic diagram of the composition and structure of a living body detection device proposed in an embodiment of the present disclosure. As shown in FIG. 14 , the living body detection device 10 includes an acquisition module 11 , a first a processing module 12, a determination module 13, a judgment module 14, a second processing module 15, a third processing module 16, a generating module 17 and a reading module 18,
所述获取模块11,配置为从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数;The acquisition module 11 is configured to acquire the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1;
所述第一处理模块12,配置为响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。The first processing module 12 is configured to, in response to the i-th image to be inspected meeting a preset quality condition, perform in vivo detection processing on the i-th image to be inspected to obtain a target detection result.
在一些实施例中,所述获取模块11,配置为从所述图像传感器采集的视频数据中提取初始图像;以及根据预设配置参数对所述初始图像进行格式预处理,获得处理后图像;以及将所述处理后图像确定为所述第i待检图像。In some embodiments, the acquiring module 11 is configured to extract an initial image from the video data collected by the image sensor; and perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image; and The processed image is determined as the i-th image to be inspected.
在一些实施例中,所述确定模块13,配置为在所述从图像传感器采集的视频数据中获取第i待检图像之后,确定所述第i待检图像对应的时间参数。In some embodiments, the determining module 13 is configured to determine a time parameter corresponding to the i-th image to be inspected after acquiring the i-th image to be inspected from the video data collected from the image sensor.
在一些实施例中,所述判断模块14,配置为根据所述时间参数判断所述第i待检图像是否满足初始检测条件。In some embodiments, the judging module 14 is configured to judge, according to the time parameter, whether the i-th image to be inspected satisfies the initial detection condition.
在一些实施例中,所述第二处理模块15,配置为若判定满足所述初始检测条件,则通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果。In some embodiments, the second processing module 15 is configured to, if it is determined that the initial detection conditions are met, perform face detection processing on the i-th image to be checked through a preset face detection network to obtain a face Test results.
在一些实施例中,所述第三处理模块16,配置为若所述人脸检测结果为存在人脸特征,则根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值。In some embodiments, the third processing module 16 is configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be inspected, if the face detection result is that there is a face feature, to obtain a quality inspection value.
在一些实施例中,所述确定模块13,还配置为若所述质量检测值大于或者等于预设质量阈值,则确定所述第i待检图像满足所述预设质量条件。In some embodiments, the determining module 13 is further configured to determine that the i-th image to be inspected satisfies the preset quality condition if the quality detection value is greater than or equal to a preset quality threshold.
在一些实施例中,所述确定模块13,配置为将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数。In some embodiments, the determining module 13 is configured to determine a time interval between the first image to be inspected and the i-th image to be inspected as the time parameter.
在一些实施例中,所述判断模块14,配置为若所述时间参数小于或者等于预设时长阈值,则读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像;其中,k为大于1且小于i的整数;以及若所述k个历史待检图像中的至少一个待检图像与所述第i待检图像不相同,则确定满足所述初始检测条件。In some embodiments, the judging module 14 is configured to read the k historical pending images corresponding to the (i-k)th to (i-1)th images to be inspected if the time parameter is less than or equal to a preset duration threshold. wherein, k is an integer greater than 1 and less than i; and if at least one of the k historical images to be inspected is different from the i-th image to be inspected, it is determined that the initial detection is satisfied condition.
在一些实施例中,所述生成模块17,配置为在将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数之后,若所述时间参数大于所述预设时长阈值,则生成检测超时的第一提示消息。In some embodiments, the generating module 17 is configured to, after determining the time interval from the first image to be inspected to the i-th image to be inspected as the time parameter, if the time parameter is greater than the If the preset duration threshold is set, a first prompt message for detecting timeout is generated.
在一些实施例中,所述生成模块17,还配置为在读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像之后,若所述k个历史待检图像均与所述第i待检图像相同,则生成检测重试的第二提示消息。In some embodiments, the generating module 17 is further configured to, after reading the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, if the k historical images to be inspected If the images are all the same as the i-th image to be inspected, a second prompt message for retrying the inspection is generated.
在一些实施例中,所述读取模块18,配置为在通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果之后,若所述人脸检测结果为不存在人脸特征,则读取第(i-n)至第(i-1)待检图像对应的n个历史人脸检测结果;其中,n为大于1且小于i的整数。In some embodiments, the reading module 18 is configured to perform face detection processing on the i-th image to be inspected through a preset face detection network to obtain a face detection result, if the face detection The result is that there is no face feature, then read the n historical face detection results corresponding to the (i-n)th to (i-1)th images to be checked; wherein, n is an integer greater than 1 and less than i.
在一些实施例中,所述生成模块17,还配置为若所述n个历史人脸检测结果均为不存在人脸特征,则生成人脸检测失败的第三提示消息。In some embodiments, the generating module 17 is further configured to generate a third prompt message that the face detection fails if the n historical face detection results are all without face features.
在一些实施例中,所述读取模块18,还配置为在根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值之后,若所述质量检测值小于所述预设质量阈值,则读取历史第(i-m)至第(i-1)待检图像对应的m个历史质量检测值;其中,m为大于1且小于i的整数。In some embodiments, the reading module 18 is further configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be inspected to obtain a quality detection value, if the quality detection value is less than the predetermined value If the quality threshold is set, m historical quality detection values corresponding to the (i-m)th to (i-1)th historical images to be inspected are read; where m is an integer greater than 1 and less than i.
在一些实施例中,所述生成模块17,还配置为若所述m个历史质量检测值均小于所述预设质量阈值,则生成质量检测失败的第四提示消息。In some embodiments, the generating module 17 is further configured to generate a fourth prompt message that the quality detection fails if the m historical quality detection values are all smaller than the preset quality threshold.
在一些实施例中,所述第一处理模块12,配置为基于预设活体检测网络确定所述第i待检图像对应的当前活体检测结果;以及若所述当前活体检测结果为存在活体,则进行存在活体计数处理,获得计数结果;若所述计数结果大于或者等于预设数量阈值,则确定所述目标检测结果为验证通过。In some embodiments, the first processing module 12 is configured to determine a current living body detection result corresponding to the i-th image to be checked based on a preset living body detection network; and if the current living body detection result is that there is a living body, then Counting of living bodies is performed to obtain a count result; if the count result is greater than or equal to a preset number threshold, it is determined that the target detection result is verified.
在一些实施例中,所述第一处理模块12,还配置为将所述第i待检图像输入所述预设活体检测网络,获得活体概率值;以及若所述活体概率值大于或者等于预设概率阈值,则确定所述当前活体检测结果为存在活体;以及若所述活体概率值小于所述预设概率阈值,则确定所述当前活体检测结果为不存在活体。In some embodiments, the first processing module 12 is further configured to input the i-th image to be inspected into the preset living body detection network to obtain a living body probability value; and if the living body probability value is greater than or equal to a predetermined value If a probability threshold is set, it is determined that the current living body detection result is the presence of a living body; and if the living body probability value is less than the preset probability threshold, it is determined that the current living body detection result is that there is no living body.
在一些实施例中,所述第一处理模块12,还配置为在进行存在活体计数处理,获得计数结果之后,若所述计数结果小于预设数量阈值,则确定所述目标检测结果为验证不通过。In some embodiments, the first processing module 12 is further configured to, after performing the live body counting process and obtaining the counting result, if the counting result is less than a preset number threshold, determine that the target detection result is not verified. pass.
在一些实施例中,所述生成模块17,还配置为在对所述第i待检图像进行活体检测处理,获得目标检测结果之后,响应于所述目标检测结果为验证通过,生成活体检测成功的第五提示消息;以及响应于所述目标检测结果为验证未通过,生成检测重试的第二提示消息。In some embodiments, the generating module 17 is further configured to, after performing a living body detection process on the i-th image to be inspected and obtaining a target detection result, in response to the target detection result being that the verification is passed, generate a successful living body detection and in response to the target detection result being that the verification fails, generating a second prompt message for detection retry.
在一些实施例中,所述图像参数包括光线、遮挡度、清晰度以及角度中的至少一项。In some embodiments, the image parameters include at least one of light, occlusion, sharpness, and angle.
在本公开的实施例中,进一步地,图15为本公开实施例提出的活体检测设备的组成结构示意图,如图15所示,本公开实施例提出的活体检测设备20还可以包括处理器21、存储有处理器21可执行指令的存储器22,进一步地,活体检测设备20还可以包括通信接口23,和用于连接处理器21、存储器22以及通信接口23的总线24。In the embodiment of the present disclosure, further, FIG. 15 is a schematic diagram of the composition structure of the living body detection device proposed by the embodiment of the present disclosure. As shown in FIG. 15 , the living body detection device 20 proposed by the embodiment of the present disclosure may further include a processor 21 , a memory 22 storing executable instructions of the processor 21 , further, the living body detection device 20 may further include a communication interface 23 , and a bus 24 for connecting the processor 21 , the memory 22 and the communication interface 23 .
在本公开的实施例中,上述处理器21可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(ProgRAMmable Logic Device,PLD)、现场可编程门阵列(Field Prog RAMmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,对于不同的设备,用于实现上述处理器功能的电子器件还可以为其它,本公开实施例不作具体限定。活体检测设备20还可以包括存储器22,该存储器22可以与处理器21连接,其中,存储器22用于存储可执行程序代码,该程序代码包括计算机操作指令,存储器22可能包含高速RAM存储器,也可能还包括非易失性存储器,例如,至少两个磁盘存储器。In the embodiment of the present disclosure, the above-mentioned processor 21 may be an application specific integrated circuit (ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD) ), Programmable Logic Device (ProgRAMmable Logic Device, PLD), Field Programmable Gate Array (Field Prog RAMmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor at least one of them. It can be understood that, for different devices, the electronic device used to implement the function of the processor may also be other, which is not specifically limited in the embodiment of the present disclosure. The living body detection device 20 may also include a memory 22, which may be connected to the processor 21, wherein the memory 22 is used to store executable program codes, which include computer operating instructions, and the memory 22 may include high-speed RAM memory, or may Also included is non-volatile memory, eg, at least two disk drives.
在本公开的实施例中,总线24用于连接通信接口23、处理器21以及存储器22以及这些器件之间的相互通信。In the embodiment of the present disclosure, the bus 24 is used to connect the communication interface 23 , the processor 21 and the memory 22 and the mutual communication among these devices.
在本公开的实施例中,存储器22,用于存储指令和数据。In the embodiment of the present disclosure, the memory 22 is used to store instructions and data.
进一步地,在本公开的实施例中,上述处理器21,用于从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数;响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。Further, in the embodiment of the present disclosure, the above-mentioned processor 21 is configured to obtain the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1; in response to the i-th image to be inspected If the image satisfies the preset quality condition, the i-th image to be inspected is subjected to in vivo detection processing to obtain a target detection result.
在实际应用中,上述存储器22可以是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);或者上述种类的存储器的组合,并向处理器15提供指令和数据。In practical applications, the above-mentioned memory 22 may be a volatile memory (volatile memory), such as a random access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as a read-only memory (Read-Only Memory, ROM), flash memory (flash memory), hard disk (Hard Disk Drive, HDD) or solid-state drive (Solid-State Drive, SSD); or a combination of the above-mentioned types of memory, and send it to the processor 15 Provide instructions and data.
另外,在本实施例中的各功能模块可以集成在一个中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in this embodiment may be integrated into one, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of software function modules.
集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of software function modules and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially or correct. Part of the contribution made by the prior art or all or part of the technical solution can be embodied in the form of a software product, the computer software product is stored in a storage medium, and includes several instructions to make a computer device (which can be a personal A computer, a server, or a network device, etc.) or a processor (processor) executes all or part of the steps of the method in this embodiment. The aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.
本公开实施例提供了一种活体检测设备,该活体检测设备可以先从图像传感器采集的视频数据中获取第i待检图像;然后响应于该第i待检图像满足预设质量条件,对该第i待检图像进行活体检测处理,以获得目标检测结果。如此,在活体检测过程中是基于连续图像进行检测的,相较于视频活体检测,网络带宽占用小,可实现检测结果的及时反馈,并且在后续活体检测之前添加质量检测过程,有效保证了 检测过程中的数据质量。可见,本公开实施例提出的活体检测方案有效解决了网络带宽占用大以及检测周期长的问题,实现了高效率的活体检测。An embodiment of the present disclosure provides a living body detection device, which can first obtain an i-th image to be inspected from video data collected by an image sensor; The i-th image to be inspected is subjected to live detection processing to obtain a target detection result. In this way, the detection process is based on continuous images in the process of living body detection. Compared with video living body detection, the network bandwidth is less occupied, and timely feedback of the detection results can be realized, and the quality detection process is added before the subsequent living body detection, which effectively ensures the detection. data quality in the process. It can be seen that the living body detection solution proposed by the embodiments of the present disclosure effectively solves the problems of large network bandwidth occupation and long detection period, and realizes high-efficiency living body detection.
本公开实施例提供一种计算机可读存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的活体检测方法。An embodiment of the present disclosure provides a computer-readable storage medium on which a program is stored, and when the program is executed by a processor, implements the above-mentioned method for detecting a living body.
具体来讲,本实施例中的一种活体检测方法对应的程序指令可以被存储在光盘,硬盘,U盘等存储介质上,当存储介质中的与一种活体检测方法对应的程序指令被一电子设备读取或被执行时,包括如下步骤:Specifically, a program instruction corresponding to a living body detection method in this embodiment may be stored on a storage medium such as an optical disk, a hard disk, a U disk, etc. When the program instruction corresponding to a living body detection method in the storage medium is stored in a When the electronic device reads or is executed, it includes the following steps:
从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数;Obtain the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1;
响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。In response to the i-th image to be inspected meeting a preset quality condition, a living body detection process is performed on the i-th image to be inspected to obtain a target detection result.
相应地,本公开实施例再提供一种计算机程序产品,所述计算机程序产品包括计算机可执行指令,该计算机可执行指令用于实现本公开实施例提供的活体检测方法中的步骤。Correspondingly, an embodiment of the present disclosure further provides a computer program product, wherein the computer program product includes computer-executable instructions, and the computer-executable instructions are used to implement the steps in the living body detection method provided by the embodiment of the present disclosure.
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by one skilled in the art, embodiments of the present disclosure may be provided as a method, system, or computer program product. Accordingly, the present disclosure may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present disclosure may take the form of a computer program product embodied on one or more computer-usable storage media having computer-usable program code embodied therein, including but not limited to disk storage, optical storage, and the like.
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的实现流程示意图和/或方框图来描述的。应理解可由计算机程序指令实现流程示意图和/或方框图中的每一流程和/或方框、以及实现流程示意图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present disclosure is described with reference to schematic flowchart illustrations and/or block diagrams of implementations of methods, apparatus (systems), and computer program products according to embodiments of the present disclosure. It will be understood that each process and/or block in the schematic flowchart illustrations and/or block diagrams, and combinations of processes and/or blocks in the schematic flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a process or processes and/or a block or blocks in the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory result in an article of manufacture comprising instruction means, the instructions An apparatus implements the functions specified in a flow or flows of the implementation flow diagram and/or a block or blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在实现流程示意图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device to cause a series of operational steps to be performed on the computer or other programmable device to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the implementing flow diagram and/or the block or blocks of the block diagram.
以上所述,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。The above descriptions are merely preferred embodiments of the present disclosure, and are not intended to limit the protection scope of the present disclosure.
工业实用性Industrial Applicability
本公开实施例中,通过从图像传感器采集的视频数据中确定第i待检图像;响应于第i待检图像满足预设质量条件,对第i待检图像进行活体检测处理,获得目标检测结果。实现了高效率的活体检测。In the embodiment of the present disclosure, the i-th image to be inspected is determined from the video data collected by the image sensor; in response to the i-th image to be inspected meeting a preset quality condition, a living body detection process is performed on the i-th image to be inspected to obtain a target detection result . High-efficiency in vivo detection is achieved.

Claims (30)

  1. 一种活体检测方法,所述方法包括:A method for detecting a living body, the method comprising:
    从图像传感器采集的视频数据中获取第i待检图像;其中,i为大于1的整数;Obtain the i-th image to be inspected from the video data collected by the image sensor; wherein, i is an integer greater than 1;
    响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。In response to the i-th image to be inspected meeting a preset quality condition, a living body detection process is performed on the i-th image to be inspected to obtain a target detection result.
  2. 根据权利要求1所述的方法,其中,所述从图像传感器采集的视频数据中获取第i待检图像,包括:The method according to claim 1, wherein the acquiring the i-th image to be inspected from the video data collected by the image sensor comprises:
    从所述图像传感器采集的视频数据中提取初始图像;extracting an initial image from the video data collected by the image sensor;
    根据预设配置参数对所述初始图像进行格式预处理,获得处理后图像;Perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image;
    将所述处理后图像确定为所述第i待检图像。The processed image is determined as the i-th image to be inspected.
  3. 根据权利要求1所述的方法,其中,在所述从图像传感器采集的视频数据中获取第i待检图像之后,所述方法还包括:The method according to claim 1, wherein after acquiring the i-th image to be inspected from the video data collected by the image sensor, the method further comprises:
    确定所述第i待检图像对应的时间参数,并根据所述时间参数判断所述第i待检图像是否满足初始检测条件;determining the time parameter corresponding to the i-th image to be inspected, and judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter;
    若判定满足所述初始检测条件,则通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果;If it is determined that the initial detection conditions are met, performing face detection processing on the i-th image to be inspected through a preset face detection network to obtain a face detection result;
    若所述人脸检测结果为存在人脸特征,则根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值;If the face detection result is that there is a face feature, then perform quality detection processing according to the image parameters corresponding to the i-th image to be checked to obtain a quality detection value;
    若所述质量检测值大于或者等于预设质量阈值,则确定所述第i待检图像满足所述预设质量条件。If the quality detection value is greater than or equal to a preset quality threshold, it is determined that the i-th image to be inspected satisfies the preset quality condition.
  4. 根据权利要求3所述的方法,其中,所述确定所述第i待检图像对应的时间参数,包括:The method according to claim 3, wherein the determining the time parameter corresponding to the i-th image to be inspected comprises:
    将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数;Determining the time interval from the first image to be inspected to the i-th image to be inspected as the time parameter;
    相应地,所述根据所述时间参数判断所述第i待检图像是否满足初始检测条件,包括:Correspondingly, judging whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter includes:
    若所述时间参数小于或者等于预设时长阈值,则读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像;其中,k为大于1且小于i的整数;If the time parameter is less than or equal to the preset duration threshold, read the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected; wherein, k is an integer greater than 1 and less than i ;
    若所述k个历史待检图像中的至少一个待检图像与所述第i待检图像不相同,则确定满足所述初始检测条件。If at least one of the k historical images to be inspected is different from the i-th image to be inspected, it is determined that the initial detection condition is satisfied.
  5. 根据权利要求4所述的方法,其中,在所述将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数之后,所述方法还包括:The method according to claim 4, wherein after the time interval between the first image to be inspected and the image to be inspected i is determined as the time parameter, the method further comprises:
    若所述时间参数大于所述预设时长阈值,则生成检测超时的第一提示消息。If the time parameter is greater than the preset duration threshold, a first prompt message for detecting a timeout is generated.
  6. 根据权利要求4所述的方法,其中,在所述读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像之后,所述方法还包括:The method according to claim 4, wherein after reading the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, the method further comprises:
    若所述k个历史待检图像均与所述第i待检图像相同,则生成检测重试的第二提示消息。If the k historical images to be inspected are all the same as the i-th image to be inspected, a second prompt message for detection retry is generated.
  7. 根据权利要求3所述的方法,其中,在所述通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果之后,所述方法还包括:The method according to claim 3, wherein, after performing face detection processing on the i-th image to be inspected through a preset face detection network to obtain a face detection result, the method further comprises:
    若所述人脸检测结果为不存在人脸特征,则读取第(i-n)至第(i-1)待检图像对应的n个历史人脸检测结果;其中,n为大于1且小于i的整数;If the face detection result is that there is no face feature, then read the n historical face detection results corresponding to the (i-n)th to (i-1)th images to be checked; wherein, n is greater than 1 and less than i the integer;
    若所述n个历史人脸检测结果均为不存在人脸特征,则生成人脸检测失败的第三提示消息。If all the n historical face detection results do not have a face feature, a third prompt message that the face detection fails is generated.
  8. 根据权利要求3所述的方法,其中,在所述根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值之后,所述方法还包括;The method according to claim 3, wherein after the quality detection process is performed according to the image parameters corresponding to the i-th image to be inspected to obtain a quality detection value, the method further comprises:
    若所述质量检测值小于所述预设质量阈值,则读取历史第(i-m)至第(i-1)待检图像对应的m个历史质量检测值;其中,m为大于1且小于i的整数;If the quality detection value is smaller than the preset quality threshold, read the m historical quality detection values corresponding to the (i-m)th to (i-1)th images to be checked in history; where m is greater than 1 and less than i the integer;
    若所述m个历史质量检测值均小于所述预设质量阈值,则生成质量检测失败的第四提示消息。If the m historical quality detection values are all smaller than the preset quality threshold, a fourth prompt message for quality detection failure is generated.
  9. 根据权利要求1所述的方法,其中,所述对所述第i待检图像进行活体检测处理,获得目标检测结果,包括:The method according to claim 1, wherein the performing a living body detection process on the i-th image to be inspected to obtain a target detection result comprises:
    基于预设活体检测网络确定所述第i待检图像对应的当前活体检测结果;determining the current living body detection result corresponding to the i-th image to be inspected based on a preset live body detection network;
    若所述当前活体检测结果为存在活体,则进行存在活体计数处理,获得计数结果;If the current living body detection result is that there is a living body, perform a living body counting process to obtain a counting result;
    若所述计数结果大于或者等于预设数量阈值,则确定所述目标检测结果为验证通过。If the count result is greater than or equal to a preset number threshold, it is determined that the target detection result is verified.
  10. 根据权利要求9所述的方法,其中,所述基于预设活体检测网络确定所述第i待检图像对应的当前活体检测结果,包括:The method according to claim 9, wherein the determining the current living body detection result corresponding to the i-th image to be checked based on a preset living body detection network comprises:
    将所述第i待检图像输入所述预设活体检测网络,获得活体概率值;Inputting the i-th image to be inspected into the preset living detection network to obtain a living probability value;
    若所述活体概率值大于或者等于预设概率阈值,则确定所述当前活体检测结果为存在活体;If the living body probability value is greater than or equal to a preset probability threshold, it is determined that the current living body detection result is the presence of a living body;
    若所述活体概率值小于所述预设概率阈值,则确定所述当前活体检测结果为不存在活体。If the living body probability value is smaller than the preset probability threshold value, it is determined that the current living body detection result is that there is no living body.
  11. 根据权利要求9所述的方法,其中,所述进行存在活体计数处理,获得计数结果之后,所述方法还包括:The method according to claim 9, wherein, after the living body counting process is performed and the counting result is obtained, the method further comprises:
    若所述计数结果小于预设数量阈值,则确定所述目标检测结果为验证不通过。If the count result is less than the preset number threshold, it is determined that the target detection result is a failed verification.
  12. 根据权利要求11所述的方法,其中,在所述对所述第i待检图像进行活体检测处理,获得目标检测结果之后,所述方法还包括如下至少一项:The method according to claim 11, wherein, after the i-th image to be inspected is subjected to in vivo detection processing to obtain a target detection result, the method further comprises at least one of the following:
    响应于所述目标检测结果为验证通过,生成活体检测成功的第五提示消息;In response to the target detection result being that the verification is passed, generating a fifth prompt message indicating that the living body detection is successful;
    响应于所述目标检测结果为验证未通过,生成检测重试的第二提示消息。In response to the target detection result being that the verification fails, a second prompt message for detection retry is generated.
  13. 根据权利要求3所述的方法,其中,所述图像参数包括光线、遮挡度、清晰度以及角度中的至少一项。The method of claim 3, wherein the image parameters include at least one of light, occlusion, sharpness, and angle.
  14. 一种活体检测装置,所述活体检测装置包括获取模块和第一处理模块,A living body detection device, the living body detection device includes an acquisition module and a first processing module,
    所述获取模块,配置为从图像传感器采集的视频数据中获取第i待检图像;其中,所述i为大于1的整数;The acquisition module is configured to acquire the i-th image to be inspected from the video data collected by the image sensor; wherein, the i is an integer greater than 1;
    所述第一处理模块,配置为响应于所述第i待检图像满足预设质量条件,对所述第i待检图像进行活体检测处理,获得目标检测结果。The first processing module is configured to, in response to the i-th image to be inspected meeting a preset quality condition, perform in vivo detection processing on the i-th image to be inspected to obtain a target detection result.
  15. 根据权利要求14所述的活体检测装置,其中,The living body detection device according to claim 14, wherein,
    所述获取模块,配置为从所述图像传感器采集的视频数据中提取初始图像;以及根据预设配置参数对所述初始图像进行格式预处理,获得处理后图像;以及将所述处理后图像确定为所述第i待检图像。The acquisition module is configured to extract an initial image from the video data collected by the image sensor; and perform format preprocessing on the initial image according to preset configuration parameters to obtain a processed image; and determine the processed image is the i-th image to be inspected.
  16. 根据权利要求14所述的活体检测装置,其中,所述活体检测装置还包括确定模块、判断模块、第二处理模块以及第三处理模块,The living body detection device according to claim 14, wherein the living body detection device further comprises a determination module, a judgment module, a second processing module and a third processing module,
    所述确定模块,配置为在所述从图像传感器采集的视频数据中获取第i待检图像之后,确定所述第i待检图像对应的时间参数;The determining module is configured to determine the time parameter corresponding to the i-th image to be inspected after acquiring the i-th image to be inspected from the video data collected from the image sensor;
    所述判断模块,配置为根据所述时间参数判断所述第i待检图像是否满足初始检测条件;The judging module is configured to judge whether the i-th image to be inspected satisfies the initial detection condition according to the time parameter;
    所述第二处理模块,配置为若判定满足所述初始检测条件,则通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果;The second processing module is configured to, if it is determined that the initial detection conditions are met, perform face detection processing on the i-th image to be inspected through a preset face detection network to obtain a face detection result;
    所述第三处理模块,配置为若所述人脸检测结果为存在人脸特征,则根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值;The third processing module is configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be checked to obtain a quality detection value if the face detection result is that there is a face feature;
    所述确定模块,还配置为若所述质量检测值大于或者等于预设质量阈值,则确定所述第i待检图像满足所述预设质量条件。The determining module is further configured to determine that the i-th image to be inspected satisfies the preset quality condition if the quality detection value is greater than or equal to a preset quality threshold.
  17. 根据权利要求16所述的活体检测装置,其中,The living body detection device according to claim 16, wherein,
    所述确定模块,配置为将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数;The determining module is configured to determine the time interval from the first image to be inspected to the i-th image to be inspected as the time parameter;
    相应地,所述判断模块,配置为若所述时间参数小于或者等于预设时长阈值,则读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像;其中,k为大于1且小于i的整数;以及若所述k个历史待检图像中的至少一个待检图像与所述第i待检图像不相同,则确定满足所述初始检测条件。Correspondingly, the judging module is configured to read k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected if the time parameter is less than or equal to the preset duration threshold; wherein , k is an integer greater than 1 and less than i; and if at least one of the k historical images to be inspected is different from the i-th image to be inspected, it is determined that the initial detection condition is satisfied.
  18. 根据权利要求17所述的活体检测装置,其中,所述活体检测装置还包括生成模块,The living body detection device according to claim 17, wherein the living body detection device further comprises a generating module,
    所述生成模块,配置为在将第一待检图像至所述第i待检图像之间的时间间隔确定为所述时间参数之后,若所述时间参数大于所述预设时长阈值,则生成检测超时的第一提示消息。The generating module is configured to, after determining the time interval from the first image to be inspected to the i-th image to be inspected as the time parameter, if the time parameter is greater than the preset duration threshold, generate The first prompt message for the detection timeout.
  19. 根据权利要求17所述的活体检测装置,其中,The living body detection device according to claim 17, wherein,
    所述生成模块17,还配置为在读取第(i-k)至第(i-1)待检图像对应的k个历史待检图像之后,若所述k个历史待检图像均与所述第i待检图像相同,则生成检测重试的第二提示消息。The generating module 17 is further configured to read the k historical images to be inspected corresponding to the (i-k)th to (i-1)th images to be inspected, if the k historical images to be inspected are the same as the i The images to be inspected are the same, and a second prompt message for retrying the inspection is generated.
  20. 根据权利要求16所述的活体检测装置,其中,所述活体检测装置还包括读取模块,The living body detection device according to claim 16, wherein the living body detection device further comprises a reading module,
    所述读取模块,配置为在通过预设人脸检测网络对所述第i待检图像进行人脸检测处理,获得人脸检测结果之后,若所述人脸检测结果为不存在人脸特征,则读取第(i-n)至第(i-1)待检图像对应的n个历史人脸检测结果;其中,n为大于1且小于i的整数;The reading module is configured to perform face detection processing on the i-th image to be checked through a preset face detection network, and after obtaining a face detection result, if the face detection result is that there is no face feature , then read the n historical face detection results corresponding to the (i-n) to (i-1) images to be inspected; wherein, n is an integer greater than 1 and less than i;
    所述生成模块,还配置为若所述n个历史人脸检测结果均为不存在人脸特征,则生成人脸检测失败的第三提示消息。The generating module is further configured to generate a third prompt message that the face detection fails if all the n historical face detection results do not have face features.
  21. 根据权利要求16所述的活体检测装置,其中,The living body detection device according to claim 16, wherein,
    所述读取模块,还配置为在根据所述第i待检图像对应的图像参数进行质量检测处理,获得质量检测值之后,若所述质量检测值小于所述预设质量阈值,则读取历史第(i-m)至第(i-1)待检图像对应的m个历史质量检测值;其中,m为大于1且小于i的整数;The reading module is further configured to perform quality detection processing according to the image parameters corresponding to the i-th image to be checked, and after obtaining a quality detection value, if the quality detection value is less than the preset quality threshold, read The m historical quality detection values corresponding to the historical (i-m)th to (i-1)th images to be inspected; wherein, m is an integer greater than 1 and less than i;
    所述生成模块17,还配置为若所述m个历史质量检测值均小于所述预设质量阈值,则生成质量检 测失败的第四提示消息。The generating module 17 is further configured to generate a fourth prompt message that the quality detection fails if the m historical quality detection values are all less than the preset quality threshold.
  22. 根据权利要求14所述的活体检测装置,其中,The living body detection device according to claim 14, wherein,
    所述第一处理模块,配置为基于预设活体检测网络确定所述第i待检图像对应的当前活体检测结果;以及若所述当前活体检测结果为存在活体,则进行存在活体计数处理,获得计数结果;若所述计数结果大于或者等于预设数量阈值,则确定所述目标检测结果为验证通过。The first processing module is configured to determine a current living body detection result corresponding to the i-th image to be inspected based on a preset living body detection network; and if the current living body detection result is the existence of living bodies, perform a living body counting process to obtain Counting result; if the counting result is greater than or equal to the preset number threshold, it is determined that the target detection result is verified.
  23. 根据权利要求22所述的活体检测装置,其中,The living body detection device according to claim 22, wherein,
    所述第一处理模块,还配置为将所述第i待检图像输入所述预设活体检测网络,获得活体概率值;以及若所述活体概率值大于或者等于预设概率阈值,则确定所述当前活体检测结果为存在活体;以及若所述活体概率值小于所述预设概率阈值,则确定所述当前活体检测结果为不存在活体。The first processing module is further configured to input the i-th image to be inspected into the preset living body detection network to obtain a living body probability value; and if the living body probability value is greater than or equal to a preset probability threshold, determine the The current living body detection result is that there is a living body; and if the living body probability value is less than the preset probability threshold, it is determined that the current living body detection result is that there is no living body.
  24. 根据权利要求22所述的活体检测装置,其中,The living body detection device according to claim 22, wherein,
    所述第一处理模块,还配置为在进行存在活体计数处理,获得计数结果之后,若所述计数结果小于预设数量阈值,则确定所述目标检测结果为验证不通过。The first processing module is further configured to, after performing the counting process of the existence of living body and obtaining the counting result, if the counting result is less than the preset number threshold, determine that the target detection result is not passed the verification.
  25. 根据权利要求24所述的活体检测装置,其中,The living body detection device according to claim 24, wherein,
    所述生成模块,还配置为在对所述第i待检图像进行活体检测处理,获得目标检测结果之后,响应于所述目标检测结果为验证通过,生成活体检测成功的第五提示消息;以及响应于所述目标检测结果为验证未通过,生成检测重试的第二提示消息。The generating module is further configured to generate a fifth prompt message of successful living body detection in response to the target detection result being that the verification is passed after the i-th image to be inspected is subjected to in vivo detection processing to obtain a target detection result; and In response to the target detection result being that the verification fails, a second prompt message for detection retry is generated.
  26. 根据权利要求16所述的活体检测装置,其中,The living body detection device according to claim 16, wherein,
    所述图像参数包括光线、遮挡度、清晰度以及角度中的至少一项。The image parameters include at least one of light, occlusion, sharpness, and angle.
  27. 一种活体检测设备,所述活体检测设备包括处理器、存储有所述处理器可执行指令的存储器,当所述指令被所述处理器执行时,实现如权利要求1-13任一项所述的方法。A living body detection device, the living body detection device comprises a processor and a memory storing instructions executable by the processor, when the instructions are executed by the processor, the implementation of any one of claims 1-13 is implemented. method described.
  28. 一种计算机可读存储介质,其上存储有程序,应用于活体检测设备中,所述程序被处理器执行时,实现如权利要求1-13任一项所述的方法。A computer-readable storage medium having a program stored thereon and applied to a living body detection device, when the program is executed by a processor, the method according to any one of claims 1-13 is implemented.
  29. 一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行,被所述电子设备中的处理器执行的情况下,实现权利要求1至13任一项所述的方法。A computer program, comprising computer-readable codes, in the case that the computer-readable codes are executed in an electronic device and executed by a processor in the electronic device, to implement the method described in any one of claims 1 to 13 method.
  30. 一种计算机程序产品,当其在计算机上运行时,使得计算机执行如权利要求1至13中任一项所述的方法。A computer program product which, when run on a computer, causes the computer to perform the method of any one of claims 1 to 13.
PCT/CN2021/103167 2021-03-31 2021-06-29 Living body detection method and apparatus, and device and computer storage medium WO2022205643A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110346603.7 2021-03-31
CN202110346603.7A CN113095180A (en) 2021-03-31 2021-03-31 Living body detection method and device, living body detection equipment and computer storage medium

Publications (1)

Publication Number Publication Date
WO2022205643A1 true WO2022205643A1 (en) 2022-10-06

Family

ID=76671554

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/103167 WO2022205643A1 (en) 2021-03-31 2021-06-29 Living body detection method and apparatus, and device and computer storage medium

Country Status (2)

Country Link
CN (1) CN113095180A (en)
WO (1) WO2022205643A1 (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109858375A (en) * 2018-12-29 2019-06-07 深圳市软数科技有限公司 Living body faces detection method, terminal and computer readable storage medium
US20190362171A1 (en) * 2018-05-25 2019-11-28 Beijing Kuangshi Technology Co., Ltd. Living body detection method, electronic device and computer readable medium
CN111368601A (en) * 2018-12-26 2020-07-03 北京市商汤科技开发有限公司 Living body detection method and apparatus, electronic device, and computer-readable storage medium
CN111967319A (en) * 2020-07-14 2020-11-20 高新兴科技集团股份有限公司 Infrared and visible light based in-vivo detection method, device, equipment and storage medium
CN112070954A (en) * 2020-09-14 2020-12-11 上海商汤智能科技有限公司 Living body identification method, living body identification device, living body identification equipment and storage medium
CN112507798A (en) * 2020-11-12 2021-03-16 上海优扬新媒信息技术有限公司 Living body detection method, electronic device, and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190362171A1 (en) * 2018-05-25 2019-11-28 Beijing Kuangshi Technology Co., Ltd. Living body detection method, electronic device and computer readable medium
CN111368601A (en) * 2018-12-26 2020-07-03 北京市商汤科技开发有限公司 Living body detection method and apparatus, electronic device, and computer-readable storage medium
CN109858375A (en) * 2018-12-29 2019-06-07 深圳市软数科技有限公司 Living body faces detection method, terminal and computer readable storage medium
CN111967319A (en) * 2020-07-14 2020-11-20 高新兴科技集团股份有限公司 Infrared and visible light based in-vivo detection method, device, equipment and storage medium
CN112070954A (en) * 2020-09-14 2020-12-11 上海商汤智能科技有限公司 Living body identification method, living body identification device, living body identification equipment and storage medium
CN112507798A (en) * 2020-11-12 2021-03-16 上海优扬新媒信息技术有限公司 Living body detection method, electronic device, and storage medium

Also Published As

Publication number Publication date
CN113095180A (en) 2021-07-09

Similar Documents

Publication Publication Date Title
US10944767B2 (en) Identifying artificial artifacts in input data to detect adversarial attacks
US11288504B2 (en) Iris liveness detection for mobile devices
CN108805047B (en) Living body detection method and device, electronic equipment and computer readable medium
Galdi et al. Multimodal authentication on smartphones: Combining iris and sensor recognition for a double check of user identity
KR20190072563A (en) Method and apparatus for detecting facial live varnish, and electronic device
CN109756458B (en) Identity authentication method and system
EP4105821A1 (en) Face liveness detection method, system and apparatus, computer device, and storage medium
US9594958B2 (en) Detection of spoofing attacks for video-based authentication
US20150227946A1 (en) Generating barcode and authenticating based on barcode
CN110991432A (en) Living body detection method, living body detection device, electronic equipment and living body detection system
US10750076B2 (en) Network device, image processing method, and computer readable medium
WO2023173686A1 (en) Detection method and apparatus, electronic device, and storage medium
CN113780212A (en) User identity verification method, device, equipment and storage medium
CN110765851A (en) Registration method, device and equipment
CN111899470A (en) Human body falling detection method, device, equipment and storage medium
CN116707965A (en) Threat detection method and device, storage medium and electronic equipment
US20230222842A1 (en) Improved face liveness detection using background/foreground motion analysis
KR20190066218A (en) Method, computing device and program for executing harmful object control
US20100102961A1 (en) Alert system based on camera identification
WO2022205643A1 (en) Living body detection method and apparatus, and device and computer storage medium
EP3035238A1 (en) Video surveillance system and method for fraud detection
TWI822309B (en) Biometric identification methods, servers, clients, methods of generating adversarial samples, computer storage media and computer program products
CN111008925A (en) Certificate watermark verification method, device, equipment and storage medium
CN110795715A (en) Data entry method, device and system and storage medium
Shashidhar et al. Novel framework for optimized digital forensic for mitigating complex image attacks

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21934292

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE