Dynamic facial expression recognition system and method based on deep spatio-temporal features

The dynamic facial expression recognition system based on deep spatiotemporal features solves the problem of feature calculation bias in non-uniformly sampled videos, and achieves accurate recognition of continuous muscle movements and improved stability in cross-identity scenarios.

CN123182279APending Publication Date: 2026-11-27ANHUI UNIVERSITY OF TRADITIONAL CHINESE MEDICINE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611347944.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-27

AI Technical Summary

Technical Problem

Existing dynamic facial expression recognition solutions are prone to disrupting the original timeline structure of videos when processing non-uniformly sampled videos, leading to deviations in feature calculation, difficulty in distinguishing continuous muscle movements from single-frame noise, and insufficient recognition stability.

Method used

A dynamic facial expression recognition system based on depth spatiotemporal features is adopted. The system generates aligned image sequences through video preprocessing, extracts depth tensor sequences, calculates short-range and long-range curvature vectors, velocity scales and transition confidence coefficients, constructs spatiotemporal graphs and weighted aggregates features to generate labeled videos.

Benefits of technology

It adapts to non-uniformly sampled facial videos, reduces feature calculation bias, distinguishes between continuous muscle movements and single-frame noise, improves recognition stability and result interpretability in cross-identity scenarios, and is compatible with devices with different computing power.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123182279A_ABST
    Figure CN123182279A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of image recognition, and discloses a dynamic facial expression recognition system and method based on deep space-time features, wherein the dynamic facial expression recognition system based on deep space-time features comprises the following steps: determining a face frame sequence; generating a center vector sequence; generating a turning reliable coefficient sequence; generating a hidden vector sequence; weighting and aggregating to obtain a video vector; and outputting a labeled video. Through the feature change consistency judgment of multiple time scales, the application can distinguish continuous facial muscle movement from false mutations caused by single-frame noise, reduce the influence of low-quality frames such as motion blur and temporary occlusion on the recognition result, peel off stable identity appearance components in the feature extraction process, reduce the interference of facial appearance differences of different people on the dynamic features, improve the recognition stability, and finally output the labeled result which is time-aligned with the original video, so that the recognition result can be quickly verified.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image recognition technology, and more specifically, to a dynamic facial expression recognition system and method based on depth spatiotemporal features. Background Technology

[0002] Dynamic facial expression recognition is a crucial supporting technology for scenarios such as human-computer interaction, emotion analysis, intelligent customer service, and driving status monitoring. It determines the corresponding emotion category by analyzing the changes in facial features and muscles over time in facial videos. Existing dynamic facial expression recognition solutions typically use convolutional neural networks to extract facial appearance features from a single frame, and then combine them with recurrent neural networks, temporal convolutional networks, or graph convolutional networks to aggregate temporal dimension information, ultimately outputting the expression classification result.

[0003] In real-world applications, videos are often captured by mobile terminals, webcams, conferencing systems, or surveillance equipment. Due to factors such as encoding buffering, network jitter, and device performance limitations, these videos frequently exhibit variable frame rates, frame drops, duplicate frames, localized motion blur, or brief occlusions. Existing solutions for processing such videos typically involve first extracting a fixed number of frames at fixed intervals, or deleting frames that failed face detection, and then processing the remaining frames at equal time intervals, calculating inter-frame feature differences or optical flow information as dynamic features.

[0004] This type of processing method easily disrupts the original timeline structure of the video, misinterpreting the artificial time intervals caused by frame deletion or frame extraction as time intervals of facial movement, leading to deviations in the calculation of feature changes. Furthermore, single-timescale inter-frame differencing struggles to distinguish between continuous muscle movement and single-frame noise, easily misidentifying false abrupt changes caused by blurred or occluded frames as facial expression features. The temporal aggregation process often relies solely on data-driven attention weights, lacking physical rule constraints, resulting in insufficient recognition stability in low-quality, non-uniformly sampled videos. Summary of the Invention

[0005] This invention provides a dynamic facial expression recognition system and method based on deep spatiotemporal features, which solves the technical problems mentioned in the background.

[0006] This invention provides a dynamic facial expression recognition system based on deep spatiotemporal features, comprising: The video preprocessing module decodes the video to be recognized, generates the original frame sequence, timestamp sequence and original frame rate information, determines the face bounding box sequence and generates the aligned image sequence. The region feature generation module extracts a depth tensor sequence from the aligned image sequence, performs mask pooling and sequence centering based on the facial region, and generates a center vector sequence. The transition confidence calculation module generates short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generates transition confidence coefficient sequence. The spatiotemporal graph reasoning module combines the center vector sequence, short-range curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establishes spatial and temporal adjacency edges, and uses the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edge to generate a hidden vector sequence. The temporal weighted aggregation module generates a temporal weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then weights and aggregates them to obtain the video vector; The labeled video generation module generates category probabilities based on video vectors, determines category indices and category names, and then overlays the category names and category probabilities onto the original frame sequence corresponding to the face bounding box sequence to generate labeled videos.

[0007] This invention provides a dynamic facial expression recognition method based on deep spatiotemporal features, comprising the following steps: Step S1: Decode the video to be recognized, generate the original frame sequence, timestamp sequence and original frame rate information, determine the face box sequence and generate the aligned image sequence; Step S2: Extract the depth tensor sequence from the aligned image sequence, perform mask pooling and sequence centering based on the facial region, and generate a center vector sequence; Step S3: Generate short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generate transition confidence coefficient sequence. Step S4: Combine the center vector sequence, short-distance curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establish spatial adjacency edges and temporal adjacency edges, and use the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edges to generate a hidden vector sequence. Step S5: Generate a time weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then aggregate them to obtain the video vector; Step S6: Generate category probabilities based on video vectors, determine category index and category name, and superimpose the category name and category probability onto the original frame sequence corresponding to the face bounding box sequence to generate annotated video.

[0008] The beneficial effects of this invention are as follows: It can adapt to facial video input with non-uniform sampling, preserving the original real timestamps and all frame content of the video, reducing feature calculation deviations caused by manual modification of the timeline. Through consistency judgment of feature changes across multiple time scales, it can distinguish between continuous facial muscle movements and spurious abrupt changes caused by single-frame noise, reducing the impact of low-quality frames such as motion blur and brief occlusions on the recognition results. By stripping stable identity appearance components during feature extraction, it can reduce the interference of differences in facial appearance among different people on dynamic features, improving recognition stability in cross-identity scenarios. The output is annotated with time aligned with the original video, supporting rapid verification of recognition results and improving interpretability. The overall incremental increase in learnable parameters is relatively small, allowing deployment on the existing architecture of convolutional graph networks, adapting to device environments with varying computing power. Attached Figure Description

[0009] Figure 1 This is a computational schematic diagram of the dynamic facial expression recognition system based on deep spatiotemporal features of the present invention; Figure 2 This is a deployment scenario diagram of the dynamic facial expression recognition system based on deep spatiotemporal features of the present invention; Figure 3 This is a schematic diagram of the non-uniform sampling video multi-scale curvature response of the present invention; Figure 4 This is a schematic diagram of the temporal variation of the facial region transition confidence coefficient of the present invention. Detailed Implementation

[0010] The subject matter described herein will now be discussed with reference to exemplary embodiments. It should be understood that these embodiments are discussed only to enable those skilled in the art to better understand and implement the subject matter described herein, and changes may be made to the function and arrangement of the elements discussed without departing from the scope of this specification. Various processes or components may be omitted, substituted, or added as needed in the examples. Furthermore, features described in some examples may be combined in other examples.

[0011] It should be noted that, unless otherwise defined, the technical or scientific terms used in one or more embodiments of the present invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in one or more embodiments of the present invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" indicate that the element or object preceding the term encompasses the elements or objects listed following the term and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.

[0012] like Figure 1 As shown, a dynamic facial expression recognition system based on deep spatiotemporal features includes: The video preprocessing module decodes the video to be recognized, generates the original frame sequence, timestamp sequence and original frame rate information, determines the face bounding box sequence and generates the aligned image sequence. The region feature generation module extracts a depth tensor sequence from the aligned image sequence, performs mask pooling and sequence centering based on the facial region, and generates a center vector sequence. The transition confidence calculation module generates short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generates transition confidence coefficient sequence. The spatiotemporal graph reasoning module combines the center vector sequence, short-range curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establishes spatial and temporal adjacency edges, and uses the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edge to generate a hidden vector sequence. The temporal weighted aggregation module generates a temporal weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then weights and aggregates them to obtain the video vector; The labeled video generation module generates category probabilities based on video vectors, determines category indices and category names, and then overlays the category names and category probabilities onto the original frame sequence corresponding to the face bounding box sequence to generate labeled videos.

[0013] In an optional implementation, the video preprocessing module processes the video to be identified according to the following steps: Step S101: Decoding is performed according to the order of timestamps in the video to be identified, generating an original frame sequence, a timestamp sequence, and original frame rate information. The timestamps in the timestamp sequence are incremented, and each original frame in the original frame sequence corresponds one-to-one with one timestamp in the timestamp sequence. The original frame sequence refers to the set of continuous image frames obtained by decoding frame by frame according to the display timestamp order in the input video container. During acquisition, the standard encoded video file output by the monitoring equipment, mobile terminal or video conferencing system can be read to complete the acquisition. No frame extraction or frame rate conversion is performed on the video during the acquisition process, and all frame contents after video decoding are completely preserved. A timestamp sequence is an ordered set of display time stamps recorded for each frame of an image in the input video container. During acquisition, the corresponding values ​​are read from the metadata field of the video file during the video decoding process. When participating in the calculation of curvature vector, velocity scale and inflection ratio, it is uniformly converted to seconds with a time accuracy of 0.001 seconds, which can reflect the real time interval between adjacent frames. The raw frame rate information refers to the number of frames per second recorded in the metadata of the input video file. It is read from the header information of the video container during the video decoding process. The unit of frame rate is frames per second. It is used to verify the continuity of the timestamp sequence. When the deviation between the timestamp interval and the theoretical interval for frame rate calculation exceeds 20%, it is determined that there is a non-uniform sampling situation. Step S102: Select the face bounding box with the largest area in the first original frame to establish the target trajectory, and determine the face bounding boxes in the remaining original frames based on the face bounding box overlap value and depth appearance coefficient to generate a face bounding box sequence. A face bounding box sequence refers to the set of coordinates that mark the position and size of the rectangular region where the target face is located in each frame of the image. During the calculation, the face detection box with the largest area is selected as the tracking target in the first frame. The target position is updated frame by frame in subsequent frames by combining the overlap of the detection boxes and the depth appearance matching degree. Each face bounding box contains four parameters: the horizontal coordinate of the upper left corner, the vertical coordinate of the upper left corner, the width of the box, and the height of the box. The origin of the coordinates is the upper left corner of the image, the horizontal axis is positive to the right, and the vertical axis is positive downward. Step S103: Perform facial key point detection on the face bounding box sequence, determine affine transformation based on the center of the eyes and the position of the root of the nose, and unify facial rotation, scale and intra-image translation; transform the facial images in each face bounding box to the same image size to generate an aligned image sequence. Aligned image sequence refers to a standardized set of facial images after affine transformation to eliminate differences in facial rotation, scale and translation. During calculation, the affine transformation matrix is ​​solved based on the coordinates of the facial key points detected in each frame, and then bilinear interpolation is performed on the corresponding facial regions in the original frame for resampling. The aligned image is a three-channel color image with a pixel value range of 0 to 255. Local illumination differences are eliminated after illumination normalization processing. The alignment target image size refers to the uniform width and height values ​​of the facial image output by the alignment operation. In this embodiment, the alignment target image size is 224 pixels × 224 pixels to adapt to the input requirements of the two-dimensional convolutional backbone network.

[0014] Step S104: For the time position of the undetected face box, perform linear interpolation based on the adjacent face boxes that have been detected; use the interpolated face box for affine transformation, and retain the corresponding original frame and timestamp.

[0015] Furthermore, the depth appearance coefficient refers to the cosine similarity value of the depth features between the detected candidate face bounding box and the tracked target face in the current frame. During the calculation, a lightweight convolutional network is used to extract the depth features of the candidate box and the target box, and then the cosine similarity of the two feature vectors is calculated to obtain the depth appearance coefficient. The larger the value, the more similar the appearance features of the two face regions are. During the tracking process, candidate boxes with an overlap greater than 0.5 and a depth appearance coefficient greater than 0.7 are selected as the target face bounding box of the current frame. If there are multiple candidate boxes that meet the conditions, the candidate box with the largest depth appearance coefficient is selected as the final target.

[0016] Furthermore, for the time position of the target face box that cannot be determined according to the face box overlap value and depth appearance coefficient mentioned above, linear interpolation is performed on the top left corner coordinates, box width and box height based on the nearest valid face boxes before and after, to obtain the interpolated face box at the corresponding time position; during the interpolation process, only the position and size parameters of the face box are determined, and the pixel content and corresponding timestamp of the original frame are not modified.

[0017] Furthermore, the affine transformation employs a six-parameter two-dimensional affine transformation model that includes rotation, scaling, and translation. The alignment reference coordinate system uses the midpoint of the line connecting the centers of the eyes as the origin, the horizontal direction of the line connecting the eyes as the positive x-axis, and the direction perpendicular to the line connecting the eyes and pointing downwards as the positive y-axis. After the transformation, the centers of the eyes are fixed at x-coordinates of 72 pixels and y-coordinates of 88 pixels, and x-coordinates of 152 pixels and y-coordinates of 88 pixels, respectively, within the aligned image. The root of the nose is fixed at x-coordinates of 112 pixels and y-coordinates of 112 pixels. The affine transformation matrix contains six parameters, which are obtained by solving a system of linear equations using the target coordinates and original coordinates of the three key points. During the transformation process, pixels exceeding the image boundary are filled with boundary pixel values ​​to avoid black borders affecting feature extraction.

[0018] It should be noted that, taking a facial video containing non-uniform timestamps as an example, all original frames are decoded in the order of the displayed timestamps. The target trajectory is established by selecting the largest facial bounding box in the first frame. In subsequent frames, the facial bounding box with the largest coefficient is selected from candidate boxes with an overlap greater than 0.5 and a depth appearance coefficient greater than 0.7. The position of undetermined facial bounding boxes is determined by linear interpolation of the preceding and following valid bounding boxes. Then, an affine transformation is performed based on the center of the eyes and the root of the nose, outputting a 224-pixel × 224-pixel aligned image while retaining the original frames and timestamps. This processing ensures that the length of the output time series is consistent with the original video, avoiding time interval distortion caused by frame removal, and providing a complete and accurate time reference for subsequent temporal feature calculations. Even if a small number of failed detection frames exist in the video, the continuity of the timeline will not be disrupted.

[0019] In an optional implementation, the region feature generation module generates a sequence of center vectors according to the following steps: Step S201: Input each aligned image in the aligned image sequence into a two-dimensional convolutional backbone network with shared parameters to generate a depth tensor sequence; A depth tensor sequence is a set of high-dimensional spatial feature maps extracted from each frame of aligned facial images by a two-dimensional convolutional backbone network. During computation, each frame of aligned images is input into a convolutional network with shared parameters. After multiple layers of convolution and downsampling operations, a two-dimensional feature map with a fixed number of channels is output. Each depth tensor contains 512 channels, and each channel corresponds to a local texture or shape feature extracted by a convolutional kernel. The spatial position has a fixed downsampling correspondence with the spatial position of the aligned image. The parameters of the 2D convolutional backbone network refer to the weights and biases of all convolutional layers, normalized layers, and linear layers in the 2D convolutional backbone network. The calibration method is to train end-to-end on a public dynamic facial expression dataset using the cross-entropy loss function. During training, a model pre-trained on a large-scale face dataset is used as the initial parameters, and then fine-tuned for 100 rounds on the expression dataset. During fine-tuning, the initial learning rate is set to 0.001, and the learning rate is adjusted using a cosine annealing strategy. The training batch size is set to 32. After training, all parameter values ​​are fixed for feature extraction. Step S202: Determine the left eye periorbital region, right eye periorbital region, central nasal cheek region, and jaw region in the normalized facial coordinates, and generate corresponding and non-overlapping region masks for each facial region. A region mask is a binary template that marks the corresponding positions of four facial regions on the feature map space coordinates. It is a single-channel binary matrix with the same size as the depth tensor space. The pixel value within the region is 1 and the pixel value outside the region is 0. The region feature can be filtered by element-wise multiplication without additional coordinate mapping calculation. When the mask is generated, the coordinates of the facial key points are first mapped to the space coordinates of the depth tensor, and then the mask values ​​are filled according to the region boundaries. The generated mask is fixed during model initialization and does not change with the input video during inference. The total number of facial regions refers to the total number of non-overlapping regions in the facial feature division. It is fixed at 4, covering the three main facial expression movement areas: eyebrows and eyes, nose and cheeks, and around the mouth, to avoid the decrease in signal-to-noise ratio of single-region features caused by overly fine division of regions.

[0020] Step S203: Perform masked average pooling on the depth tensor sequence using a region mask to generate a region vector sequence; Specifically, the formula for calculating the region vector is as follows: ; in, Indicates the first The time position Region vectors of facial regions Indicates the first The depth tensor at each time location in the horizontal position and longitudinal position The vector at that location, Indicates the first The area mask for each facial region is positioned horizontally. and longitudinal position Binary mask value at the location, Represents the horizontal dimension of the depth tensor. Represents the vertical dimension of the depth tensor; A region vector sequence refers to a set of fixed-dimensional feature vectors corresponding to each facial region in each frame of an image. During calculation, the depth tensor of each frame is multiplied element by element with the corresponding region mask, and then average pooling is performed on all feature vectors within the mask coverage area to obtain the feature vector of a single region in a single frame. Each region vector has a dimension of 512, and each dimension in the vector corresponds to the average response value of a region in a convolutional channel, which can characterize the activation degree of the region in the corresponding feature channel. Step S204: For each facial region, calculate the average value of the region vectors at all time points as the time average vector; subtract the time average vector from the region vectors at each time point to generate a center vector sequence. Specifically, the formula for calculating the center vector is as follows: ; in, Indicates the first The time position The center vector of each facial region Indicates the first The time position Region vectors of facial regions Indicates the first The time position Region vectors of facial regions This indicates the total number of frames in the original frame sequence.

[0021] The center vector sequence refers to the centered feature set obtained by subtracting the average feature vector of the entire video segment from the feature vector of each region. During the calculation, the feature vectors of all frames in the same region are first averaged in each dimension to obtain the region average vector. Then, the feature vector of the region in each frame is subtracted from the corresponding average vector in each dimension. The centering operation is performed in each dimension. The average value of the entire video segment is calculated separately for each dimension. Then, the subtraction is performed frame by frame. After centering, the average value of the feature vector of each region in the entire video segment is 0 in each dimension. Furthermore, the four regions respectively cover the left eye periorbital region, the right eye periorbital region, the central nasal cheek region, and the oral and mandibular region, and the regional masks corresponding to each region do not overlap.

[0022] Furthermore, the 2D convolutional backbone network uses an 18-layer residual network as its basic architecture. The last fully connected classification layer of the network is removed, and the 512-channel feature map output by the last convolutional layer is retained as the depth tensor. The horizontal and vertical dimensions of the output feature map are both 1 / 32 of the corresponding size of the aligned image, corresponding to a spatial size of 7×7 under a 224-pixel × 224-pixel input. The 18-layer residual network contains four residual stages, each stage contains two residual blocks, and each residual block contains two 3×3 convolutional layers. The network downsampling factor is 32 times. The final output 7×7 spatial size feature map can cover all areas of the aligned face and can capture local texture changes around the eyebrows, eyes, and mouth.

[0023] It should be noted that different people have stable differences in facial bone structure, skin texture, and facial features. These differences remain largely unchanged throughout the video and are not considered part of facial expression dynamics. The above embodiment can eliminate the interference of different facial appearances on dynamic features, allowing subsequent calculations to focus on facial deformation information over time, thus improving the discriminative power of facial expression dynamics. The centered features no longer contain fixed differences in individual facial features. Even if there are significant differences in the appearance of neutral faces among different people, the changes in features generated by their facial expressions have a consistent distribution pattern. This can reduce the risk of the model overfitting to the identity features of the training set and improve the performance of cross-identity recognition.

[0024] In an optional implementation, the transition confidence calculation module generates a short-range curvature vector sequence, a long-range curvature vector sequence, a velocity scale sequence, a joint consistency coefficient sequence, a transition ratio sequence, and a transition confidence coefficient sequence according to the following steps: Step S301: For each time position with two time positions before and after, perform second-order difference quotient calculation based on the center vector of the adjacent time positions and the timestamp interval to generate a short-distance curvature vector. Specifically, the formula for calculating the short-range curvature vector is as follows: ; in, Indicates the first The time position The short-range curvature vector of each facial region , and They represent the first The, the The and the first The time position The center vector of each facial region , and They represent the first The, the The and the first Timestamp of each time location; Short-range curvature vector sequence refers to a set of second-order change vectors calculated based on the center vectors of three adjacent frames and the corresponding real time intervals. During the calculation, the time difference of the three adjacent frames is used as the time step, and the change rate of the first-order change rate of the center vector is recalculated to obtain the corresponding vector. The time window of short-range curvature covers the content of three frames and is highly sensitive to rapidly occurring muscle movements. Step S302: Calculate the second-order difference quotient based on the current time position and the center vectors of the two time positions before and after it, as well as the timestamp interval, to generate a long-distance curvature vector; Specifically, the formula for calculating the long-distance curvature vector is as follows: ; in, Indicates the first The time position The long-range curvature vector of each facial region , and They represent the first The, the The and the first The time position The center vector of each facial region , and They represent the first The, the The and the first Timestamp of each time location; Long-distance curvature vector sequence refers to the set of second-order change vectors calculated based on the center vector of three frames with a one-frame interval and the corresponding real time interval. During the calculation, the time difference between each frame and the second frame before and the second frame after is used as the time step. The first-order rate of change of the center vector is recalculated to obtain the corresponding vector. The time window of long-distance curvature covers five frames and has good stability for slow-moving muscle movements. Step S303: Calculate the ratio of the center vector difference norm between adjacent time positions to the corresponding timestamp interval; add the two ratios to generate the velocity scale; Specifically, the formula for calculating the velocity scale is as follows: ; in, Indicates the first The time position The velocity scale of each facial region Indicates the first The time position and the first The L2 norm of the difference between the center vectors at each time position. Indicates the first The time position and the first The L2 norm of the difference between the center vectors at each time position. Indicates the first The time position and the first The timestamp interval for each time location. Indicates the first The time position and the first The timestamp interval for each time location; A velocity scale sequence is a set of scalar values ​​that characterize the rate of change of regional features between adjacent frames. It is calculated by calculating the feature vector distance between each frame and its previous and next frames, dividing by the corresponding time interval, and then summing the results. The velocity scale can reflect the local motion intensity at the current position and is used to normalize the curvature values ​​under different motion intensities. Step S304: Generate a direction consistency coefficient based on the inner product of the short-distance curvature vector and the long-distance curvature vector, the norms of the two curvature vectors, and the first stability term; generate an amplitude consistency coefficient based on the smaller norm of the two curvature vectors, the larger norm, and the first stability term; multiply the direction consistency coefficient and the amplitude consistency coefficient to generate a joint consistency coefficient. Specifically, the formula for calculating the joint consistency coefficient is as follows: ; in, Indicates the first The time position The joint consistency coefficient of each facial region This represents the dot product of the short-range curvature vector and the long-range curvature vector. The L2 norm of the short-range curvature vector. The L2 norm of the long-range curvature vector, Indicates the first stable term; The first stabilizing term refers to the small positive number in the denominator of the calculation after adding the direction consistency coefficient and the amplitude consistency coefficient. The preferred value is 0.000001 to avoid the denominator being zero. The joint consistency coefficient sequence refers to a dimensionless scalar set that characterizes the degree of matching between short-distance curvature and long-distance curvature in terms of direction and magnitude. When calculating, the cosine similarity and norm ratio of the two curvature vectors are calculated separately, and then the two results are multiplied and normalized to the interval between 0 and 1. The closer the value is to 1, the higher the consistency of curvature between the two time intervals, and the more likely the corresponding feature changes are to be real continuous motion. Step S305: Generate the transition ratio value based on the norm of the short-distance curvature vector, the time span between adjacent time positions, the velocity scale, and the second stability term; Specifically, the formula for calculating the transition ratio is as follows: ; in, Indicates the first The time position The transition ratio of each facial region The L2 norm of the short-range curvature vector. Indicates the first The time position and the first The time span between time locations Represents a speed scale. Indicates the second stable term; The second stabilizing term refers to a small positive number added to the denominator of the transition ratio calculation, preferably 0.000001, to avoid the denominator being zero when the velocity scale is zero; The transition ratio sequence refers to the set of scalars of local deformation transition intensity after local motion velocity normalization. It is calculated by multiplying the norm of the short-distance curvature by the corresponding time window length and then dividing by twice the sum of the local velocity scale and the second stability term. The transition ratio eliminates the influence of motion velocity and time interval and can reflect the severity of the transition of local deformation. Step S306: Generate a saturation ratio based on the transition ratio and saturation scale; multiply the joint consistency coefficient by the saturation ratio to generate the transition confidence coefficient; Specifically, the formula for calculating the confidence coefficient of the turning point is as follows: ; in, Indicates the first The time position The confidence coefficient of the transition in each facial region Denotes the joint consistency coefficient. Indicates the transition ratio, The saturation scale is represented by the short-range curvature vector and the turning point confidence coefficient of the third time position, which are copied from the first and second time positions. The short-range curvature vector and the turning point confidence coefficient of the third to last time position are copied from the second to last time position.

[0025] The saturation scale refers to a dimensionless positive parameter that controls the saturation growth rate of the inflection ratio. It is preferably set to 0.5 so that the inflection ratio is in a reasonable linear growth range under normal muscle strength, and avoids the credibility coefficient of individual high-intensity motion frames from saturating to 1. The transition confidence coefficient sequence refers to the set of facial muscle movement transition confidence scalars that integrate curvature consistency and transition intensity. It is obtained by multiplying the joint consistency coefficient and the transition ratio after mapping by a saturation function. The value ranges from 0 to 1. The closer the value is to 1, the higher the confidence that there is a real muscle movement transition at that position.

[0026] Furthermore, the values ​​of the first and second stable terms both range from 0.00000001 to 0.0001, and the value of the saturation scale ranges from 0.2 to 1.0. None of the parameters need to be adjusted separately for different scenarios. The default values ​​can cover the numerical range of various common video sources such as network cameras, mobile terminals, and surveillance videos. For example, when the input video is a regular surveillance video at 30 frames per second, the time interval between adjacent frames is about 0.033 seconds. The curvature norm generated by regular facial movements is about 0.1 to 2.0, and the velocity scale is about 1 to 10. The value of the stable term 0.000001 is five orders of magnitude smaller than the minimum curvature norm and will not have an observable numerical impact on the calculation results.

[0027] Furthermore, short-range curvature is used to capture rapid feature changes between three adjacent frames. It is highly sensitive to short-term muscle movements but is easily affected by single-frame noise. Long-range curvature is used to capture slow feature changes within a five-frame window. It is more robust to single-frame noise but less sensitive to fast, small-amplitude movements. Combining the curvature of the two time intervals can simultaneously cover the motion features of both fast micro-expressions and slow macro-expressions. At the same time, single-frame noise is filtered out through consistency judgment. The curvature direction and amplitude of real continuous motion will maintain a high degree of consistency in the two time intervals.

[0028] It's important to note that real facial muscle movement is a continuous mechanical process. The resulting feature changes maintain a consistent direction and similar amplitude within short and slightly longer time windows. In contrast, isolated blurred frames, occluded frames, or frames with decoding errors will produce abrupt changes at a single frame location, failing to form a continuous and consistent curvature direction within a long window spanning multiple frames. Joint consistency determination can utilize this physical characteristic to filter out spurious abrupt changes without requiring additional training of a noise classifier. This process filters out spurious feature changes generated by isolated bad frames and blurred frames, preserving genuine short-term facial muscle movement transition features, improving the signal-to-noise ratio of temporal features. After confidence coefficient weighting, large numerical feature differences generated by single-frame noise will not be classified as valid muscle movements, reducing the likelihood of subsequent temporal networks mislearning noise as facial expression features.

[0029] In an optional implementation, the spatiotemporal graph inference module generates a sequence of hidden vectors according to the following steps: Step S401: Perform layer normalization on the center vector and the short-range curvature vector respectively; combine the normalized center vector, the normalized short-range curvature vector and the turning confidence coefficient to form a node vector sequence; Specifically, the expression for the node vector is as follows: ; in, Indicates the first The time position Node vectors of facial regions Representation layer normalization operation, Represents the center vector. Represents the short-range curvature vector. The sign indicates the confidence coefficient of the transition; the semicolon in square brackets indicates vector concatenation. The node vector sequence refers to the set of feature vectors corresponding to each input node of the graph network. During the calculation, the center vector and the short-range curvature vector are normalized by the layer respectively, and then concatenated with the turning confidence coefficient of the corresponding position to obtain a single vector. Each node corresponds to the feature of a facial region at a time position. The total number of nodes is the total number of regions multiplied by the total number of video frames. The layer normalization operation parameters refer to the scaling and offset parameters corresponding to the layer normalization operation. The calibration method is to obtain them together with the entire network through end-to-end backpropagation training on the facial expression dataset. The parameter dimension is consistent with the dimension of the input normalized feature vector. During initialization, the scaling parameter is set to 1 and the offset parameter is set to 0.

[0030] Step S402: At each time position, the facial region is used as a spatial node; the left and right peri-eye regions are connected to the central nasal and cheek regions respectively, and the central nasal and cheek regions are connected to the oral and mandibular regions to form a set of regional adjacency and spatial adjacency edges; each spatial node is connected to the previous and next time position nodes of the same facial region to form a temporal adjacency edge. The region adjacency set refers to the set that marks the spatial connection relationship between different facial regions. It is an undirected connection relationship between the left periorbital area and the central nasolabial fold, the right periorbital area and the central nasolabial fold and the mandible. This connection relationship is consistent with the physiological connection direction of facial muscles and can simulate the spatial diffusion path of muscle movement. The spatial connection remains consistent at all time positions and does not change with time. Step S403: Process the current node vector using the self-mapping matrix, process the spatial adjacent node vectors within the region's adjacency set using the region mapping matrix, and process the adjacent time position node vectors using the time mapping matrix; determine the propagation coefficient of the time adjacent edge based on the time retention coefficient and the turning confidence coefficient, and adjust the time mapping result using the propagation coefficient; after adding the three processing results, perform Gaussian error linear unit activation to generate a hidden vector sequence. Specifically, the formula for calculating the hidden vector is as follows: ; in, Indicates the first The time position Hidden vectors for each facial region This represents the activation operation of the Gaussian error linear unit. Represents the self-mapping matrix. Represents the region mapping matrix, Represents the time mapping matrix, Indicates the first The time position Node vectors of facial regions Indicates the first The set of adjacent regions of a facial area Indicates the first The number of facial regions contained in the region adjacency set of a given facial region. Indicates the first The first time location region in the adjacent set Node vectors of facial regions Indicates satisfaction Time retention factor, Indicates the first The time position The confidence coefficient of the transition in each facial region and They represent the first The time position and the The time position Node vectors for each facial region; Boundary node vectors are determined according to the following formula: ; in, This represents the boundary node vector preceding the first time position. The node vector representing the first time position. This represents the boundary node vector after the last time position. The node vector representing the last time position. This indicates the total number of frames in the original frame sequence.

[0031] The self-mapping matrix refers to the weight matrix that performs a linear transformation on the node's own features. It is calibrated by training the entire network together on the expression dataset using end-to-end backpropagation. The matrix dimension matches the node vector dimension and the hidden vector dimension. During training, the parameters are randomly initialized using a Gaussian distribution. The region mapping matrix is ​​a weight matrix that performs a linear transformation on the features of spatially adjacent nodes. It is calibrated by training the entire network together on the expression dataset using end-to-end backpropagation. The matrix dimension matches the node vector dimension and the hidden vector dimension. During training, the parameters are randomly initialized using a Gaussian distribution. The time mapping matrix is ​​a weight matrix that performs a linear transformation on the features of temporally adjacent nodes. It is calibrated by training the entire network together on the expression dataset using end-to-end backpropagation. The matrix dimension matches the node vector dimension and the hidden vector dimension. During training, the parameters are randomly initialized using a Gaussian distribution. The time retention factor is a dimensionless parameter that controls the minimum propagation intensity of the time edge of low-confidence nodes. Its value ranges from 0.1 to 0.3, with a preferred value of 0.2. This ensures that low-confidence frames can still retain limited contextual information while avoiding excessive propagation intensity that could cause noise to spread in the time dimension. The hidden vector sequence refers to the set of node feature vectors output after the graph network is propagated and updated. It is obtained by adding the node's own transformation features, spatial adjacent node aggregation features, and temporal adjacent node gated aggregation features and then activating them with a Gaussian error linear unit activation function. Each hidden vector has a dimension of 512. Furthermore, the time retention coefficient ranges from 0.1 to 0.3. When the input video quality is high and there is little noise, the lower limit of 0.1 can be used to further strengthen the propagation weight of high-confidence frames. When the input video quality is low and there are many unstable detection frames, the upper limit of 0.3 can be used to improve the smoothness of temporal features.

[0032] Furthermore, the value of the turning point confidence coefficient is linearly related to the propagation intensity of the time edge. When the confidence coefficient is 1, the time edge reaches the maximum propagation intensity. When the confidence coefficient is 0, the time edge still retains the minimum propagation intensity corresponding to the time retention coefficient. The propagation intensity of the spatial edge remains a fixed value and is not affected by the confidence coefficient, thus ensuring the stability of the motion diffusion relationship between facial regions.

[0033] It should be noted that using the transition confidence coefficient as a gating coefficient adjusts the temporal edge propagation strength of the spatiotemporal graph network, giving high-confidence muscle movement transition frames stronger temporal context propagation weights. Conventional spatiotemporal graph networks typically generate all edge weights from learnable parameters, which can easily overfit to the frame rate and noise patterns of the training set when training data is limited. Introducing a confidence coefficient calculated based on physical rules as a fixed gating provides the graph network with temporal propagation priors without increasing the number of learnable parameters, guiding the network to learn the temporal dependencies between effective muscle movement frames. This processing strengthens the temporal information propagation of real muscle movement transition frames, weakens the interference of noisy frames on temporal features, and makes the features extracted by the spatiotemporal graph network more focused on effective facial expression dynamics. The gating mechanism can achieve adaptive weighting of temporal features without adding additional supervision signals. During training, the network can use more parameter capacity to learn the feature transformations of keyframes, improving the model's generalization ability with limited training data.

[0034] In an optional implementation, the temporal weighted aggregation module generates video vectors according to the following steps: Step S501: Perform regional averaging on all hidden vectors and all turning point confidence coefficients at each time location to generate time vectors and time confidence coefficients; Specifically, the formulas for calculating the time vector and the time confidence coefficient are as follows: ; in, Indicates the first Time vectors at each time location Indicates the first The time position Hidden vectors for each facial region Indicates the total number of facial regions; ; in, Indicates the first The time reliability coefficient of each time location Indicates the first The time position The confidence coefficient of the transition in each facial region Indicates the total number of facial regions; A time vector sequence is a set of frame-level feature vectors obtained by averaging the hidden features of all regions at the same time position. It is calculated by adding the hidden vectors of the four regions in the same frame dimension by dimension and then dividing by the total number of regions. Each time vector has 512 dimensions, corresponding to the global facial dynamic features of a single frame. The temporal reliability coefficient sequence refers to the set of frame-level reliability scalars obtained by averaging the transition reliability coefficients of all regions at the same time position. It is calculated by adding the transition reliability coefficients of the four regions within the same frame and dividing by the total number of regions. The value ranges from 0 to 1. The closer the value is to 1, the higher the overall reliability of the frame. Step S502: Add the inner product of the attention vector and the time vector, and the product of the coupling weight and the time confidence coefficient; perform exponential normalization on the summation result for all time positions to generate a time weight sequence; specifically, the formula for calculating the time weight is as follows: ; in, Indicates the first Time weight of each time position Represents the attention vector. This represents the transpose of the attention vector. Indicates the first Time vectors at each time location Indicates coupling weights, Indicates the first The time reliability coefficient of each time location and They represent the first Time vectors and time reliability coefficients at each time location Indicates the total number of frames in the original frame sequence; Attention vector is a trainable vector used to calculate frame-level feature attention score. It is calibrated by training the entire network together on the expression dataset using end-to-end backpropagation. The vector dimension is the same as the time vector dimension, and it is initialized with a fixed value of all 0.1. Coupling weights refer to trainable scalar parameters that adjust the proportion of the confidence coefficient in the time weights. They are calibrated by training the entire network together on the facial expression dataset using end-to-end backpropagation, with the initial value of the parameter set to 1.0. The time-weighted sequence refers to the scalar set of the proportion of each frame's features contributing to the final video-level features. It is calculated by adding the attention score and weighted confidence coefficient of each frame and then normalizing it exponentially. The sum of all weights is 1. The higher the weight value, the greater the contribution of that frame to the final classification. Step S503: Perform a weighted summation on all time vectors using the time weight sequence to generate a video vector; Specifically, the formula for calculating video vectors is as follows: ; in, Represents a video vector. Indicates the first Time weight of each time position Indicates the first Time vectors at each time location This indicates the total number of frames in the original frame sequence.

[0035] A video vector is a global feature vector obtained by aggregating information from all frames of a video. It is calculated by multiplying the time vector of each frame by its corresponding time weight and then adding them together dimension by dimension. The vector has 512 dimensions and contains complete dynamic expression information of the entire video.

[0036] Furthermore, the coupling weight is used to adjust the influence of the time reliability coefficient in the time weight calculation. The typical value range after training is 0.5 to 2.0. Setting the initial value to 1.0 can ensure the training stability in the early stage of training.

[0037] Furthermore, the design basis of the region averaging operation is that the contribution of the four facial regions to expression recognition does not have a fixed priority relationship. The main motion regions of different expressions are different. Using simple averaging can avoid the inductive bias caused by artificially preset region weights. At the same time, it can reduce the number of learnable parameters of the aggregation operation, reduce the risk of overfitting the model on small sample datasets, and obtain stable frame-level features without additional spatial attention training. The averaging operation assigns the same weight to the features of all regions, so there will be no situation where the features of a certain region dominate the frame-level features.

[0038] It's important to note that coupling learnable temporal attention with prior transition confidence coefficients to calculate temporal weights allows the aggregation process to simultaneously consider both data-driven feature discriminativeness and the credibility constraints of physical rules. Pure learnable temporal attention tends to classify frames with abrupt changes in identity features or illumination variations as high-weight frames, while pure confidence coefficient weighting struggles to utilize implicit category differentiation information within the data. The coupling of the two provides a foundational, effective prior for frame selection using the confidence coefficients, which in turn allows learnable attention to further filter frames valuable for classification. This complementary approach enhances the discriminativeness of the aggregated features. This process biases temporal aggregation towards key frames with genuine muscle movement transitions while preserving data-driven feature discriminative capabilities, improving the ability to differentiate facial expression categories in video-level features. The coupled weighted temporal weights are neither completely affected by noisy frames nor miss subtle discriminative features in the data due to fixed rules, resulting in stable video-level representations under varying video input qualities.

[0039] In an optional implementation, the annotation video generation module generates the annotation video according to the following steps: Step S601: Perform a linear mapping on the video vector using the classification weight matrix and classification bias vector to generate the category score for each dynamic facial expression category; The classification weight matrix refers to the weight matrix used for feature transformation in the classification linear layer. It is calibrated by training the entire network together on the facial expression dataset using end-to-end backpropagation. The number of rows in the matrix is ​​equal to the total number of facial expression categories, and the number of columns is equal to the dimension of the video vector. The parameters are initialized randomly using a Gaussian distribution during initialization. The classification bias vector refers to the bias parameter of the classification linear layer. It is calibrated by training the entire network together on the facial expression dataset using end-to-end backpropagation. The vector dimension is equal to the total number of facial expression categories, and all values ​​are set to 0 during initialization. The category score sequence refers to the set of original scores for each expression category output by the linear classification layer. It is calculated by multiplying the classification weight matrix by the video vector and then adding the classification bias vector. The higher the score, the greater the probability of the corresponding category. Step S602: Perform exponential normalization on the category scores to generate category probabilities; Specifically, the formula for calculating category probability is as follows: ; in, Indicates the first The category probability of each dynamic facial expression category. Represents the classification weight matrix. Represents a video vector. This represents the classification bias vector. This indicates the total number of categories of dynamic facial expressions. Indicates the first Category scores for each dynamic facial expression category. Indicates the first Category scores for each dynamic facial expression category; The category probability sequence refers to the set of predicted probabilities corresponding to each expression category. It is obtained by performing an exponential normalization operation on the category score sequence during calculation. The sum of all category probabilities is 1. The higher the probability value, the higher the prediction confidence of the corresponding category. The optimal total number of expression categories is 7, corresponding to seven basic expressions: anger, disgust, fear, happiness, sadness, surprise, and neutral. This covers the expression categories for most daily scenarios, and the number of categories can be expanded according to actual scenario needs. Step S603: Determine the category index corresponding to the category with the largest value, and query the category name based on the category index; Specifically, the formula for calculating the category index is as follows: ; in, This represents the index of the dynamic facial expression category with the highest category probability value. Indicates the first The category probability of each dynamic facial expression category. This indicates the total number of categories of dynamic facial expressions. This indicates that the category index with the highest category probability value is selected from all category indexes; The category index refers to the index of the expression category with the highest predicted probability. It is obtained by traversing the category probability sequence and selecting the index of the category with the highest probability value. The index is sequentially encoded starting from 1. Step S604: Overlay the category name and category index corresponding to the category probability above each face bounding box in the original frame sequence; re-encode according to the timestamp sequence and the original frame rate information to generate an annotated video.

[0040] Annotated video refers to the output video file after superimposing the annotations of the facial expression recognition results. During the calculation, the category name and probability text are drawn above the face bounding box of each frame of the original image, and then re-encoded according to the encoding format, frame rate and timestamp order of the original video. Except for the category name, category probability and the area covered by the background, the remaining pixel content of the original frame remains unchanged.

[0041] Furthermore, the system supports seven categories of dynamic facial expressions: category index 1 corresponds to anger, category index 2 to disgust, category index 3 to fear, category index 4 to happiness, category index 5 to sadness, category index 6 to surprise, and category index 7 to neutral. The name mapping rule is that the category index corresponds to the above seven expression names in ascending order. The number of categories and corresponding names can be expanded according to the actual needs of the scenario. For example, if the predicted category index of a certain video is 4 and the corresponding category probability is 0.92, then the final output expression category is happiness, the prediction confidence is 92%, and the labeled text is displayed as happiness 92%.

[0042] Furthermore, the overlay position of the annotation information is 10 pixels above the midpoint of the upper edge of the face bounding box. The text uses an opaque black background with a white sans-serif font, and the font size is 1 / 10 of the height of the face bounding box. The video encoding uses a general lossy video encoding format, and the bitrate setting is consistent with the original video. It strictly follows the timestamp and frame rate of each frame of the original video, without discarding any original frames or inserting duplicate frames. Anti-aliasing rendering is used when drawing the text to ensure that the annotation text is clear and legible without obscuring key facial areas.

[0043] It should be noted that the identification and annotation are based on the overlay of the original frame sequence, retaining the original timestamps and original frame rates for re-encoding. No frame extraction or frame rate conversion is performed on the output video, ensuring the time alignment accuracy between the annotations and the original video. This invention retains all original frames and timestamps throughout the process, allowing the annotated video to be matched frame-by-frame with the content of the original video, facilitating the location of the time points where facial expressions occur. This processing aligns the time dimension of the output annotated video with the original video, facilitating manual verification of the accuracy and time correspondence of the identification results, improving the interpretability of the results, and allowing verifiers to drag the progress bar to view the identification results at any time point.

[0044] In an optional implementation, the dynamic facial expression recognition method based on deep spatiotemporal features includes the following steps: Step S1: Decode the video to be recognized, generate the original frame sequence, timestamp sequence and original frame rate information, determine the face box sequence and generate the aligned image sequence; Step S2: Extract the depth tensor sequence from the aligned image sequence, perform mask pooling and sequence centering based on the facial region, and generate a center vector sequence; Step S3: Generate short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generate transition confidence coefficient sequence. Step S4: Combine the center vector sequence, short-distance curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establish spatial adjacency edges and temporal adjacency edges, and use the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edges to generate a hidden vector sequence. Step S5: Generate a time weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then aggregate them to obtain the video vector; Step S6: Generate category probabilities based on video vectors, determine category index and category name, and superimpose the category name and category probability onto the original frame sequence corresponding to the face bounding box sequence to generate annotated video.

[0045] It should be noted that, as Figure 2 As shown, this system can be deployed on cloud servers or edge computing devices, supporting various video sources such as network cameras, mobile terminals, video conferencing systems, vehicle cameras, and customer service seat cameras. During deployment, an aligned image size of 224 pixels × 224 pixels is used. The system input is a continuous facial video stream or a local video file. During runtime, the system processes the video content frame by frame, outputting the expression category and corresponding confidence level of the current video segment. After processing, an annotated video with time alignment to the original video is generated.

[0046] During model training, publicly available dynamic facial expression datasets and scene-based self-built datasets are collected. Facial key point annotations and expression category annotations are performed on the video data. The training samples are divided into training set, validation set and test set in a 7:2:1 ratio. During training, data augmentation methods such as random rotation, random brightness adjustment and random noise addition are used to improve the model's generalization ability. The accuracy of the validation set is monitored during training. Training is stopped when the accuracy of the validation set no longer improves for 10 consecutive rounds. The model weight with the highest accuracy of the validation set is selected as the final deployment weight.

[0047] In intelligent customer service scenarios, the system connects to the camera video streams of customer service agents, analyzing users' facial expression changes in real time. When it detects persistent expressions of disgust or anger from users, it can display a prompt to the agent, assisting the agent in adjusting communication strategies. In video conferencing scenarios, the system can statistically analyze the facial expressions of participants in real time, helping the host judge participants' feedback on the meeting content. In driving status monitoring scenarios, the system can identify expressions related to driver distraction and drowsiness, issuing timely safety reminders. In online education scenarios, the system can analyze students' listening status and facial expressions, assisting teachers in adjusting the pace of instruction.

[0048] like Figure 3 As shown in the figure, this diagram illustrates the response patterns of short-range and long-range curvature as a function of video time under non-uniform temporal sampling conditions. The horizontal axis represents the actual timestamp, and the vertical axis represents the curvature norm. During the continuous facial muscle movement phase, both sets of curvatures exhibit a synchronous upward and downward trend, indicating that continuous facial feature changes can be captured at different time scales. At isolated noise locations, the short-range curvature shows a significant abrupt increase, while the long-range curvature shows a smaller change, indicating that the short time window is more sensitive to single-frame anomalies, while the longer time window can weaken the impact of local abrupt changes. The consistency of the two sets of curvature responses can be used to determine whether feature changes originate from real continuous motion, thereby reducing misjudgments caused by blurred frames, occluded frames, or decoding anomalies, and providing a basis for calculating the transition confidence coefficient.

[0049] like Figure 4 As shown in the figure, this diagram illustrates the variation of the transition confidence coefficients of four facial regions—the left and right eye periorbital area, the central nasal cheek area, and the jaw—with real-time. The horizontal axis represents the video timestamp, and the vertical axis represents the transition confidence coefficient. Higher values ​​indicate that the dynamic changes in the corresponding region more closely match continuous facial muscle movement characteristics. As the expression gradually forms and intensifies, the confidence coefficients of each region generally increase synchronously, with the jaw and central nasal cheek areas showing larger changes, reflecting that the expression movement during this segment is mainly concentrated in the perioral and nasal cheek areas. At isolated noise locations, the confidence coefficients of all four regions decrease significantly, indicating that multi-scale curvature consistency judgment can suppress spurious abrupt changes caused by abnormal frames. This result can provide a reliable gating basis for the propagation of temporal information in spatiotemporal maps and subsequent frame-level weighted aggregation.

[0050] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A dynamic facial expression recognition system based on deep spatiotemporal features, characterized in that, include: The video preprocessing module decodes the video to be recognized, generates the original frame sequence, timestamp sequence and original frame rate information, determines the face bounding box sequence and generates the aligned image sequence. The region feature generation module extracts a depth tensor sequence from the aligned image sequence, performs mask pooling and sequence centering based on the facial region, and generates a center vector sequence. The transition confidence calculation module generates short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generates transition confidence coefficient sequence. The spatiotemporal graph reasoning module combines the center vector sequence, short-range curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establishes spatial and temporal adjacency edges, and uses the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edge to generate a hidden vector sequence. The temporal weighted aggregation module generates a temporal weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then weights and aggregates them to obtain the video vector; The labeled video generation module generates category probabilities based on video vectors, determines category indices and category names, and then overlays the category names and category probabilities onto the original frame sequence corresponding to the face bounding box sequence to generate labeled videos.

2. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The video preprocessing module processes the video to be recognized according to the following operations: Decoding is performed based on the order of timestamps in the video to be identified, generating the original frame sequence, timestamp sequence, and original frame rate information, with the timestamps in the timestamp sequence incrementing; In the first original frame, the largest facial bounding box is selected to establish the target trajectory. A facial bounding box sequence is generated based on the facial bounding box overlap value and the depth appearance coefficient. Facial key points are detected in the face bounding box sequence, and affine transformations are determined based on the positions of the eye center and the root of the nose to generate an aligned image sequence. For time locations where no face bounding boxes are detected, linear interpolation is performed based on adjacent face bounding boxes that have been detected, while preserving the original frame and timestamp.

3. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The region feature generation module generates a sequence of center vectors according to the following operations: Each aligned image is input into a two-dimensional convolutional backbone network with shared parameters to generate a sequence of depth tensors. Determine the left peri-eye region, right peri-eye region, central nasal and cheek region, and oral and mandibular region in normalized facial coordinates, and generate a region mask; A region vector sequence is generated by performing masked average pooling on the depth tensor sequence using a region mask. Subtract the time average vector of the corresponding facial region from each region vector to generate a central vector sequence.

4. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The turnaround trusted computing module generates short-range curvature vector sequences, long-range curvature vector sequences, and velocity scale sequences based on timestamp sequences and center vector sequences according to the following operations: Based on the center vectors of adjacent time positions and the timestamp interval, a second-order difference quotient is calculated to generate a short-distance curvature vector; Based on the current time position and the center vector and timestamp interval of the two time positions before and after, the second-order difference quotient is calculated to generate the long-distance curvature vector; Calculate the ratio of the norm of the center vector difference between adjacent time positions to the corresponding timestamp interval; Add the two ratios together to generate the velocity scale.

5. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The transition confidence calculation module generates a joint consistency coefficient sequence, a transition ratio sequence, and a transition confidence coefficient sequence based on short-range curvature vector sequences, long-range curvature vector sequences, and velocity scale sequences according to the following operations: A direction consistency coefficient is generated based on the inner product of the short-range curvature vector and the long-range curvature vector, the norms of the two curvature vectors, and the first stability term; an amplitude consistency coefficient is generated based on the smaller norm of the two curvature vectors, the larger norm, and the first stability term; the two coefficients are multiplied to generate a joint consistency coefficient. The transition ratio is generated based on the norm of the short-range curvature vector, the time span, the velocity scale, and the second stability term. The saturation ratio is generated based on the transition ratio and the saturation scale; the joint consistency coefficient is multiplied by the saturation ratio to generate the transition confidence coefficient, and the boundary time position is filled.

6. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The spatiotemporal graph inference module generates a sequence of hidden vectors according to the following operations: Layer normalization is performed on the center vector and short-range curvature vector, and then combined with the transition confidence coefficient to form a node vector sequence; Using the facial area as a spatial node, connect the periorbital area with the central nasal and cheek area, and the central nasal and cheek area with the mouth and jaw area to establish spatial adjacency edges; Connect adjacent time location nodes of the same facial region to establish a time adjacency edge; The current node vector, spatially adjacent node vector, and adjacent time position node vector are processed using the self-mapping matrix, region mapping matrix, and time mapping matrix, respectively. The propagation coefficient of the time adjacent edge is determined based on the time retention coefficient and the turning confidence coefficient, and the time mapping result is adjusted using the propagation coefficient. After adding the three processing results, Gaussian error linear unit activation is performed to generate a hidden vector sequence.

7. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The temporal weighted aggregation module generates video vectors according to the following operations: For each time point, the hidden vector and the turning point confidence coefficient are averaged over a region to generate a time vector and a time confidence coefficient. The inner product of the attention vector and the time vector, the product of the coupling weight and the time confidence coefficient are added together, and exponential normalization is performed to generate the time weight sequence. The time vector is weighted and summed using a time-weighted sequence to generate a video vector.

8. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The labeled video generation module generates category probabilities according to the following steps: A linear mapping is performed on the video vector using the classification weight matrix and classification bias vector to generate class scores; then, exponential normalization is performed on the class scores to generate class probabilities.

9. The dynamic facial expression recognition system based on depth spatiotemporal features according to claim 1, characterized in that, The labeled video generation module generates labeled videos based on category probabilities using the following steps: Determine the category index corresponding to the category with the highest value, and then query the category name; The category name and category probability are overlaid above each face bounding box. The original frame sequence is then re-encoded according to the timestamp sequence and the original frame rate information to generate an annotated video.

10. A dynamic facial expression recognition method based on deep spatiotemporal features, characterized in that, Performing the dynamic facial expression recognition system based on deep spatiotemporal features as described in any one of claims 1 to 9 includes the following steps: Step S1: Decode the video to be recognized, generate the original frame sequence, timestamp sequence and original frame rate information, determine the face box sequence and generate the aligned image sequence; Step S2: Extract the depth tensor sequence from the aligned image sequence, perform mask pooling and sequence centering based on the facial region, and generate a center vector sequence; Step S3: Generate short-range curvature vector sequence, long-range curvature vector sequence, velocity scale sequence, joint consistency coefficient sequence and transition ratio sequence based on timestamp sequence and center vector sequence, and generate transition confidence coefficient sequence. Step S4: Combine the center vector sequence, short-distance curvature vector sequence, and turning point confidence coefficient sequence into a node vector sequence, establish spatial adjacency edges and temporal adjacency edges, and use the turning point confidence coefficient sequence to adjust the propagation coefficient of the temporal adjacency edges to generate a hidden vector sequence. Step S5: Generate a time weight sequence based on the hidden vector sequence and the transition confidence coefficient sequence, and then aggregate them to obtain the video vector; Step S6: Generate category probabilities based on video vectors, determine category index and category name, and superimpose the category name and category probability onto the original frame sequence corresponding to the face bounding box sequence to generate annotated video.