Video generation model training method and device, electronic equipment and storage medium
Iterative diffusion processing is performed in the video generation model through a pure multi-layer perceptron architecture, which solves the problem that the attention mechanism-based diffusion model training consumes a lot of computing resources and achieves efficient video generation.
Patent Information
- Application Number
- CN202410999837.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-07-24
AI Technical Summary
Existing diffusion models based on attention mechanisms consume a lot of computing resources and are slow to train in video generation tasks.
Using a pure multi-layer perceptron architecture, multiple multi-layer perceptrons of the video generation model learn and extract feature information from the feature map of the video frame in the spatial dimension, and learn and extract feature information from the feature map at each time step in the temporal dimension. Perform iterative diffusion processing to simulate the generation process of video frames and generate video frames with coherence and consistency.
It reduces the complexity of the video generation model, reduces computing resources, improves training efficiency, and achieves the generation of high-quality visual content at lower computing costs.
Smart Images

Figure CN118658032A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a training method, device, electronic device and storage medium for a video generation model. Background Art
[0002] With the rapid development of computer technology, diffusion models have achieved remarkable success in image generation and video generation tasks. Most of the existing diffusion models for visual content generation are modeled using the UNet architecture, which can achieve the same dimension of output and input, and is suitable for diffusion models. The UNet architecture used by the existing diffusion model not only contains residual-based convolution modules, but also adopts an attention mechanism. However, diffusion based on the attention mechanism usually contains a large number of parameters and requires a lot of computing resources and memory for training and reasoning. Summary of the invention
[0003] In view of this, the embodiments of the present application provide a training method, device, electronic device and storage medium for a video generation model to solve the problem in the prior art that the diffusion model training based on the attention mechanism consumes a lot of computing resources and has a slow training speed.
[0004] In a first aspect of an embodiment of the present application, a method for training a video generation model is provided, comprising: obtaining a training set, the training set comprising multiple training samples, the training samples comprising multiple training video frames of a training video; inputting each training sample into the video generation model, performing feature embedding on the training video frames of each training video, and obtaining feature maps of the training video frames of each training video; performing feature embedding on multiple time steps of the video generation model, and obtaining feature maps of each time step; inputting the feature maps of each time step and the feature maps of the training video frames of each training video into multiple multi-layer perceptrons of the video generation model, performing multiple iterative diffusion processing on the feature maps of each time step and the feature maps of the training video frames of each training video based on each multi-layer perceptron, and obtaining initial feature maps of video frames of corresponding multiple predicted videos; determining a target feature map of the video frame of each predicted video according to the initial feature map of the video frame of each predicted video; decoding the target feature map of the video frame of each predicted video to obtain each video frame of each predicted video; calculating a loss value of the video generation model based on each video frame of each predicted video and each training video frame of each training video, and updating the parameters of the video generation model according to the loss value.
[0005] According to a second aspect of an embodiment of the present application, a training device for a video generation model is provided, comprising: an acquisition module for acquiring a training set, wherein the training set comprises a plurality of training samples, and the training samples comprise a plurality of training video frames of a training video; a feature embedding module for inputting each training sample into the video generation model, performing feature embedding on the training video frames of each training video, and obtaining a feature map of the training video frames of each training video; a time step encoding module for performing feature embedding on a plurality of time steps of the video generation model, and obtaining a feature map of each time step; and a diffusion module for inputting the feature map of each time step and the feature map of the training video frames of each training video into a plurality of multi-layer perceptual layers of the video generation model. A knowledge machine, based on each multi-layer perceptron, performs multiple iterative diffusion processing on the feature map of each time step and the feature map of the training video frame of each training video to obtain the initial feature maps of the video frames of the corresponding multiple predicted videos; a determination module, for determining the target feature map of the video frame of each predicted video according to the initial feature map of the video frame of each predicted video; a decoding module, for decoding the target feature map of the video frame of each predicted video to obtain each video frame of each predicted video; an updating module, for calculating the loss value of the video generation model based on each video frame of each predicted video and each training video frame of each training video, and updating the parameters of the video generation model according to the loss value.
[0006] According to a third aspect of an embodiment of the present application, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.
[0007] According to a fourth aspect of an embodiment of the present application, a readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0008] Compared with the prior art, the embodiments of the present application have the following beneficial effects: by obtaining a training set, the training set includes multiple training samples, each sample includes multiple training video frames of a training video, and the multiple training video frames of a training video are the learning targets of a video generation model. The video generation model learns how to generate multiple video frames of a prediction video close to the multiple training video frames of the training video based on the training set during the training phase. Input each training sample into the video generation model, map the training video frames of each training video into a feature space of a specified dimension through feature embedding, compress the high-dimensional pixel information into a low-dimensional feature space, and obtain a feature map of the training video frames of each training video, which is convenient for the subsequent further processing and learning of the video generation model. The time step of the video generation model can represent the discrete time interval when the video generation model generates or reconstructs the video frame. In the diffusion processing process of the video generation model, each time step corresponds to the video generation model gradually recovering the information content of the training video frame. Perform learnable embedding on multiple time steps to obtain feature maps of each time step, and represent the time information in numerical form, which helps the video generation model understand the specific details of the current stage at each time step stage, so as to better perform diffusion processing and generate multiple video frames of the prediction video. The feature maps of each time step and the feature maps of the training video frames of each training video are input into the multiple multi-layer perceptrons of the video generation model. The feature maps of each time step and the feature maps of the training video frames of each training video are iteratively diffused multiple times by the multiple multi-layer perceptrons of the video generation model to obtain the initial feature maps of the corresponding multiple predicted video frames, and the generation process of the predicted video frames is simulated. The temporal dependency and spatial correlation between the video frames are learned in the diffusion process, which is helpful to generate video frames with coherence and consistency. Without introducing the attention mechanism and convolution layer, the multiple multi-layer perceptrons of the video generation model learn and extract feature information in the spatial dimension of the feature maps of the training video frames of each training video, and learn and extract feature information in the temporal dimension of the feature maps of each time step. Iterative diffusion processing is performed through the architecture of the pure multi-layer perceptron to simulate the generation of multiple video frames of the predicted video, which is helpful to generate the predicted video with consistency in spatiotemporal information. Based on the initial feature maps of the video frames of each predicted video, the ideal feature representation of each predicted video frame is determined through some optimization processes, that is, the target feature map of the video frame of each predicted video. The target feature map of each predicted video frame is decoded, and the feature representation learned by the video generation model is converted into a visualized video frame, that is, each video frame of each predicted video, so as to be compared with the training video frames of each real training video. The loss value between each predicted video frame and the corresponding training video frame is calculated. The loss value can measure the gap between the predicted result of the video generation model and the real result.The parameters of the video generation model can be updated according to the loss value, so that the video generation model can more accurately generate the video frames of the predicted video in the next round of iteration, and gradually predict the distribution close to the real data during the training process. The video generation model proposed in this application uses a pure multi-layer perceptron architecture for the generation task of video content without introducing the attention mechanism and convolution layer. The feature map of the video frame is learned and extracted in the spatial dimension through multiple multi-layer perceptrons of the video generation model, and the feature map of each time step is learned and extracted in the temporal dimension. The pure multi-layer perceptron architecture reduces the complexity of the video generation model and reduces the computing resources, so that it is more efficient in computing, and the time required for the training process of the video generation model proposed in this application is shorter. The video generation model proposed in this application solves the problem that the diffusion model training based on the attention mechanism in the prior art consumes a lot of computing resources and has a slow training speed under the conditions of less parameters and computing amount, and realizes the generation of high-quality visual content at a lower computing cost. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0010] Figure 1 is a schematic diagram of an application scenario of an embodiment of the present application; Figure 2 It is a flowchart of a training method for a video generation model provided in an embodiment of the present application; Figure 3 It is a structural schematic diagram of a video generation model provided in an embodiment of the present application; Figure 4 It is a structural schematic diagram of a multi-layer perceptron provided in an embodiment of the present application; Figure 5 is a schematic diagram of the structure of a spatial information mixing layer provided in an embodiment of the present application; Figure 6 It is a structural schematic diagram of a timing information mixing layer provided in an embodiment of the present application; Figure 7 It is a structural schematic diagram of a training device for a video generation model provided in an embodiment of the present application; Figure 8 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0011] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0012] A method and device for training a video generation model according to an embodiment of the present application will be described in detail below with reference to the accompanying drawings.
[0013] Figure 1 1 is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario may include terminal devices 1, 2 and 3, a server 4 and a network 5.
[0014] Terminal devices 1, 2 and 3 can be hardware or software. When terminal devices 1, 2 and 3 are hardware, they can be various electronic devices with display screens and supporting communication with server 4, including but not limited to smart phones, tablet computers, laptop portable computers and desktop computers, etc.; when terminal devices 1, 2 and 3 are software, they can be installed in the above electronic devices. Terminal devices 1, 2 and 3 can be implemented as multiple software or software modules, or as a single software or software module, and the embodiments of the present application are not limited to this. Furthermore, various applications can be installed on terminal devices 1, 2 and 3, such as data processing applications, instant messaging tools, social platform software, search applications, shopping applications, etc.
[0015] The server 4 may be a server that provides various services, for example, a background server that receives a request sent by a terminal device that establishes a communication connection with the server, and the background server may receive and analyze the request sent by the terminal device, and generate a processing result. The server 4 may be a single server, a server cluster composed of several servers, or a cloud computing service center, which is not limited in the present application.
[0016] It should be noted that the server 4 can be hardware or software. When the server 4 is hardware, it can be various electronic devices that provide various services for the terminal devices 1, 2, and 3. When the server 4 is software, it can be multiple software or software modules that provide various services for the terminal devices 1, 2, and 3, or it can be a single software or software module that provides various services for the terminal devices 1, 2, and 3, and the embodiments of the present application are not limited to this.
[0017] The network 5 can be a wired network connected by coaxial cable, twisted pair and optical fiber, or it can be a wireless network that can interconnect various communication devices without wiring, such as Bluetooth, Near Field Communication (NFC), infrared, etc., which is not limited in the embodiments of the present application.
[0018] The user can establish a communication connection with the server 4 via the network 5 through the terminal devices 1, 2 and 3 to receive or send information, etc. Specifically, the server 4 obtains a training set, which includes multiple training samples, and the training samples include multiple training video frames of training videos; each training sample is input into a video generation model, and features are embedded in the training video frames of each training video to obtain feature maps of the training video frames of each training video; multiple time steps of the video generation model are feature embedded to obtain feature maps of each time step; the feature maps of each time step and the feature maps of the training video frames of each training video are input into multiple multi-layer perceptrons of the video generation model, and based on each multi-layer perceptron, multiple iterative diffusion processes are performed on the feature maps of each time step and the feature maps of the training video frames of each training video to obtain initial feature maps of video frames of corresponding multiple predicted videos; based on the initial feature maps of the video frames of each predicted video, a target feature map of the video frame of each predicted video is determined; the target feature map of the video frame of each predicted video is decoded to obtain each video frame of each predicted video; based on each video frame of each predicted video and each training video frame of each training video, a loss value of the video generation model is calculated, and the parameters of the video generation model are updated according to the loss value.
[0019] It should be noted that the specific types, quantities and combinations of the terminal devices 1, 2 and 3, the server 4 and the network 5 can be adjusted according to the actual needs of the application scenario, and the embodiments of the present application do not limit this.
[0020] Figure 2 It is a flowchart of a training method for a video generation model provided in an embodiment of the present application. Figure 2 The training method of the video generation model can be Figure 1 The server executes. Figure 2 As shown, the training method of the video generation model includes: Step 201: Obtain a training set, where the training set includes a plurality of training samples, and the training samples include a plurality of training video frames of a training video.
[0021] In some embodiments, a training set for training a video generation model can be obtained from a public database. The training set contains multiple training samples, each training sample corresponds to a complete training video, and multiple training video frames of the training video are arranged in chronological order, which can together constitute a visual narrative or action sequence. Each training video is formed by a series of training video frames played continuously at a certain frequency. Each training video frame represents the state of the corresponding training video at a certain moment. The training video frames of the training video contain rich spatial information (such as object position, shape, color, etc.) and potential motion information. The training video frames of the training video contain visual information that the video generation model needs to learn, and provide the spatial features and temporal dynamics required by the video generation model. The sequence composed of training video frames helps the video generation model learn the temporal dynamics of the video, such as the motion trajectory of the object, speed changes, action connection, etc. Understanding and simulating time-related features is an important factor in generating natural and smooth videos. The multiple training samples in the training set can include various scenes, actions, styles, etc., and the rich training samples help the video generation model learn a wide range of rich visual and dynamic features during the training process. During the training process, the video generation model can learn how to capture key visual features, understand spatiotemporal relationships, predict future frames, and generate coherent video sequences from multiple training video frames of each input training video through multiple training samples in the training set.
[0022] Step 202: Input each training sample into the video generation model, perform feature embedding on the training video frame of each training video, and obtain a feature map of the training video frame of each training video.
[0023] In some embodiments, the training video frames of each training video are input into the video generation model to be trained, and the training video frames of each training video are feature embedded, and the high-dimensional training video frames of each training video are mapped to the feature space of the specified dimension through feature embedding, and key information is extracted from the training video frames of each training video. The key information may include the color, texture, shape, motion, etc. of the training video frames of each training video, and the feature map of the corresponding training video frames of each training video is obtained. The feature map of the training video frames of each training video can represent the visual features and spatiotemporal information captured by the video generation model. The original high-dimensional data (video frame) is reduced in dimension and abstracted by feature embedding, and irrelevant details are eliminated, and information of great significance for predicting video generation is highlighted, which helps to reduce the amount of calculation during the training process and improve the training and reasoning efficiency of the video generation model. The training video frames of each training video are feature embedded to obtain the feature maps of the training video frames of each training video. The feature maps also contain the time dependency between the video frames, which helps the video generation model understand the motion trajectory of the object (or object) in the training video, the coherence of the action, and the change of the scene, so as to generate more natural and coherent video content.
[0024] Step 203, feature embedding is performed on multiple time steps of the video generation model to obtain feature maps of each time step.
[0025] In some embodiments, learnable feature embedding is performed on multiple time steps of the video generation model to obtain feature maps for each time step, which is a key part of the video generation model. The time information can be passed to the video generation model through the feature maps for each time step. Performing learnable feature embedding on multiple time steps of the video generation model to obtain feature maps for each time step helps the video generation model understand the specific details of the current stage at each time step, so as to better generate predicted videos. The video generation model has different weights or behavior patterns at different time steps. The feature maps for each time step can provide the video generation model with key information for predicting video generation at each time step, so as to better follow the inherent laws of the subsequent diffusion processing process of the video generation model, help to better understand the process of data evolution, and ultimately generate high-quality predicted videos.
[0026] In step 204, the feature maps of each time step and the feature maps of the training video frames of each training video are input into multiple multi-layer perceptrons of the video generation model, and multiple iterative diffusion processes are performed on the feature maps of each time step and the feature maps of the training video frames of each training video based on each multi-layer perceptron to obtain initial feature maps of the video frames of the corresponding multiple predicted videos.
[0027] In some embodiments, the number of time steps corresponds to the number of times the video generation model performs iterative diffusion processing. Specifically, if the video generation model corresponds to ten time steps, the video generation model will perform diffusion processing ten times. During the first diffusion processing, the feature map of the first time step and the feature map of the training video frame of each training video are input into multiple multi-layer perceptrons of the video generation model. Based on each multi-layer perceptron, the feature map of each time step and the feature map of the training video frame of each training video are subjected to the first diffusion processing to obtain the result of the first diffusion processing. During the second diffusion processing, the result of the first diffusion processing, the feature map of the first time step and the feature map of the training video frame of each training video are input into multiple multi-layer perceptrons of the video generation model. Based on each multi-layer perceptron, a second diffusion processing is performed on the feature map of each time step and the feature map of the training video frame of each training video to obtain the result of the second diffusion processing; in the process of the third diffusion processing, the result of the second diffusion processing, the feature map of the second time step and the feature map of the training video frame of each training video are input into multiple multi-layer perceptrons of the video generation model, and based on each multi-layer perceptron, a third diffusion processing is performed on the feature map of each time step and the feature map of the training video frame of each training video to obtain the result of the third diffusion processing, and so on, the result of the tenth diffusion processing, that is, the initial feature map of the video frame of the multiple predicted videos, is obtained.
[0028] In some embodiments, the video generation model includes multiple continuous multilayer perceptrons, and the multiple multilayer perceptrons are connected in series in the video generation model. Specifically, if the video generation model includes three multilayer perceptrons, namely the first multilayer perceptron, the first multilayer perceptron and the third multilayer perceptron, when performing the first diffusion process, the feature map of the first time step and the feature map of the training video frame of each training video are input into the first multilayer perceptron of the video generation model for nonlinear transformation to obtain the output result of the first multilayer perceptron; the output result of the first multilayer perceptron, the feature map of the first time step and the feature map of the training video frame of each training video are input into the second multilayer perceptron of the video generation model for nonlinear transformation to obtain the output result of the second multilayer perceptron; the output result of the second multilayer perceptron, the feature map of the first time step and the feature map of the training video frame of each training video are input into the third multilayer perceptron of the video generation model for nonlinear transformation to obtain the output result of the third multilayer perceptron, that is, the result of the first diffusion process. Referring to the first diffusion processing, the feature maps of each time step and the feature maps of the training video frames of each training video are input into multiple multi-layer perceptrons of the video generation model, and multiple iterative diffusion processing is performed on the feature maps of each time step and the feature maps of the training video frames of each training video based on each multi-layer perceptron to obtain initial feature maps of the video frames of the corresponding multiple predicted videos.
[0029] In some embodiments, the multi-layer perceptron of the video generation model is a neural network structure that can process the feature graph of the input time step and the feature graph of the training video frame of each training video, and learn the complex feature representation of the input data through multi-layer nonlinear transformation to extract higher-level feature information. The feature graph of the time step and the feature graph of the training video frame of each training video contain the visual information of the video frame and the temporal information of the time step, which is the basis for the video generation model to generate the predicted video frame. The multi-layer perceptron captures the complex spatiotemporal dependencies and intrinsic patterns between the video frames by performing nonlinear transformation and combination on the above feature graphs to generate the initial feature graph of the predicted video frame similar to the training video frame. In each diffusion processing process, the multi-layer perceptron of the video generation model can generate a new predicted feature graph based on the input feature graph, and fuse it with the input feature graph. In the process of diffusion processing again and again, the initial feature graph of the video frame of the generated predicted video gradually approaches the training video frame of the training video. Through multiple iterations, the video generation model can gradually optimize its prediction results and improve the quality of the generated video. The feature graphs of each time step and the feature graphs of the training video frames of each training video are input into multiple multi-layer perceptrons, and multiple iterative diffusion processes are performed. The powerful representation ability of the multi-layer perceptron is used to gradually build and optimize the video frames of the predicted video, which helps to finally generate high-quality, expected video content. Without introducing attention mechanisms and convolutional layers, the multiple multi-layer perceptrons of the video generation model learn and extract feature information in the spatial dimension of the feature graphs of the training video frames of each training video through the multiple multi-layer perceptrons of the video generation model, and learn and extract feature information in the temporal dimension of the feature graphs of each time step. Iterative diffusion processing is performed through the architecture of a pure multi-layer perceptron to simulate the generation of multiple video frames of the predicted video, which helps the generated predicted video to have consistency in spatiotemporal information. The pure multi-layer perceptron architecture reduces the complexity of the video generation model and reduces computing resources, thereby being more efficient in computing, so that the training process of the video generation model proposed in this application requires a shorter time and consumes less computing resources.
[0030] Step 205 , determining a target feature map of a video frame of each predicted video according to the initial feature map of the video frame of each predicted video.
[0031] In some embodiments, the initial feature map of the video frame of the predicted video is a feature representation obtained after multiple iterative diffusion processes of the multi-layer perceptron of the video generation model, which is a preliminary estimate of the video frame content of the predicted video by the video generation model. The target feature map of the video frame of the predicted video is an ideal feature representation of the video frame of the predicted video to be generated. A series of nonlinear transformation processes can be performed on the initial feature map of the video frame of each predicted video, and the initial feature map can be further optimized and adjusted to obtain the target feature map of the video frame of each predicted video. Determining the target feature map of the video frame of the predicted video based on the initial feature map of the video frame of the predicted video is a key step in the training of the video generation model, which helps to further improve the accuracy of the video frame of the predicted video, enhance the robustness of the video generation model, and promote the improvement of the performance of the video generation model.
[0032] Step 206, decoding the target feature map of the video frame of each predicted video to obtain each video frame of each predicted video.
[0033] In some embodiments, the video generation model also includes a decoder, which inputs the target feature maps of the video frames of each predicted video into the decoder, decodes the target feature maps of the video frames of each predicted video, and converts the abstract feature maps into specific video frame images, i.e., each video frame of each predicted video containing a temporal relationship, so that people can intuitively see each video frame of the predicted video generated by the video generation model.
[0034] Step 207, calculating the loss value of the video generation model based on each video frame of each prediction video and each training video frame of each training video, and updating the parameters of the video generation model according to the loss value.
[0035] In some embodiments, the average square error of each pixel between each video frame of each predicted video and each training video frame of each training video is calculated to obtain a loss value. The loss value can measure the difference between the video frame of the predicted video and the video frame of the training video, such as the difference at the pixel level or the difference at the feature level. By calculating the loss value, the accuracy of the prediction result of the video generation model can be quantified, thereby guiding the subsequent parameter update. According to the loss value, the gradient of the video generation model parameter to the loss value is calculated by the back propagation algorithm, and the parameters of the video generation model are updated according to the gradient. The video generation model parameters are updated based on the training set. By continuously adjusting the parameters to minimize the loss value, the video generation model gradually learns how to generate video content similar to the training data based on the given input, that is, the video generation model has a good ability to generate new videos. The parameter update of the video generation model is an iterative optimization process. As the number of iterations increases, the parameters of the video generation model are gradually adjusted to the optimal state, so that the video frame of the predicted video is closer to the video frame of the training video. The video generation model can learn more about the laws and characteristics of the video generation task, which helps the video generation model to perform better in subsequent tasks and generate more real, natural and coherent video content.
[0036] Based on the training method of the video generation model proposed in this application, the obtained training set contains multiple training samples, each sample contains multiple training video frames of the training video, and the multiple training video frames of the training video are the learning targets of the video generation model. The video generation model learns how to generate multiple video frames of the predicted video close to the multiple training video frames of the training video based on the training set during the training stage. Input each training sample into the video generation model, map the training video frames of each training video into the feature space of the specified dimension through feature embedding, compress the high-dimensional pixel information into the low-dimensional feature space, and obtain the feature map of the training video frame of each training video, which is convenient for the subsequent further processing and learning of the video generation model. The time step of the video generation model can represent the discrete time interval when the video generation model generates or reconstructs the video frame. In the diffusion processing process of the video generation model, each time step corresponds to the video generation model gradually recovering the information content of the training video frame. Perform learnable embedding on multiple time steps to obtain the feature map of each time step, and represent the time information in numerical form, which helps the video generation model to understand the specific details of the current stage at each time step stage, so as to better perform diffusion processing and generate multiple video frames of the predicted video. The feature maps of each time step and the feature maps of the training video frames of each training video are input into the multiple multi-layer perceptrons of the video generation model. The feature maps of each time step and the feature maps of the training video frames of each training video are iteratively diffused multiple times by the multiple multi-layer perceptrons of the video generation model to obtain the initial feature maps of the corresponding multiple predicted video frames, and the generation process of the predicted video frames is simulated. The temporal dependency and spatial correlation between the video frames are learned in the diffusion process, which is helpful to generate video frames with coherence and consistency. Without introducing the attention mechanism and convolution layer, the multiple multi-layer perceptrons of the video generation model learn and extract feature information in the spatial dimension of the feature maps of the training video frames of each training video, and learn and extract feature information in the temporal dimension of the feature maps of each time step. Iterative diffusion processing is performed through the architecture of the pure multi-layer perceptron to simulate the generation of multiple video frames of the predicted video, which is helpful to generate the predicted video with consistency in spatiotemporal information. Based on the initial feature maps of the video frames of each predicted video, the ideal feature representation of each predicted video frame is determined through some optimization processes, that is, the target feature map of the video frame of each predicted video. The target feature map of each predicted video frame is decoded, and the feature representation learned by the video generation model is converted into a visualized video frame, that is, each video frame of each predicted video, so as to be compared with the training video frames of each real training video. The loss value between each predicted video frame and the corresponding training video frame is calculated. The loss value can measure the gap between the predicted result of the video generation model and the real result.According to the loss value, the parameters of the video generation model can be updated through the back propagation algorithm, so that the video generation model can more accurately generate the video frames of the predicted video in the next round of iteration, and gradually predict the distribution close to the real data during the training process. The video generation model proposed in this application uses a pure multi-layer perceptron architecture for the generation task of video content without introducing the attention mechanism and convolution layer. The feature map of the video frame is learned and extracted in the spatial dimension through multiple multi-layer perceptrons of the video generation model, and the feature map of each time step is learned and extracted in the temporal dimension. The pure multi-layer perceptron architecture reduces the complexity of the video generation model and reduces the computing resources, so that it is more efficient in computing, and the time required for the training process of the video generation model proposed in this application is shorter. The video generation model proposed in this application solves the problem that the diffusion model training based on the attention mechanism in the prior art consumes a lot of computing resources and has a slow training speed under the condition of less parameters and computing amount, and realizes the generation of high-quality visual content at a lower computing cost.
[0037] In some embodiments, based on the initial feature maps of the video frames of each predicted video, the target feature maps of the video frames of each predicted video are determined, including: normalizing the initial feature maps of the video frames of each predicted video to obtain the normalized feature maps of the video frames of each predicted video; linearizing the target normalized feature maps of the video frames of each predicted video to obtain the linearization results of the video frames of each predicted video; and reshaping the feature maps of the linearization results of the video frames of each predicted video to obtain the target feature maps of the video frames of each predicted video.
[0038] In some embodiments, the video generation model also includes a normalization layer, a feature linear mapping layer, and a reshaping layer. The initial feature map of the video frame of each predicted video is input into the normalization layer for normalization processing, and the numerical value in the feature map is adjusted to a uniform scale range, which can eliminate the dimension differences and numerical range differences between different features, and obtain the normalized feature map of the video frame of each predicted video, which helps to stabilize the training process and accelerate the convergence of the video generation model. The normalized feature map of the video frame of each predicted video is input into the feature linear mapping layer for linearization processing, and the linear combination of the normalized feature maps of the input video frames of each predicted video is extracted to form a higher level of abstract feature representation, and the linearization processing results of the video frames of each predicted video are obtained. The reshape() function can be used to reshape the feature map of the linearization processing results of the video frames of each predicted video, and the shape (height, width, number of channels) of the input feature map is adjusted to meet the requirements of subsequent processing such as the input format of the decoder, and the target feature map of the video frame of each predicted video is obtained. By reshaping the feature maps of the linearized processing results of the video frames of each predicted video, the target feature maps of the video frames of each predicted video can be correctly and reasonably used to predict and generate the video frames. The above normalization, linearization and reshaping work together to improve the performance of the video generation model and the accuracy of prediction.
[0039] refer to Figure 3, if the video generation model includes three multi-layer perceptrons, the video generation model includes: a first feature embedding layer 301, a second feature embedding layer 302, a first multi-layer perceptron 303, a second multi-layer perceptron 304, a third multi-layer perceptron 305, a normalization layer 306, a feature linear mapping layer 307, a reshaping layer 308, and a decoder 309. The training video frames of each training video are input into the first feature embedding layer 301 for feature embedding to obtain feature maps of the training video frames of each training video, and multiple time steps of the video generation model are input into the second feature embedding layer 302 for feature embedding to obtain feature maps of each time step. When performing the first diffusion process, the feature graph of the first time step and the feature graph of the training video frame of each training video are input into the first multilayer perceptron 303 of the video generation model for nonlinear transformation to obtain the output result of the first multilayer perceptron; the output result of the first multilayer perceptron, the feature graph of the first time step and the feature graph of the training video frame of each training video are input into the second multilayer perceptron 304 of the video generation model for nonlinear transformation to obtain the output result of the second multilayer perceptron; the output result of the second multilayer perceptron, the feature graph of the first time step and the feature graph of the training video frame of each training video are input into the third multilayer perceptron 404 of the video generation model for nonlinear transformation to obtain the output result of the third multilayer perceptron, i.e., the result of the first diffusion process. Referring to the first diffusion process, the feature graph of each time step and the feature graph of the training video frame of each training video are input into multiple multilayer perceptrons of the video generation model, and multiple iterative diffusion processes are performed on the feature graph of each time step and the feature graph of the training video frame of each training video based on each multilayer perceptron to obtain the initial feature graphs of the video frames of the corresponding multiple predicted videos. The initial feature map of the video frame of each predicted video is input to the normalization layer 306 for normalization processing to obtain the normalized feature map of the video frame of each predicted video, and the normalized feature map of the video frame of each predicted video is input to the feature linear mapping layer 307 for linearization processing to obtain the linearization processing result of the video frame of each predicted video, and the linearization processing result of the video frame of each predicted video is input to the reshaping layer 308 for reshaping to obtain the target feature map of the video frame of each predicted video. The target feature map of the video frame of each predicted video is input to the decoder 309 for decoding processing to obtain the video frame of each predicted video. The video generation model proposed in this application uses a pure multi-layer perceptron architecture for the generation task of video content without introducing an attention mechanism and a convolutional layer. The feature map of the video frame is learned and extracted feature information in the spatial dimension through multiple multi-layer perceptrons of the video generation model, and the feature map of each time step is learned and extracted feature information in the temporal dimension. The pure multi-layer perceptron architecture reduces the complexity of the video generation model, reduces computing resources, and is more efficient in computing. The training process of the video generation model proposed in this application requires a shorter time.The above is an embodiment of the present application. The present application does not limit the number of multi-layer perceptrons in the video generation model. In actual application, the number of multi-layer perceptrons in the video generation model can be set according to actual needs.
[0040] In some embodiments, the multilayer perceptron includes a first temporal information mixing layer, a first spatial information mixing layer, a second temporal information mixing layer, and a second spatial information mixing layer, and each multilayer perceptron performs multiple iterative diffusion processes on the feature graphs of each time step and the feature graphs of the training video frames of each training video to obtain the initial feature graphs of the video frames of the corresponding multiple predicted videos, including: performing temporal information fusion processing on the output result of the previous multilayer perceptron or the feature graphs of the training video frames of each training video with the feature graphs of each time step according to the first temporal information mixing layer of each multilayer perceptron, and obtaining the processing result of the first temporal information mixing layer of each multilayer perceptron; performing processing on the first temporal information mixing layer of each multilayer perceptron according to the first spatial information mixing layer of each multilayer perceptron The results are subjected to spatial information fusion processing with the feature maps of the training video frames of each training video to obtain the processing results of the first spatial information mixing layer of each multilayer perceptron; according to the second temporal information mixing layer of each multilayer perceptron, the processing results of the first spatial information mixing layer of each multilayer perceptron are subjected to temporal information fusion processing with the feature maps of each time step to obtain the processing results of the second temporal information mixing layer of each multilayer perceptron; according to the second spatial information mixing layer of each multilayer perceptron, the processing results of the second temporal information mixing layer of each multilayer perceptron are subjected to spatial information fusion processing with the feature maps of the training video frames of each training video to obtain the output results of each multilayer perceptron, and the output result of the last multilayer perceptron is determined as the initial feature map of the video frame of each predicted video.
[0041] In some embodiments, the video generation model includes a plurality of multilayer perceptrons, each of which has the same structure, and each multilayer perceptron includes a first temporal information mixing layer, a first spatial information mixing layer, a second temporal information mixing layer, and a second spatial information mixing layer. For each multilayer perceptron, if the multilayer perceptron is not the first multilayer perceptron in the video generation model, the first temporal information mixing layer of the multilayer perceptron is used to perform temporal information fusion processing on the output result of the previous multilayer perceptron and the feature graphs of each time step, and obtain the processing result of the first temporal information mixing layer of the multilayer perceptron. If the multilayer perceptron is the first multilayer perceptron in the video generation model, the first temporal information mixing layer of the multilayer perceptron is used to perform temporal information fusion processing on the feature graphs of the training video frames of each training video and the feature graphs of each time step, and obtain the processing result of the first temporal information mixing layer of the multilayer perceptron. Through the first time series information mixing layer of each multi-layer perceptron, the output result of the previous multi-layer perceptron (or the feature map of the training video frame of each training video) is fused with the feature map of the time step to extract and integrate the key information in time series. Through the fusion processing of time series information, the video generation model can learn the time dependency between video frames, which helps to understand the dynamic changes or motion trajectories in the training video.
[0042] In some embodiments, the processing result of the first temporal information mixing layer of the multilayer perceptron and the feature graphs of the training video frames of each training video are subjected to spatial information fusion processing through the first spatial information mixing layer of the multilayer perceptron, and the spatial information is further fused to capture the spatial structure and features in the training video frames, thereby obtaining the processing result of the first spatial information mixing layer of the multilayer perceptron. Performing spatial information fusion through the first spatial information mixing layer helps the video generation model understand the content in the training video frames, and helps to more accurately generate video frames of the predicted video.
[0043] In some embodiments, the processing results of the first spatial information mixing layer of the multilayer perceptron and the feature graphs of each time step are subjected to temporal information fusion processing through the second temporal information mixing layer of the multilayer perceptron to obtain the processing results of the second temporal information mixing layer of the multilayer perceptron. The temporal features of the video frames are further optimized through the second spatial information mixing layer to extract the information of the training video in the time dimension, which helps the video generation model to more deeply capture the temporal dependency between video frames and improve the accuracy of the prediction.
[0044] In some embodiments, the processing result of the second temporal information mixing layer of the multilayer perceptron and the feature graph of the training video frame of each training video are subjected to spatial information fusion processing by the second spatial information mixing layer of the multilayer perceptron, and the spatial information is further fused to capture the spatial structure and features in the training video frame, so as to obtain the processing result of the second spatial information mixing layer of the multilayer perceptron. Performing spatial information fusion again by the second spatial information mixing layer helps the video generation model to better understand the content in the training video frame and more accurately generate the video frame of the predicted video. The multilayer perceptron performs feature fusion and feature extraction on the feature graph of each training video frame of each training video and the feature graph of each time step, and alternately extracts fusion feature information in the temporal and spatial dimensions. The above-mentioned first temporal information mixing layer and the second temporal information mixing layer have the same structure, and the first spatial information mixing layer and the second spatial information mixing layer have the same structure. The alternating spatial information mixing layer and the temporal information mixing layer in the multilayer perceptron extract features of the input feature information in the spatial dimension and the temporal dimension, systematically integrate the features of the video frame in the time and space dimensions, and construct a comprehensive spatiotemporal feature representation, which helps to generate consistent visual content in the spatiotemporal dimensions. The output result of the last multi-layer perceptron obtained by the last diffusion process is determined as the initial feature map of the video frame of each predicted video. The initial feature map of the video frame of the predicted video contains both temporal information and spatial information, providing rich feature representation for subsequent decoding processing.
[0045] refer to Figure 4, the first multilayer perceptron 303 includes: a first temporal information mixing layer 401, a first spatial information mixing layer 402, a second temporal information mixing layer 403 and a second spatial information mixing layer 304. The feature graphs of each training video frame of each training video and the feature graphs of each time step are input into the first temporal information mixing layer 401 for temporal information fusion processing to obtain the processing result of the first temporal information mixing layer of the first multilayer perceptron. The processing result of the first temporal information mixing layer of the first multilayer perceptron and the feature graphs of the training video frames of each training video are input into the first spatial information mixing layer 402 for spatial information fusion processing to obtain the processing result of the first spatial information mixing layer of the first multilayer perceptron. The processing result of the first spatial information mixing layer of the first multilayer perceptron and the feature graphs of each time step are input into the second temporal information mixing layer 403 for temporal information fusion processing to obtain the processing result of the second temporal information mixing layer of the first multilayer perceptron. The processing result of the second temporal information mixing layer of the first multilayer perceptron and the feature graphs of the training video frames of each training video are input into the second spatial information mixing layer 404 for spatial information fusion processing to obtain the output result of the first multilayer perceptron. The feature maps of each training video frame and each time step of each training video are fused and extracted by a multi-layer perceptron, and the fused feature information is extracted alternately in the temporal and spatial dimensions. The alternating spatial information mixing layer and temporal information mixing layer in the multi-layer perceptron extract features of the input feature information in the spatial and temporal dimensions, which helps to generate consistent visual content in the spatial and temporal dimensions.
[0046] In some embodiments, according to the first spatial information mixing layer of each multilayer perceptron, spatial information fusion processing is performed on the processing results of the first temporal information mixing layer of each multilayer perceptron and the feature map of the training video frame of each training video to obtain the processing results of the first spatial information mixing layer of each multilayer perceptron, including: adding the processing results of the first temporal information mixing layer of each multilayer perceptron and the feature map of the training video frame of each training video to obtain the first fused feature map of the training video frame of each training video; normalizing the first fused feature map of the training video frame of each training video to obtain the first normalized feature map of the training video frame of each training video; The first normalized feature map of the training video frame of each training video is nonlinearly transformed to obtain the first nonlinear processing result of the training video frame of each training video; the first nonlinear processing result of the training video frame of each training video and the feature map of the training video frame of each training video are added to obtain the second fused feature map of the training video frame of each training video; the second fused feature map of the training video frame of each training video is normalized to obtain the second normalized feature map of the training video frame of each training video; the second normalized feature map of the training video frame of each training video is nonlinearly transformed to obtain the processing result of the first spatial information mixing layer of each multi-layer perceptron.
[0047] In some embodiments, reference Figure 5, the first spatial information mixing layer 402 includes: a first normalization layer 501, a first multi-layer perceptron unit 502, a second normalization layer 503, and a second multi-layer perceptron unit 504. The first multi-layer perceptron unit 502 and the second multi-layer perceptron unit 504 are both the most basic multi-layer perceptrons, including an input layer, a hidden layer, and an output layer. The processing result of the first temporal information mixing layer of the multi-layer perceptron is added to the feature map of the training video frame of each training video, and the temporal information and spatial information (feature map of the training video frame of each training video) input by the first temporal information mixing layer are preliminarily fused, and the information after temporal processing is directly combined with the spatial features, and the information of two different dimensions is preliminarily integrated to obtain the first fused feature map of the training video frame of each training video. The first fused feature map of the training video frame of each training video is input into the first normalization layer 501 for normalization processing to obtain the first normalized feature map of the training video frame of each training video, which helps to eliminate the data distribution difference in the feature map, so that different features are comparable, and at the same time, the feature value falls into a reasonable numerical range to avoid instability or information distortion caused by excessive or too small values in subsequent calculations. The first normalized feature map of the training video frame of each training video is input into the first multi-layer perceptron unit 502 for nonlinear transformation to obtain the first nonlinear processing result of the training video frame of each training video. Nonlinear transformation can enhance the nonlinear expression ability of the video generation model, so that the video generation model can learn and represent more complex and higher-level spatial features, which helps the video generation model to better understand the content of the video frame. The first nonlinear processing result of the training video frame of each training video and the feature map of the training video frame of each training video are added to obtain the second fused feature map of the training video frame of each training video, and the features after nonlinear transformation and the feature map of the training video frame of the training video are further fused to strengthen the key spatial features and retain the useful information in the feature map of the input training video frame. The second fused feature map of the training video frame of each training video is input into the second normalization layer 503 for normalization processing to obtain the second normalized feature map of the training video frame of each training video, which helps to eliminate data distribution differences and makes the feature map more suitable for subsequent nonlinear processing. The second normalized feature map of the training video frame of each training video is input into the second multi-layer perceptron unit 504 for nonlinear transformation to obtain the processing result of the first spatial information mixing layer of each multi-layer perceptron, which can further extract and integrate spatial features to obtain a more accurate and richer feature representation, which helps the video generation model to more comprehensively understand the spatial structure and dynamic changes of the video frame, thereby generating a more accurately predicted video frame. It should be noted that the structure of the first spatial information mixing layer in each multi-layer perceptron is the same.
[0048] In some embodiments, according to the second temporal information mixing layer of each multilayer perceptron, the processing results of the first spatial information mixing layer of each multilayer perceptron are subjected to temporal information fusion processing with the feature graphs of each time step to obtain the processing results of the second temporal information mixing layer of each multilayer perceptron, including: adding the processing results of the first spatial information mixing layer of each multilayer perceptron and the feature graphs of each time step to obtain a third fused feature graph of the training video frame of each training video; normalizing the third fused feature graph of the training video frame of each training video to obtain a third normalized feature graph of the training video frame of each training video; The third normalized feature map of the training video frame of the video is nonlinearly transformed to obtain the second nonlinear processing result of the training video frame of each training video; the second nonlinear processing result of the training video frame of each training video and the feature map of each time step are added to obtain the fourth fused feature map of the training video frame of each training video; the fourth fused feature map of the training video frame of each training video is normalized to obtain the fourth normalized feature map of the training video frame of each training video; the fourth normalized feature map of the training video frame of each training video is nonlinearly transformed to obtain the processing result of the second temporal information mixing layer of each multi-layer perceptron.
[0049] refer to Figure 6, the second temporal information mixing layer 403 includes: a third normalization layer 601, a third multi-layer perceptron unit 602, a fourth normalization layer 603, and a fourth multi-layer perceptron unit 604. The third multi-layer perceptron unit 602 and the fourth multi-layer perceptron unit 604 are both the most basic multi-layer perceptrons, including an input layer, a hidden layer, and an output layer. The processing result of the first spatial information mixing layer of the multi-layer perceptron and the feature map of the time step are added to fuse the spatial information and the temporal information to obtain the third fused feature map of the training video frame of each training video. Through the addition operation, the video generation model can simultaneously consider the spatial structure of the video frame and the temporal characteristics of the current time step, providing a basis for subsequent temporal information fusion. The third fused feature map of the training video frame of each training video is input into the third normalization layer 601 for normalization processing to obtain the third normalized feature map of the training video frame of each training video. Normalization processing helps the fused feature value to be within a reasonable range, avoids numerical overflow or undersaturation problems, and is conducive to the stable progress of subsequent calculations. The third normalized feature map of the training video frame of each training video is input into the third multi-layer perceptron unit 602 for nonlinear transformation, so as to increase the expression ability of the video generation model, capture the nonlinear relationship between the spatiotemporal features, extract a higher level of feature representation, and obtain the second nonlinear processing result of the training video frame of each training video. The second nonlinear processing result of the training video frame of each training video is added to the feature map of the time step, and the features after the nonlinear transformation are further integrated with the current temporal features (the feature map of the time step), and the key information in the feature map of the time step is strengthened. At the same time, the spatial and temporal features after the nonlinear transformation are retained, and a deeper and more comprehensive spatiotemporal fusion feature is obtained, that is, the fourth fusion feature map of the training video frame of each training video. The fourth fusion feature map of the training video frame of each training video is input into the fourth normalization layer 603 for normalization processing to obtain the fourth normalized feature map of the training video frame of each training video, which is helpful to maintain the numerical stability and consistency of the feature scale, and provide good input conditions for subsequent nonlinear transformation. The fourth normalized feature map of the training video frame of each training video is input into the fourth multi-layer perceptron unit 604 for nonlinear transformation, so as to further enhance the deep nonlinear modeling capability of the feature map of the video generation model, learn and extract features from the information of the input video frame in the temporal dimension, and obtain the processing result of the second temporal information mixing layer of the multi-layer perceptron. Through the above series of temporal information fusion processing, the processing result of the second temporal information mixing layer of the multi-layer perceptron is obtained, and the information of the video frame of the input training video is learned and extracted in the temporal dimension, which helps the video generation model to have a deeper understanding of the temporal changes of the video frame, thereby generating a more accurate predicted video frame. It should be noted that the structure of the second spatial information mixing layer in each multi-layer perceptron is the same.
[0050] In some embodiments, after updating the parameters of the video generation model according to the loss value, it also includes: obtaining a description text and multiple noise maps; inputting the description text and each noise map into the video generation model, performing feature embedding on the description text to obtain a feature map of the description text, performing feature embedding on each noise map to obtain a feature map of each noise map, and performing feature embedding on multiple time steps of the video generation model to obtain a feature map of each time step; inputting the feature map of each time step, the feature map of the description text, and the feature map of each time step into each multi-layer perceptron of the video generation model, performing multiple iterative diffusion processing on the feature map of each noise map, the feature map of each time step, and the feature map of the description text based on each multi-layer perceptron to obtain initial feature maps of multiple video frames of the target video containing a temporal relationship; determining feature maps of multiple video frames of the target video based on the initial feature maps of each video frame of the target video; decoding the feature maps of multiple video frames of the target video to obtain the target video.
[0051] In some embodiments, a description text and multiple noise maps are obtained. The description text is a text description of the target video, which can be used as a semantic guide for generating the target video. The multiple noise maps can be Gaussian noise maps, which are the initial random input for video generation. The noise map contains randomly distributed pixel values, which are used for the video generation model to gradually construct meaningful video frames in multiple diffusion processes. The description text and each noise map are input into the video generation model, and feature embedding is performed on the description text to convert the description text into a numerical form that the video generation model can understand, that is, a feature map of the description text. Feature embedding is performed on each noise map to convert each noise map into a numerical form that the video generation model can understand, that is, a feature map of each noise map. Learnable feature embedding is performed on multiple time steps to obtain feature maps of each time step. The feature maps of each time step help the video generation model understand the specific details of the current stage at each time step, so as to better denoise. The feature maps of each time step can provide the video generation model with key information for denoising at each time step, which helps the video generation model better understand the evolution of the data and ultimately generate high-quality target videos. The feature graphs of each time step, the feature graphs of the description text and the feature graphs of each time step are input into each multi-layer perceptron of the video generation model. Based on each multi-layer perceptron, the feature graphs of each noise graph, the feature graphs of each time step and the feature graphs of the description text are subjected to multiple iterative diffusion processing, and the above information is fused and extracted at different levels. Through multiple iterations, the video content matching the description text can be gradually extracted from the noise graph. At the same time, considering the temporal relationship, it is helpful to have coherence and rationality between the generated video frames, and the initial feature graphs of multiple video frames of the target video containing the temporal relationship are obtained. A series of adjustments are made to the initial feature graphs of the multiple video frames of the target video, which may include normalization processing, linear transformation and reshaping, to obtain the feature graphs of the multiple video frames of the target video for subsequent decoding processing. The feature graphs of the multiple video frames of the target video are decoded, and the feature graphs of the multiple video frames of the target video are converted back to the image space, that is, the actual video frames are generated to obtain the target video. The target video is generated according to the description text and the noise graph, and has the content and temporal relationship consistent with the description text. The video generation model of the present application performs diffusion processing based on multiple multi-layer perceptrons without introducing attention mechanisms and convolutional layers. Compared with diffusion models based on convolutional neural networks and self-attention mechanisms, the video generation model of the present application has fewer parameters and computational complexity, and can generate high-quality visual content at a lower computational cost.
[0052] In some embodiments, the video generation model also includes a decoder, which decodes feature maps of multiple video frames of the target video to obtain the target video, including: inputting the feature maps of multiple video frames of the target video into the decoder, decoding the feature maps of each video frame of the target video based on the decoder to obtain each video frame of the target video; arranging each video frame of the target video based on the temporal relationship between each video frame of the target video to generate the target video.
[0053] In some embodiments, the decoder is a neural network structure specially designed to convert feature maps back into videos. The decoder can be a variational self-decoder. The feature maps of multiple video frames of the target video are input into the decoder, and the image details are reversely constructed. Clear video frames can be gradually restored from the underlying texture to the high-level structure. The feature maps of multiple video frames of the highly abstract and compressed target video are gradually restored to the individual video frames of the target video with actual pixel values and temporal relationships. According to the order between the various video frames of the target video, the various video frames of the decoded target video are arranged to generate a continuous video stream. Each video frame is played in sequence according to its position on the timeline to form a target video with a smooth dynamic effect. The target video remains smooth and coherent in the transition between video frames, which conforms to the user's habit and expectations of watching videos.
[0054] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present application, which will not be described one by one here.
[0055] The following is an embodiment of the device of the present application, which can be used to execute the embodiment of the method of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the method of the present application.
[0056] Figure 7 Schematic diagram of a training device for a video generation model provided in an embodiment of the present application. Figure 7 As shown, the training device of the video generation model includes: An acquisition module 701 is used to acquire a training set, where the training set includes a plurality of training samples, and the training samples include a plurality of training video frames of a training video; A feature embedding module 702 is used to input each training sample into a video generation model, perform feature embedding on a training video frame of each training video, and obtain a feature map of the training video frame of each training video; A time step encoding module 703 is used to embed features of multiple time steps of the video generation model to obtain feature maps of each time step; Diffusion module 704, used for inputting the feature graphs of each time step and the feature graphs of the training video frames of each training video into multiple multi-layer perceptrons of the video generation model, and performing multiple iterative diffusion processes on the feature graphs of each time step and the feature graphs of the training video frames of each training video based on each multi-layer perceptron, so as to obtain initial feature graphs of the video frames of the corresponding multiple predicted videos; A determination module 705, configured to determine a target feature map of a video frame of each predicted video according to an initial feature map of a video frame of each predicted video; A decoding module 706, configured to decode the target feature map of each predicted video frame to obtain each video frame of each predicted video; The updating module 707 is used to calculate the loss value of the video generation model based on each video frame of each prediction video and each training video frame of each training video, and update the parameters of the video generation model according to the loss value.
[0057] According to the technical solution provided by the embodiment of the present application, by obtaining a training set, the training set includes multiple training samples, each sample includes multiple training video frames of a training video, and the multiple training video frames of a training video are the target of video generation model learning. The video generation model learns how to generate multiple video frames of a predicted video close to the multiple training video frames of the training video based on the training set during the training stage. Input each training sample into the video generation model, map the training video frames of each training video to the feature space of a specified dimension through feature embedding, compress the high-dimensional pixel information into the low-dimensional feature space, and obtain the feature map of the training video frame of each training video, which is convenient for the subsequent further processing and learning of the video generation model. The time step of the video generation model can represent the discrete time interval when the video generation model generates or reconstructs the video frame. In the diffusion processing process of the video generation model, each time step corresponds to the video generation model gradually recovering the information content of the training video frame. Perform a learnable embedding on multiple time steps to obtain the feature map of each time step, and represent the time information in numerical form, which helps the video generation model to understand the specific details of the current stage at each time step stage, so as to better perform diffusion processing and generate multiple video frames of the predicted video. The feature maps of each time step and the feature maps of the training video frames of each training video are input into the multiple multi-layer perceptrons of the video generation model. The feature maps of each time step and the feature maps of the training video frames of each training video are iteratively diffused multiple times by the multiple multi-layer perceptrons of the video generation model to obtain the initial feature maps of the corresponding multiple predicted video frames, and the generation process of the predicted video frames is simulated. The temporal dependency and spatial correlation between the video frames are learned in the diffusion process, which is helpful to generate video frames with coherence and consistency. Without introducing the attention mechanism and convolution layer, the multiple multi-layer perceptrons of the video generation model learn and extract feature information in the spatial dimension of the feature maps of the training video frames of each training video, and learn and extract feature information in the temporal dimension of the feature maps of each time step. Iterative diffusion processing is performed through the architecture of the pure multi-layer perceptron to simulate the generation of multiple video frames of the predicted video, which is helpful to generate the predicted video with consistency in spatiotemporal information. Based on the initial feature maps of the video frames of each predicted video, the ideal feature representation of each predicted video frame is determined through some optimization processes, that is, the target feature map of the video frame of each predicted video. The target feature map of each predicted video frame is decoded, and the feature representation learned by the video generation model is converted into a visualized video frame, that is, each video frame of each predicted video, so as to be compared with the training video frames of each real training video. The loss value between each predicted video frame and the corresponding training video frame is calculated. The loss value can measure the gap between the predicted result of the video generation model and the real result.According to the loss value, the parameters of the video generation model can be updated through the back propagation algorithm, so that the video generation model can more accurately generate the video frames of the predicted video in the next round of iteration, and gradually predict the distribution close to the real data during the training process. The video generation model proposed in this application uses a pure multi-layer perceptron architecture for the generation task of video content without introducing the attention mechanism and convolution layer. The feature map of the video frame is learned and extracted in the spatial dimension through multiple multi-layer perceptrons of the video generation model, and the feature map of each time step is learned and extracted in the temporal dimension. The pure multi-layer perceptron architecture reduces the complexity of the video generation model and reduces the computing resources, so that it is more efficient in computing, and the time required for the training process of the video generation model proposed in this application is shorter. The video generation model proposed in this application solves the problem that the diffusion model training based on the attention mechanism in the prior art consumes a lot of computing resources and has a slow training speed under the condition of less parameters and computing amount, and realizes the generation of high-quality visual content at a lower computing cost.
[0058] In some embodiments, the determination module 705 is configured to normalize the initial feature maps of the video frames of each predicted video to obtain the normalized feature maps of the video frames of each predicted video; linearize the target normalized feature maps of the video frames of each predicted video to obtain the linearization results of the video frames of each predicted video; and reshape the feature maps of the linearization results of the video frames of each predicted video to obtain the target feature maps of the video frames of each predicted video.
[0059] In some embodiments, the multilayer perceptron includes a first temporal information mixing layer, a first spatial information mixing layer, a second temporal information mixing layer, and a second spatial information mixing layer. The diffusion module 704 is configured to perform temporal information fusion processing on the output result of the previous multilayer perceptron or the feature map of the training video frame of each training video and the feature map of each time step according to the first temporal information mixing layer of each multilayer perceptron to obtain the processing result of the first temporal information mixing layer of each multilayer perceptron; perform spatial information fusion processing on the processing result of the first temporal information mixing layer of each multilayer perceptron and the feature map of the training video frame of each training video according to the first spatial information mixing layer of each multilayer perceptron. The processing results of the first spatial information mixing layer of each multilayer perceptron are obtained; according to the second temporal information mixing layer of each multilayer perceptron, the processing results of the first spatial information mixing layer of each multilayer perceptron are subjected to temporal information fusion processing with the feature graph of each time step to obtain the processing results of the second temporal information mixing layer of each multilayer perceptron; according to the second spatial information mixing layer of each multilayer perceptron, the processing results of the second temporal information mixing layer of each multilayer perceptron are subjected to spatial information fusion processing with the feature graph of the training video frame of each training video to obtain the output results of each multilayer perceptron, and the output result of the last multilayer perceptron is determined as the initial feature graph of the video frame of each predicted video.
[0060] In some embodiments, the diffusion module 704 is configured to add the processing results of the first temporal information mixing layer of each multilayer perceptron and the feature maps of the training video frames of each training video to obtain the first fused feature maps of the training video frames of each training video; normalize the first fused feature maps of the training video frames of each training video to obtain the first normalized feature maps of the training video frames of each training video; perform nonlinear transformation on the first normalized feature maps of the training video frames of each training video to obtain the first nonlinear processing results of the training video frames of each training video; add the first nonlinear processing results of the training video frames of each training video and the feature maps of the training video frames of each training video to obtain the second fused feature maps of the training video frames of each training video; normalize the second fused feature maps of the training video frames of each training video to obtain the second normalized feature maps of the training video frames of each training video; perform nonlinear transformation on the second normalized feature maps of the training video frames of each training video to obtain the processing results of the first spatial information mixing layer of each multilayer perceptron.
[0061] In some embodiments, the diffusion module 704 is configured to add the processing results of the first spatial information mixing layer of each multilayer perceptron and the feature maps of each time step to obtain a third fused feature map of the training video frame of each training video; normalize the third fused feature map of the training video frame of each training video to obtain a third normalized feature map of the training video frame of each training video; perform a nonlinear transformation on the third normalized feature map of the training video frame of each training video to obtain a second nonlinear processing result of the training video frame of each training video; add the second nonlinear processing result of the training video frame of each training video and the feature maps of each time step to obtain a fourth fused feature map of the training video frame of each training video; normalize the fourth fused feature map of the training video frame of each training video to obtain a fourth normalized feature map of the training video frame of each training video; perform a nonlinear transformation on the fourth normalized feature map of the training video frame of each training video to obtain the processing result of the second temporal information mixing layer of each multilayer perceptron.
[0062] In some embodiments, after updating the parameters of the video generation model according to the loss value, the training device of the video generation model is configured to obtain a description text and multiple noise maps; input the description text and each noise map into the video generation model, perform feature embedding on the description text to obtain a feature map of the description text, perform feature embedding on each noise map to obtain a feature map of each noise map, and perform feature embedding on multiple time steps of the video generation model to obtain a feature map of each time step; input the feature map of each time step, the feature map of the description text, and the feature map of each time step into each multi-layer perceptron of the video generation model, perform multiple iterative diffusion processing on the feature map of each noise map, the feature map of each time step, and the feature map of the description text based on each multi-layer perceptron, and obtain initial feature maps of multiple video frames of the target video containing a temporal relationship; determine the feature maps of multiple video frames of the target video based on the initial feature maps of each video frame of the target video; and decode the feature maps of multiple video frames of the target video to obtain the target video.
[0063] In some embodiments, the training device of the video generation model is configured to input feature maps of multiple video frames of the target video into a decoder, decode the feature maps of each video frame of the target video based on the decoder to obtain each video frame of the target video; arrange each video frame of the target video based on the temporal relationship between each video frame of the target video to generate the target video.
[0064] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0065] Figure 8 Schematic diagram of an electronic device 8 provided in an embodiment of the present application. Figure 8 As shown, the electronic device 8 of this embodiment includes: a processor 801, a memory 802, and a computer program 803 stored in the memory 802 and executable on the processor 801. When the processor 801 executes the computer program 803, the steps in the above-mentioned method embodiments are implemented. Alternatively, when the processor 801 executes the computer program 803, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0066] The electronic device 8 may be a desktop computer, a notebook, a PDA, a cloud server, or other electronic device. The electronic device 8 may include, but is not limited to, a processor 801 and a memory 802. Those skilled in the art will appreciate that Figure 8 The electronic device 8 is merely an example and does not limit the electronic device 8 . The electronic device 8 may include more or fewer components than those shown in the figure, or different components.
[0067] The processor 801 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0068] The memory 802 may be an internal storage unit of the electronic device 8, for example, a hard disk or memory of the electronic device 8. The memory 802 may also be an external storage device of the electronic device 8, for example, a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 8. The memory 802 may also include both an internal storage unit of the electronic device 8 and an external storage device. The memory 802 is used to store computer programs and other programs and data required by the electronic device.
[0069] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units.
[0070] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium (such as a computer-readable storage medium). Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. The computer program may include computer program code, which may be in source code form, object code form, executable file or some intermediate form. The computer-readable storage medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0071] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A video generation model training method, characterized in that: include: Acquire a training set, wherein the training set includes a plurality of training samples, and the training samples include a plurality of training video frames of a training video; Inputting each of the training samples into the video generation model, performing feature embedding on the training video frames of each of the training videos, and obtaining feature maps of the training video frames of each of the training videos; Performing feature embedding on multiple time steps of the video generation model to obtain feature graphs of each of the time steps; Inputting the feature graphs of each time step and the feature graphs of each training video frame of the training video into multiple multi-layer perceptrons of the video generation model, performing multiple iterative diffusion processes on the feature graphs of each time step and the feature graphs of each training video frame of the training video based on each multi-layer perceptron, to obtain initial feature graphs of the video frames of the corresponding multiple predicted videos; Determining target feature maps of video frames of each predicted video according to the initial feature maps of the video frames of each predicted video; Decoding the target feature map of each video frame of the predicted video to obtain each video frame of the predicted video; The loss value of the video generation model is calculated based on each video frame of each predicted video and each training video frame of each training video, and the parameters of the video generation model are updated according to the loss value.
2. The method according to claim 1, characterized in that The multilayer perceptron includes a first temporal information mixing layer, a first spatial information mixing layer, a second temporal information mixing layer, and a second spatial information mixing layer. The multilayer perceptrons perform multiple iterative diffusion processes on the feature graphs of each time step and the feature graphs of the training video frames of each training video to obtain initial feature graphs of the corresponding multiple predicted video frames, including: According to the first time series information mixing layer of each of the multilayer perceptrons, a time series information fusion process is performed on the output result of the previous multilayer perceptron or the feature graph of the training video frame of each of the training videos and the feature graph of each of the time steps to obtain a processing result of the first time series information mixing layer of each of the multilayer perceptrons; According to the first spatial information mixing layer of each of the multilayer perceptrons, spatial information fusion processing is performed on the processing results of the first temporal information mixing layer of each of the multilayer perceptrons and the feature graphs of the training video frames of each of the training videos to obtain the processing results of the first spatial information mixing layer of each of the multilayer perceptrons; According to the second time series information mixing layer of each of the multilayer perceptrons, performing time series information fusion processing on the processing results of the first spatial information mixing layer of each of the multilayer perceptrons and the feature graphs of each of the time steps, to obtain the processing results of the second time series information mixing layer of each of the multilayer perceptrons; According to the second spatial information mixing layer of each of the multilayer perceptrons, spatial information fusion processing is performed on the processing results of the second temporal information mixing layer of each of the multilayer perceptrons and the feature maps of the training video frames of each of the training videos to obtain the output results of each of the multilayer perceptrons, and the output result of the last multilayer perceptron is determined as the initial feature map of the video frame of each of the predicted videos.
3. The method according to claim 2, characterized in that According to the first spatial information mixing layer of each of the multilayer perceptrons, spatial information fusion processing is performed on the processing results of the first temporal information mixing layer of each of the multilayer perceptrons and the feature graphs of the training video frames of each of the training videos to obtain the processing results of the first spatial information mixing layer of each of the multilayer perceptrons, including: Adding the processing results of the first time series information mixing layer of each of the multi-layer perceptrons and the feature maps of the training video frames of each of the training videos to obtain a first fused feature map of the training video frames of each of the training videos; Normalizing the first fused feature map of the training video frame of each of the training videos to obtain the first normalized feature map of the training video frame of each of the training videos; Performing a nonlinear transformation on the first normalized feature map of the training video frame of each of the training videos to obtain a first nonlinear processing result of the training video frame of each of the training videos; Adding the first nonlinear processing result of the training video frame of each of the training videos and the feature map of the training video frame of each of the training videos to obtain a second fused feature map of the training video frame of each of the training videos; Normalizing the second fused feature maps of the training video frames of each of the training videos to obtain second normalized feature maps of the training video frames of each of the training videos; A nonlinear transformation is performed on the second normalized feature map of the training video frame of each of the training videos to obtain a processing result of the first spatial information mixing layer of each of the multi-layer perceptrons.
4. The method according to claim 2, characterized in that: According to the second time series information mixing layer of each of the multilayer perceptrons, performing time series information fusion processing on the processing results of the first spatial information mixing layer of each of the multilayer perceptrons and the feature graphs of each of the time steps to obtain the processing results of the second time series information mixing layer of each of the multilayer perceptrons, includes: Adding the processing results of the first spatial information mixing layer of each of the multi-layer perceptrons and the feature maps of each of the time steps to obtain a third fused feature map of the training video frame of each of the training videos; Normalizing the third fused feature map of the training video frame of each of the training videos to obtain the third normalized feature map of the training video frame of each of the training videos; Performing a nonlinear transformation on the third normalized feature map of the training video frame of each of the training videos to obtain a second nonlinear processing result of the training video frame of each of the training videos; Adding the second nonlinear processing result of the training video frame of each of the training videos and the feature map of each of the time steps to obtain a fourth fused feature map of the training video frame of each of the training videos; Normalizing the fourth fused feature map of the training video frame of each of the training videos to obtain the fourth normalized feature map of the training video frame of each of the training videos; A nonlinear transformation is performed on the fourth normalized feature map of the training video frame of each of the training videos to obtain a processing result of the second temporal information mixing layer of each of the multilayer perceptrons.
5. The method according to claim 1, characterized in that Determining the target feature map of each video frame of the predicted video according to the initial feature map of each video frame of the predicted video includes: Normalizing the initial feature maps of the video frames of the predicted videos to obtain normalized feature maps of the video frames of the predicted videos; Performing linearization processing on the target normalized feature graph of each of the video frames of the predicted video to obtain linearization processing results of the video frames of each of the predicted videos; The linearization processing results of the video frames of the predicted videos are subjected to feature map reshaping to obtain target feature maps of the video frames of the predicted videos.
6. The method according to claim 1, characterized in that After updating the parameters of the video generation model according to the loss value, the method further includes: Get description text and multiple noise maps; Inputting the description text and each of the noise maps into the video generation model, performing feature embedding on the description text to obtain a feature map of the description text, performing feature embedding on each of the noise maps to obtain a feature map of each of the noise maps, and performing feature embedding on multiple time steps of the video generation model to obtain a feature map of each of the time steps; Inputting the feature graphs of each time step, the feature graphs of the description text, and the feature graphs of each time step into each multilayer perceptron of the video generation model, performing multiple iterative diffusion processes on the feature graphs of each noise image, the feature graphs of each time step, and the feature graphs of the description text based on each multilayer perceptron, to obtain initial feature graphs of multiple video frames of the target video containing a temporal relationship; Determining feature maps of multiple video frames of the target video according to the initial feature maps of each video frame of the target video; Decoding the feature maps of multiple video frames of the target video to obtain the target video.
7. The method according to claim 6, characterized in that The video generation model further includes a decoder, and the decoding process of the feature graphs of the plurality of video frames of the target video to obtain the target video includes: Inputting feature graphs of a plurality of video frames of the target video into the decoder, and performing decoding processing on the feature graphs of each video frame of the target video based on the decoder to obtain each video frame of the target video; The target video is generated by arranging the video frames of the target video based on the temporal relationship between the video frames of the target video.
8. A training device for a video generation model, characterized in that: include: An acquisition module, used to acquire a training set, wherein the training set includes a plurality of training samples, and the training samples include a plurality of training video frames of a training video; A feature embedding module, used to input each of the training samples into the video generation model, perform feature embedding on the training video frames of each of the training videos, and obtain feature maps of the training video frames of each of the training videos; A time step encoding module, used for embedding features of multiple time steps of the video generation model to obtain feature maps of each time step; A diffusion module, used for inputting the feature graphs of each time step and the feature graphs of each training video frame of the training video into multiple multi-layer perceptrons of the video generation model, and performing multiple iterative diffusion processes on the feature graphs of each time step and the feature graphs of each training video frame of the training video based on each multi-layer perceptron to obtain initial feature graphs of the video frames of the corresponding multiple predicted videos; A determination module, configured to determine a target feature map of each video frame of the predicted video according to an initial feature map of each video frame of the predicted video; A decoding module, used for decoding the target feature map of each video frame of the predicted video to obtain each video frame of the predicted video; An updating module is used to calculate the loss value of the video generation model based on each video frame of each predicted video and each training video frame of each training video, and update the parameters of the video generation model according to the loss value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Video generation method, device and apparatus and computer readable storage medium
CN113766310A
Video action clip generation method, system and device and readable storage medium
CN114339403A
Method and device for generating video clip from text description and sequence of key points synthesized by diffusion model
RU2823216C1
Cited By
Motion video generation method and device, electronic equipment and storage medium
CN120264038A
Video generation model training method and device, electronic equipment and storage medium
CN122534302A
Video generation model training method and device, electronic equipment and storage medium
CN122534302B
