Face authentication method and system

CN122990767APending Publication Date: 2026-10-27TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610963271.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-30
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]基于上述现有技术的不足,本申请提供了一种人脸的认证方法及系统,以解决现有技术所带来的实时响应性较差的问题

Benefits of technology

[0071]本申请提供的一种人脸的认证方法,通过获取用户的实时视频流,并对当前帧通过人脸质量检测后即时送入基座模型进行流式特征编码,避免了现有技术中需先完整采集固定时长的视频片段再统一判别的等待过程。在此基础上,通过将当前帧编码特征与历史帧编码特征进行时序融合以更新当前证据状态,使模型能够随帧到达持续累积判别依据,进而通过决策头对当前证据状态进行早停决策处理,使得在信息充足时即输出判定信号并给出认证结果,无需等待后续帧的采集与处理。由此,本申请从机制上消除了“先采完整片段再统一判别”所带来的固有等待时延,显著提升了人脸认证的实时响应性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122990767A_ABST
    Figure CN122990767A_ABST
Patent Text Reader

Abstract

The application discloses a face authentication method and system, comprising: acquiring a real-time video stream of a user, and immediately sending a current frame to a base model for stream feature coding after face quality detection, thereby avoiding the waiting process of uniformly discriminating after complete acquisition of a fixed-length video segment in the prior art. On this basis, the current frame coding features and the historical frame coding features are time-series fused to update the current evidence state, so that the model can continuously accumulate the discrimination basis with the arrival of frames, and then the decision head is used for early stop decision processing on the current evidence state, so that the determination signal is output and the authentication result is given when the information is sufficient, without waiting for the acquisition and processing of subsequent frames. Therefore, the application eliminates the inherent waiting delay caused by uniformly discriminating after complete acquisition of a complete segment in mechanism, and significantly improves the real-time responsiveness of face authentication.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of computer vision, artificial intelligence security and facial information processing technology, and in particular to a facial authentication method and system. Background Technology

[0002] With the widespread adoption of facial recognition technology in scenarios such as mobile login, payment, remote account opening, and financial risk control, facial liveness authentication has become a crucial line of defense for ensuring digital identity security. At the same time, photo re-enhancing, screen replay, 3D masks, and forged facial videos synthesized using video-generated models, facial editing, and deepfake technologies are constantly evolving, their realism and diversity continuously improving, posing an increasingly serious threat to liveness authentication systems.

[0003] Current mainstream facial liveness detection generally employs a "cooperative" approach. This method requires the person being authenticated to maintain a fixed posture and align themselves with the viewfinder during the authentication process, while simultaneously performing specific actions such as blinking, opening their mouth, turning their head, or reading numbers as prompted by the system. After capturing images that meet the requirements, the system extracts features from a set of freeze frames or a complete video clip, then inputs these features into a discrimination model. Finally, the model outputs a classification score representing the probability of authenticity in an end-to-end manner, thus completing the liveness determination.

[0004] However, the "cooperative" method relies entirely on the post-collection batch classification of preset acquisition segments for its judgment process. The model can only passively receive and process the video frames that have been fully acquired. It cannot dynamically adjust the observation time according to the difficulty of the input content, nor can it terminate the acquisition and output the conclusion in advance when there is sufficient information. This rigid decision-making mechanism results in poor time delay. Summary of the Invention

[0005] In view of the shortcomings of the prior art, this application provides a face authentication method and system to solve the problem of poor real-time responsiveness caused by the prior art.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] The first aspect of this application provides a method for facial authentication, including:

[0008] Acquire the user's real-time video stream;

[0009] Perform face quality detection on the current frame of the real-time video stream;

[0010] If the current frame passes the face quality detection, the current frame is input into the base model, and the visual encoder of the base model performs streaming feature encoding on the current frame to obtain the current frame encoding features, and obtains the historical frame encoding features corresponding to the historical frames; wherein, the historical frame encoding features corresponding to the historical frames refer to the features obtained by streaming feature encoding the previous frames of the current frame through the base model.

[0011] The current frame coding features and the historical frame coding features are fused in a time sequence to obtain the current evidence state;

[0012] The decision head of the base model performs early stop decision processing on the current evidence state to obtain an early stop gating signal; wherein, the base model is pre-trained by reinforcement learning fine-tuning based on sample video streams with true / false type labels;

[0013] When the early stop gate control signal is a determination signal, the base model outputs the user's face authentication result.

[0014] Optionally, in the above face authentication method, the training method of the base model includes:

[0015] Obtain sample video streams with true / false type labels;

[0016] The sample video stream is formatted to obtain the target video stream, and the target video stream is used to perform supervised fine-tuning of the base model;

[0017] Using the target video stream, the supervised fine-tuned base model is fine-tuned by reinforcement learning using group relative policy optimization to obtain the candidate decision path corresponding to the target video stream;

[0018] The reward value of the candidate decision path is calculated, and the parameters of the base model are adjusted according to the ranking result of the reward value to obtain the trained base model; wherein, the base model strengthens the decision behavior corresponding to the candidate decision path with high reward value and suppresses the decision behavior corresponding to the candidate decision path with low reward value.

[0019] Optionally, in the above face authentication method, calculating the reward value of the candidate decision path includes:

[0020] When the final conclusion of the candidate decision path is consistent with the true / false type label, a positive reward value is calculated;

[0021] When the final conclusion of the candidate decision path is inconsistent with the true / false type label, calculate the zero reward value or the negative reward value.

[0022] When the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions, the positive excitation value is calculated;

[0023] When either the early stop gating signal or the confidence level corresponding to the candidate decision path fails to meet the preset calibration conditions, a negative excitation value is calculated.

[0024] When the candidate decision path determines that the attack sample is a live object, the first penalty value is calculated.

[0025] When the candidate decision path identifies a real liveness target as an attack, a second penalty value is calculated.

[0026] The candidate decision paths are validated using a structured format.

[0027] When the candidate decision path passes the structured format validation, a format compliance reward value is calculated;

[0028] If the candidate decision path fails the structured format validation, a format violation penalty value is calculated.

[0029] The target value is obtained by weighted summation of the various reward values ​​and / or penalty values, and the target value is used as the reward value of the candidate decision path.

[0030] Optionally, in the above face authentication method, the step of performing face quality detection on the current frame in the real-time video stream includes:

[0031] Extract the face region from the current frame contained in the real-time video stream;

[0032] The face regions are aligned, and the aligned face regions are then evaluated for quality. The quality evaluation includes assessment of the integrity of the face corresponding to the face region, clarity, illumination, and occlusion.

[0033] When all the indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold, the current frame is determined to have passed the face quality detection.

[0034] Optionally, the above-mentioned face authentication method further includes:

[0035] If the current frame fails the face quality detection, the next frame is extracted from the real-time video stream and used as the current frame. Then, the process of performing face quality detection on the current frame in the real-time video stream is resumed.

[0036] Optionally, in the above face authentication method, after performing early stop decision processing on the current evidence state through the decision head of the base model to obtain the early stop gating signal, it further includes:

[0037] When the early stop gating signal is a continue signal, the next frame of the current frame in the real-time video stream is obtained as the new current frame, and the face quality detection of the current frame in the real-time video stream is performed until the base model outputs the early stop gating signal as a judgment signal or the preset maximum number of observation frames is reached.

[0038] When the real-time video stream reaches the preset maximum number of observation frames, and the base model does not output the early stop gating signal as a judgment signal, the base model outputs a low confidence result.

[0039] A second aspect of this application provides a face authentication system, comprising:

[0040] The data acquisition unit is used to acquire the user's real-time video stream;

[0041] The face detection unit is used to perform face quality detection on the current frame in the real-time video stream;

[0042] The encoding unit is configured to, if the current frame passes face quality detection, input the current frame into the base model, perform streaming feature encoding on the current frame through the visual encoder of the base model to obtain the current frame encoding features, and obtain the historical frame encoding features corresponding to the historical frames; wherein, the historical frame encoding features corresponding to the historical frames refer to the features obtained by performing streaming feature encoding on the previous frames of the current frame through the base model;

[0043] A fusion unit is used to perform temporal fusion of the current frame coding features and the historical frame coding features to obtain the current evidence state;

[0044] The decision processing unit is used to perform early stop decision processing on the current evidence state through the decision head of the base model to obtain an early stop gating signal; wherein, the base model is pre-trained by reinforcement learning fine-tuning based on sample video streams with true / false type labels;

[0045] The output unit is used to output the user's face authentication result when the early stop gate control signal is a determination signal.

[0046] Optionally, the above-mentioned face authentication system may also include:

[0047] The first acquisition unit is used to acquire sample video streams with true / false type labels;

[0048] The processing unit is used to format the sample video stream to obtain the target video stream, and to use the target video stream to perform supervised fine-tuning of the base model.

[0049] The fine-tuning unit is used to use the target video stream to perform reinforcement learning fine-tuning on the supervised fine-tuned base model using group relative policy optimization, so as to obtain the candidate decision path corresponding to the target video stream.

[0050] The numerical calculation unit is used to calculate the reward value of the candidate decision path and adjust the parameters of the base model according to the ranking result of the reward value to obtain the trained base model; wherein, the base model strengthens the decision behavior corresponding to the candidate decision path with high reward value and suppresses the decision behavior corresponding to the candidate decision path with low reward value.

[0051] Optionally, in the above-described face authentication system, the numerical calculation unit includes:

[0052] The first calculation unit is used to calculate the positive reward value when the final conclusion of the candidate decision path is consistent with the true / false type label.

[0053] The second calculation unit is used to calculate a zero reward value or a negative reward value when the final conclusion of the candidate decision path is inconsistent with the true / false type label.

[0054] The third calculation unit is used to calculate the positive excitation value when the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions.

[0055] The fourth calculation unit is used to calculate the negative excitation value when either the early stop gating signal or the confidence level corresponding to the candidate decision path does not meet the preset calibration conditions.

[0056] The fifth calculation unit is used to calculate the first penalty value when the candidate decision path determines that the attack sample is a live object;

[0057] The sixth calculation unit is used to calculate the second penalty value when the candidate decision path determines a real liveness object as an attack.

[0058] The verification unit is used to perform structured format verification on the candidate decision paths;

[0059] The seventh calculation unit is used to calculate the format compliance reward value when the candidate decision path passes the structured format verification.

[0060] The eighth calculation unit is used to calculate the format violation penalty value when the candidate decision path fails the structured format validation.

[0061] The reward value determination unit is used to perform a weighted summation of each reward value and / or penalty value to obtain a target value, and to use the target value as the reward value of the candidate decision path.

[0062] Optionally, in the above-described face authentication system, the face detection unit includes:

[0063] An extraction unit is used to extract a face region from the current frame contained in the real-time video stream;

[0064] A quality assessment unit is used to align the face region and perform a quality assessment on the aligned face region; wherein, the quality assessment includes an assessment of the integrity of the face corresponding to the face region, a sharpness assessment, an illumination assessment, and an occlusion assessment.

[0065] The determining unit is used to determine that the current frame passes the face quality detection when all indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold.

[0066] Optionally, the above-mentioned face authentication system may also include:

[0067] An extraction unit is configured to extract the next frame from the real-time video stream if the current frame fails the face quality detection, and use the next frame as the current frame, and return to perform face quality detection on the current frame in the real-time video stream.

[0068] Optionally, the above-mentioned face authentication system may also include:

[0069] The second acquisition unit is used to acquire the next frame of the current frame in the real-time video stream as the new current frame when the early stop gate signal is a continuation signal, and return to perform face quality detection on the current frame in the real-time video stream until the base model outputs the early stop gate signal as a judgment signal or reaches the preset maximum number of observation frames.

[0070] The result output unit is used to output a low-confidence result when the real-time video stream reaches the preset maximum number of observation frames and the base model does not output the early stop gating signal as a judgment signal.

[0071] This application provides a face authentication method that acquires the user's real-time video stream and immediately sends the current frame, after passing face quality detection, to a base model for streaming feature encoding. This avoids the waiting process in existing technologies that require first acquiring a complete video segment of a fixed duration before unified judgment. Furthermore, by temporally fusing the encoded features of the current frame with those of historical frames to update the current evidence state, the model can continuously accumulate judgment criteria as frames arrive. Then, a decision head performs early stop decision processing on the current evidence state, enabling the output of a judgment signal and the provision of an authentication result when sufficient information is available, without waiting for the acquisition and processing of subsequent frames. Therefore, this application fundamentally eliminates the inherent waiting delay caused by "acquiring complete segments before unified judgment," significantly improving the real-time responsiveness of face authentication. Attached Figure Description

[0072] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0073] Figure 1 A flowchart illustrating a face authentication method provided in an embodiment of this application;

[0074] Figure 2 A flowchart illustrating a face quality detection method provided in another embodiment of this application;

[0075] Figure 3 A flowchart illustrating a training method for a base model provided in another embodiment of this application;

[0076] Figure 4 An overall architecture diagram of an authentication system provided in another embodiment of this application;

[0077] Figure 5 This is a schematic diagram of the structure of a face authentication system provided in another embodiment of this application. Detailed Implementation

[0078] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0079] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0080] This application provides a face authentication method, such as... Figure 1 As shown, the specific steps include:

[0081] S101. Obtain the user's real-time video stream.

[0082] Specifically, a "real-time video stream" refers to a sequence of video frames continuously generated by a mobile device or terminal camera at a set frame rate and processed by an algorithm in real time upon capture, as opposed to offline video clips that are captured completely first and then processed uniformly. Each frame in this video stream records the user's facial image information while the device is held naturally in hand.

[0083] It is easy to understand that the acquisition of real-time video streams does not require users to specifically activate the authentication function, maintain a fixed posture, or complete any cooperative actions. Users only need to look naturally at the device's camera to complete the acquisition.

[0084] S102. Perform face quality detection on the current frame in the real-time video stream.

[0085] Specifically, to ensure the input quality for subsequent incremental inference, a lightweight face quality detection needs to be performed before each frame enters the base model. This step is used to determine whether the current frame has sufficient facial information for subsequent feature encoding.

[0086] Optionally, in another embodiment of this application, one specific implementation of step S102 is as follows: Figure 2 As shown, it includes the following steps:

[0087] S201. Extract the face region from the current frame contained in the real-time video stream.

[0088] It is understandable that the current frame is any frame of image arriving in chronological order within the real-time video stream. Face regions can be located and cropped from the current frame using face detection algorithms to avoid impacting the overall real-time processing performance.

[0089] S202. Align the face region and evaluate the quality of the aligned face region.

[0090] The quality assessment includes assessment of the integrity of the face in the face region, clarity, illumination, and occlusion.

[0091] Specifically, alignment processing refers to correcting the facial region to a standardized pose by locating facial key points to eliminate scale and angle differences caused by head rotation. Quality assessment comprehensively evaluates the aligned facial region from multiple dimensions: integrity assessment confirms whether the current frame contains a complete face; sharpness assessment detects motion blur or defocus; illumination assessment determines whether the brightness of the facial region is uniform and sufficient; and occlusion assessment detects whether there are obstructions such as masks, sunglasses, or bangs covering key facial areas, thus maintaining a frame buffer that slides over time.

[0092] S203. When all indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold, the current frame is determined to pass the face quality detection.

[0093] Understandably, when a face that meets the minimum quality threshold is detected in the image, the subsequent incremental inference process is automatically started, thereby achieving seamless "identification upon picking up" rather than waiting for the user to perform a specified action.

[0094] S103. Determine whether the current frame in the real-time video stream passes the face quality detection.

[0095] Understandably, step S104 is executed when the current frame passes the face quality detection.

[0096] Optionally, in another embodiment of this application, after performing step S103, the method further includes:

[0097] If the current frame fails the face quality detection, the next frame is extracted from the real-time video stream and used as the current frame. Then, the process is repeated to perform face quality detection on the current frame in the real-time video stream.

[0098] Specifically, when the current frame fails the face quality detection, it indicates that the frame cannot provide effective discrimination clues due to insufficient clarity, poor lighting conditions, missing or severely occluded faces. In this case, the base model cannot extract valuable features from the frame for evidence accumulation. Forcibly sending the frame into the subsequent processing flow will not only fail to improve the accuracy of the judgment but may also introduce noise interference. Therefore, the system obtains the next frame from the real-time video stream and uses this next frame as the new current frame, returning to step S102 to re-perform face quality detection. It is easy to understand that the "next frame" refers to the video frame immediately following the current frame in the time sequence of the video stream. The system reads subsequent frames sequentially from the video stream buffer queue by incrementing the frame number. Through the above steps, the system continuously performs quality detection on the frames in the video stream until a frame passes the quality detection to start the incremental inference process, or continues detection until the end of the video stream. This frame skipping mechanism ensures that only frames that meet the quality requirements are sent to the base model for feature encoding and evidence updating, effectively guaranteeing the input quality for subsequent inference, while avoiding interruption of the entire authentication process due to single-frame quality issues, thus improving the robustness and fluency of the system.

[0099] S104. Input the current frame into the base model, perform streaming feature encoding on the current frame through the visual encoder of the base model to obtain the current frame encoding features, and obtain the historical frame encoding features corresponding to the historical frames.

[0100] Here, the historical frame coding features corresponding to the historical frame refer to the features obtained by streaming feature coding of the previous frames of the current frame through the base model.

[0101] Specifically, the "base model" refers to a large-scale, multimodal model that has undergone extensive pre-training, possesses general visual and language understanding capabilities, and can be fine-tuned downstream to adapt to specific liveness detection tasks. This base model comprises two core functional components: a visual encoder and a decision head. The visual encoder extracts high-dimensional feature vectors from the input video frames, while the decision head makes early stopping decisions and liveness determinations based on accumulated evidence states.

[0102] "Streaming feature encoding" refers to the process by which a visual encoder extracts features as each frame arrives, rather than waiting for all frames to arrive before encoding them all at once. Each frame is processed by the visual encoder and outputs a fixed-dimensional feature vector, which encodes visual information such as the texture, lighting, and geometric structure of the face in that frame.

[0103] S105. Perform temporal fusion of the current frame coding features and the historical frame coding features to obtain the current evidence state.

[0104] Specifically, "temporal fusion" refers to the operation of aggregating the encoded features of the current frame with those of historical frames in chronological order, with the aim of forming a joint feature representation that updates incrementally over time. In one implementation, temporal fusion can employ recurrent neural networks, temporal self-attention, or gated recurrent units to model the feature sequence. The fused output is the current evidence state, a multi-dimensional vector representing all liveness detection cues accumulated by the model from the initial frame to the current frame.

[0105] This evidence state explicitly encodes multi-dimensional clues for liveness authentication, including but not limited to: fine-grained anomalies in skin texture and edge transitions, consistency of lighting and highlights / shadows, inter-frame motion coherence and naturalness of facial micro-dynamics, rationality of geometric structure and physical laws, and rhythmic features of remote photoplethysmography (PPG) physiological signals extracted from the real-time video stream. The evidence state is continuously refined with the arrival of new frames, serving as the basis for subsequent early stop decisions and judgments.

[0106] S106. The decision head of the base model performs early stop decision processing on the current evidence state to obtain the early stop gating signal.

[0107] The base model is pre-trained using reinforcement learning fine-tuning based on sample video streams with true / false type labels.

[0108] Specifically, the "decision head" is a submodule in the base model responsible for making output decisions based on the current state of evidence. Its input is the current state of evidence, and its output is an early stop gating signal. The early stop gating signal has two possible values: a decision signal or a continue signal. When the model determines that the currently accumulated evidence is sufficient to support a reliable conclusion, it outputs a decision signal; otherwise, it outputs a continue signal.

[0109] In one implementation, the decision head first calculates the current decision confidence level based on the current evidence state and compares this confidence level with a preset gating threshold τ. If the confidence level reaches the gating threshold τ and the inference converges, a decision signal is output. Otherwise, a continue signal is output.

[0110] The "preset gating threshold τ" is a pre-defined hyperparameter used to control the conservatism of early stopping. The higher the τ value, the more the model tends to observe more frames before making a decision; the lower the τ value, the more the model tends to output a conclusion as early as possible.

[0111] Optionally, embodiments of this application provide a training method for a base model, such as... Figure 3 As shown, it includes the following steps:

[0112] S301. Obtain the sample video stream with true / false type labels.

[0113] Specifically, the "authenticity / fakeness type label" refers to the annotation information corresponding to the sample video stream, used to indicate whether the face in the sample video stream is a real, live person or a fake attack. Types of fake attacks can include, but are not limited to, photo re-enhancing, screen replay, 3D masks, face swapping, face reenactment, and fully synthetic forgery. The specific form of the label can be a categorized label, such as "real," "face swap," "face reenactment," or "fully synthetic."

[0114] S302. Format the sample video stream to obtain the target video stream, and use the target video stream to perform supervised fine-tuning of the base model.

[0115] It should be noted that "supervised fine-tuning" refers to supervised parameter updates of a pre-trained model based on labeled supervised samples. Its goal is to enable the base model to stably organize inference fields, output early stopping gating signals and conclusion labels in a standardized manner in real-time video streaming scenarios, and express multi-dimensional evidence in a parsable and structured way, thereby ensuring that the rewards in the subsequent reinforcement learning stage can be stably calculated.

[0116] "Supervisory trajectory for progressively accumulating evidence" refers to a sequence of supervisory signals constructed according to frame order, with the information of evidence progressively enriched as the number of frames increases. This guides the model to learn which discriminative cues to focus on at different observation times. "Standardized label format" refers to a predefined output format specification, including the label names of inference fields, the value specifications for early stopping gating signals, and the marking method for conclusion labels. For example, the inference fields can adopt... <reasoning> ……< / reasoning> The format of the encapsulation can be used, and the conclusion label can be adopted. <answer> live< / answer> or <answer> spoof< / answer> The output format is "continue" or "decide".

[0117] S303. Using the target video stream, the base model after supervised fine-tuning is fine-tuned by reinforcement learning through group relative policy optimization to obtain the candidate decision path corresponding to the target video stream.

[0118] Specifically, "group relative policy optimization" is a reinforcement learning fine-tuning method that samples multiple candidate outputs for the same input and updates the policy based on the relative advantage estimate within the group. Compared with traditional reinforcement learning algorithms, its advantage lies in the fact that it does not require additional training of a value network, but directly uses the relative advantages and disadvantages between multiple sampled trajectories under the same input to estimate the advantage value and update the policy, thereby simplifying the training process and improving sample efficiency.

[0119] A "candidate decision path" refers to the decision trajectory formed by the base model in a single complete inference of the same video stream sample. It includes the evolution of the model's evidence state at each frame, the selected early stopping time, and the final output conclusion. Due to the inherent randomness within the base model (such as dropout or sampling temperature), multiple inferences on the same video stream sample can yield multiple candidate decision paths that stop and output conclusions at different early stopping times.

[0120] S304. Calculate the reward value of the candidate decision path, and adjust the parameters of the base model according to the ranking result of the reward value to obtain the trained base model.

[0121] The base model reinforces decision-making behaviors corresponding to candidate decision-making paths with high reward values ​​and suppresses decision-making behaviors corresponding to candidate decision-making paths with low reward values.

[0122] Specifically, within the group-relative policy optimization framework, a set of candidate decision paths sampled from the same video stream are ranked from highest to lowest based on their reward values. Paths with high reward values ​​indicate a better combination of early stopping time and decision, and the model tends to mimic this type of decision behavior during training. Paths with low reward values ​​indicate a worse combination of early stopping time and decision, and the model gradually reduces this type of decision behavior during training. By updating the policy through intra-group relative comparisons rather than absolute scores, the model gradually learns a sequential decision-making strategy of "giving the correct decision at the earliest appropriate time with the fewest number of frames."

[0123] Optionally, in another embodiment of this application, a specific implementation of calculating the reward value of the candidate decision path in step S304 specifically includes processes A1-A10:

[0124] A1: Calculate the positive reward value when the final conclusion of the candidate decision path is consistent with the true / false type label.

[0125] It is easy to understand that positive reward-driven pedestal models tend to replicate and reinforce decision-making behaviors that produce correct judgments during training, thereby improving the model's basic discriminative ability.

[0126] A2: When the final conclusion of the candidate decision path is inconsistent with the true / false type label, calculate the zero reward value or the negative reward value.

[0127] Specifically, "inconsistency" refers to situations where the final conclusion does not match the true / false type label, such as classifying a fake attack sample as a live entity, or classifying a real live entity sample as a fake. In this case, no positive feedback is given to the candidate decision path (i.e., zero reward value is calculated), or negative feedback is given (i.e., negative reward value is calculated). Conversely to the effect of positive reward values, zero or negative reward values ​​put the candidate decision path at a disadvantage in the group ranking, thereby guiding the base model to reduce the probability of such erroneous decision-making behavior in subsequent training. For example, in one implementation, zero reward value is used instead of negative reward value when the final conclusion is inconsistent with the true / false type label, aiming to avoid excessive punishment leading to training instability. In another implementation, negative reward values ​​can be used to more significantly suppress erroneous judgments. By contrasting the positive reward for correct judgments with zero or negative rewards for incorrect judgments, the model can effectively learn to distinguish between real live entities and various fake attacks, which is the core reward signal driving the model to acquire discriminative ability.

[0128] A3: When the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions, calculate the positive excitation value.

[0129] A4: When either the early stop gating signal or the confidence level corresponding to the candidate decision path does not meet the preset calibration conditions, calculate the negative excitation value.

[0130] It should be noted that A3 and A4 together constitute the confidence-gated reward term. The so-called "preset calibration condition" refers to the matching relationship that the model's output early-stop gating signal and the reported confidence level should satisfy. Specifically, if the model outputs a decision signal, its confidence level should reach the preset gating threshold τ. If the model outputs a continue signal, its confidence level should be lower than the preset gating threshold τ. This reward term encourages the model to trigger a decision signal only when the evidence is truly sufficient, suppressing two types of irrational decision-making behaviors: "making a decision too early with insufficient evidence" and "delaying decision-making even with sufficient evidence."

[0131] A5: When a candidate decision path determines that the attack sample is a live target, calculate the first penalty value.

[0132] A6: When a candidate decision path identifies a real liveness target as an attack, calculate the second penalty value.

[0133] Understandably, A5 and A6 together constitute the asymmetric discrimination reward. In authentication risk control scenarios, the security cost of mistakenly admitting an attack sample as a live agent (i.e., false admission) is far higher than the experiential cost of mistakenly rejecting a real live agent as an attack (i.e., false rejection). Therefore, the absolute value of the first penalty value should be greater than the absolute value of the second penalty value, thereby specifically reducing the false admission rate while also taking into account the false rejection rate.

[0134] A7: Perform structured format validation on candidate decision paths.

[0135] It should be noted that the purpose of structured format validation is to ensure that the model output can be stably parsed by the system, thereby supporting the normal operation of subsequent reward value calculation and risk control linkage. If the inference fields of the model output are not encapsulated with correct labels, the value of the early stop gating signal is neither "continue" nor "decide", or the conclusion label is missing or incorrectly formatted, then the candidate decision path is judged to have failed the structured format validation. Conversely, if all fields conform to the predefined format specifications, then the candidate decision path passes the structured format validation. The validation result provides a basis for determining the format compliance reward value or the format violation penalty value in subsequent steps.

[0136] Therefore, by setting up a structured format verification mechanism, the base model can be constrained to organize its output content in a standardized format, so that the model can gradually form a stable output habit during the reinforcement learning fine-tuning process, thereby ensuring that the authentication conclusions and evidence summaries output by the model in the actual reasoning stage can be correctly parsed and processed by the upper-level system.

[0137] A8: When a candidate decision path passes the structured format validation, calculate the format compliance reward value.

[0138] A9: Calculate the format violation penalty value when the candidate decision path fails the structured format validation.

[0139] Understandably, A7 to A9 together constitute the format and length reward items, which are used to constrain the format validity and conciseness of the inference fields, early stopping gating signals, and conclusion labels, ensuring that the model output can be stably parsed.

[0140] A10: Calculate the weighted sum of each reward value and / or penalty value to obtain the target value, and use the target value as the reward value for the candidate decision path.

[0141] S107. When the early stop gate control signal is a judgment signal, the base model outputs the user's face authentication result.

[0142] Specifically, when the decision head outputs a judgment signal, the base model generates a liveness authentication conclusion based on the current evidence state. This conclusion includes a truth or falsehood determination result and the corresponding confidence level. In one implementation, the base model outputs the key evidence and inferences currently relied upon in the inference field, and uses... <answer> live< / answer> Representing a real living being, with <answer> spoof< / answer> This indicates a forgery attack. This authentication result is the final conclusion of the current authentication session.

[0143] Optionally, the early stop gating signal can be a determination signal or a continuation signal. Therefore, when the early stop gating signal is detected as a continuation signal, in another embodiment of this application, it further includes processes B1-B2:

[0144] B1: When the early stop gating signal is a continue signal, obtain the next frame of the current frame in the real-time video stream as the new current frame, and return to perform face quality detection on the current frame in the real-time video stream until the base model outputs the early stop gating signal as a judgment signal or reaches the preset maximum number of observation frames.

[0145] Specifically, in process B1, when the early stop gating signal is a continue signal, it means that the base model determines that the currently accumulated evidence is insufficient to support a reliable liveness authentication conclusion, and more frames of information are needed to update the evidence status. Therefore, the system obtains the next frame from the real-time video stream as the new current frame and returns to step S102. Obtaining the next frame involves reading the video frames immediately following the current frame from the buffer queue of the real-time video stream in chronological order. It should be noted that the purpose of returning to step S102 is to re-perform face quality detection on the newly arrived frames to ensure that only frames that pass the quality detection are sent to the base model for feature encoding and evidence updating. Through this looping mechanism, the system can continuously acquire subsequent frames and gradually accumulate evidence until the early stop condition is met or the preset maximum number of observation frames is reached.

[0146] The "preset maximum number of observation frames" N is a pre-defined hyperparameter used to prevent the model from looping indefinitely when evidence is insufficient. If the model continues to output a continue signal until N frames are reached and a reliable determination is still not made, the system should switch to the exception handling process, i.e., process B2.

[0147] B2: When the real-time video stream reaches the preset maximum number of observation frames, and the base model does not output an early stop gating signal as a decision signal, the base model outputs a low confidence result.

[0148] Specifically, a "low-confidence result" refers to a conclusion with a low-confidence flag output by the base model when it still cannot provide a reliable judgment after reaching the maximum number of observation frames. The difference between this result and a normal judgment is that its confidence level is lower than the normal judgment threshold. Therefore, when the real-time video stream reaches the preset maximum number of observation frames, and the base model does not output an early stop gating signal as a judgment signal, the base model outputs a low-confidence result and performs a secondary verification process. The "secondary verification process" refers to a backup verification mechanism triggered when the model cannot make a reliable judgment. In one implementation, this process may include more intensive cooperative liveness detection or manual review.

[0149] Furthermore, after the base model outputs a judgment signal and provides an authentication result, it can also send the authentication result, confidence level, and evidence summary output by the base model to the upper-level risk control strategy module for identity verification linkage. For example, when the authentication conclusion is a forgery attack or the confidence level is lower than a preset threshold, the upper-level risk control strategy module can trigger a secondary verification or reject the current authentication request.

[0150] The system architecture upon which the embodiments of this application depend is described below. To support the normal operation of the above method flow, this application constructs a system architecture comprising four sequentially connected modules, as follows: Figure 4 As shown, the system architecture includes a real-time data acquisition and non-intrusive triggering module ( Figure 4 100), streaming feature coding and evidence status maintenance module ( Figure 4 200), Incremental Reasoning and Adaptive Early Stopping Decision Module ( Figure 4 (300) and the conclusion output and risk control linkage module ( Figure 4 (400 in China). Among them:

[0151] The real-time acquisition and seamless triggering module continuously generates video frame streams at a frame rate and sends them to the processing pipeline in real time when the user naturally holds the mobile device. It performs lightweight face detection, alignment, and quality assessment on each arriving frame and maintains a frame buffer that slides over time. When a face meeting the minimum quality threshold is detected in the frame, the module automatically initiates the subsequent incremental inference process.

[0152] The streaming feature encoding and evidence state maintenance module is used to stream-encode continuously arriving frames or key frames extracted with adaptive step size by the visual encoder of the base model, and to fuse the encoding results of historical frames with the current frame to form an evidence state that is updated incrementally over time.

[0153] The incremental reasoning and adaptive early stopping decision module is used to perform incremental reasoning based on the current evidence state at each decision time, output early stopping gating signals, and provide the confidence level and truth or falsehood conclusion of liveness authentication when the decision signal is obtained.

[0154] The conclusion output and risk control linkage module is used to output the authentication conclusion, confidence level and readable evidence summary, and link it with the upper-level identity verification, payment and risk control strategies. For sessions that are judged to be suspicious or whose evidence is always insufficient, a higher-intensity secondary verification or manual review is triggered.

[0155] It is easy to understand that the four modules mentioned above do not operate independently, but are connected sequentially according to the data flow order: the video stream from the front-facing camera first enters the real-time acquisition and non-intrusive triggering module, and after passing quality inspection, it is sent to the streaming feature encoding and evidence status maintenance module for feature encoding and evidence updating. Then, the incremental reasoning and adaptive early termination decision module makes an early termination decision based on the updated evidence status. Finally, the conclusion output and risk control linkage module outputs the authentication result and executes the linkage strategy. The above modules work together to form the complete system architecture of this application that realizes "acquisition on the spot, reasoning on the spot, and adaptive early termination".

[0156] This application provides a method that acquires the user's real-time video stream and immediately sends the current frame, after passing face quality detection, to a base model for streaming feature encoding. This avoids the waiting process in existing technologies, which require first acquiring a complete video segment of a fixed duration before unified judgment. Furthermore, by temporally fusing the encoded features of the current frame with those of historical frames to update the current evidence state, the model can continuously accumulate judgment criteria as frames arrive. Then, a decision head performs early stop decision processing on the current evidence state, enabling the output of a judgment signal and the provision of an authentication result when sufficient information is available, without waiting for the acquisition and processing of subsequent frames. Therefore, this application fundamentally eliminates the inherent waiting latency caused by "acquiring complete segments before unified judgment," significantly improving the real-time responsiveness of face authentication.

[0157] Another embodiment of this application provides a face authentication system, such as... Figure 5 As shown, it includes the following units:

[0158] The data acquisition unit 501 is used to acquire the user's real-time video stream.

[0159] The face detection unit 502 is used to perform face quality detection on the current frame in the real-time video stream.

[0160] The encoding unit 503 is used to input the current frame into the base model if the current frame passes the face quality detection, and to perform streaming feature encoding on the current frame through the visual encoder of the base model to obtain the current frame encoded features, and to obtain the historical frame encoded features corresponding to the historical frames. The historical frame encoded features refer to the features obtained by performing streaming feature encoding on the previous frames of the current frame through the base model.

[0161] The fusion unit 504 is used to perform temporal fusion of the current frame coding features and the historical frame coding features to obtain the current evidence state.

[0162] The decision processing unit 505 is used to perform early stop decision processing on the current evidence state through the decision head of the base model to obtain an early stop gating signal. The base model is pre-trained by reinforcement learning fine-tuning based on sample video streams with true / false type labels.

[0163] Output unit 506 is used to output the user's face authentication result when the early stop gate control signal is a judgment signal.

[0164] It should be noted that the specific working process of the above-mentioned units in the embodiments of this application can be referred to steps S101 to S107 in the above method embodiments, and will not be repeated here.

[0165] Optionally, another embodiment of this application provides a face authentication system that further includes:

[0166] The first acquisition unit is used to acquire sample video streams with true / false type labels.

[0167] The processing unit is used to format the sample video stream to obtain the target video stream, and to use the target video stream to perform supervised fine-tuning of the base model.

[0168] The fine-tuning unit is used to fine-tune the supervised fine-tuned base model using group relative policy optimization with the target video stream to obtain the candidate decision path corresponding to the target video stream.

[0169] The numerical computation unit is used to calculate the reward value of candidate decision paths and adjust the parameters of the base model according to the ranking of reward values ​​to obtain a trained base model. Specifically, the base model reinforces the decision behaviors corresponding to candidate decision paths with high reward values ​​and suppresses the decision behaviors corresponding to candidate decision paths with low reward values.

[0170] Optionally, in another embodiment of this application, a face authentication system includes a numerical calculation unit comprising:

[0171] The first calculation unit is used to calculate the positive reward value when the final conclusion of the candidate decision path is consistent with the true / false type label.

[0172] The second calculation unit is used to calculate the zero reward value or negative reward value when the final conclusion of the candidate decision path is inconsistent with the true / false type label.

[0173] The third calculation unit is used to calculate the positive excitation value when the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions.

[0174] The fourth calculation unit is used to calculate the negative excitation value when either the early stop gating signal or the confidence level corresponding to the candidate decision path does not meet the preset calibration conditions.

[0175] The fifth calculation unit is used to calculate the first penalty value when the candidate decision path determines that the attack sample is a live object.

[0176] The sixth calculation unit is used to calculate the second penalty value when the candidate decision path determines that a real liveness is an attack.

[0177] The verification unit is used to perform structured format verification on candidate decision paths.

[0178] The seventh calculation unit is used to calculate the format compliance reward value when the candidate decision path passes the structured format verification.

[0179] The eighth calculation unit is used to calculate the format violation penalty value when a candidate decision path fails the structured format validation.

[0180] The reward value determination unit is used to perform a weighted summation of each reward value and / or penalty value to obtain the target value, and use the target value as the reward value of the candidate decision path.

[0181] Optionally, in another embodiment of this application, a face authentication system includes a face detection unit 502, comprising:

[0182] The extraction unit is used to extract the face region from the current frame contained in the real-time video stream.

[0183] The quality assessment unit is used to align the face region and then perform a quality assessment on the aligned face region. The quality assessment includes evaluation of the integrity of the face corresponding to the face region, sharpness, illumination, and occlusion.

[0184] The determination unit is used to determine that the current frame passes the face quality detection when all indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold.

[0185] Optionally, another embodiment of this application provides a face authentication system that further includes:

[0186] The extraction unit is used to extract the next frame from the real-time video stream if the current frame fails the face quality detection, and use the next frame as the current frame, and return to perform face quality detection on the current frame in the real-time video stream.

[0187] Optionally, another embodiment of this application provides a face authentication system that further includes:

[0188] The second acquisition unit is used to acquire the next frame of the current frame in the real-time video stream as the new current frame when the early stop gate signal is a continuation signal, and return to perform face quality detection on the current frame in the real-time video stream until the base model outputs the early stop gate signal as a judgment signal or the preset maximum number of observation frames is reached.

[0189] The result output unit is used to output a low-confidence result when the real-time video stream reaches the preset maximum number of observation frames and the base model does not output an early stop gating signal as a judgment signal.

[0190] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.

[0191] It should also be noted that the face authentication system provided in this application has the technical effects of any of the above embodiments, and will not be described in detail here.

[0192] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0193] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A face authentication method, characterized in that, include: Acquire the user's real-time video stream; Perform face quality detection on the current frame of the real-time video stream; If the current frame passes the face quality detection, the current frame is input into the base model, and the visual encoder of the base model performs streaming feature encoding on the current frame to obtain the current frame encoding features, and obtains the historical frame encoding features corresponding to the historical frames; wherein, the historical frame encoding features corresponding to the historical frames refer to the features obtained by streaming feature encoding the previous frames of the current frame through the base model. The current frame coding features and the historical frame coding features are fused in a time sequence to obtain the current evidence state; The decision head of the base model performs early stop decision processing on the current evidence state to obtain an early stop gating signal; wherein, the base model is pre-trained by reinforcement learning fine-tuning based on sample video streams with true / false type labels; When the early stop gate control signal is a determination signal, the base model outputs the user's face authentication result.

2. The method according to claim 1, characterized in that, The training method for the base model includes: Obtain sample video streams with true / false type labels; The sample video stream is formatted to obtain the target video stream, and the target video stream is used to perform supervised fine-tuning of the base model; Using the target video stream, the supervised fine-tuned base model is fine-tuned by reinforcement learning using group relative policy optimization to obtain the candidate decision path corresponding to the target video stream; The reward value of the candidate decision path is calculated, and the parameters of the base model are adjusted according to the ranking result of the reward value to obtain the trained base model; wherein, the base model strengthens the decision behavior corresponding to the candidate decision path with high reward value and suppresses the decision behavior corresponding to the candidate decision path with low reward value.

3. The method according to claim 2, characterized in that, The calculation of the reward value of the candidate decision path includes: When the final conclusion of the candidate decision path is consistent with the true / false type label, a positive reward value is calculated; When the final conclusion of the candidate decision path is inconsistent with the true / false type label, calculate the zero reward value or the negative reward value. When the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions, the positive excitation value is calculated; When either the early stop gating signal or the confidence level corresponding to the candidate decision path fails to meet the preset calibration conditions, a negative excitation value is calculated. When the candidate decision path determines that the attack sample is a live object, the first penalty value is calculated. When the candidate decision path identifies a real liveness target as an attack, a second penalty value is calculated. The candidate decision paths are validated using a structured format. When the candidate decision path passes the structured format validation, a format compliance reward value is calculated; If the candidate decision path fails the structured format validation, a format violation penalty value is calculated. The target value is obtained by weighted summation of the various reward values ​​and / or penalty values, and the target value is used as the reward value of the candidate decision path.

4. The method according to claim 1, characterized in that, The step of performing face quality detection on the current frame in the real-time video stream includes: Extract the face region from the current frame contained in the real-time video stream; The face regions are aligned, and the aligned face regions are then evaluated for quality. The quality evaluation includes assessment of the integrity of the face corresponding to the face region, clarity, illumination, and occlusion. When all the indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold, the current frame is determined to have passed the face quality detection.

5. The method according to claim 1, characterized in that, Also includes: If the current frame fails the face quality detection, the next frame is extracted from the real-time video stream and used as the current frame. Then, the process of performing face quality detection on the current frame in the real-time video stream is resumed.

6. The method according to claim 1, characterized in that, After performing early stop decision processing on the current evidence state through the decision head of the base model to obtain the early stop gating signal, the process further includes: When the early stop gate signal is a continue signal, the next frame of the current frame in the real-time video stream is obtained as the new current frame, and the face quality detection of the current frame in the real-time video stream is performed until the base model outputs the early stop gate signal as a judgment signal or the preset maximum number of observation frames is reached. When the real-time video stream reaches the preset maximum number of observation frames, and the base model does not output the early stop gating signal as a judgment signal, the base model outputs a low confidence result.

7. A facial recognition system, characterized in that, include: The data acquisition unit is used to acquire the user's real-time video stream; The face detection unit is used to perform face quality detection on the current frame in the real-time video stream; The encoding unit is configured to, if the current frame passes face quality detection, input the current frame into the base model, perform streaming feature encoding on the current frame through the visual encoder of the base model to obtain the current frame encoding features, and obtain the historical frame encoding features corresponding to the historical frames; wherein, the historical frame encoding features corresponding to the historical frames refer to the features obtained by performing streaming feature encoding on the previous frames of the current frame through the base model; A fusion unit is used to perform temporal fusion of the current frame coding features and the historical frame coding features to obtain the current evidence state; The decision processing unit is used to perform early stop decision processing on the current evidence state through the decision head of the base model to obtain an early stop gating signal; wherein, the base model is pre-trained by reinforcement learning fine-tuning based on sample video streams with true / false type labels; The output unit is used to output the user's face authentication result when the early stop gate control signal is a determination signal.

8. The system according to claim 7, characterized in that, Also includes: The first acquisition unit is used to acquire sample video streams with true / false type labels; The processing unit is used to format the sample video stream to obtain the target video stream, and to use the target video stream to perform supervised fine-tuning of the base model. The fine-tuning unit is used to use the target video stream to perform reinforcement learning fine-tuning on the supervised fine-tuned base model using group relative policy optimization, so as to obtain the candidate decision path corresponding to the target video stream. The numerical calculation unit is used to calculate the reward value of the candidate decision path and adjust the parameters of the base model according to the ranking result of the reward value to obtain the trained base model; wherein, the base model strengthens the decision behavior corresponding to the candidate decision path with high reward value and suppresses the decision behavior corresponding to the candidate decision path with low reward value.

9. The system according to claim 8, characterized in that, The numerical calculation unit includes: The first calculation unit is used to calculate the positive reward value when the final conclusion of the candidate decision path is consistent with the true / false type label. The second calculation unit is used to calculate a zero reward value or a negative reward value when the final conclusion of the candidate decision path is inconsistent with the true / false type label. The third calculation unit is used to calculate the positive excitation value when the early stop gating signal and confidence level corresponding to the candidate decision path both meet the preset calibration conditions. The fourth calculation unit is used to calculate the negative excitation value when either the early stop gating signal or the confidence level corresponding to the candidate decision path does not meet the preset calibration conditions. The fifth calculation unit is used to calculate the first penalty value when the candidate decision path determines that the attack sample is a live object; The sixth calculation unit is used to calculate the second penalty value when the candidate decision path determines a real liveness object as an attack. The verification unit is used to perform structured format verification on the candidate decision paths; The seventh calculation unit is used to calculate the format compliance reward value when the candidate decision path passes the structured format verification. The eighth calculation unit is used to calculate the format violation penalty value when the candidate decision path fails the structured format validation. The reward value determination unit is used to perform a weighted summation of each reward value and / or penalty value to obtain a target value, and to use the target value as the reward value of the candidate decision path.

10. The system according to claim 7, characterized in that, The face detection unit includes: An extraction unit is used to extract a face region from the current frame contained in the real-time video stream; A quality assessment unit is used to align the face region and perform a quality assessment on the aligned face region; wherein, the quality assessment includes an assessment of the integrity of the face corresponding to the face region, a sharpness assessment, an illumination assessment, and an occlusion assessment. The determining unit is used to determine that the current frame passes the face quality detection when all indicators of integrity assessment, sharpness assessment, illumination assessment and occlusion assessment corresponding to the face region meet the preset threshold values.