Motion interpolation method and device, electronic equipment and readable storage medium
By combining out-of-order autoregressive models and flexible dependent attention masks (FDAM), the problem of error accumulation in action interpolation of autoregressive models is solved, achieving high-accuracy animation interpolation and generating vivid and powerful human motion.
Patent Information
- Application Number
- CN202211190768.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-28
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2042-09-28
AI Technical Summary
Existing animation interpolation methods cannot depict vivid and powerful human movements. Autoregressive models experience rapid error accumulation during motion interpolation, leading to a gradual increase in prediction errors.
An out-of-order autoregressive model is adopted for action interpolation. Flexible dependent attention mask (FDAM) is used to replace the lower triangular mask matrix in the multi-head self-attention mechanism, breaking the temporal order dependency in the traditional autoregressive model. Highly correlated and less biased element frames are selected as prediction references to gradually obtain interpolation results. Error accumulation is reduced through key frame interpolation and smoothing.
It improves the accuracy of motion interpolation, reduces error accumulation, and enables the generation of vivid and powerful human motion animations.
Smart Images

Figure CN115471588B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of animation generation technology, and more particularly to a motion interpolation method, apparatus, electronic device, and readable storage medium. Background Technology
[0002] When creating character animations, animators use motion interpolation to fill in the gaps between manually drawn keyframes. However, both the methods provided by animation software and current research on motion interpolation are mathematical methods based on three-dimensional geometry, which cannot depict vivid and powerful human movement.
[0003] To address the aforementioned issues, Harvey et al. proposed a robust autoregressive model.
[0004] However, when using autoregressive models for action interpolation, errors accumulate rapidly, and the accumulated errors increase with each prediction. Summary of the Invention
[0005] This invention provides an action interpolation method, apparatus, electronic device, and readable storage medium, which can solve the problem of rapid error accumulation in autoregressive models when performing action interpolation.
[0006] In a first aspect, embodiments of the present invention provide an action interpolation method, the method comprising:
[0007] Obtain the target action sequence, which includes known action frames and multiple blank frames; based on the out-of-order autoregressive model, obtain the interpolation results of the target action sequence step by step according to the trained dependency relationship and prediction order; the dependency relationship includes the dependency relationship between frames in the known action frames and blank frames.
[0008] Secondly, embodiments of the present invention provide a training method for a disordered autoregressive model, the training method being used to train the disordered autoregressive model described in the first aspect, the method comprising:
[0009] Obtain the sample action sequence set;
[0010] Based on the sample action sequence set, the out-of-order autoregressive model is trained using a teacher-forced strategy to obtain a one-stage out-of-order autoregressive model.
[0011] Based on the sample action sequence set, the first-stage out-of-order autoregressive model is trained in two stages according to the strategy that the model output is generated entirely from the first two frames, so as to obtain the trained out-of-order autoregressive model.
[0012] Thirdly, embodiments of the present invention provide an action interpolation device, the device comprising:
[0013] A target action sequence acquisition module is used to acquire a target action sequence, which includes known action frames and multiple blank frames.
[0014] The interpolation module is used to obtain the interpolation results of the target action sequence step by step based on the out-of-order autoregressive model and according to the trained dependency relationship and prediction order; the dependency relationship includes the dependency relationship between frames in the known action frames and blank frames.
[0015] Fourthly, embodiments of the present invention provide a training apparatus for a disordered autoregressive model, the training apparatus being used to train the disordered autoregressive model described in the first aspect, the apparatus comprising:
[0016] The sample action sequence set acquisition module is used to acquire sample action sequence sets;
[0017] The first-stage training module is used to train the out-of-order autoregressive model based on the sample action sequence set using a teacher-forced strategy, thereby obtaining the first-stage out-of-order autoregressive model.
[0018] The two-stage training module is used to perform two-stage training on the first-stage out-of-order autoregressive model based on the sample action sequence set and according to the strategy that the model output is generated entirely from the first two frames, so as to obtain the trained out-of-order autoregressive model.
[0019] The training device is used to train the out-of-order autoregressive model as described in the first aspect.
[0020] Fifthly, embodiments of the present invention provide an electronic device, including: a processor and a memory, wherein the processor executes a computer program stored in the memory to implement the method as described in the first or second aspect.
[0021] In a sixth aspect, embodiments of the present invention provide a readable storage medium storing computer instructions that, when executed by a processor, implement the method described in the first or second aspect.
[0022] The embodiments of the present invention have the following advantages:
[0023] This invention provides an action interpolation method. The method interpolates a target action sequence according to a preset dependency and prediction order. Specifically, it achieves action sequence interpolation through keyframe interpolation, frame-by-frame generation within keyframe intervals, and smoothing. This breaks the time-series dependency and prediction order of traditional autoregressive models. By selecting keyframes, it reduces the speed of error accumulation during autoregression. Furthermore, it provides a self-attention-based out-of-order autoregression model and its training method for performing out-of-order autoregression. It cleverly designs a Flexible Dependency Attention Mask (FDAM) to replace the lower triangular mask matrix in the multi-head self-attention mechanism, realizing out-of-order autoregression based on dependency and prediction order. By using a divide-and-conquer approach, it reduces the path length of error accumulation and error propagation, thereby improving the accuracy of action interpolation from the perspective of error propagation. Attached Figure Description
[0024] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. 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.
[0025] Figure 1 A flowchart of an embodiment of the action interpolation method of the present invention is shown;
[0026] Figure 2 An architecture diagram of an embodiment of an out-of-order autoregressive model is shown;
[0027] Figure 3 This diagram illustrates the sequence changes during a target action sequence interpolation process.
[0028] Figure 4 A flowchart illustrating an embodiment of a training method for a disordered autoregressive model is shown;
[0029] Figure 5 A structural block diagram of an embodiment of the action interpolation device of the present invention is shown;
[0030] Figure 6 A block diagram of a training device for a disordered autoregressive model is shown.
[0031] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present invention is shown. Detailed Implementation
[0032] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention. Furthermore, it should be noted that the various data-related processes in the embodiments of this application are carried out in compliance with the relevant data protection laws and policies of the country where the location is located, and with the authorization granted by the owner of the corresponding device.
[0033] When creating character animations, animators use motion interpolation to fill in the gaps between manually drawn keyframes. However, both the methods provided by animation software and current research on motion interpolation are mathematical methods based on three-dimensional geometry, which cannot depict vivid and powerful human movement.
[0034] To address the aforementioned issues, Harvey et al. proposed a robust autoregressive model.
[0035] In action interpolation, only the first and last frames are known; all intermediate frames are predicted. For example, based on autoregressive models such as RNNs, predictions are made frame by frame from the first to the last, using the two actual frames as a basis. The prediction for each frame depends on the first and last frames and the prediction results from the previous frames.
[0036] For example, to generate a sequence X = [x0, x1, x2, ..., x] of length T using a traditional autoregressive method T-1 ](x inp (Assuming it is considered as input), the prediction order of the original autoregressive model is:
[0037] O AR = [0,1,2,…,T-1] (1)
[0038] x i =f(x) inp ,x0,x1,x2,…,x i-1 ;Θ) (2)
[0039] Where, x i The prediction uses information from all frames preceding the i-th frame, which can be denoted as x0, x1, x2, ..., x. i-1 To x i The dependency relationship; f represents an autoregressive model with parameter Θ. Therefore, for each element x i Both exist from x0 to x i The dependencies between frames, and from x i To x T-1The dependencies between frames cause the prediction bias to accumulate. The number of frames containing the biased prediction results will be greater than two. At this point, the model's prediction depends on a large number of biases, causing the bias to become larger and larger, and eventually it will be impossible to connect the last frame.
[0040] Therefore, when using autoregressive models for action interpolation, there will be a large accumulation of errors.
[0041] To address the above problems, this invention provides an action interpolation method. (Refer to...) Figure 1 The flowchart illustrates an embodiment of an action interpolation method according to the present invention, the method including:
[0042] Step 101: Obtain the target action sequence.
[0043] The target action sequence includes known action frames and multiple blank frames. The known action frames can be located at the beginning or end of the target action sequence. For example, in a 31-frame target action sequence, the known frames are frame 0 and frame 30, and the rest are blank frames. In this invention, the blank frames 1-29 are interpolated.
[0044] Step 102: Based on the out-of-order autoregressive model, the interpolation results of the target action sequence are obtained step by step according to the trained dependency relationship and prediction order; the dependency relationship includes the dependency relationship between frames in the known action frames and blank frames.
[0045] The dependency relationship specifically refers to which frames a prediction depends on. For example, in traditional autoregression, x... i The prediction depends on x i Any previous frames then constitute x0, x1, x2, ..., x i-1 To x i Dependency relationships.
[0046] Unlike autoregressive models such as RNNs, this embodiment of the invention employs out-of-order autoregressive interpolation, selecting highly correlated and less biased element frames in the frame sequence as references for subsequent predictions. This reduces the rate of error accumulation and breaks the left-to-right temporal dependency found in traditional autoregressive models. The out-of-order autoregressive model is used to implement the out-of-order autoregressive interpolation principle, processing the target action sequence obtained in step 101 based on out-of-order autoregression to obtain the interpolation result of the target action sequence.
[0047] Compared to formulas (1) and (2) in traditional autoregressive prediction, in this embodiment of the invention, the dependencies and prediction order in the out-of-order autoregressive model are implemented according to the following formula:
[0048] O SAR =[t0,t1,t2,…,tT-1 (3)
[0049]
[0050] Among them, O SAR This represents the prediction order of the out-of-order autoregressive model, from t0 to t... T-1 This represents the preset prediction order after rearrangement. For example, if the element frames in an unknown sequence A are ordered 0, 1, 2, 3, 4 in time, in the out-of-order autoregressive model of this invention, to predict each element frame in A, the prediction order is rearranged. The rearranged prediction order could be 3, 1, 0, 4, 2; f represents the dependent variable. and independent variable x inp The functional relationship, with parameter Θ'; express The prediction results of previous frames; while the choice function indicates that the predictions should be made according to a preset dependency. The elements in the frame are set to zero to select the non-zeroed element frames as input pairs. Make predictions. When training for out-of-order autoregressive action interpolation, the prediction order can be randomly selected, or each prediction can be randomly determined to depend on previous predictions, in order to filter out the prediction order and dependencies that provide the best interpolation performance for a fixed-length sequence T.
[0051] The preset dependency and prediction order refer to the dependency and prediction order that achieve the best interpolation effect for a fixed-length action sequence based on the principle of disordered prediction order and dependency.
[0052] The out-of-order autoregressive model is a deep learning model built on the interpolation idea of the out-of-order autoregressive model. It breaks the traditional autoregressive model's prediction relationship and dependency relationship based on time sequence and realizes a custom prediction order and dependency relationship.
[0053] In this embodiment of the invention, the out-of-order autoregressive model can be a GPT-based version of the transformer decoder, and the lower triangular mask matrix in the traditional multi-head self-attention mechanism can be replaced with a Flexible Dependency Attention Mask (FDAM), so that the skeleton of GPT can achieve out-of-order autoregression.
[0054] The out-of-order autoregressive model includes a spatial pose encoder, a temporal decoder, and a spatial pose decoder. The temporal decoder includes an FDAM multi-head attention layer and a feedforward neural network. The flexible dependent attention mask multi-head attention layer is used to mask the input frames to realize the dependencies and prediction order in the interpolation of the target action sequence.
[0055] The spatial pose encoder encodes the input target action sequence to obtain a feature matrix, which is then input into a temporal decoder. The spatial pose can be implemented using a spatial transformer encoder. Corresponding to the spatial pose encoder, the spatial pose decoder decodes the output of the temporal decoder to obtain the interpolation result of the target action sequence. The temporal decoder performs out-of-order autoregression on the encoded target action sequence to obtain the interpolated feature matrix of the target action sequence.
[0056] In the FDAM multi-head attention layer, the internal FDAM can mask the input frames to realize the dependencies and prediction order in the target action sequence interpolation, controlling which input frames are used or masked to generate the prediction results of blank frames. This implements the choice function in formula (2), allowing blank frames to be predicted according to preset dependencies. Simultaneously, generated frames are stored in real time and can be used as dependencies for subsequent generation. O is generated sequentially. SAR The element frame in the matrix is denoted as the target. Each time, the preceding sequence number is used as the path. The path is considered the route to generate each blank frame, and the frame predicted by the path is the target frame. Along the path, each item in `generated` is checked to see if it is a dependency for generating the target. If a dependency exists, `FDAM[path, dependency]` in the `FDAM` matrix is set to 1.
[0057] The FDAM multi-head attention layer uses a scale dot product as the kernel function for the self-attention mechanism, where on the i-th path:
[0058]
[0059] Q = EW Q (6)
[0060] K = EW K (7)
[0061] V = EW V (8)
[0062] Where Q, K, and V represent Query, Key, and Value in the attention mechanism, respectively, and E represents the action sequence embedding matrix input from the spatial pose encoder to the temporal decoder. j This represents the j-th action frame in the target action sequence; W represents the transformation matrix parameter.
[0063] In the algorithm, if the generation of the target frame requires the i-th item on the path as a dependency, then FDAM[path, dependency] is set to 1; otherwise, it is set to 0. This masks all inputs that are not dependent.
[0064] As an example, let's explain the dependency-based prediction of blank frames using the FDAC to control the input frames. If we want to generate the intermediate 28 frames using frames 1 and 30, one possible dependency relationship is that the generation of frame 8 depends on frames 1 and 30, the generation of frame 15 depends on frames 8 and 30, and the generation of frame 23 depends on frames 1, 15, and 30. Specifically, in the FDAC module, we use line 1 as the path to generate frame 8. In the first row of the mask, only items 1 and 30 are 1, and the rest are 0. Then, we use line 8 (where frame 8 was just generated) as the path to generate frame 15. In the 15th row of the mask, only items 8 and 30 are 1, and the rest are 0. Next, we use line 15 (where frame 15 was just generated) as the path to generate frame 23. In the 15th row of the mask, only items 1, 15, and 30 are 1, and the rest are 0. This process continues until the prediction of frame 28 is completed.
[0065] In the out-of-order autoregressive action interpolation method described in this invention, the interpolation of unknown frames, i.e. blank frames, in the target sequence does not need to depend on the prediction results of all previous frames. Based on the preset dependency relationship and prediction order, elements or frames that are highly correlated and have less deviation are selected as references for subsequent predictions, thereby gradually obtaining the interpolation results of the target action sequence. This reduces the rate of error accumulation in the traditional autoregressive model and improves the accuracy of action interpolation from the perspective of error propagation.
[0066] Optionally, step 102, which involves obtaining the interpolation results of the target action sequence step by step based on the out-of-order autoregressive model according to the trained dependencies and prediction order, includes:
[0067] Step S201: Determine one or more keyframes from the blank frame;
[0068] Step S202: Based on the out-of-order autoregressive model, obtain the prediction results of the key frames in sequence according to the trained dependency relationship;
[0069] Step S203: According to the trained dependency relationship and prediction order between two adjacent keyframes and the blank frames between the two adjacent keyframes, the prediction result of the blank frames between the two adjacent keyframes is obtained by using the interpolation result of the keyframes and the out-of-order autoregressive model.
[0070] When performing motion interpolation, the errors accumulated in the early generated frames are small, and the resulting predictions typically have a small bias. This makes them the best dependencies for predicting subsequent blank frames. Therefore, in this invention, these early generated frames can be evenly distributed throughout the entire motion sequence. Specifically, N can be selected. k A keyframe, generated first, divides the entire target motion sequence into multiple sequence intervals, referred to as keyframe intervals in this invention. When generating blank frames between any two adjacent keyframes, these blank frames within an interval cannot depend on any information from other intervals; they can only depend on the first and last keyframes of that interval, which are generated very early and therefore have minimal bias. Thus, the entire motion interpolation problem is divided into many smaller subproblems with the same premise by these keyframes. Alternatively, recursion can be continued to divide the problem into even smaller intervals, thereby reducing the rapidly increasing error accumulation seen in traditional autoregression. In this embodiment, the keyframes can be manually determined by professionals during motion interpolation in animation production, and prediction results are gradually generated based on preset dependencies.
[0071] Wherein, corresponding to step S202, the keyframe formula for one recursion is:
[0072]
[0073]
[0074] Where, k i sequence O k Represents the list of keyframes; Formula (6) represents the autoregressive formula for keyframe interpolation, where the generation of each keyframe depends on all previously generated keyframes, Θ f For function parameters; 1≤i≤N k .
[0075] Corresponding to step S202, after the subproblem becomes sufficiently simple, in this embodiment of the invention, by using blank frames within the traditional autoregressive prediction interval from left to right, the frame-by-frame generation within each interval cannot depend on the results already generated in other intervals.
[0076] Each subproblem, i.e., the blank frame within the interval, is generated according to the following formula:
[0077]
[0078]
[0079]
[0080] Among them, O f This represents the sequence of intervals segmented by keyframes; The interpolation order of blank frames in the i-th subproblem interval is represented by formula (9). Formula (9) represents the function expression of generating prediction results frame by frame through the traditional autoregressive model based on the key frames at the beginning and end of the key frame interval and the prediction results before the i-th frame in the interval.
[0081] Optionally, after step 102, which involves obtaining the interpolation results of the target action sequence step by step based on the out-of-order autoregressive model according to the trained dependencies and prediction order, the method further includes:
[0082] Step 103: Smooth the interpolation result of the target action sequence to obtain the final interpolation result of the target action sequence.
[0083] Considering that in the prediction results of blank frames generated based on disordered autoregression, two temporally adjacent frames may not be continuous due to different dependencies, it is necessary to smooth the interpolation results of the target action sequence obtained by 102 and regenerate the interpolation results of the sequence.
[0084] Image smoothing refers to a processing method that makes the brightness of an image tend to be flat. In the embodiments of the present invention, similar to image smoothing, smoothing refers to a processing method that makes the actions between different action frames continuous. For example, after arranging the interpolation results of the target action sequence generated in step 102 in chronological order, the interpolation is used to replace the regeneration, and the prediction results of the blank frames after smoothing are obtained, thereby obtaining the continuous target action sequence frames, i.e., the interpolation results of the target action sequence.
[0085] Optionally, the interpolation result of the target action sequence in step 102 includes the prediction result of the blank frame;
[0086] Step 103 involves smoothing the interpolation result of the target action sequence to obtain the final interpolation result of the target action sequence, including:
[0087] Step S301: Using the prediction result of the blank frame as a reference frame, insert a new blank frame between every two adjacent frames in the reference frame.
[0088] Step S302: Based on the reference frame, generate the prediction result of the new blank frame using autoregression.
[0089] Step S303: Replace the reference frame with the prediction result of the new blank frame to obtain the interpolation result of the target action sequence.
[0090] In the prediction results of the obtained blank frames, two temporally adjacent frames may not be continuous due to different dependencies. Therefore, it is necessary to smooth the prediction results of the generated blank frames and regenerate them.
[0091] The smoothing method described in steps S301-S303 differs from commonly used convolutional smoothing. Essentially, it employs a trick—frame interpolation—to regenerate the prediction results of blank frames. Using the prediction results of these blank frames as reference frames, a new blank frame is inserted between every two reference frames. The newly added frames are used to store the smoothed results and will be generated in parallel during the next autoregressive operation. Therefore, the length L of the entire sequence (including the first and last known frames) should be L = 2T + 3, where odd-numbered frames between 1 and 2T + 1 are reference frames, and even-numbered frames between 2 and 2T are the prediction results of the new blank frames, which are then used as the final output, with an output length of T.
[0092] Optionally, refer to Figure 2 The diagram illustrates an architecture of an out-of-order autoregressive model embodiment. The out-of-order autoregressive model includes a spatial pose encoder, a temporal decoder, and a spatial pose decoder. The temporal decoder includes an FDAM multi-head attention layer and a feedforward neural network. The flexible dependent attention mask multi-head attention layer is used to mask the input frames to realize the dependencies and the prediction order in the target action sequence interpolation.
[0093] The out-of-order autoregressive model performs the action interpolation method as described in step 102.
[0094] The out-of-order autoregressive model breaks away from the traditional autoregressive model's prediction order and dependency relationship based on time sequence, and realizes a custom prediction order and dependency relationship.
[0095] In this embodiment of the invention, the out-of-order autoregressive model is based on the GPT version of the transformer decoder, and a flexible dependent attention mask (FDAM) is used instead of the lower triangular mask matrix in the multi-head self-attention mechanism, so that the skeleton of GPT can achieve out-of-order autoregression.
[0096] The spatial pose encoder is used to encode the input target action sequence, obtain the feature matrix of the target action sequence, and input it into the temporal decoder. The spatial pose can be implemented using a spatial transformer encoder.
[0097] In the FDAM multi-head attention layer, the internal FDAM can mask the input frames to realize the dependencies and prediction order in the target action sequence interpolation, controlling which input frames are used or masked to generate the prediction results of blank frames. This implements the choice function in formula (2), allowing blank frames to be predicted according to preset dependencies. Simultaneously, generated frames are stored in real time and can be used as dependencies for subsequent generation. O is generated sequentially. SAR The element frame in the matrix is denoted as the target. Each time, the preceding sequence number is used as the path. The path is considered the route to generate each blank frame, and the frame predicted by the path is the target frame. Along the path, each item in `generated` is checked to see if it is a dependency for generating the target. If a dependency exists, `FDAM[path, dependency]` in the `FDAM` matrix is set to 1.
[0098] The FDAM multi-head attention layer uses a scale dot product as the kernel function for the self-attention mechanism, where the attention head on the i-th path is:
[0099]
[0100] Q = EW Q (6)
[0101] K = EW K (7)
[0102] V = EW V (8)
[0103] Where Q, K, and V represent Query, Key, and Value in the attention mechanism, respectively, and E represents the action sequence embedding matrix input from the spatial pose encoder to the temporal decoder. j This represents the j-th action frame in the target action sequence; W represents the transformation matrix parameter.
[0104] In the algorithm, if the generation of the target frame requires the i-th item on the path as a dependency, then FDAM[path, dependency] is set to 1; otherwise, it is set to 0. This masks all inputs that are not part of the dependency relationship.
[0105] As an example, let's explain the above method of using FDAC to control input frames and predict blank frames based on dependencies. If we want to generate the intermediate 28 frames using frames 1 and 30, and the keyframes determined according to a preset dependency relationship are frames 8, 15, and 23, then one possible dependency relationship is that the generation of frame 8 depends on frames 1 and 30, the generation of frame 15 depends on frames 8 and 30, and the generation of frame 23 depends on frames 1, 15, and 30. Specifically, in the FDAC module, we use line 1 as the path to generate frame 8. In the first row of the corresponding mask, only items 1 and 30 are 1, and the rest are 0. Then, we use line 8 (where frame 8 was just generated) as the path to generate frame 15. In the 15th row of the corresponding mask, only items 8 and 30 are 1, and the rest are 0. Next, using line 15 (where frame 15 was just generated) as the path, frame 23 is generated. In the corresponding mask, only items 1, 15, and 30 in line 15 are 1, and the rest are 0. This process is repeated to complete the prediction of frame 28.
[0106] Figure 2 The basic architecture of the out-of-order autoregressive model is illustrated, and the basic process of one round of autoregression is described. The target action sequence of length T is input at the bottom. This sequence is transformed into a high-dimensional action sequence embedding matrix by a spatial pose encoder, and then input into a temporal decoder. The temporal decoder includes an FDM (Multi-Head Attention Mechanism) network and a feedforward neural network. The FDM network and feedforward neural network obtain the interpolated action sequence embedding matrix of a single blank frame in the current prediction order. This matrix is then input into the spatial pose decoder to obtain the prediction result for a blank frame in the target action sequence. The results are not arranged in chronological order; the prediction order needs to be checked to determine the order of the results and place them into the target action sequence. This is one round of out-of-order autoregression. The output of this round of out-of-order autoregression is then used as input to continue the next round. After obtaining the prediction results for all keyframes, out-of-order autoregression continues to interpolate blank frames within the keyframe intervals until all blank frames have been interpolated.
[0107] based on Figure 2 The architecture of the out-of-order autoregressive model shown uses the output of this round of out-of-order autoregression as input after generating the first keyframe, and continues to the next round of out-of-order autoregression. (Refer to...) Figure 3The diagram illustrates a sequence transformation during the interpolation process of a target action sequence. First, as described in step S201, after determining keyframes in the target action sequence, the keyframes are generated one by one according to a preset dependency relationship. Since the prediction order is different from the temporal order of the frames in the original sequence, they are rearranged into the target action sequence according to the original temporal order. Then, as described in step S202, based on the dependency relationship between two adjacent keyframes and the corresponding blank frames between them, the prediction results of the blank frames between each pair of adjacent keyframes are obtained using the interpolation results of the keyframes. Simultaneously, these blank frames are rearranged into the target action sequence according to the original temporal order, ultimately obtaining the prediction results of all blank frames in the target action sequence.
[0108] Reference Figure 4 The diagram illustrates a flowchart of an embodiment of a training method for a disordered autoregressive model, the training method being used to train... Figure 1 and / or Figure 3 The out-of-order autoregressive model shown may include the method described in steps 103 and S301-S302, wherein the training method includes:
[0109] Step 201: Obtain the sample action sequence set.
[0110] The sample motion sequence set includes continuous motion sequences, such as multiple frames in a continuous animation. Optionally, the sample motion sequence set can be obtained through the AMSS dataset. The AMSS dataset is a collection of some public motion sequence datasets. For example, all available datasets in the SMPL+H format can be used. The SMPL+H skeleton includes 22 body joints and 30 hand joints, and the data contains various actions and motion sequences at different frame rates. Each pose is represented as a three-dimensional relative angle of the joints. Combining the smoothing method described in steps S301-S303, corresponding to the length of the output sequence, the size of the training data needs to be set to conform to the relationship L=2T+3 mentioned above. Of course, the relationship between the length of the output sequence and the length of the training sequence will be different for different smoothing methods. In this embodiment of the invention, the original motion sequence set is segmented by the operation of a sliding window to obtain a sample motion sequence set that meets the requirements.
[0111] Step 202: Based on the sample action sequence set, the out-of-order autoregressive model is trained using a teacher-forced strategy to obtain a one-stage out-of-order autoregressive model.
[0112] The teacher-mandated strategy is a training method for recurrent neural networks that uses ground truth as input instead of previously predicted values. Ground truth refers to the supervised data used in supervised training of machine learning models. This ensures that biased previous predictions are not used as input for subsequent predictions, thus guaranteeing the effectiveness of subsequent predictions in the current training. In this way, the generation of each blank frame depends on the input ground truth, optimizing the model's intermediate processing and parameter training.
[0113] Step 203: Based on the sample action sequence set, perform two-stage training on the first-stage out-of-order autoregressive model according to the strategy that the model output is generated entirely from the first two frames, to obtain the trained out-of-order autoregressive model.
[0114] In this step, the embodiment of the present invention abandons the teacher-forced strategy and follows the strategy that the model output is generated entirely from the first two frames. Only the first two frames of the sequence in the sample action sequence set and the final interpolation result of the sample sequence are used to perform the second-stage training of the first-stage disordered autoregressive model. In this way, the model can further improve the loss effect of model training and improve the actual performance of the model.
[0115] In summary, this invention provides an action interpolation method. It interpolates the target action sequence according to a preset dependency and prediction order. Specifically, it achieves action sequence interpolation through keyframe interpolation, frame-by-frame generation within keyframe intervals, and smoothing. This breaks the time-series dependency and prediction order of traditional autoregressive models. By selecting keyframes, it reduces the speed of error accumulation during autoregression. Furthermore, it provides a self-attention-based out-of-order autoregression model for performing out-of-order autoregression. It cleverly designs a Flexible Dependency Attention Mask (FDAM) to replace the lower triangular mask matrix in the multi-head self-attention mechanism, realizing out-of-order autoregression based on dependency and prediction order. Through a divide-and-conquer approach, it reduces the path length of error accumulation, reduces error propagation, and improves the accuracy of action interpolation from the perspective of error propagation.
[0116] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.
[0117] Reference Figure 5 The diagram illustrates a structural block diagram of an embodiment of the motion interpolation device of the present invention. The device 300 may include:
[0118] The target action sequence acquisition module 301 is used to acquire a target action sequence, which includes known action frames and multiple blank frames.
[0119] The interpolation module 302 is used to obtain the interpolation results of the target action sequence step by step based on the out-of-order autoregressive model and according to the trained dependency relationship and prediction order; the dependency relationship includes the dependency relationship between frames in the known action frames and blank frames.
[0120] Optionally, the target action sequence acquisition module may include:
[0121] The blank frame prediction submodule is used to obtain the prediction results of the multiple blank frames step by step according to the preset dependency relationship and prediction order.
[0122] The smoothing submodule is used to smooth the prediction results of the blank frames and obtain the interpolation results of the target action sequence.
[0123] Optionally, the interpolation module may include:
[0124] A keyframe determination submodule is used to determine one or more keyframes from the blank frames;
[0125] The keyframe prediction submodule is used to obtain the prediction results of the keyframes sequentially according to the trained dependency relationship based on the out-of-order autoregressive model.
[0126] The blank frame interpolation submodule within the keyframe interval obtains the prediction results of the blank frames between two adjacent keyframes by using the interpolation results of the keyframes and the out-of-order autoregressive model, according to the trained dependency relationship and prediction order between two adjacent keyframes and the blank frames between the two adjacent keyframes.
[0127] Optionally, the device may further include:
[0128] The smoothing module is used to smooth the interpolation result of the target action sequence to obtain the final interpolation result of the target action sequence.
[0129] Optionally, the interpolation result of the target action sequence includes the prediction result of the blank frame;
[0130] The smoothing module includes:
[0131] The new blank frame insertion submodule is used to insert a new blank frame between every two adjacent frames in the reference frame, using the prediction result of the blank frame as the reference frame.
[0132] The new blank frame regression submodule is used to generate prediction results for the new blank frame by autoregression, depending on the reference frame.
[0133] The target action sequence interpolation result acquisition submodule is used to replace the reference frame with the prediction result of the new blank frame to obtain the final interpolation result of the target action sequence.
[0134] Reference Figure 6 The diagram shows a structural block diagram of a training device for a disordered autoregressive model, which is used to train... Figure 1 and / or Figure 3 The out-of-order autoregressive model shown may include the method described in steps 103 and S301-S302, and the device 400 includes:
[0135] The sample action sequence set acquisition module 401 is used to acquire the sample action sequence set;
[0136] The first-stage training module 402 is used to train the out-of-order autoregressive model based on the sample action sequence set using a teacher-forced strategy to obtain the first-stage out-of-order autoregressive model.
[0137] The two-stage training module 403 is used to perform two-stage training on the one-stage out-of-order autoregressive model based on the sample action sequence set and according to the strategy that the model output is generated entirely from the first two frames, so as to obtain the trained out-of-order autoregressive model.
[0138] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0139] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0140] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0141] refer to Figure 7 The illustration shows an electronic device 500 provided in an embodiment of this application, including: a processor 501, a memory 502, and a computer program stored in the memory 502 and executable on the processor 501. When the computer program is executed by the processor 501, it implements the steps of the action interpolation method as described in the method embodiment.
[0142] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the steps of the action interpolation method and achieve the same technical effect. To avoid repetition, this will not be described again here.
[0143] The processor is the processor in the electronic device described in the above-described electronic device embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0144] The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general-purpose systems can also be used in conjunction with the teachings herein. The required structure for constructing such systems is apparent from the above description. Furthermore, the embodiments of this disclosure are not directed to any particular programming language. It should be understood that the embodiments of this disclosure described herein can be implemented using various programming languages, and the above description of specific languages is for the purpose of disclosing the best mode of implementation of the embodiments of this disclosure.
[0145] Numerous specific details are set forth in the specification provided herein. However, it will be understood that embodiments of the present disclosure may be practiced without these specific details. In some instances, well-known methods, structures, and techniques have not been shown in detail so as not to obscure the understanding of this specification.
[0146] Similarly, it should be understood that, in order to streamline this disclosure and aid in understanding one or more of the various inventive aspects, in the foregoing description of exemplary embodiments of the present disclosure, various features of the embodiments of the present disclosure are sometimes grouped together in a single embodiment, figure, or description thereof. However, this approach to disclosure should not be construed as reflecting an intention that the claimed embodiments of the present disclosure require more features than expressly recited in each claim. Rather, as reflected in the following claims, inventive aspects lie in fewer than all features of a single foregoing disclosed embodiment. Therefore, the claims following the detailed description are hereby expressly incorporated into that detailed description, wherein each claim itself is a separate embodiment of the present disclosure.
[0147] Those skilled in the art will understand that modules in the device of the embodiments can be adaptively changed and placed in one or more devices different from that embodiment. Modules, units, or components in the embodiments can be combined into a single module, unit, or component, and further, they can be divided into multiple sub-modules, sub-units, or sub-components. Except where at least some of such features and / or processes or units are mutually exclusive, any combination can be used to combine all features disclosed in this specification (including the accompanying claims, abstract, and drawings) and all processes or units of any method or device so disclosed. Unless expressly stated otherwise, each feature disclosed in this specification (including the accompanying claims, abstract, and drawings) may be replaced by an alternative feature that serves the same, equivalent, or similar purpose.
[0148] The various component embodiments of this disclosure can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that microprocessors or digital signal processors (DSPs) can be used in practice to implement some or all of the functions of some or all of the components in the sorting device according to the embodiments of this disclosure. Embodiments of this disclosure can also be implemented as device or apparatus programs for performing some or all of the methods described herein. Such programs implementing embodiments of this disclosure can be stored on a computer-readable medium or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0149] It should be noted that the above embodiments are illustrative of embodiments of this disclosure and not restrictive of embodiments of this disclosure, and that those skilled in the art can devise alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses should not be construed as limiting the claims. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. Embodiments of this disclosure can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by the same item of hardware. The use of the words first, second, and third, etc., does not indicate any order. These words can be interpreted as names.
[0150] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0151] The above description is only a preferred embodiment of the present disclosure and is not intended to limit the embodiments of the present disclosure. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the embodiments of the present disclosure should be included within the protection scope of the embodiments of the present disclosure.
[0152] The above description is merely a specific implementation of the embodiments of this disclosure, but the protection scope of the embodiments of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this disclosure should be included within the protection scope of the embodiments of this disclosure. Therefore, the protection scope of the embodiments of this disclosure should be determined by the protection scope of the claims.
Claims
1. An action interpolation method, characterized in that, include: Obtain the target action sequence, which includes known action frames and multiple blank frames; Based on the out-of-order autoregressive model, the interpolation results of the target action sequence are obtained step by step according to the trained dependency relationship and prediction order. The dependency relationship includes the dependency relationship between frames in the known action frames and blank frames. The out-of-order autoregressive model can be a GPT-based transformer decoder, replacing the lower triangular mask matrix in the traditional multi-head autoattention mechanism with a flexible dependent attention mask (FDAM), enabling the GPT skeleton to achieve out-of-order autoregression. The out-of-order autoregressive model includes a spatial pose encoder, a temporal decoder, and a spatial pose decoder. The temporal decoder includes an FDM multi-head attention layer and a feedforward neural network. The flexible dependent attention mask multi-head attention layer is used to mask the input frames to determine dependencies and prediction order in the target action sequence interpolation. The spatial pose encoder encodes the input target action sequence to obtain its feature matrix, which is then input into the temporal decoder. The spatial pose can be implemented using a spatial transformer encoder. Corresponding to the spatial pose encoder, the spatial pose decoder decodes the output of the temporal decoder to obtain the interpolation result of the target action sequence. The temporal decoder performs out-of-order autoregression on the encoded target action sequence to obtain the interpolation feature matrix of the target action sequence.
2. The method according to claim 1, characterized in that, The method based on the out-of-order autoregressive model, which progressively obtains the interpolation results of the target action sequence according to the trained dependencies and prediction order, includes: Determine one or more keyframes from the blank frames; Based on the out-of-order autoregressive model, the prediction results of the key frames are obtained sequentially according to the trained dependencies and prediction order; Based on the trained dependencies and prediction order between two adjacent keyframes and the blank frames between them, the prediction results of the blank frames between the two adjacent keyframes are obtained using the interpolation results of the keyframes and the out-of-order autoregressive model.
3. The method according to claim 1, characterized in that, The out-of-order autoregressive model includes a flexible dependent attention mask multi-head attention layer, which is used to mask the input frames to realize the dependencies and the prediction order in the target action sequence interpolation.
4. The method according to claim 1, characterized in that, After gradually obtaining the interpolation results of the target action sequence, the method further includes: The interpolation result of the target action sequence is smoothed to obtain the final interpolation result of the target action sequence.
5. The method according to claim 4, characterized in that, The interpolation result of the target action sequence includes the prediction result of the blank frame. The smoothing process performed on the interpolation result of the target action sequence to obtain the final interpolation result of the target action sequence includes: Using the prediction result of the blank frame as a reference frame, a new blank frame is inserted between every two adjacent frames in the reference frame; Based on the reference frame, the prediction results for the new blank frame are generated using autoregression; The prediction result of the new blank frame is used to replace the reference frame to obtain the final interpolation result of the target action sequence.
6. A training method for a disordered autoregressive model, characterized in that, The training method refers to the action interpolation method according to any one of claims 1-5, including: Obtain the sample action sequence set; Based on the sample action sequence set, the out-of-order autoregressive model is trained using a teacher-forced strategy to obtain a one-stage out-of-order autoregressive model. Based on the sample action sequence set, the first-stage out-of-order autoregressive model is trained in two stages according to the strategy that the model output is generated entirely from the first two frames, so as to obtain the trained out-of-order autoregressive model.
7. An action interpolation device, characterized in that, include: A target action sequence acquisition module is used to acquire a target action sequence, which includes known action frames and multiple blank frames. The interpolation module is used to obtain the interpolation results of the target action sequence step by step based on the out-of-order autoregressive model, according to the trained dependencies and prediction order; the dependencies include the dependencies between frames in the known action frames and blank frames. The out-of-order autoregressive model can be a GPT-based transformer decoder, replacing the lower triangular mask matrix in the traditional multi-head autoattention mechanism with a flexible dependent attention mask (FDAM), enabling the GPT skeleton to achieve out-of-order autoregression. The out-of-order autoregressive model includes a spatial pose encoder, a temporal decoder, and a spatial pose decoder. The temporal decoder includes an FDM multi-head attention layer and a feedforward neural network. The flexible dependent attention mask multi-head attention layer is used to mask the input frames to determine dependencies and prediction order in the target action sequence interpolation. The spatial pose encoder encodes the input target action sequence to obtain its feature matrix, which is then input into the temporal decoder. The spatial pose can be implemented using a spatial transformer encoder. Corresponding to the spatial pose encoder, the spatial pose decoder decodes the output of the temporal decoder to obtain the interpolation result of the target action sequence. The temporal decoder performs out-of-order autoregression on the encoded target action sequence to obtain the interpolation feature matrix of the target action sequence.
8. A training device for a disordered autoregressive model, characterized in that, The training device employs the motion interpolation method according to any one of claims 1-5, comprising: The sample action sequence set acquisition module is used to acquire sample action sequence sets; The first-stage training module is used to train the out-of-order autoregressive model based on the sample action sequence set using a teacher-forced strategy, and obtain the first-stage out-of-order autoregressive model. The two-stage training module is used to perform two-stage training on the one-stage out-of-order autoregressive model based on the sample action sequence set and according to the strategy that the model output is generated entirely from the first two frames, so as to obtain the trained out-of-order autoregressive model.
9. An electronic device, characterized in that, include: A processor and a memory, wherein the processor executes a computer program stored in the memory to implement the method of any one of claims 1 to 6.
10. A readable storage medium, characterized in that, When the instructions in the storage medium are executed by the processor of the device, the device is able to perform the method as described in any one of claims 1 to 6.
