Lightweight explainable generalization recognition method for cross-dataset face forgery
Patent Information
- Application Number
- CN202611136653.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-29
- Publication Date
- 2026-10-23
AI Technical Summary
[0008](一)跨数据集泛化能力不足
[0055]1、单模态轻量输入,降低工程落地门槛:针对现有模型复杂度与部署成本偏高的技术问题,本发明依赖单一RGB图像或视频帧作为唯一输入源,无需红外、深度或结构光等附加硬件模态。这从根本上规避了多模态方案中跨模态数据对齐的难题,并显著降低了对终端设备传感器的依赖。结合轻量化骨干网络设计,该方案可直接部署于金融终端、门禁面板及移动设备等算力受限的边缘端,具备极高的工程兼容性与部署经济性。
Smart Images

Figure CN122967323A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of computer vision, pattern recognition, artificial intelligence security and intelligent identity authentication, and more specifically, to a lightweight, interpretable and generalized recognition method for cross-dataset face anti-spoofing. Background Technology
[0002] Facial liveness detection technology is a core component of facial recognition systems for security and anti-spoofing. It aims to accurately distinguish whether a facial image captured by a camera originates from a real, living person or is based on various forgery or attack vectors (such as paper photos, printed photos, electronic screen playback, partially punched-out photos, masks, 3D head models, etc.). This technology is widely deployed in scenarios such as facial recognition payment, facial recognition withdrawal, remote account opening, smart access control and attendance, government identity verification, and terminal device unlocking. It plays a decisive role in ensuring identity authenticity, preventing fraud attacks, and improving the overall reliability of the system.
[0003] In recent years, with the evolution of artificial intelligence technology, liveness detection schemes based on multimodal large models, visual-language large models, and attention-assisted reasoning have gradually become research hotspots. Through a search of existing patent and non-patent literature, relevant technical solutions can be summarized into the following categories:
[0004] The first category comprises methods based on large multimodal models or visual-language models. Examples include Chinese patent applications CN120388404A, CN121305695A, and CN121281147A. These methods input the face image to be detected, along with auxiliary modal information, structured prompts, or inference chains, into a large-scale multimodal model to perform tasks such as coarse-grained and fine-grained classification, attack cause inference, or forgery region localization. The advantage of this type of method lies in the introduction of inference and interpretation capabilities; however, its detection chain is complex, highly dependent on the inference overhead of a large model, and has high deployment costs and computational latency.
[0005] The second category involves methods that utilize attention maps or auxiliary cues to guide visual language models in detection and localization. For example, Chinese patent application CN121170911A first generates an attention map using a counterfeit detection prediction model, and then inputs it along with detection cues into a large visual language model to output detection results and the coordinates of the counterfeit region. This type of scheme can provide a certain degree of spatial localization information, but it still essentially relies on an additional large model inference process, increasing the system burden.
[0006] The third category comprises multimodal collaborative solutions geared towards quality labeling or risk assessment. For example, Chinese patent application CN121884418A primarily focuses on face quality label generation, while CN121415446A concentrates on risk feature design. This type of technology mainly addresses issues related to image quality assessment, risk scoring, or transparency in the decision-making process; its core objective is not directly aimed at the generalized anti-spoofing recognition task of RGB images across datasets.
[0007] In summary, RGB face liveness detection technology for practical engineering deployment still faces the following pressing technical challenges:
[0008] (i) Insufficient generalization ability across datasets. Existing models are prone to overfitting to the inherent biases of specific training sets, such as device response, background environment, shooting scene and attack medium. When faced with test sets from different sources, the detection accuracy degrades significantly, making it difficult to meet the stability requirements in real open scenarios.
[0009] (ii) High model complexity and deployment cost. In particular, the technical route based on multimodal large models has a huge number of parameters, a long inference chain, and often requires additional auxiliary modal inputs, which leads to demanding requirements on computing and storage resources, making it unfavorable for lightweight deployment on mobile, edge and embedded devices.
[0010] (iii) The model has weak interpretability or the interpretation is inconsistent with the classification results. Some existing methods only output binary classification decision labels and cannot provide verifiable judgment criteria. For example, they cannot clearly explain whether the model makes a judgment based on specific forgery clues such as paper edges, screen borders, print textures, planar geometric distortions, or local hole punching. Others can generate text explanations, but the explanation content lacks logical consistency with the final classification results, which reduces the credibility of the decision.
[0011] (iv) The effectiveness of unified modeling for different attack types is limited. The deceptive clues presented by various forgery methods, such as printing attacks, screen playback attacks, and local hole punching attacks, differ significantly (e.g., printing attacks focus on texture and edge anomalies, screen playback attacks focus on borders and planar display features, and hole punching attacks involve evidence from specific local areas). Existing technologies lack a unified and transferable conceptual representation system to effectively characterize and distinguish these heterogeneous forgery traces.
[0012] (v) The annotation cost of high-precision spatial interpretation of supervision signals is high. To obtain category labels, semantic concept labels and pixel-level fake region labels simultaneously for fully supervised training, a large amount of manual annotation is required, which poses a huge challenge to large-scale data construction and model expansion in multiple public datasets and diverse real-world scenarios.
[0013] Therefore, under the current technological background, there is an urgent need in this field for an RGB single-modal face liveness detection technology that can take into account cross-dataset generalization ability, lightweight deployment requirements on the edge, interpretability of the decision process, and adaptive modeling of multiple attack types, so as to overcome the many shortcomings of the existing technologies. Summary of the Invention
[0014] To overcome the shortcomings and deficiencies of existing technologies, the present invention aims to provide a lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing. This method adds a forgery clue prediction branch, a concept prediction branch, a forgery region-level interpretation branch, and a templated interpretation generation module to a lightweight visual backbone network, and imposes consistency constraints on classification, clues, and concepts. It can achieve high-precision, high-reliability, low-cost, and open-scenario-based edge face anti-spoofing detection.
[0015] To achieve the above objectives, the present invention is implemented through the following technical solution: a lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing, which uses a trained interpretable face anti-spoofing model to recognize face RGB images or video frames, outputs liveness detection results, and outputs attack explanation information when the liveness detection result is an attack.
[0016] The interpretable face anti-spoofing model includes a lightweight visual backbone network and an interpretation module; the interpretation module includes:
[0017] The fake clue prediction branch is used to predict multiple clue labels to obtain clue prediction results;
[0018] The concept prediction branch is used to predict multiple concept labels to obtain concept prediction results;
[0019] Fake region-level explanation branches to output more than one heatmap;
[0020] The templated explanation generation module is used to convert concept prediction results into readable explanation text;
[0021] Consistency constraints are applied to the cue prediction results and concept prediction results, as well as the concept prediction results and the main classification results output by the lightweight visual backbone network, to align the main classification results, cue prediction results, and concept prediction results.
[0022] The attack explanation information includes: clue prediction results, concept prediction results, heatmaps, and readable explanation text.
[0023] Preferably, the consistency constraint on the cue prediction result and the concept prediction result, as well as the consistency constraint on the concept prediction result and the main classification result output by the lightweight visual backbone network, refers to:
[0024] Setting clues—constructing a relation matrix based on conceptual hierarchy ;in, Indicates the type of clue tag. This indicates the type of concept label; the concept aggregation response at the cue level, obtained from concept prediction, is as follows:
[0025] ;
[0026] in, This represents the response of the k-th cue tag derived from related concept tags; This represents the concept response probability of the j-th concept label obtained by the i-th sample through the interpretable face anti-spoofing model; Indicates the first The first clue tag and the first The concept labels are semantically related; Indicates the concept label number;
[0027] Setting Clues—Conceptual Consistency Loss for:
[0028] ;
[0029] in, Indicates the predicted first The first sample The probability of responding to a clue;
[0030] Set attack indicator variables ;in, This is the main classification result output by the lightweight visual backbone network. Indicates attack determination, Indicates liveness determination; sets category-conceptual consistency loss. for:
[0031] ;
[0032] Where mean() represents the mean function; max() represents the maximum value function; Indicates the activation threshold of concept labels; This represents the maximum concept response probability for the i-th sample;
[0033] Loss of Clue-Conceptual Consistency And category-concept consistency loss Add to total loss Joint optimization is performed.
[0034] Preferably, the total loss for:
[0035] ;
[0036] in, Total loss; Loss of primary classification results; Predicting losses based on clues; For conceptual prediction results; , , and These are the contribution coefficients.
[0037] Preferably, the training method for the interpretable face anti-spoofing model is as follows:
[0038] Several publicly available RGB face anti-spoofing datasets were collected as samples; the RGB face images or video frames of each RGB face anti-spoofing dataset were preprocessed in a unified manner, and the RGB images or video frames and their corresponding metadata were cleaned and converted in a unified format to construct weakly labeled interpretation data;
[0039] First, the lightweight visual backbone network and the forgery clue prediction branch are trained to enable the interpretable face anti-spoofing model to have stable liveness recognition and clue response capabilities.
[0040] Then, the concept prediction branch is added to the training to learn fine-grained concepts;
[0041] Consistency constraints are added between the cue prediction results and the concept prediction results, as well as between the concept prediction results and the main classification results, to align the main classification results, cue prediction results, and concept prediction results.
[0042] Based on computer vision algorithms, fake regions are generated. Through a weakly supervised learning mechanism, heatmaps of the fake region-level interpretation branches are trained.
[0043] Preferably, the method for constructing the weakly labeled explanation data is as follows:
[0044] From the metadata of RGB images or video frames, the dataset name, data division, subject number, acquisition device, scene type and attack medium are parsed from the sample path, directory name, protocol field and attack type. The attack names of different datasets are uniformly mapped to attack families, including: real, printed photos, video playback, curved photos and cropped photos.
[0045] Based on the formation mechanism of various attack families, corresponding clue tags and concept tags are generated for the samples;
[0046] By combining face detection, contour analysis, and region priors, coarse localization of fake regions is generated, and the detection method, confidence level, and manual verification mark are recorded to form a unified and interpretable weak label.
[0047] Preferably, the face RGB image or video frame is input into the interpretable face anti-spoofing model, the lightweight visual backbone network outputs the main classification result, the forgery clue prediction branch outputs the clue response probability of each clue label, and the concept prediction branch outputs the concept response probability of each concept label.
[0048] Based on the Top-K algorithm, the Top-K clue labels ranked by the top K clue response probabilities and the Top-K probability labels ranked by the top K concept response probabilities are extracted and compared with the decision threshold. The Top-K clue labels and Top-K probability labels that are greater than the decision threshold are used as the clue prediction results and concept prediction results, respectively.
[0049] Preferably, the multi-cue tag includes at least: presentation medium boundary cue, resampling frequency artifact cue, reflection / illumination inconsistency cue, material / texture anomaly cue, and geometric shadow mismatch cue;
[0050] The multi-concept labels include at least: paper edges, screen bezels / device bezels, moiré patterns / resampling artifacts, inconsistent screen reflections / reflections, abnormal printed surface textures, flat / flat surface features, abnormal mask materials, discontinuous mask seams / outlines, abnormal local shadow structures, and eye holes or cutting marks.
[0051] Preferably, the readable explanatory text includes: a liveness detection result section and a concept prediction result section.
[0052] A readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing.
[0053] A computer device includes a processor and a memory for storing a processor-executable program, wherein when the processor executes the program stored in the memory, it implements the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing.
[0054] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0055] 1. Single-modal lightweight input, lowering the barrier to engineering implementation: Addressing the technical issues of high complexity and deployment costs in existing models, this invention relies on a single RGB image or video frame as the sole input source, eliminating the need for additional hardware modalities such as infrared, depth, or structured light. This fundamentally avoids the challenge of cross-modal data alignment in multimodal solutions and significantly reduces reliance on terminal device sensors. Combined with a lightweight backbone network design, this solution can be directly deployed at edge devices with limited computing power, such as financial terminals, access control panels, and mobile devices, exhibiting extremely high engineering compatibility and deployment economy.
[0056] 2. Constructing a unified ontology to overcome cross-domain generalization bottlenecks: Addressing the challenges of insufficient cross-dataset generalization and the difficulty of unified modeling of heterogeneous attacks, this invention innovatively introduces a three-level explanatory ontology of "clues—concepts—regions," mapping various forgery traces from different datasets (such as print textures, screen borders, and punch-hole edges) to a unified and transferable semantic space. This ontology architecture allows the model to no longer rely on the "surface statistical biases" (such as background environment and device response) of specific datasets, but instead focus on the "common semantic features" of the attack's essence. As a result, the model maintains stable discriminative power during cross-dataset testing, effectively solving the problem of generalization degradation in real-world open scenarios.
[0057] 3. Explanation Module Design Balancing Performance and Efficiency: To address the issues of lengthy inference chains and excessive resource consumption, this invention employs a design paradigm that decouples the lightweight visual backbone network (as a feature extractor) from the explanation module. During the inference phase, the explanation module can be flexibly enabled or disabled depending on the application scenario: providing detailed heatmaps and explanations when auditing is required, while in normal scenarios, only the backbone network can be run to ensure extremely low latency. This design achieves simultaneous output of high-performance classification and refined explanations with minimal additional parameters, avoiding the enormous computational overhead of large end-to-end models.
[0058] 4. Classification-Concept and Clue-Concept Consistency Constraints to Enhance Decision Credibility: Addressing the issue of weak model interpretability or inconsistencies between interpretation and classification results, this invention innovatively constructs a three-level consistency constraint mechanism: "low-level forgery clues—mid-level semantic concepts—top-level binary classification decision." This mechanism mandates that the model's reasoning path must follow a strict causal logic chain: 1) Clue Perception: The model first captures low-level physical forgery traces from the image, such as paper edges, screen moiré patterns, print textures, planar geometric distortions, or local hole-punch areas—atomic-level clues; 2) Concept Mapping: The above clues are abstracted into mid-level semantic concepts (e.g., "existence of print textures," "existence of screen borders," "existence of hole-punch areas"); 3) Decision Alignment: The final binary classification decision (real / forged) must form a logical implication relationship with the activated set of semantic concepts. That is, only when a specific forgery clue is fully perceived and mapped to the corresponding concept can the model make the corresponding forgery category judgment. This causal-oriented training constraint completely eliminates the drawback of "disconnect between explanation content and classification results" in traditional methods. It makes the explanatory text output by the model (such as "determined to be a screen playback attack due to the detection of screen borders") traceable to specific image spatial regions, thus providing a logically rigorous, traceable, and auditable basis for judgment in high-credibility scenarios such as face verification and financial auditing.
[0059] 5. Regional-level weakly supervised heatmap output, providing refined spatial evidence: This invention eliminates the need for expensive pixel-level precise annotation. Through a weakly supervised learning mechanism, it can automatically generate multi-scale spatial response heatmaps containing medium regions, boundary regions, planar face regions, and local fake hole-punch regions. These heatmaps are not only spatial representations of semantic concepts but also intuitive "evidence maps," clearly showing reviewers whether the model is focusing on paper edges, screen reflections, or mask stitching, thus greatly enhancing the spatial transparency of the decision-making process.
[0060] 6. Unified weak annotation format, significantly reducing data construction costs: This invention abandons the reliance on pixel-level masks or keypoint coordinates for fine-grained annotation in traditional methods. By designing a standardized weak annotation format for interpreting data (requiring only image-level labels and coarse region hints), this technology can be quickly adapted and migrated to multiple public academic datasets and various vertical domain business datasets at extremely low marginal cost. This uniformity of data format lays an efficient engineering foundation for the scalable expansion and continuous iteration of the model.
[0061] 7. Covering diverse high-value scenarios and possessing broad adaptability: Based on the aforementioned characteristics of high generalization, lightweight design, and strong interpretability, the solution of this invention is adaptable to diverse scenarios with stringent requirements for security, real-time performance, and hardware cost. Whether it's facial recognition verification for financial payment terminals, contactless access control and attendance in smart parks, or remote real-name authentication and rapid unlocking of mobile terminals in government services, this solution can provide stable, reliable, and low-power facial liveness detection services, possessing broad commercial application prospects. Attached Figure Description
[0062] Figure 1 This is a flowchart of the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing proposed in this invention.
[0063] Figure 2 This is a flowchart illustrating the training process of the face anti-spoofing model of the present invention;
[0064] Figure 3 This is a schematic diagram illustrating the reasoning process of the face anti-spoofing model that can be explained by the present invention. Detailed Implementation
[0065] The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments.
[0066] Example 1
[0067] This embodiment presents a lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing, such as... Figure 1As shown, a trained interpretable face anti-spoofing model is used to recognize face RGB images or video frames, outputting liveness detection results, and outputting attack explanation information when the liveness detection result is an attack.
[0068] The interpretable face anti-spoofing model includes a lightweight visual backbone network and an interpretation module.
[0069] The lightweight visual backbone network adopts the MoGA-ETA visual backbone network (Mixture of GradientAdapters with Enhanced Text Guidance and Alignment, MoGA-ETA), which includes an image segmentation module, a pre-trained visual encoder, MoGA (mixed gradient adapter), and a visual feature output module.
[0070] The explanation module includes:
[0071] The fake clue prediction branch is used to predict multiple clue labels to obtain clue prediction results;
[0072] The concept prediction branch is used to predict multiple concept labels to obtain concept prediction results;
[0073] Fake region-level explanation branches to output more than one heatmap;
[0074] The templated explanation generation module is used to convert concept prediction results into readable explanation text;
[0075] Consistency constraints are applied to the cue prediction results and concept prediction results, as well as the concept prediction results and the main classification results output by the lightweight visual backbone network, to align the main classification results, cue prediction results, and concept prediction results.
[0076] Input the RGB image or video frame of the face into the interpretable face anti-spoofing model. The lightweight visual backbone network outputs the main classification result, the forgery clue prediction branch outputs the clue response probability of each clue label, and the concept prediction branch outputs the concept response probability of each concept label.
[0077] Based on the Top-K algorithm, the Top-K clue labels ranked by the top K clue response probabilities and the Top-K probability labels ranked by the top K concept response probabilities are extracted and compared with the decision threshold. The Top-K clue labels and Top-K probability labels that are greater than the decision threshold are used as the clue prediction results and concept prediction results, respectively.
[0078] Multi-cue labels include at least: presentation medium boundary cues, resampling frequency artifact cues, reflection / lighting inconsistency cues, material / texture anomaly cues, and geometric shadow mismatch cues; specifically:
[0079] Q1: presentation_medium_boundary: Presentation medium boundaries, including paper edges, screen borders, mask outlines, head mold boundaries, and cutting marks;
[0080] Q2: recapture_frequency_artifact: Frequency domain anomalies caused by resampling or re-capturing, including moiré patterns, pixel arrays, and screen refresh marks;
[0081] Q3: reflection_glare_inconsistency: Abnormal reflection and specular highlight, commonly seen on screens, smooth plastic masks, or highly reflective materials;
[0082] Q4: material_texture_abnormality: Abnormal material texture, including abnormal paper fibers, printing particles, silicone, plastic, or head mold material;
[0083] Q5: geometry_flatness_shading_inconsistency: This includes issues such as flat photos lacking realistic 3D structure, and local shadows on masks that are geometrically inconsistent with real human faces.
[0084] Multi-concept labels include at least: paper edges, screen bezels / device bezels, moiré patterns / resampling artifacts, inconsistent screen reflections / reflections, abnormal printed surface textures, flat / flat surface features, abnormal mask material, discontinuous mask seams / outlines, abnormal local shadow structures, and eyeholes or cutting marks. Specifically:
[0085] C1: Paper_Edge - The edge of a piece of paper, photograph, or flat media;
[0086] C2: Screen_Border_Device_Bezel Screen border, device edge, or display media outline;
[0087] C3: Moire_Recapture_Artifact: Moire pattern, pixel array, or recapture frequency domain anomaly;
[0088] C4: Screen_Glare_Reflection - Screen glare, specular highlights, or discontinuous brightness.
[0089] C5: Print_Surface_Texture - Print texture, paper grain, or color degradation;
[0090] C6: Flat_Surface_Cue - Planar geometry, lacking realistic 3D undulations;
[0091] C7: Mask_Material_Abnormality - Abnormal texture of the mask, head mold, or silicone material;
[0092] C8: Mask_Seam_Contour indicates mask seams, broken contours, or discontinuous boundaries;
[0093] C9: Abnormal_Shading_Geometry indicates abnormal local shading, geometry, or skin tone transitions.
[0094] C10: Eye_Hole_Cutout. Abnormalities in eye, mouth, or nose cutting or partial openings.
[0095] like Figure 2 As shown, the training method for the face anti-spoofing model can be explained as follows:
[0096] Collect several publicly available RGB face anti-spoofing datasets, including at least one or more of the following: print attack samples, screen playback samples, local hole-punch samples, and real liveness samples;
[0097] Perform unified preprocessing on RGB face images or video frames of each RGB face anti-spoofing dataset, including but not limited to face detection, face cropping, size normalization, pixel normalization, video keyframe extraction, and data augmentation.
[0098] Weakly labeled interpretation data is constructed by uniformly cleaning and formatting RGB image or video frames and their corresponding metadata. The method for constructing the weakly labeled interpretation data is as follows:
[0099] From the metadata of RGB images or video frames, the dataset name, data division, subject number, acquisition device, scene type and attack medium are parsed from the sample path, directory name, protocol field and attack type. The attack names of different datasets are uniformly mapped to attack families, including: real, printed photos, video playback, curved photos and cropped photos.
[0100] Based on the formation mechanism of various attack families, corresponding clue tags and concept tags are generated for the samples;
[0101] By combining face detection, contour analysis, and region priors, coarse localization of forged regions is generated, and the detection method, confidence level, and manual verification markers are recorded to form a unified, interpretable weak label. Interpretable weak labels include at least image-level true / false labels, cue-level labels, concept-level labels, and coarse localization of forged regions.
[0102] Then, the lightweight visual backbone network and the forgery clue prediction branch are trained to enable the interpretable face anti-spoofing model to first have stable liveness recognition and clue response capabilities.
[0103] Then, the concept prediction branch is added to the training to learn fine-grained concepts without significantly increasing the complexity of the lightweight visual backbone network.
[0104] Consistency constraints are added between the cue prediction results and the concept prediction results, as well as between the concept prediction results and the main classification results, to align the main classification results, cue prediction results, and concept prediction results.
[0105] Based on computer vision algorithms, such as face detection, edge detection, contour detection, screen candidate region detection, skin color segmentation, and hand detection, fake regions are generated. Through a weakly supervised learning mechanism, heatmaps output by the fake region-level interpretation branch are trained.
[0106] Applying consistency constraints to the cue prediction results and concept prediction results, as well as to the concept prediction results and the main classification results output by the lightweight visual backbone network, means:
[0107] Setting clues—constructing a relation matrix based on conceptual hierarchy ;in, Indicates the type of clue tag. This indicates the type of concept label; the concept aggregation response at the cue level, obtained from concept prediction, is as follows:
[0108] ;
[0109] That is, using concepts to predict and then inferring the response to clues; among which, This represents the response of the k-th cue tag derived from related concept tags; This represents the concept response probability of the j-th concept label obtained by the i-th sample through the interpretable face anti-spoofing model; Indicates the first The first clue tag and the first The concept labels are semantically related; Indicates the concept label number;
[0110] Setting Clues—Conceptual Consistency Loss for:
[0111] ;
[0112] That is, the constraint clue prediction is consistent with the concept back-inference result; among which, Indicates the predicted first The first sample The probability of responding to a clue; Clue tag types;
[0113] Set attack indicator variables ;in, This is the main classification result output by the lightweight visual backbone network. Indicates attack determination, Indicates liveness determination; sets category-conceptual consistency loss. for:
[0114] ;
[0115] This means that real samples should not activate attack concepts, while attack samples must activate at least one attack concept. Here, mean() represents the mean function; max() represents the maximum value function. Indicates the activation threshold of concept labels; This represents the maximum concept response probability for the i-th sample;
[0116] Loss of Clue-Conceptual Consistency And category-concept consistency loss Add to total loss Joint optimization is performed. Total loss for:
[0117] ;
[0118] in, Total loss; Loss of primary classification results; Predicting losses based on clues; For conceptual prediction results; , , and These are contribution coefficients used to balance cue supervision, concept supervision, cue-concept consistency constraints, and category-concept consistency constraints, respectively.
[0119] like Figure 3 As shown, during the inference phase, the RGB image or video frame of the face to be detected is input into the trained interpretable face anti-spoofing model, which outputs a liveness detection result (liveness / attack decision result). If the liveness detection result indicates an attack, attack explanation information is output. The attack explanation information includes: cue prediction results, concept prediction results, heatmaps, and readable explanation text. The readable explanation text includes both the liveness detection result and the concept prediction result.
[0120] After outputting attack explanation information when the liveness detection result is an attack, the explanation label is then applied to the RGB image or video frame of the face.
[0121] Example 2
[0122] This embodiment provides a readable storage medium storing a computer program. When executed by a processor, the computer program causes the processor to perform the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing described in Embodiment 1.
[0123] Example 3
[0124] This embodiment discloses a computer device, including a processor and a memory for storing processor-executable programs. When the processor executes the program stored in the memory, it implements the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing described in Embodiment 1.
[0125] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.
Claims
1. A lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing, characterized in that: The trained interpretable face anti-spoofing model is used to recognize face RGB images or video frames, output liveness detection results, and output attack explanation information when the liveness detection result is an attack. The interpretable face anti-spoofing model includes a lightweight visual backbone network and an interpretation module; The explanation module includes: The fake clue prediction branch is used to predict multiple clue labels to obtain clue prediction results; The concept prediction branch is used to predict multiple concept labels to obtain concept prediction results; Fake region-level explanation branches to output more than one heatmap; The templated explanation generation module is used to convert concept prediction results into readable explanation text; Consistency constraints are applied to the cue prediction results and concept prediction results, as well as the concept prediction results and the main classification results output by the lightweight visual backbone network, to align the main classification results, cue prediction results, and concept prediction results. The attack explanation information includes: clue prediction results, concept prediction results, heatmaps, and readable explanation text.
2. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 1, characterized in that: Applying consistency constraints to the cue prediction results and concept prediction results, as well as to the concept prediction results and the main classification results output by the lightweight visual backbone network, means: Setting clues—constructing a relation matrix based on conceptual hierarchy ;in, Indicates the type of clue tag. This indicates the type of concept label; the concept aggregation response at the cue level, obtained from concept prediction, is as follows: ; in, This represents the response of the k-th cue tag derived from related concept tags; This represents the concept response probability of the j-th concept label obtained by the i-th sample through the interpretable face anti-spoofing model; Indicates the first The first clue tag and the first The concept labels are semantically related; Indicates the concept label number; Setting Clues—Conceptual Consistency Loss for: ; in, Indicates the predicted first The first sample The probability of responding to a clue; Set attack indicator variables ;in, This is the main classification result output by the lightweight visual backbone network. Indicates attack determination, Indicates liveness determination; sets category-conceptual consistency loss. for: ; Where mean() represents the mean function; max() represents the maximum value function; Indicates the activation threshold of concept labels; This represents the maximum concept response probability for the i-th sample; Loss of Clue-Conceptual Consistency And category-concept consistency loss Add to total loss Joint optimization is performed.
3. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 2, characterized in that: The total loss for: ; in, Total loss; Loss of primary classification results; Predicting losses based on clues; For conceptual prediction results; , , and These are the contribution coefficients.
4. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 1, characterized in that: The training method for the explainable face anti-spoofing model is as follows: Collect several publicly available RGB face anti-spoofing datasets; perform unified preprocessing on the RGB face images or video frames of each RGB face anti-spoofing dataset, and perform unified cleaning and unified format conversion on the RGB images or video frames and their corresponding metadata to construct weakly labeled interpretation data; First, the lightweight visual backbone network and the forgery clue prediction branch are trained to enable the interpretable face anti-spoofing model to have stable liveness recognition and clue response capabilities. Then, the concept prediction branch is added to the training to learn fine-grained concepts; Consistency constraints are added between the cue prediction results and the concept prediction results, as well as between the concept prediction results and the main classification results, to align the main classification results, cue prediction results, and concept prediction results. Based on computer vision algorithms, fake regions are generated. Through a weakly supervised learning mechanism, heatmaps of the fake region-level interpretation branches are trained.
5. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 4, characterized in that: The method for constructing the weakly labeled interpretation data is as follows: From the metadata of RGB images or video frames, the dataset name, data division, subject number, acquisition device, scene type and attack medium are parsed from the sample path, directory name, protocol field and attack type. The attack names of different datasets are uniformly mapped to attack families, including: real, printed photos, video playback, curved photos and cropped photos. Based on the formation mechanism of various attack families, corresponding clue tags and concept tags are generated for the samples; By combining face detection, contour analysis, and region priors, coarse localization of fake regions is generated, and the detection method, confidence level, and manual verification mark are recorded to form a unified and interpretable weak label.
6. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 1, characterized in that: Input the RGB image or video frame of the face into the interpretable face anti-spoofing model. The lightweight visual backbone network outputs the main classification result, the forgery clue prediction branch outputs the clue response probability of each clue label, and the concept prediction branch outputs the concept response probability of each concept label. Based on the Top-K algorithm, the Top-K clue labels ranked by the top K clue response probabilities and the Top-K probability labels ranked by the top K concept response probabilities are extracted and compared with the decision threshold. The Top-K clue labels and Top-K probability labels that are greater than the decision threshold are used as the clue prediction results and concept prediction results, respectively.
7. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 1, characterized in that: The multi-cue labels include at least: presentation medium boundary cues, resampling frequency artifact cues, reflection / lighting inconsistency cues, material / texture anomaly cues, and geometric shadow mismatch cues. The multi-concept labels include at least: paper edges, screen bezels / device bezels, moiré patterns / resampling artifacts, inconsistent screen reflections / reflections, abnormal printed surface textures, flat / flat surface features, abnormal mask materials, discontinuous mask seams / outlines, abnormal local shadow structures, and eye holes or cutting marks.
8. The lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing according to claim 1, characterized in that: The readable explanatory text includes: a liveness detection result section and a concept prediction result section.
9. A readable storage medium, characterized in that, The storage medium stores a computer program that, when executed by a processor, causes the processor to perform any one of the lightweight, interpretable, and generalized recognition methods for cross-dataset face anti-spoofing as described in any one of claims 1-8.
10. A computer device comprising a processor and a memory for storing a processor-executable program, characterized in that, When the processor executes the program stored in the memory, it implements the lightweight, interpretable, and generalized recognition method for cross-dataset face anti-spoofing as described in any one of claims 1-8.
Citation Information
Patent Citations
Face in-vivo detection method, device and equipment based on multi-modal large language model, and storage medium
CN120388404A
Face image detection method and device, electronic equipment and storage medium
CN121170911A
Face living body recognition method and system of self-constructed reasoning chain, medium and product
CN121281147A
Static living body detection method and system based on multi-modal large model
CN121305695A
Risk feature design method based on multiple modes
CN121415446A