Liveness detection method and apparatus, and electronic device and storage medium

By dynamically adjusting the weight of the liveness score and smoothing the historical score, the problems of false positives and low efficiency in liveness detection are solved, and fast and accurate liveness recognition is achieved.

WO2026113442A1PCT designated stage Publication Date: 2026-06-04ZHEJIANG UNIVIEW TECH CO LTD

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
ZHEJIANG UNIVIEW TECH CO LTD
Filing Date
2025-07-15
Publication Date
2026-06-04

AI Technical Summary

Technical Problem

Existing liveness detection technologies are susceptible to interference from complex environmental factors, leading to false positives for spurious bodies. Furthermore, detection methods based on multiple frames of images affect efficiency and accuracy.

Method used

By determining the initial liveness score, the number of liveness score comparisons and their weights, and combining historical liveness scores for data smoothing, the weights of the liveness scores are dynamically adjusted to quickly determine whether the patient is a live or a prosthesis.

Benefits of technology

It improves the speed and accuracy of liveness detection, reduces false positives for spurious bodies, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025108591_04062026_PF_FP_ABST
    Figure CN2025108591_04062026_PF_FP_ABST
Patent Text Reader

Abstract

A liveness detection method and apparatus, and an electronic device and a storage medium. The method comprises: determining an initial liveness score of at least one current target subject in a current image (S110); determining the number of liveness score comparisons matching the current target subject, and determining an initial liveness score weight matching the number of liveness score comparisons (S120); on the basis of the initial liveness score of the current target subject, the initial liveness score weight, and a historical liveness score of the current target subject in an image previous to the current image, determining a target liveness score of the current target subject (S130); and on the basis of the target liveness score of the current target subject, determining whether the current target subject is a live subject (S140).
Need to check novelty before this filing date? Find Prior Art

Description

Liveness detection methods, devices, electronic equipment, and storage media

[0001] This application claims priority to Chinese Patent Application No. 202411728659.9, filed with the Chinese Patent Office on November 28, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0002] This application relates to the field of image processing technology, such as a liveness detection method, apparatus, electronic device, and storage medium. Background Technology

[0003] With the continuous development of biometric technology, liveness detection technology has become an important means to ensure the security of biometric systems. Liveness detection can effectively block spoofing attacks by determining whether the identified target is a real living person.

[0004] Current liveness detection methods may rely on feature analysis of a single frame of image. However, this approach is susceptible to interference from complex environmental factors, easily leading to false positives for fake objects. Furthermore, if the target object is located at the edge of the image or its angle is deflected, it is also easy to mistake a real target object for a fake. Other liveness detection methods may rely on judging the state set of a certain number of images. However, this method requires accumulating a preset number of frames and determining the liveness detection result based on the category ratio in the multi-frame judgment results. This affects the efficiency and speed of liveness detection, and also results in low accuracy. Summary of the Invention

[0005] This application provides a liveness detection method, apparatus, electronic device, and storage medium to improve the speed, accuracy, and stability of liveness detection.

[0006] In a first aspect, embodiments of this application provide a liveness detection method, the method comprising:

[0007] Determine the initial liveness score of at least one current target object in the current image;

[0008] Determine the number of liveness score comparisons that match the current target object, and determine the initial liveness score weights that match the number of liveness score comparisons;

[0009] The target liveness score of the current target object is determined based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image.

[0010] Based on the target liveness score of the current target object, determine whether the current target object is a live object.

[0011] Secondly, embodiments of this application also provide a liveness detection device, which includes:

[0012] The initial liveness score determination module is configured to determine the initial liveness score of at least one current target object in the current image;

[0013] The initial liveness score weight determination module is configured to determine the number of liveness score comparisons that match the current target object, and to determine the initial liveness score weight that matches the number of liveness score comparisons.

[0014] The target liveness score determination module is configured to determine the target liveness score of the current target object based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image.

[0015] The liveness detection module is configured to determine whether the current target object is a live object based on the target liveness score of the current target object.

[0016] Thirdly, embodiments of this application also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the liveness detection method as described in any of the embodiments of this application.

[0017] Fourthly, embodiments of this application also provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform any of the liveness detection methods described in the embodiments of this application. Attached Figure Description

[0018] Figure 1 is a flowchart of a liveness detection method provided in an embodiment of this application;

[0019] Figure 2 is a flowchart of another liveness detection method provided in an embodiment of this application;

[0020] Figure 3 is a schematic diagram of the screen area division of a shooting device provided in an embodiment of this application;

[0021] Figure 4 is a schematic diagram of a liveness detection device provided in an embodiment of this application;

[0022] Figure 5 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0023] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. In the embodiments of this application, certain software, components, models, etc., existing solutions in the industry may be mentioned. These should be considered exemplary, intended to illustrate the feasibility of implementing the technical solutions of this application, but do not imply that the applicant has already used or necessarily used such solutions.

[0024] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.

[0025] Figure 1 is a flowchart of a liveness detection method provided in an embodiment of this application. This embodiment is applicable to situations involving liveness detection. The method can be executed by a liveness detection device, which can be implemented in hardware and / or software. The liveness detection device can be configured in an electronic device and used in conjunction with an imaging device, or it can be directly configured in an imaging device.

[0026] As shown in Figure 1, the method includes:

[0027] S110. Determine the initial liveness score of at least one current target object in the current image.

[0028] In this embodiment, the current image refers to the image currently being processed, captured by the imaging device. Since this embodiment utilizes a liveness detection device, the liveness detection device can be directly integrated into the imaging device, processing the image after it is captured; alternatively, it can be integrated into other electronic devices and used in conjunction with the imaging device. The electronic devices and imaging device are pre-connected, with the imaging device transmitting the captured image to the electronic device, where the liveness detection device processes the image. The imaging device can be a binocular camera, a monocular camera, or a video camera, etc., and the current image can be a red-green-blue (RGB) image or an infrared (IR) near-infrared image.

[0029] The current target object is the result obtained after object detection in the current image. The target object can be a face, a human body, an animal, etc. For example, by performing object detection on the current image using an object detection algorithm or model, at least one current target object is obtained. When there are multiple current target objects, each object can be processed separately.

[0030] The initial liveness score is the liveness score output by a liveness detection algorithm or model for the current target object. This initial liveness score is not the final result of the current target object's liveness score; rather, it is obtained after subsequent data smoothing using a weighted strategy based on different numbers of liveness score comparisons.

[0031] For example, determining the initial liveness score of the current target object can be achieved by cropping the target object region in the current image to obtain the target object image, and then performing image preprocessing such as denoising, grayscale conversion, and normalization on the target object image. Alternatively, a liveness detection model can be pre-trained on sample images labeled as live or not. This liveness detection model can then be used to extract liveness features from the target object image, such as motion features or physiological features like skin texture, ultimately outputting the initial liveness score of the current target object.

[0032] In this embodiment, an initial liveness score is obtained by performing liveness detection on the current target object in the current image. This initial liveness score is subsequently updated using different weighting strategies for data smoothing. This avoids false positives caused by liveness detection based on a single frame image, thus improving the accuracy of liveness detection. Furthermore, this embodiment updates the initial liveness score of the current target object in the current image to obtain the final target liveness score, and then performs liveness determination based on this target liveness score. This eliminates the need to accumulate a certain number of image frames before liveness determination, improving both the accuracy and efficiency of liveness detection.

[0033] S120. Determine the number of liveness score comparisons that match the current target object, and determine the initial liveness score weight that matches the number of liveness score comparisons.

[0034] In this embodiment, the number of liveness score comparisons refers to the number of image frames for which liveness score comparisons have been performed on the current target object. If the current target object has been determined to be a live object, the liveness detection process for the current target object ends. Therefore, the number of liveness score comparisons can also refer to the number of image frames for which the current target object has not been determined to be a live object.

[0035] In this embodiment, the number of liveness score comparisons for each target object can be accumulated. When a target object is detected for the first time, the initial value of the number of liveness score comparisons for that target object is set to 0. If the target object is not identified as a live being based on its target liveness score, the number of liveness score comparisons is incremented by one. When the target object is detected again, if the target object is identified as a live being based on its target liveness score, the liveness detection process for that target object is stopped; otherwise, the number of liveness score comparisons is continuously accumulated.

[0036] When there are multiple target objects, it is necessary to count the number of liveness score comparisons for each target object separately. At the same time, for consecutive frames, it is necessary to determine whether the target objects detected in consecutive frames belong to the same target object, so as to realize the separate counting of liveness score comparisons for multiple target objects.

[0037] In some embodiments, determining whether a target object detected in two consecutive frames belongs to the same target object can be achieved by setting a target object identifier for the target object during target object detection and tracking. For example, taking the current image and the previous image as examples, when performing target object detection and tracking on the previous image, a target object identifier is set for at least one previous target object in the previous image; similarly, when performing target object detection and tracking on the current image, a target object identifier is set for at least one current target object in the current image. By comparing the target object identifiers of the current target object and the previous target object, it is determined whether the current target object and the previous target object belong to the same target object, thereby enabling subsequent counting of liveness score comparisons.

[0038] In some embodiments, determining whether the target objects detected in two consecutive frames belong to the same target object can also be achieved by comparing the similarity of the target objects in the two consecutive frames. For example, taking the current image and the previous image as an example, the similarity is calculated for at least one current target object in the current image and at least one previous target object in the previous image. Based on the similarity, it is determined whether the current target object and the previous target object belong to the same target object, and then the number of subsequent liveness score comparisons is counted.

[0039] The initial liveness score weight refers to the weight assigned to the initial liveness score when calculating the target liveness score of the current target object. In this embodiment, the fewer the number of liveness score comparisons, the higher the initial liveness score weight.

[0040] When the number of liveness score comparisons is small, a higher initial liveness score weight is set, meaning the initial liveness score of the current target object has a higher confidence level. In scenarios where the target object is actually live, this allows for rapid identification as a live object, improving liveness detection speed. However, in scenarios where the target object is actually a fake, prolonged fake attacks are easily misidentified as live. Therefore, as the number of liveness score comparisons increases, the initial liveness score weight decreases, meaning the confidence level of the initial liveness score decreases. In scenarios where the target object is actually a fake, decreasing the initial liveness score weight frame by frame can effectively detect fake attacks.

[0041] In some embodiments, determining the initial liveness score weight that matches the number of liveness score comparisons can be achieved by pre-setting different mapping relationships between different ranges of liveness score comparisons and the initial liveness score weight. For example, for liveness score comparisons of 1-3, the corresponding initial liveness score weight is set to 0.9; for liveness score comparisons of 4-5, the corresponding initial liveness score weight is set to 0.3; for liveness score comparisons of 6-8, the corresponding initial liveness score weight is set to 0.2; and for liveness score comparisons greater than or equal to 9, the corresponding initial liveness score weight is set to 0.1.

[0042] In some embodiments, determining the initial liveness score weights that match the number of liveness score comparisons can also be achieved by setting a mathematical function to define the relationship between the number of liveness score comparisons and the initial liveness score weights. For example, for the case of 1-3 liveness score comparisons, the relationship between the number of liveness score comparisons and the initial liveness score weights can be determined by the following formula: Where ω is the initial liveness score weight, and n is the number of liveness score comparisons; for cases where the number of liveness score comparisons is greater than 3, the relationship between the number of liveness score comparisons and the initial liveness score weight can be determined by the following formula:

[0043] In some embodiments, determining an initial liveness score weight that matches the number of liveness score comparisons includes: in response to determining that the number of liveness score comparisons is less than or equal to a preset comparison number threshold, determining the initial liveness score weight as a preset weight.

[0044] In this embodiment, the comparison count threshold can be a small value, such as 3 or 5, and the preset weight can be a large weight, such as 0.9. When the number of liveness score comparisons is less than or equal to the preset comparison count threshold, a higher weight is set for the initial liveness score of the current target object in the current image, so as to improve the detection speed and accuracy of real liveness at this stage.

[0045] In scenarios where the target object is actually a real live subject, in the initial stages when there are fewer liveness score comparisons, the target object has a high initial liveness score. Furthermore, the initial liveness score has a high weight, allowing the target object to be quickly identified as a real live subject. Even if the target object has a low initial liveness score in one or a few frames due to false detections, environmental changes, or angle shifts, the high weight of the initial liveness score means that the target object can still be quickly identified as a real live subject when the initial liveness score detection in the current image is normal.

[0046] Therefore, in this embodiment, when the number of liveness score comparisons is less than or equal to a preset comparison threshold, a higher preset weight is set for the initial liveness score, which can not only improve the detection speed of real liveness, but also improve the accuracy of real liveness determination.

[0047] In some embodiments, determining an initial liveness score weight that matches the number of liveness score comparisons may further include: in response to determining that the number of liveness score comparisons is greater than a preset comparison number threshold, determining an initial liveness score weight based on the number of liveness score comparisons; wherein the initial liveness score weight is less than a preset weight, and the larger the number of liveness score comparisons, the smaller the initial liveness score weight.

[0048] In this embodiment, when the number of liveness score comparisons exceeds a preset comparison threshold, a smaller weight is set for the initial liveness score, and the weight of the initial liveness score gradually decreases as the number of liveness score comparisons increases.

[0049] For example, the relationship between the number of liveness score comparisons and the initial liveness score weights can be determined using the following formula: Taking a threshold of 3 comparisons and a preset weight of 0.9 as an example, when the number of liveness score comparisons is less than or equal to 3, the initial liveness score weight is 0.9. When the number of liveness score comparisons is greater than 3, the initial liveness score weight is... n represents the number of liveness score comparisons. When the number of liveness score comparisons is 4, the initial liveness score weight is 0.25; when the number of liveness score comparisons is 5, the initial liveness score weight is 0.2. As the number of liveness score comparisons increases, the initial liveness score weight gradually decreases.

[0050] For common spoofing attacks, the liveness score is usually low in the initial stage. However, prolonged spoofing attacks may cause the liveness score to rise, leading to misclassification as a real live subject. Therefore, this embodiment assigns a small weight to the initial liveness score when the number of liveness score comparisons exceeds a preset comparison threshold. Furthermore, the weight of the initial liveness score gradually decreases as the number of liveness score comparisons increases. This setting improves the accuracy of spoofing detection and ensures effective spoofing detection.

[0051] In this embodiment, by adjusting the dynamic initial liveness score weight based on the number of liveness score comparisons, the speed and accuracy of liveness detection are improved on the one hand, and the accuracy of spurious detection is improved on the other hand, thus avoiding false positives for spurious detection.

[0052] S130. Determine the target liveness score of the current target object based on the initial liveness score, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image.

[0053] In this embodiment, the historical liveness score is obtained by smoothing the initial historical liveness score of the current target object in the previous image of the current image. Correspondingly, after determining the target liveness score of the current target object in this embodiment, the target liveness score is also used as the historical liveness score of the target corresponding to the current image, and thus applied to the calculation of the target liveness score of the current target object in the next image of the current image.

[0054] In this embodiment, the historical liveness score weight is 1 minus the initial liveness score weight. Based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image, the target liveness score of the current target object is determined. This can be achieved using the following formula: P = μ × P current +(1-μ)×P pre Where P is the target liveness score of the current target object, μ is the initial liveness score weight, and P current P represents the initial liveness score of the current target object. pre This represents the historical liveness score of the current target object in the previous image of the current image.

[0055] For example, when the current target object is first identified, the liveness score comparison count is set to an initial value of 0. Simultaneously, since the current target object does not exist in the previous image, the historical liveness score is also set to an initial value of 0. At this point, the product of the initial liveness score and the initial liveness score weight of the current target object is the target liveness score of the current target object. In subsequent liveness determinations based on the target liveness score, if the target liveness score does not indicate a live object, the liveness score comparison count is incremented by one, and the target liveness score is used as the historical liveness score of the current target object. When processing the image following the current image, the target liveness score of the current target object in the following image can be calculated using the above formula based on the initial liveness score, the initial liveness score weight, and the historical liveness score of the current target object in the following image.

[0056] Based on the above calculation formula and the initial liveness score weights corresponding to different liveness score comparison counts, it can be seen that: in the early stage of comparison, that is, when the number of liveness score comparisons is small, the initial liveness score weight has a high value. At this time, the calculation of the target liveness score refers more to the initial liveness score of the current target object in the current image, thereby improving the detection speed and accuracy of true liveness. In the later stage of comparison, that is, when the number of liveness score comparisons is large, the initial liveness score weight gradually decreases, while the historical liveness score weight gradually increases. At this time, the calculation of the target liveness score refers more to the historical liveness score, which can improve the accuracy of spoofing judgment and ensure the spoofing detection effect.

[0057] In this embodiment, different initial liveness score weighting strategies are set for each segment of the liveness score comparison count. Simultaneously, historical liveness scores are introduced to smooth the initial liveness score of the current target object in the current image. The advantages of this approach are twofold: firstly, it improves the detection speed and accuracy of real liveness objects and enhances the detection of fake objects; secondly, introducing historical liveness scores to smooth the initial liveness score avoids judgment errors caused by false detections of initial liveness scores in a single frame or several frames.

[0058] S140. Based on the target liveness score of the current target object, determine whether the current target object is a live object.

[0059] In this embodiment, the presence or absence of a live target object can be determined by comparing its target liveness score with a preset score threshold. A higher target liveness score indicates a greater probability that the target object is alive; therefore, the score threshold is typically a high liveness score. In this embodiment, a liveness detection prompt can also be provided when the target liveness score of the current target object is greater than or equal to the preset score threshold. For example, a liveness detection prompt can be implemented through voice announcements, user interface displays, or other methods.

[0060] In some embodiments, a specific strategy for determining whether the current target object is alive based on the target liveness score of the current target object can be determined according to the applicable scenario of liveness detection.

[0061] In one example, taking a human or animal as the target object, and considering a scenario where liveness detection is applied to flight area security, to ensure the safety of the flight area as much as possible, it is necessary to detect as many potential live objects as possible, while having a certain tolerance for spurious objects being mistakenly identified as live. In this scenario, on the one hand, the score threshold can be appropriately lowered, and on the other hand, a liveness detection prompt can be given only when the current target object is identified as live.

[0062] In another example, taking a face as the target object and liveness detection as an application to pedestrian detection, it's necessary not only to improve the liveness detection experience and avoid spoofing attacks, but also to prevent false positives when people are merely stopping without intending to pass, ensuring seamless passage for these individuals. Therefore, in this scenario, on the one hand, the score threshold can be appropriately increased; on the other hand, when the target liveness score is below the preset threshold, it shouldn't be directly identified as a spoof. Instead, factors such as the number of liveness score comparisons, movement trajectory, and movement speed should be considered to further determine whether the current target object is a spoof. Only after being identified as a spoof in this second judgment process should a spoof detection prompt be issued, thus ensuring seamless passage for those who are merely stopping without intending to pass.

[0063] In this embodiment, the initial liveness score and the number of liveness score comparisons for the current target object in the current image are determined, and an initial liveness score weight matching the number of liveness score comparisons is determined. Based on the initial liveness score, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image, the target liveness score of the current target object is determined. The target liveness score is then used to determine whether the current target object is alive. This solves the problem in related technologies where liveness detection based on a single frame image easily leads to false positives, and the problem that liveness detection based on the cumulative state of liveness detection scores from a certain number of frames affects liveness detection efficiency and reduces liveness detection speed. This improves the speed, accuracy, and stability of liveness detection.

[0064] Figure 2 is a flowchart of another liveness detection method provided in the embodiment of this application. Based on the above embodiment, the embodiment of this application specifies the process of judging the liveness of the current target object according to the target liveness score.

[0065] As shown in Figure 2, the method includes:

[0066] S210. Determine the initial liveness score of at least one current target object in the current image.

[0067] S220. Determine the number of liveness score comparisons that match the current target object, and determine the initial liveness score weight that matches the number of liveness score comparisons.

[0068] S230. Determine the target liveness score of the current target object based on the initial liveness score, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image.

[0069] In this embodiment, the process of determining the initial liveness score of the current target object in the current image, the process of determining the initial liveness score weight, and the process of calculating the target liveness score of the current target object have been described in the above embodiments, and will not be repeated here.

[0070] S240. Determine whether the target liveness score of the current target object is greater than or equal to the preset score threshold. If yes, execute S250; otherwise, execute S260.

[0071] In this embodiment, when the target liveness score of the current target object is greater than or equal to the score threshold, the current target object is determined to be a live object; when the target liveness score of the current target object is less than the score threshold, it is necessary to combine the number of liveness score comparisons of the current target object to determine whether the current target object is a spurious object.

[0072] When the target object is located at the edge of the image, lingers for an extended period, or is at an angle, it is easily misidentified as a fake. In such cases, the target object may not have any intent matching the liveness detection scenario, such as the intent to pass through. If it is misidentified as a fake, or even if a fake detection warning is issued after misidentification, it will negatively impact the user experience of the target object.

[0073] Therefore, in this embodiment, when the target liveness score of the current target object is less than the score threshold, it further determines whether the current target object is a spoof by combining the number of liveness score comparisons and factors such as the current target object's movement trajectory and behavioral state. The advantage of this setting is that, based on the initial segmented smoothing of the liveness score to improve the accuracy of both real liveness detection and spoof detection, by introducing a comparison number threshold that is adaptively quantized based on the target object's behavioral state to judge the number of liveness score comparisons, it can avoid the influence of the target object's behavioral state on the liveness detection results, effectively identify real liveness without any intention to detect liveness, and improve the user experience.

[0074] S250. Determine that the current target object is a living being.

[0075] In this embodiment, when the target liveness score of the current target object is greater than or equal to the liveness score threshold, the current target object is directly determined to be a live object, and the liveness detection process for the current target object is stopped.

[0076] In some embodiments, after determining that the current target object is a living being, a liveness detection prompt can be given through voice prompts, user interface displays, or other means.

[0077] S260. Determine the threshold number of comparisons to match the current target object.

[0078] In this embodiment, the comparison count threshold is used to represent the sensitivity of prosthesis detection. When the number of comparisons of the liveness score of the current target object is greater than or equal to the comparison count threshold, the current target object is determined to be a prosthesis.

[0079] In this embodiment, the comparison count threshold is a value that is adaptively adjusted according to the current behavior state of the target object. The larger the comparison count threshold, the lower the probability that the current target object is identified as a fake, and the smaller the comparison count threshold, the higher the probability that the current target object is identified as a fake.

[0080] In this embodiment, by adaptively adjusting the comparison threshold based on the current behavior state of the target object, the limiting conditions for detecting fake objects can be determined, avoiding the misdetection of real living objects without the intention of detecting living objects as fake objects, thus improving the user experience.

[0081] The higher the comparison threshold, the lower the probability that the current target object is identified as a fake. Therefore, a higher comparison threshold can be set for genuine live objects without any intention to detect liveness. The current target object's behavior, such as its trajectory, speed, offset angle, and distance from the camera, can be used to determine whether it is a genuine live object without any intention to detect liveness. For example, if the target object's trajectory is located at the edge of the image, its speed is low or even zero, its offset angle is large, and its distance from the camera is far, it is assumed that it may only be lingering within the camera's field of view. In this case, a higher comparison threshold can be set to avoid misidentifying this type of target object as a fake.

[0082] In some embodiments, determining a threshold for the number of comparisons to match the current target object may include:

[0083] A1. Determine the motion trajectory of the current target object in the current image and at least one historical image preceding the current image, the tilt angle of the current target object in the current image, the motion speed of the current target object in the current image, and the size ratio of the current target object in the current image;

[0084] A2. Determine the detection intent evaluation value of the current target object based on the motion trajectory, tilt angle, motion speed, and size ratio;

[0085] A3. Determine the threshold for the number of comparisons based on the detection intent evaluation value; wherein, the detection intent evaluation value is inversely proportional to the threshold for the number of comparisons.

[0086] In this embodiment, the current target object can be tracked and its trajectory determined by tracking algorithms such as Kalman filtering, particle filtering, deep learning, or optical flow.

[0087] If the motion trajectory of the current target object is located at the edge of the image area of ​​the shooting device, it is more likely to be misjudged as a fake. Therefore, the closer the motion trajectory of the current target object is to the edge of the image area of ​​the shooting device, the lower the detection intent evaluation value, the higher the comparison number threshold, and the lower the probability that the current target object is judged as a fake.

[0088] The tilt angle of the current target object in the current image can be determined by pose estimation algorithms based on feature point detection, deep learning, or model matching.

[0089] If the current target object has a large tilt angle in the current image, it is more likely to be misidentified as a fake. Therefore, the larger the tilt angle of the current target object in the current image, the lower the detection intent evaluation value, the higher the comparison number threshold, and the lower the probability that the current target object is identified as a fake.

[0090] The motion speed of a target object in the current image can be determined using methods such as optical flow and frame difference. Taking frame difference as an example, the pixel distance can be calculated based on the position of the target object in the current image and its position in the previous image; then, the spatial distance can be determined based on the pre-calibrated mapping relationship between pixel distance and spatial distance; finally, the motion speed can be calculated based on the spatial distance and the frame time interval between the current image and the previous image.

[0091] The motion speed of the current target object in the current image can also be determined by pre-fitting a mapping relationship between the target object's region size and the distance between the target object and the imaging device. Based on the region size and mapping relationship of the current target object in the current and previous images, the distance between the target object and the imaging device in the current image and the distance between the target object and the imaging device in the previous image are determined respectively. Based on the distance difference and the frame time interval between the current and previous images, the motion speed of the current target object in the current image is calculated.

[0092] In this embodiment, the mapping relationship between the target object region size and the distance between the target object and the imaging device can be determined by polynomial fitting. For example, a polynomial is constructed: p(x) = a n x n +a n-1 x n-1 +…+a1x+a0, where x is the independent variable, representing the size of the target object region, p(x) represents the distance between the target object and the shooting device, and a…+a1x+a0… n a n-1 a1, a0, ... are the coefficients to be solved. The least squares method is used to fit polynomial coefficients using the dimensions of multiple sample target object regions and their corresponding distances. The fitted polynomial coefficients minimize the sum of squared errors of the target object region dimensions and their corresponding distances within the set of polynomial coefficients.

[0093] If the current target object has a low or even zero motion speed in the current image, the lower its detection intent evaluation value and the higher the comparison number threshold, the lower the probability that the current target object is identified as a fake.

[0094] The size ratio of the current target object in the current image can be calculated by the ratio of the size of the current target object region to the size of the current image. The smaller the size ratio, the lower the detection intent evaluation value of the current target object, the higher the comparison number threshold, and the lower the probability that the current target object is identified as a fake.

[0095] In this embodiment, the detection intent evaluation value of the current target object is determined based on the motion trajectory, tilt angle, motion speed, and size ratio. Specifically, the motion trajectory evaluation value, tilt angle evaluation value, motion speed evaluation value, and size ratio evaluation value can be determined based on the motion trajectory, tilt angle, motion speed, and size ratio, respectively. Weights can be assigned to each evaluation value, and then a weighted average can be performed to obtain the detection intent evaluation value.

[0096] Based on the motion trajectory, a motion trajectory evaluation value is determined. In some embodiments, the image area of ​​the shooting device can be divided into different sub-regions, and different motion trajectory evaluation values ​​can be set for different regions. After determining the motion trajectory, the motion trajectory evaluation value of the current target object can be determined based on the proportion of the motion trajectory length in each region.

[0097] For example, as shown in Figure 3, a schematic diagram of the screen area division of a shooting device is provided. The screen area of ​​the shooting device is divided into five areas: A, B, and C. The lowest motion trajectory evaluation value can be set for areas A and D, such as 0.2; the lower motion trajectory evaluation value can be set for areas B and C, such as 0.3; and the highest motion trajectory evaluation value can be set for area E, such as 0.8.

[0098] In some embodiments, the motion trajectory evaluation value of the current target object is determined based on the proportion of the motion trajectory length in each region. This can be achieved by determining the length of the motion trajectory in each region and using the motion trajectory evaluation value corresponding to the region with the highest length as the current target object's motion trajectory evaluation value. Alternatively, the length of the motion trajectory in each region can be determined, and the ratio of each region's length to the total length can be calculated. This ratio is then used as the weight for each region, and the motion trajectory evaluation values ​​for each region are weighted and summed to obtain the final motion trajectory evaluation value of the current target object.

[0099] Based on the motion trajectory, a motion trajectory evaluation value is determined. In some embodiments, the image area of ​​the shooting device may be divided into different sub-regions, and different motion trajectory evaluation values ​​are set for different regions. The coordinates of the center point of the motion trajectory are calculated, and the motion trajectory evaluation value corresponding to the sub-region where the center point coordinates are located is used as the motion trajectory evaluation value of the current target object.

[0100] Based on the tilt angle, a tilt angle evaluation value is determined. In some embodiments, different tilt angle ranges can be assigned corresponding tilt angle evaluation values. The tilt angle evaluation value of the current target object is determined based on the tilt angle range corresponding to the tilt angle of the current target object. For example, for tilt angles of 0-40°, the corresponding tilt angle evaluation value can be set to 1, and for tilt angles of 41°-90°, the corresponding tilt angle evaluation value can be set to 0.3.

[0101] Based on the movement speed, a motion speed evaluation value is determined. In some embodiments, different motion speed evaluation values ​​can be set for different motion speed ranges. The motion speed evaluation value of the current target object is determined according to the motion speed range in which the current target object moves within the current image. For example, for a motion speed of 0-0.05 m / s, the corresponding motion speed evaluation value can be set to 0.2; for a motion speed of 0.06-0.1 m / s, the corresponding motion speed evaluation value can be set to 0.3; for a motion speed of 0.11-0.2 m / s, the corresponding motion speed evaluation value can be set to 0.5; and for a motion speed greater than 0.2 m / s, the corresponding motion speed evaluation value can be set to 0.8. The setting of the motion speed range and the correspondence between the motion speed range and the motion speed evaluation value can be flexibly determined according to the actual situation of the applicable scenario.

[0102] Based on the size ratio, a size ratio evaluation value is determined. Different size ratio ranges can be assigned corresponding evaluation values. The evaluation value of the current target object is determined according to the size ratio range within which it falls in the current image. For example, a size ratio less than 2% can be set to 0.2; 3%-5% to 0.3; 6%-10% to 0.5; and greater than 10% to 0.8. Similarly, the size ratio ranges and their corresponding evaluation values ​​can be flexibly determined based on the specific circumstances of the application scenario.

[0103] Based on the detected intent evaluation value, a threshold for the number of comparisons is determined. In some embodiments, a corresponding threshold for the number of comparisons can be set according to different ranges of detected intent evaluation values. For example, for a detected intent evaluation value of 0-0.3, the threshold for the number of comparisons is set to 100; for a detected intent evaluation value of 0.4-0.6, the threshold for the number of comparisons is set to 50; and for a detected intent evaluation value greater than 0.6, the threshold for the number of comparisons is set to 10.

[0104] Based on the detected intent evaluation value, a threshold for the number of comparisons is determined. In some embodiments, this can be determined using a mathematical function. The smaller the detected intent evaluation value, the larger the threshold for the number of comparisons. The specific form of the mathematical function can be set according to actual needs. For example, it can be set to...

[0105] In some embodiments, determining the threshold for the number of comparisons to match the current target object may further include:

[0106] B1. Determine the trajectory of the current target object in the current image and at least one historical image preceding the current image, the tilt angle of the current target object in the current image, and the speed of the current target object in the current image;

[0107] B2. Determine the threshold number of comparisons to match the current target object based on the current target object's motion trajectory, tilt angle, and motion speed.

[0108] In this embodiment, the process of determining the motion trajectory, tilt angle, and motion speed has been described in the above embodiments, and will not be repeated here.

[0109] In some embodiments, A2 may include: determining a motion trajectory coefficient based on the motion trajectory of the current target object, determining a tilt angle coefficient based on the tilt angle of the current target object, determining a reference frame number based on the motion speed, and determining a threshold number of comparisons to match the current target object based on the motion trajectory coefficient, the tilt angle coefficient, and the reference frame number.

[0110] In this embodiment, the closer the motion trajectory of the current target object is to the edge of the image area of ​​the shooting device, the larger the motion trajectory coefficient. Correspondingly, different motion trajectory coefficients can be set for different sub-regions of the image area of ​​the shooting device. Taking the image area of ​​the shooting device in Figure 3 as divided into five regions A, E, and D as an example, the highest motion trajectory coefficient, such as 1, can be set for regions A and D; a relatively high motion trajectory coefficient, such as 0.5, can be set for regions B and C; and the lowest motion trajectory coefficient, such as 0.2, can be set for region E. The motion trajectory coefficient of the current target object is determined by weighted summation of the motion trajectory coefficients of each region based on the motion trajectory length ratio of the region with the largest proportion, or based on the proportion of the motion trajectory length in each region.

[0111] In this embodiment, the larger the tilt angle of the current target object, the larger the tilt angle coefficient. Correspondingly, different tilt angle coefficients are set for different tilt angle ranges. The tilt angle coefficient of the current target object is determined based on the tilt angle range corresponding to its tilt angle. For example, for tilt angles of 0-40°, the corresponding tilt angle coefficient can be set to 0.3; for tilt angles of 41°-90°, the corresponding tilt angle evaluation value can be set to 0.8.

[0112] The reference frame number is determined based on the motion speed. In some embodiments, the reference frame number can be determined separately for different motion speed ranges. For example, for motion speeds of 0-0.05 m / s, the corresponding reference frame number can be set to 50; for motion speeds of 0.06-0.1 m / s, the corresponding reference frame number can be set to 20; for motion speeds of 0.11-0.2 m / s, the corresponding reference frame number can be set to 10; and for motion speeds greater than 0.2 m / s, the corresponding reference frame number can be set to 3.

[0113] Based on the motion trajectory coefficient, tilt angle coefficient, and reference frame number, the threshold for the number of comparisons required to match the current target object is determined. This can be achieved by adding 1 to the values ​​obtained from the motion trajectory coefficient and tilt angle coefficient, multiplying this value by the reference frame number, and obtaining the final threshold for the number of comparisons. For example, if the motion trajectory coefficient is 0.5, the tilt angle coefficient is 0.8, and the reference frame number is 50, then the threshold for the number of comparisons is (1 + 0.5 + 0.8) × 50 = 115.

[0114] In other embodiments, A2 may further include: determining a threshold number of comparisons to match the current target object using the following formula: Where λ represents the threshold number of comparisons to match the current target object, and L t+1 L represents the distance between the target object and the shooting device at the current time (i.e., time t+1). t+1 To determine the distance L based on the current target object's size at the current moment and the pre-fitted relationship between the target object's size and distance, t-1 L represents the distance between the target object and the imaging device at time t-1. t-1 The distance v is determined based on the current target object size at time t-1 and the pre-fitted relationship between the target object size and distance. t v represents the velocity of the current target object at time t. t According to L t+1 L t The velocity is calculated from the inter-frame time interval of adjacent images, where Δt is the inter-frame time interval of adjacent images, and w tra The motion trajectory coefficients, w, are obtained by determining the position of the motion trajectory within the image frame. ang The tilt angle coefficient is determined based on the tilt angle.

[0115] In this embodiment, the process of determining the motion trajectory coefficient and tilt angle coefficient will not be described again. This can be used as a method to determine the baseline frame count. Based on the current target object's speed at the current moment, the number of image frames required for the target object to move from its position at time t-1 to its position at time t+1 is calculated and used as the baseline frame count. The smaller the speed, the larger the baseline frame count.

[0116] In this embodiment, the influence of factors such as the current target object's motion trajectory, motion speed, and tilt angle on the detection of spurs is comprehensively considered, and the adaptive dynamic adjustment of the comparison number threshold is realized. The limiting conditions of the spur state are determined, which avoids real living objects without the intention to be detected being misjudged as spurs, and provides a good passage experience for real living objects without the intention to be detected.

[0117] S270. Determine whether the number of liveness score comparisons of the current target object is greater than or equal to the comparison count threshold. If yes, execute S280; otherwise, return to execute S210.

[0118] In this embodiment, the number of liveness score comparisons is compared with an adaptively dynamically adjusted comparison threshold. Only when the number of liveness score comparisons of the current target object is greater than or equal to the comparison threshold is the current target object determined to be non-live (i.e., a prosthesis).

[0119] S280. Determine that the current target object is not a living organism.

[0120] In this embodiment, after determining that the current target object is a non-living body (i.e., a prosthesis), the prosthesis detection prompt can be given through voice prompts, user interface display, or other means.

[0121] In some embodiments, for a current target object whose liveness score comparison count is less than the comparison count threshold, neither a liveness detection prompt is given (because its target liveness score is less than the liveness score threshold) nor a spurious detection prompt is given (because its liveness score comparison count is less than the comparison count threshold). Therefore, the current target object is considered to be a real live body without the intention of being detected, and no prompt is given, but it needs to be continuously monitored until it is detected as a live / spurious body, or it leaves the frame area of ​​the shooting device.

[0122] This embodiment combines historical liveness scores from the previous image to perform time-segmented smoothing on the initial liveness score of the current target object in the current image, updating and correcting the liveness score in the current image. This avoids the false alarm problem that exists in single frames in liveness detection technology, improving the efficiency and speed of liveness detection while maintaining the accuracy and stability of both liveness and spoof detection. Furthermore, by combining a comparison count threshold obtained through dynamic adaptive adjustment based on the current target object's behavioral state, the constraints on spoof status are determined. By judging the number of liveness score comparisons, the sensitivity to spoof reporting is reduced, ensuring seamless passage for genuinely live individuals who do not intend to be detected, thereby improving the user experience.

[0123] Figure 4 is a schematic diagram of a liveness detection device provided in an embodiment of this application. As shown in Figure 4, the device includes:

[0124] The initial liveness score determination module 310 is configured to determine the initial liveness score of at least one current target object in the current image;

[0125] The initial liveness score weight determination module 320 is configured to determine the number of liveness score comparisons that match the current target object, and to determine the initial liveness score weight that matches the number of liveness score comparisons.

[0126] The target liveness score determination module 330 is configured to determine the target liveness score of the current target object based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image.

[0127] The liveness detection module 340 is configured to determine whether the current target object is a live object based on the target liveness score of the current target object.

[0128] In this embodiment, the initial liveness score and the number of liveness score comparisons for the current target object in the current image are determined, and an initial liveness score weight matching the number of liveness score comparisons is determined. Based on the initial liveness score, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image, the target liveness score of the current target object is determined. The target liveness score is then used to determine whether the current target object is alive. This solves the problem in related technologies where liveness detection based on a single frame image easily leads to false positives, and the problem that liveness detection based on the cumulative state of liveness detection scores from a certain number of frames affects liveness detection efficiency and reduces liveness detection speed. This improves the speed, accuracy, and stability of liveness detection.

[0129] In some embodiments, the initial liveness score weighting determination module 320 includes:

[0130] The first weight determination unit is configured to determine the initial liveness score weight as a preset weight in response to determining that the number of liveness score comparisons is less than or equal to a preset comparison number threshold.

[0131] In some embodiments, the initial liveness score weighting determination module 320 includes:

[0132] The second weight determination unit is configured to determine the initial liveness score weight based on the number of liveness score comparisons in response to determining that the number of liveness score comparisons is greater than a preset comparison number threshold.

[0133] The initial liveness score weight is less than the preset weight, and the greater the number of liveness score comparisons, the smaller the initial liveness score weight.

[0134] In some embodiments, the target liveness score determination module 330 includes:

[0135] The target liveness score calculation unit is configured to determine the target liveness score of the current target object using the following formula: P = μ × P current +(1-μ)×P pre ;

[0136] Where P is the target liveness score of the current target object, μ is the initial liveness score weight, and P current P represents the initial liveness score of the current target object. pre This represents the historical liveness score of the current target object in the previous image of the current image.

[0137] In some embodiments, the liveness detection module 340 includes:

[0138] The comparison count threshold determination unit is set to determine the comparison count threshold matching the current target object in response to the target liveness score of the current target object being less than a preset score threshold.

[0139] The non-liveness determination unit is configured to determine that the current target object is non-liveness in response to the determination that the number of liveness score comparisons of the current target object is greater than or equal to the number of comparisons threshold.

[0140] In some embodiments, the comparison count threshold determination unit is configured as follows:

[0141] Determine the trajectory of the current target object in the current image and at least one previous historical image, the tilt angle of the current target object in the current image, and the speed of the current target object in the current image;

[0142] Based on the current target object's motion trajectory, tilt angle, and motion speed, determine the threshold for the number of comparisons to match the current target object.

[0143] In some embodiments, the comparison count threshold determination unit is configured as follows:

[0144] The threshold for the number of comparisons required to match the current target object is determined using the following formula:

[0145] Where λ represents the threshold number of comparisons to match the current target object, and L t+1 L represents the distance between the target object and the shooting device at the current time (i.e., time t+1). t+1 To determine the distance L based on the current target object's size at the current moment and the pre-fitted relationship between the target object's size and distance, t-1 L represents the distance between the target object and the imaging device at time t-1. t-1 The distance v is determined based on the current target object size at time t-1 and the pre-fitted relationship between the target object size and distance. t v represents the velocity of the current target object at time t. t According to L t+1 L t The velocity is calculated from the inter-frame time interval of adjacent images, where Δt is the inter-frame time interval of adjacent images, and w tra The motion trajectory coefficients, w, are obtained by determining the position of the motion trajectory within the image frame. ang The tilt angle coefficient is determined based on the tilt angle.

[0146] The liveness detection device provided in this application can execute the liveness detection method provided in any embodiment of this application, and has the corresponding functional modules and beneficial effects of the method.

[0147] The figure illustrates a schematic diagram of an electronic device 10 that can be used to implement embodiments of this application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative.

[0148] As shown in Figure 5, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from the storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0149] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0150] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Processor 11 may include a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as liveness detection methods.

[0151] In some embodiments, the liveness detection method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or mounted on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the liveness detection method described above may be performed. In other embodiments, processor 11 may be configured to perform the liveness detection method by any other suitable means (e.g., by means of firmware).

[0152] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0153] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0154] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. A computer-readable storage medium may be a machine-readable signal medium. A machine-readable storage medium may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM), flash memory, optical fiber, compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the foregoing.

[0155] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a cathode ray tube (CRT) or liquid crystal display (LCD) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0156] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0157] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system. It addresses the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.

Claims

1. A method for detecting liveness, comprising: Determine the initial liveness score of at least one current target object in the current image; Determine the number of liveness score comparisons that match the current target object, and determine the initial liveness score weights that match the number of liveness score comparisons; The target liveness score of the current target object is determined based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image. Based on the target liveness score of the current target object, determine whether the current target object is a live object.

2. The method according to claim 1, wherein, Determining the initial liveness score weights that match the number of liveness score comparisons includes: In response to determining that the number of live cell score comparisons is less than or equal to a preset comparison number threshold, the initial live cell score weight is determined to be a preset weight.

3. The method according to claim 2, wherein, Determining the initial liveness score weights that match the number of liveness score comparisons includes: In response to determining that the number of liveness score comparisons is greater than a preset comparison number threshold, an initial liveness score weight is determined based on the number of liveness score comparisons. The initial liveness score weight is less than the preset weight, and the greater the number of liveness score comparisons, the smaller the initial liveness score weight.

4. The method according to claim 3, wherein, Based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image, the target liveness score of the current target object is determined, including: The target liveness score of the current target object is determined using the following formula: P=μ×P current +(1-μ)×P pre ; Where P is the target liveness score of the current target object, μ is the initial liveness score weight, and P current P represents the initial liveness score of the current target object. pre This represents the historical liveness score of the current target object in the previous image of the current image.

5. The method according to claim 1, wherein, Based on the target liveness score of the current target object, determine whether the current target object is a live object, including: In response to the target liveness score of the current target object being less than a preset score threshold, a threshold for the number of comparisons to match the current target object is determined; In response to determining that the number of liveness score comparisons of the current target object is greater than or equal to the number of comparisons threshold, the current target object is determined to be non-live.

6. The method according to claim 5, wherein, Determine the threshold for the number of comparisons required to match the current target object, including: Determine the trajectory of the current target object in the current image and at least one previous historical image, the tilt angle of the current target object in the current image, and the speed of the current target object in the current image; Based on the current target object's motion trajectory, tilt angle, and motion speed, determine the threshold for the number of comparisons to match the current target object.

7. The method according to claim 6, wherein, The threshold for the number of comparisons required to match the current target object is determined using the following formula: Where λ represents the threshold number of comparisons to match the current target object, and L t+1 L represents the distance between the target object and the shooting device at the current time (i.e., time t+1). t+1 To determine the distance L based on the current target object's size at the current moment and the pre-fitted relationship between the target object's size and distance, t-1 L represents the distance between the target object and the imaging device at time t-1. t-1 The distance v is determined based on the current target object size at time t-1 and the pre-fitted relationship between the target object size and distance. t v represents the velocity of the current target object at time t. t According to L t+1 L t The velocity is calculated from the inter-frame time interval of adjacent images, where Δt is the inter-frame time interval of adjacent images, and w tra The motion trajectory coefficients, w, are obtained by determining the position of the motion trajectory within the image frame. ang The tilt angle coefficient is determined based on the tilt angle.

8. A liveness detection device, comprising: The initial liveness score determination module is configured to determine the initial liveness score of at least one current target object in the current image; The initial liveness score weight determination module is configured to determine the number of liveness score comparisons that match the current target object, and to determine the initial liveness score weight that matches the number of liveness score comparisons. The target liveness score determination module is configured to determine the target liveness score of the current target object based on the initial liveness score of the current target object, the initial liveness score weight, and the historical liveness score of the current target object in the previous image of the current image. The liveness detection module is configured to determine whether the current target object is a live object based on the target liveness score of the current target object.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the program, implements the liveness detection method as described in any one of claims 1-7.

10. A storage medium storing computer-executable instructions, which, when executed by a computer processor, are used to perform the liveness detection method as described in any one of claims 1-7.