Face recognition mathematical model construction method and system, electronic device, and storage medium
By constructing an adversarial training strategy based on a 3D convolutional network and a multi-head attention mechanism, the problem of insufficient robustness of face recognition models under dynamic occlusion is solved, and high-fidelity face recognition results are achieved.
Patent Information
- Application Number
- CN202511118503.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-11
- Publication Date
- 2026-03-03
- Estimated Expiration
- 2045-08-11
AI Technical Summary
Existing facial recognition technology struggles to effectively capture nonlinear deformations and changes in light and shadow caused by occlusion and facial movements under dynamic occlusion conditions, thus limiting its ability to identify individuals.
By collecting facial features and occlusion data, dynamic video sequences are generated. Spatiotemporal features are extracted using a 3D convolutional network. Combined with multi-head attention mechanism and adversarial training strategy, a mathematical model with adversarial robustness is constructed.
The robustness and generalization ability of the model to complex deformations have been improved, and high-fidelity face recognition has been achieved for accurate identification under occlusion conditions.
Smart Images

Figure CN120913263B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vision and pattern recognition technology, and in particular to methods and systems for constructing mathematical models for face recognition, electronic devices, and storage media. Background Technology
[0002] In recent years, with the rapid development of deep learning and computer vision technologies, facial recognition technology has been widely applied in various fields such as security monitoring, identity authentication, and smart terminal interaction. Traditional facial recognition methods mainly rely on the extraction and matching of complete facial features in static images, typically based on shallow feature descriptors such as principal component analysis, linear discriminant analysis, or local binary patterns for modeling. The integration of 3D face reconstruction and physical simulation technologies provides a new technical path for facial recognition, especially showing potential in dynamic lighting, pose changes, and non-rigid deformation modeling.
[0003] Most occlusion perception models rely on predefined occlusion templates or simple image overlay methods to generate training data, failing to fully consider the physical interaction between the occluder and the face. Existing methods often treat the motion trajectory of the occluder as an independent variable during spatiotemporal feature modeling, lacking in-depth analysis of the motion coupling relationship of facial key points. This makes it difficult to capture the nonlinear deformation and lighting changes of the occluder caused by facial movements, thus limiting the model's ability to discriminate identities under dynamic occlusion. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides a method for constructing mathematical models for face recognition to solve the problem of how to construct mathematical models that have physical realism and adversarial robustness.
[0006] To address the aforementioned technical problems, the present invention provides the following technical solution: Firstly, the present invention provides a method for constructing a mathematical model for face recognition, comprising: collecting facial feature data and facial occlusion data, obtaining the occlusion area range and marking dynamic deformation parameters to generate a facial image dataset; performing real-time dynamic rendering on the facial image dataset, and simulating the elastic deformation and light reflection effects of the occlusion based on the motion trajectory of the facial occlusion to generate a dynamic video sequence; preprocessing the dynamic video sequence, extracting spatiotemporal features segment by segment through a three-dimensional convolutional network, and capturing the interaction changes between the motion trajectory of the occlusion and facial features to generate a spatiotemporal feature tensor; inputting the spatiotemporal feature tensor into a joint modeling architecture to initialize a mathematical model for face recognition, generating an initial version of the mathematical model for face recognition, and analyzing inter-frame dependencies through a multi-head attention mechanism to generate risk prediction results; dynamically adjusting the initial version of the mathematical model for face recognition based on the risk prediction results, and generating a new mathematical model for face recognition through an adversarial training strategy.
[0007] As a preferred embodiment of the method for constructing a mathematical model for face recognition according to the present invention, the specific steps for collecting face feature data and facial occlusion data, obtaining the occlusion area range, marking dynamic deformation parameters, and generating a face image dataset are as follows: the face feature data includes the coordinates of the face detection box and the coordinates of the key points of the facial features; the facial occlusion data includes the material characteristics and thickness data of the occlusion; based on the face feature data and facial occlusion data, the occlusion area range is obtained, and then dynamic deformation parameters are marked to generate a face image dataset.
[0008] As a preferred embodiment of the method for constructing a mathematical model for face recognition described in this invention, the real-time dynamic rendering of the face image dataset and the specific steps based on the motion trajectory of the facial occluder are as follows: collecting the motion trajectory of the facial occluder, establishing a rigid transformation mapping between the pixel coordinate system and the spatial coordinate system of the face image dataset in combination with the face image dataset, and generating a three-dimensional scene entity; based on the three-dimensional scene entity, combining the facial occluder data and the motion trajectory of the facial occluder, calculating the mesh deformation displacement frame by frame through vertex force analysis, and generating an occluder mesh sequence.
[0009] As a preferred embodiment of the face recognition mathematical model construction method of the present invention, the dynamic video sequence is generated by simulating the elastic deformation and light reflection effect of the occluder. The specific steps are as follows: based on the occluder mesh sequence, combined with the material characteristics of the occluder and the real-time ambient lighting parameters, the optical distribution of the simulated surface is generated by tracing the photon path to generate a lighting rendering frame sequence; the lighting rendering frame sequence is sorted, and after applying motion vector compensation to eliminate jitter, the dynamic video sequence is obtained by time resampling.
[0010] As a preferred embodiment of the method for constructing a mathematical model for face recognition according to the present invention, the preprocessing of the dynamic video sequence and the extraction of spatiotemporal features segment by segment through a three-dimensional convolutional network are specifically performed as follows: the dynamic video sequence is cut into video segments according to a fixed time window and standardized to generate a set of standardized video segments; features are extracted from the set of standardized video segments through a three-dimensional convolutional network architecture to generate a primary spatiotemporal feature cube.
[0011] As a preferred embodiment of the method for constructing a mathematical model for face recognition according to the present invention, the specific steps for capturing the interaction between the motion trajectory of the occluded object and the facial features to generate a spatiotemporal feature tensor are as follows: based on the initial spatiotemporal feature cube, the motion trajectory features and facial features are processed separately through a dual-branch attention mechanism to generate an enhanced spatiotemporal feature matrix; based on the enhanced spatiotemporal feature matrix, a spatiotemporal feature tensor is generated through feature fusion of the time dimension and the spatial dimension.
[0012] As a preferred embodiment of the face recognition mathematical model construction method of the present invention, the steps of initializing the face recognition mathematical model by inputting the spatiotemporal feature tensor into the joint modeling architecture to generate an initial version of the face recognition mathematical model, and analyzing the inter-frame dependencies through a multi-head attention mechanism to generate risk prediction results are as follows: Based on the spatiotemporal feature tensor, a dual-branch joint modeling architecture is constructed, and the face recognition mathematical model framework is obtained through a feature fusion layer; according to the face recognition mathematical model framework, the spatiotemporal feature tensor is segmented according to the time step and dynamically weighted to generate an initial version of the face recognition mathematical model; the feature change index is calculated to obtain the motion abnormality score representing the degree of motion abnormality, the feature change intensity of the facial region is calculated as the regional risk value, and linearly combined according to the weight ratio to generate risk prediction results.
[0013] As a preferred embodiment of the face recognition mathematical model construction method of the present invention, the specific steps of dynamically adjusting the initial face recognition mathematical model based on the risk prediction results and generating a face recognition mathematical model through an adversarial training strategy are as follows: Based on the risk prediction results, the learning rate is dynamically adjusted by configuring a decay coefficient and the batch size is adjusted inversely to generate a set of control parameters; adversarial examples are generated by using the projection gradient descent method according to the set of control parameters, and the face image dataset and adversarial examples are mixed to form a training dataset; using the training dataset, combined with the set of control parameters, the parameters of the initial face recognition mathematical model are updated through the backpropagation algorithm to generate an updated face recognition mathematical model; multimodal feature optimization is performed on the updated face recognition mathematical model, and the recognition accuracy of the multimodal feature-optimized face recognition mathematical model in occluded scenarios is evaluated to generate a face recognition mathematical model.
[0014] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the face recognition mathematical model construction method as described in the first aspect of the present invention.
[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the face recognition mathematical model construction method as described in the first aspect of the present invention.
[0016] The beneficial effects of this invention are as follows: by fusing facial feature key points and material parameters to generate occluded face images with dynamic deformation, high-fidelity data synthesis is achieved, which is used to improve the generalization ability of the model and solves the problem of unnatural occlusion fitting; by calculating mesh deformation frame by frame through vertex force analysis, physically realistic dynamic occlusion simulation is achieved, which is used to construct realistic training videos and enhances the robustness of the model to complex deformations. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the method for constructing a mathematical model for face recognition.
[0019] Figure 2 This is a flowchart of the process for collecting facial feature data and occlusion data.
[0020] Figure 3 A flowchart for generating dynamic video sequences.
[0021] Figure 4 This is a flowchart for multimodal feature optimization and model evaluation. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0025] Reference Figures 1-4 As an embodiment of the present invention, this embodiment provides a method for constructing a mathematical model for face recognition, including the following steps:
[0026] S1: Collect facial feature data and facial occlusion data, and after obtaining the occlusion area range, mark the dynamic deformation parameters to generate a facial image dataset;
[0027] S1.1: Facial feature data includes the coordinates of the face detection box and the coordinates of key points of the facial features;
[0028] It should be noted that the facial feature data is obtained by face detection processing to obtain the coordinates of the face detection box, specifically represented by four values: the coordinates of the upper left corner of the rectangle, its width, and its height (for example, (100, 150, 200, 250) indicates a rectangular area with the upper left corner located at the image pixel coordinates (100, 150), a width of 200 pixels, and a height of 250 pixels). At the same time, the coordinates of the facial key points are obtained through the facial key point localization algorithm, including the coordinates of the left pupil, right pupil, nose tip, left corner of mouth, and right corner of mouth (for example, left pupil coordinates (120, 180), right pupil coordinates (180, 180), nose tip coordinates (150, 220), left corner of mouth coordinates (130, 250), right corner of mouth coordinates (170, 250)). The final output facial feature data contains two sets of structured data: the coordinates of the face detection box and the coordinates of the facial key points.
[0029] S1.2: Facial occlusion data includes the material properties and thickness data of the occlusion;
[0030] It should be noted that the facial occlusion data is obtained by using physical measuring instruments to acquire the material properties of the occlusion, specifically the three physical parameters of elastic modulus, coefficient of friction, and light transmittance (e.g., elastic modulus of cotton is 0.8, coefficient of friction is 0.3, and light transmittance is 40%-60%). At the same time, the thickness data is obtained by using a laser thickness gauge, which is expressed as a precise value in millimeters (e.g., medical mask thickness is 1.2 mm, blanket thickness is 5.0 mm). The final output facial occlusion data includes two sets of standardized parameters: the material properties of the occlusion and the thickness data.
[0031] S1.3: Based on facial feature data and facial occlusion data, the range of the occlusion area is obtained, and dynamic deformation parameters are labeled to generate a facial image dataset.
[0032] Furthermore, based on the coordinates of the face detection box and key facial features in the face feature data, combined with the material characteristics and thickness data of the facial occlusion data, the occlusion area is obtained through a geometric mapping method, specifically represented as the rectangular range coordinates of the mouth and nose area; dynamic deformation parameters, including deformation coefficient and recovery rate, are marked according to the elastic modulus and thickness of the facial occlusion data; finally, a face image dataset is generated, containing a sequence of face images with occlusion area annotations and dynamic deformation parameter annotations.
[0033] S2: Real-time dynamic rendering of the face image dataset, and simulation of the elastic deformation and light reflection effects of the occluders based on the motion trajectory of the facial occluders to generate dynamic video sequences;
[0034] S2.1: Collect the motion trajectory of facial occlusions, and combine the face image dataset to establish a rigid transformation mapping between the pixel coordinate system and the spatial coordinate system of the face image dataset to generate a 3D scene entity;
[0035] Furthermore, the collected motion trajectories of facial occluders include displacement direction data, velocity curve data, and acceleration data. Combining the coordinates of the face detection box and the coordinates of the key facial features in the face image dataset, a rigid transformation mapping between the pixel coordinate system and the spatial coordinate system of the face image dataset is established through the feature point correspondence method. This generates a three-dimensional scene entity, which includes a mesh sequence of occluders with motion trajectory annotations and a registered three-dimensional face model, where each vertex is associated with spatial coordinate system coordinates.
[0036] It should be noted that when establishing a rigid transformation mapping using the feature point correspondence method, firstly, fixed facial feature key points in the face image dataset are selected as the reference. Three-dimensional coordinates are assigned to the facial feature key points in the spatial coordinate system. The optimal rotation matrix and translation vector are obtained through the least squares method, so that the distance error between the key points in the pixel coordinate system and the corresponding points in the spatial coordinate system after transformation is minimized. Finally, a rigid transformation relationship between pixel coordinates and spatial coordinates is established.
[0037] S2.2: Based on the 3D scene entities, combined with the facial occlusion data and the facial occlusion motion trajectory, the mesh deformation displacement is calculated frame by frame through vertex force analysis to generate the occlusion mesh sequence;
[0038] The formula for calculating the mesh deformation displacement is:
[0039] ;
[0040] in, This represents the amount of mesh deformation displacement. Indicates the first The elastic modulus of the material, Represents vertices initial coordinates, Key points representing the trajectory coordinates Indicates the material thickness parameter. This represents the material density parameter. Represents the time-dependent decay function. Indicate key points Radius of influence This represents the coefficient of inertia (range: 0.1-0.7). Indicates the forces exerted by the external environment. This indicates the total number of material types involved in the calculation.
[0041] It should be noted that, based on the vertex coordinate data in the 3D scene entity, combined with the material properties and thickness data of the face occlusion data, as well as the velocity curve data and acceleration data of the face occlusion motion trajectory, the force state of each vertex during the motion process is analyzed through physical simulation methods, and the mesh deformation displacement is calculated frame by frame; finally, an occlusion mesh sequence is generated, which includes a deformation mesh dataset with timestamps, and each mesh vertex records a 3D displacement vector.
[0042] The process of analyzing the force state of each vertex during motion is as follows: First, the vertex mass is obtained based on the material properties and thickness data of the face occlusion; then, the inertial force is obtained by combining the acceleration data of the motion trajectory; the elastic restoring force is obtained based on the vertex displacement and elastic modulus; the viscous damping force is obtained based on the velocity data of the motion trajectory and the friction coefficient; the resultant force is obtained by superimposing the three forces; the instantaneous acceleration of the vertex is solved by Newton's second law; and the displacement is updated using kinematic formulas to complete the closed-loop analysis from the force state to the deformation displacement.
[0043] S2.3: Based on the occlusion mesh sequence, combined with the material properties of the occlusion and real-time ambient lighting parameters, the surface optical distribution is simulated through photon path tracing to generate a lighting rendering frame sequence;
[0044] Furthermore, based on the deformed mesh data in the occlusion mesh sequence, combined with the material properties of the occlusion and the real-time ambient lighting parameters, the interaction process between photons and the mesh surface is tracked using the Monte Carlo ray propagation simulation method to obtain the light energy distribution of each pixel; finally, a lighting rendering frame sequence is generated.
[0045] It should be noted that the Monte Carlo ray propagation simulation method achieves ray tracing by randomly sampling photon paths. It emits photon beams from the light source and obtains the interaction behavior between photons and the vertices of the mesh surface based on material property parameters, including three interaction types: diffuse reflection, specular reflection, and transmission. After each interaction, the photon propagation direction is adjusted according to the probability density function. The position and energy of the photons reaching the imaging plane are recorded cumulatively. Finally, a surface optical distribution map is generated by statistically analyzing the distribution of a large number of photons. The photon energy data in the surface optical distribution map is mapped to the standard RGB color space through a color conversion method. First, the photon energy value is normalized to the range (example value: 0-1). Then, it is converted to XYZ tristimulus values according to the color matching function. Finally, the RGB pixel value (example value: 8 bits) is calculated through the sRGB conversion matrix. Each pixel in the generated lighting rendering frame sequence stores the final RGB value.
[0046] S2.4: Sort the lighting rendering frame sequence, apply motion vector compensation to eliminate jitter, and then obtain the dynamic video sequence through time resampling.
[0047] Furthermore, the lighting rendering frame sequence is arranged in time stamp order to form a coherent frame group. The correspondence between motion trajectories between frames is established by analyzing the changes in feature point positions. A weighted averaging strategy is used to smooth the motion vectors. New frames are inserted between existing frames according to the time ratio to complete resampling and generate a dynamic video sequence.
[0048] It should be noted that when establishing the correspondence between motion trajectories between frames through feature point position change analysis, the same facial key points are first detected in two adjacent frames, and the displacement vectors of each key point are obtained. Median filtering is then applied to the displacement vectors of all matching key points to establish the correspondence matrix between motion trajectories between frames. When inserting a new frame between existing frames, the time ratio of the insertion position is first determined. The RGB values of corresponding pixels in the preceding and following frames are linearly mixed according to the time ratio (example: the RGB values of pixel (100, 200) in frame 4 (180, 200, 150) and the RGB values of pixel (190, 210, 160) in frame 5 (100, 200) are mixed at 60% and 40% respectively to obtain the new frame pixel (100, 200) (184, 204, 154)). The same interpolation operation is performed on all pixels to generate a complete new frame, and finally, the dynamic video sequence with increased frame rate is output.
[0049] S3: Preprocess the dynamic video sequence, extract spatiotemporal features segment by segment through a 3D convolutional network, capture the interaction changes between the motion trajectory of occluded objects and facial features, and generate spatiotemporal feature tensors;
[0050] S3.1: Cut the dynamic video sequence into video segments according to a fixed time window, and perform standardization processing to generate a set of standardized video segments;
[0051] Specifically, the dynamic video sequence is segmented into video segment nodes according to a fixed length (example value: 16 frames). Each video segment node is adjusted to a set resolution (example value: 224×224 pixels) and converted to the YCbCr color space. The value range of the luminance component is expanded to a set range (example value: 0-255 range) through histogram equalization to generate a standardized set of video segments.
[0052] It should be noted that the histogram equalization operation first calculates the pixel value distribution histogram of the brightness component, obtains the cumulative distribution function and establishes a mapping table, and then replaces the value of each pixel in the original image according to the mapping table.
[0053] S3.2: Feature extraction is performed on a standardized set of video clips using a three-dimensional convolutional network architecture to generate a primary spatiotemporal feature cube;
[0054] Specifically, a standardized set of video clips is input into a 3D convolutional network architecture for processing. First, a cubic convolutional kernel is used to scan the spatiotemporal features of the video clips. Then, the feature size is compressed through a 3D max pooling operation. Finally, a 3D dilated convolution is used to expand the receptive field to capture long-range dependencies, generating a primary spatiotemporal feature cube.
[0055] It should be noted that the three-dimensional max pooling operation is implemented by sliding a cube window of fixed size on the input feature cube, extracting the maximum value in each window as the output, thus preserving the spatiotemporal features while achieving feature dimensionality reduction.
[0056] 3D dilated convolution expands the receptive field by inserting holes between standard convolution kernel elements. In practice, the convolution kernel is sampled at intervals according to the dilation rate (example value: 2), so that the computation at each output position can cover a wider spatiotemporal region in the input feature map, while keeping the number of parameters unchanged. This structure is particularly suitable for capturing long-range spatiotemporal dependencies that span multiple frames in video sequences.
[0057] The range of the spatiotemporal region corresponding to each output feature point in the input data during the receptive field of convolution determines the size of the network's feature capture field.
[0058] S3.3: Based on the primary spatiotemporal feature cube, motion trajectory features and facial features are processed separately through a dual-branch attention mechanism to generate an enhanced spatiotemporal feature matrix;
[0059] Specifically, the primary spatiotemporal feature cube is input to a dual-branch attention mechanism for processing. The motion trajectory branch analyzes the displacement correlation between consecutive frames through a temporal self-attention node, while the face feature branch focuses on key facial features through a spatial attention node. The outputs of the two branches interact through a cross-attention layer to generate enhanced spatiotemporal feature moments.
[0060] It should be noted that the temporal attention node first divides the primary spatiotemporal feature cube into multiple segments along the time dimension, obtains the similarity score between each pair of segments, normalizes the scores using the softmax function to obtain attention weights, and finally sums the features of each segment according to the attention weights to achieve cross-frame motion trajectory feature fusion. The spatial attention node generates a two-dimensional Gaussian distribution weight map centered on each facial keypoint coordinate, based on the coordinates of the facial keypoints. The two-dimensional Gaussian distribution weight map is multiplied pixel-by-pixel with the primary spatiotemporal feature cube, and the importance of each channel feature is reweighted using a (example value: 1×1) convolution kernel, finally outputting an enhanced spatial attention feature map.
[0061] S3.4: Based on the enhanced spatiotemporal feature matrix, a spatiotemporal feature tensor is generated by fusing features from the time and spatial dimensions.
[0062] Specifically, based on the enhanced spatiotemporal feature matrix, firstly, gated recurrent nodes are applied along the time dimension to capture long-term dependencies, while three-dimensional convolution is used in the spatial dimension to reorganize cross-channel features. Finally, the time features and spatial features are weighted and fused through a spatiotemporal cross-connection layer to generate a spatiotemporal feature tensor.
[0063] It should be noted that when using gated loop nodes to capture long-term dependencies along the time dimension, the spatiotemporal feature matrix is input into the gated loop node in the order of time steps. By updating the gate control to retain the proportion of historical memory and resetting the gate control to control the degree of influence of the current input, the hidden state is calculated to fuse historical information with the current input, and the output time feature vector integrates the dependencies of all time steps.
[0064] The spatiotemporal cross-connection layer first performs an outer product operation on the temporal feature vector and the spatial feature vector to generate an interaction matrix. The interaction matrix is then scored for importance using trainable weight parameters, and the feature combination with the highest score is selected. Finally, the selected spatiotemporal cross features are concatenated with the original features.
[0065] S4: Input the spatiotemporal feature tensor into the joint modeling architecture to initialize the face recognition mathematical model, generate the initial version of the face recognition mathematical model, and analyze the inter-frame dependency relationship through the multi-head attention mechanism to generate risk prediction results;
[0066] S4.1: Based on the spatiotemporal feature tensor, a dual-branch joint modeling architecture is constructed, and the mathematical model framework for face recognition is obtained through the feature fusion layer;
[0067] Furthermore, a dual-branch joint modeling architecture is constructed based on spatiotemporal feature tensors. The spatiotemporal feature encoding branch uses a three-dimensional residual network to extract multi-level spatiotemporal features, while the key point auxiliary branch loads face key point detection nodes to generate an attention mask. The outputs of the two branches are fused by element-wise multiplication and (example value: 1×1) convolution to generate a mathematical model framework for face recognition.
[0068] It should be noted that the facial landmark detection node first locates the coordinates of the key points of the facial features (example: left pupil (120, 180), right corner of mouth (170, 250)), generates a two-dimensional Gaussian distribution heatmap centered on the key points, performs channel-by-channel multiplication on the heatmap and the input feature map, adjusts the channel dimension through (example value: 1×1) convolution, and finally outputs the key point attention mask.
[0069] The 3D residual network extracts multi-level spatiotemporal features by stacking multiple residual blocks. Each residual block contains two (example value: 3×3×3) convolutional layers and a skip connection structure. The initial spatiotemporal feature data provided by the skip connection spatiotemporal feature tensor is added to the convolutional output. The features are processed by batch normalization and ReLU activation function to generate multi-level spatiotemporal features.
[0070] S4.2: Based on the mathematical model framework for face recognition, the spatiotemporal feature tensor is segmented according to the time step and dynamic weight fusion is performed to generate the initial version of the mathematical model for face recognition.
[0071] Furthermore, based on the mathematical model framework for face recognition, the spatiotemporal feature tensor is divided into several segments with a fixed time step. Each time slice is converted into a feature vector through an independent fully connected layer. A gating attention mechanism is used to obtain the dynamic weights of each time slice. The feature vectors of all time slices are weighted and summed to generate the initial version of the face recognition mathematical model.
[0072] It should be noted that the gated attention mechanism first inputs the feature vector of each time slice into the fully connected layer to generate a query vector, a key vector, and a value vector. It then obtains the dot product similarity score between the query vector and the key vectors of all time slices, normalizes it into attention weights using the softmax function, and finally sums the value vectors of each time slice according to the attention weights to output the fused feature vector after dynamic weight allocation.
[0073] S4.3: Calculate the feature change index to obtain the motion abnormality score that represents the degree of motion abnormality, calculate the feature change intensity of the five sensory regions as the regional risk value, and linearly combine them according to the weight ratio to generate the risk prediction result.
[0074] The formula for calculating the characteristic change index is:
[0075] ;
[0076] in, express The dynamic change index of characteristics at any given time. express The spatiotemporal feature tensor at time t, express The characteristic stability coefficient at time (range: 0.1-1.2). Represents a numerical stability constant (example value: 1e-6). Indicates the first Temporal attention weights of frames, Indicates the length of the analysis time window. It represents the relative displacement over time.
[0077] The formula for calculating the intensity of feature changes in the facial region is:
[0078] ;
[0079] in, Indicates the intensity of characteristic changes in the facial features. Indicates the first The key points of the five facial features are in the first The feature vector of a frame, Indicates the first Mean temporal features of key points Indicates the length of the analysis time window. Indicates the index of key points of the facial features. Indicates the timing number of the video frame.
[0080] It should be noted that the feature change index is calculated based on the spatiotemporal feature tensor, and the degree of motion anomaly is obtained by the norm of the feature difference between adjacent frames within the time window; the intensity of regional feature change is calculated for the feature vectors of key facial features, and the degree of deviation of each key point feature from the temporal mean is obtained; the motion anomaly score and the regional risk value are combined according to the weight ratio to generate the final risk prediction result (example: R=0.6Dt+0.4Y).
[0081] S5: Dynamically adjust the initial version of the face recognition mathematical model based on the risk prediction results, and generate a face recognition mathematical model through adversarial training strategy.
[0082] S5.1: Based on the risk prediction results, configure the decay coefficient to dynamically adjust the learning rate and inversely adjust the batch size to generate a set of control parameters;
[0083] Furthermore, based on the risk prediction results, a three-level risk classification is performed (example: R<0.3 is low risk, 0.3≤R≤0.7 is medium risk, and R>0.7 is high risk), and attenuation coefficients are configured for each level (example: low risk α=0.9, medium risk α=0.5, and high risk α=0.1). The learning rate is dynamically adjusted according to the attenuation coefficients, and the batch size is adjusted according to the inverse relationship of the risk prediction results to generate a set of control parameters.
[0084] S5.2: Based on the set of control parameters, generate adversarial examples using the projection gradient descent method, and mix the face image dataset with the adversarial examples to form a training dataset;
[0085] Furthermore, based on the learning rate and batch size in the set of control parameters, the projective gradient descent method is used to generate adversarial perturbations on the original face image. By iterating the gradient of the loss function and constraining the perturbation amplitude, the generated adversarial samples are mixed with the original face image in proportion to obtain mixed samples, thus generating the training dataset.
[0086] It should be noted that the projection gradient descent method first obtains the gradient of the loss function of the original face image under the current face recognition mathematical model, applies a perturbation in the gradient direction, and constrains the perturbation within the allowable range through projection operation (e.g., limit the pixel change to no more than ±5). Iteratively executes gradient calculation and perturbation application until the maximum number of iterations is reached. The generated adversarial example retains the visual structure of the original image but contains targeted perturbations.
[0087] S5.3: Using the training dataset and the set of control parameters, update the parameters of the initial face recognition mathematical model through the backpropagation algorithm to generate the updated face recognition mathematical model;
[0088] Furthermore, using mixed samples from the training dataset, and based on the learning rate and batch size set by the parameter set, the gradient of the loss function with respect to the model parameters is calculated through the backpropagation algorithm. The weight parameters of the face recognition mathematical model are updated according to the learning rate ratio. After multiple rounds of iterative optimization, an updated face recognition mathematical model is generated.
[0089] S5.4: Perform multimodal feature optimization on the updated face recognition mathematical model, evaluate the recognition accuracy of the face recognition mathematical model after multimodal feature optimization in occluded scenarios, and generate a face recognition mathematical model.
[0090] Furthermore, the updated face recognition mathematical model is processed through a multimodal feature optimization method. The outputs of the spatiotemporal feature branch and the texture feature branch are fused through an attention mechanism. The recognition accuracy of the multimodal feature-optimized face recognition mathematical model in occluded scenarios is evaluated on an occluded test dataset, and finally, a face recognition mathematical model is generated.
[0091] It should be noted that the attention mechanism fusion first converts the spatiotemporal feature vector and texture feature vector into attention scores through independent fully connected layers. The dot product similarity of the two attention scores is then obtained and normalized using softmax to become the fusion weights. The original feature vectors are then weighted and summed. The recognition accuracy of the face recognition mathematical model optimized with multimodal features is evaluated by performing forward inference on an independent test dataset containing occluded samples. The face feature vector output by the multimodal feature-optimized face recognition mathematical model is compared with the labeled identity data, and the percentage of correctly matched samples is used as the accuracy.
[0092] This embodiment also provides a computer device applicable to the method of constructing a mathematical model for face recognition, including: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the method of constructing a mathematical model for face recognition as proposed in the above embodiment.
[0093] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.
[0094] This embodiment also provides a storage medium storing a computer program, which, when executed by a processor, implements the method for constructing a mathematical model for face recognition as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0095] In summary, this invention achieves high-fidelity data synthesis by fusing facial feature key points and material parameters to generate occluded face images with dynamic deformation, thereby improving the model's generalization ability and solving the problem of unnatural occlusion fitting; and by calculating mesh deformation frame by frame through vertex force analysis, it achieves physically realistic dynamic occlusion simulation, which is used to construct realistic training videos and enhances the model's robustness to complex deformations.
[0096] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A method for constructing a mathematical model for face recognition, characterized in that: The application relates to a method for generating a dynamic video sequence based on a face image dataset and a face occlusion object dataset. The method comprises the following steps of: Collecting face feature data and face occlusion object data, and marking dynamic deformation parameters after obtaining an occlusion region range to generate a face image dataset; Real-time dynamic rendering is performed on the face image dataset, and according to a face occlusion object motion track, the elastic deformation and light reflection effect of the face occlusion object are simulated to generate a dynamic video sequence, and the specific steps are as follows, Collecting a face occlusion object motion track, and combining the face image dataset to establish a rigid transformation mapping between a face image dataset pixel coordinate system and a space coordinate system to generate a three-dimensional scene entity; According to the three-dimensional scene entity, the face occlusion object data and the face occlusion object motion track are combined to calculate the grid deformation displacement of each frame through vertex force analysis, and a face occlusion object grid sequence is generated; Based on the face occlusion object grid sequence, the material characteristics of the face occlusion object and real-time environmental light parameters are combined to simulate surface optical distribution through photon path tracking to generate a light rendering frame sequence; After frame sorting and application of motion vector compensation to eliminate jitter, the dynamic video sequence is obtained through time resampling; Pretreatment is performed on the dynamic video sequence, time-space features are extracted through a three-dimensional convolution network, and interactive changes of the face occlusion object motion track and the face feature are captured to generate a time-space feature tensor; The time-space feature tensor is input into a joint modeling architecture to initialize a face recognition mathematical model, an initial version of the face recognition mathematical model is generated, and a risk prediction result is generated through a multi-head attention mechanism to analyze interframe dependency; 2. The method of claim 1, wherein: The initial version of the face recognition mathematical model is dynamically adjusted based on the risk prediction result, and the face recognition mathematical model is generated through an adversarial training strategy. The specific steps of collecting face feature data and face occlusion object data, and marking dynamic deformation parameters after obtaining an occlusion region range to generate a face image dataset are as follows, The face feature data comprises face detection frame coordinates and five feature point coordinates; The face occlusion object data comprises material characteristics and thickness data of the face occlusion object; 3. The method of claim 1, wherein: Based on the face feature data and the face occlusion object data, the occlusion region range is obtained, and dynamic deformation parameters are marked to generate a face image dataset. The specific steps of pretreating the dynamic video sequence and extracting time-space features through a three-dimensional convolution network are as follows, The dynamic video sequence is cut into video segments according to a fixed time window, and standardized processing is performed to generate a standardized video segment set; 4. The method of claim 3, wherein: The standardized video segment set is subjected to feature extraction through a three-dimensional convolution network architecture to generate a primary time-space feature cube. The specific steps of capturing interactive changes of the face occlusion object motion track and the face feature to generate a time-space feature tensor are as follows, According to the primary time-space feature cube, motion track features and face features are processed through a double-branch attention mechanism to generate an enhanced time-space feature matrix; 5. The method of claim 4, wherein: Based on the enhanced time-space feature matrix, a time-space feature tensor is generated through feature fusion in the time dimension and the space dimension. The specific steps of inputting the time-space feature tensor into a joint modeling architecture to initialize a face recognition mathematical model, generating an initial version of the face recognition mathematical model, and generating a risk prediction result through a multi-head attention mechanism to analyze interframe dependency are as follows, Based on the space-time feature tensor, a double-branch joint modeling architecture is constructed, and a face recognition mathematical model framework is obtained through a feature fusion layer; According to the face recognition mathematical model framework, the space-time feature tensor is segmented according to the time step, and dynamic weight fusion is performed to generate a preliminary face recognition mathematical model; The feature change index is calculated to obtain the motion anomaly score representing the degree of motion anomaly, the feature change intensity of the facial feature region is calculated as the regional risk value, and the risk prediction result is generated by linear combination according to the weight proportion.
6. The method of claim 5, wherein: The preliminary face recognition mathematical model is dynamically adjusted based on the risk prediction result, and the face recognition mathematical model is generated through the adversarial training strategy, and the specific steps are as follows, Based on the risk prediction result, the decay coefficient is configured to dynamically adjust the learning rate, and the batch size is inversely adjusted to generate a set of regulation parameters; According to the set of regulation parameters, an adversarial sample is generated by a projection gradient descent method, and the face image dataset and the adversarial sample are mixed to form a training dataset; Using the training dataset, the preliminary face recognition mathematical model parameters are updated by a back propagation algorithm combined with the set of regulation parameters to generate an updated face recognition mathematical model; The updated face recognition mathematical model is subjected to multi-modal feature optimization, and the recognition accuracy of the face recognition mathematical model after multi-modal feature optimization in the occlusion scene is evaluated to generate the face recognition mathematical model. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is characterized in that: The processor executes the computer program to realize the steps of the face recognition mathematical model construction method of any one of claims 1-6.
8. A computer readable storage medium having stored thereon a computer program, characterized in that: The computer program is executed by the processor to realize the steps of the face recognition mathematical model construction method of any one of claims 1-6.
Citation Information
Patent Citations
Voice-driven speaker head movement video synthesis enhancement method and system, and storage medium
CN115294622A
AR game camera system based on combination of real scene and 3D game elements
CN120163717A