MotionBooth framework-based customized object dynamic video generation method
By introducing the MotionBooth framework into text generation video technology, using subject area loss, video retention loss and subject token cross attention loss, combined with training-free technology to manage motion, the problem of inaccurate object and camera motion control in the existing technology is solved. , improving video quality and versatility, and reducing computational costs.
Patent Information
- Application Number
- CN202410834840.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-29
AI Technical Summary
Existing text generation video technology has problems such as inaccurate object motion and camera motion control, poor video quality, blurred background and static video when generating videos containing customized objects. It also has high computational cost, lacks versatility, and cannot adapt to a variety of movements. type of demand.
Adopting a customized object dynamic video generation method based on the MotionBooth framework, the object learning performance is enhanced by introducing subject area loss, video retention loss and subject token cross attention loss in the model learning and training stage, and is managed through no training technology in the inference stage Object and camera movement, build the MotionBooth framework to achieve precise control of object and camera movement.
It improves the quality of video generation, ensures the consistency of object appearance, reduces computing costs, enables control of multiple motion types without retraining, solves the problems of background blur and unnatural object movement, and significantly improves the efficiency of generated videos. Dynamic effects and control precision.
Smart Images

Figure CN118869902A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of text-generated video technology, and in particular to a customized object dynamic video generation method based on a MotionBooth framework. Background Art
[0002] With the rapid development of computer vision and generative artificial intelligence technology, text-to-video (T2V) technology has made significant progress. The process of text-to-video involves the technology of converting text content into video form. Existing technologies such as VideoBooth (Videobooth: Diffusion-based video generation with image prompts) generate short video clips by training image encoders to embed the appearance of objects, but the generated videos often show minimal or lack of motion; DreamVideo (Dreamvideo: Composing your dream videos with customized subject and motion) is fine-tuned for specific motion types, but it needs to be trained separately for each motion type, which is cumbersome and computationally expensive.
[0003] It can be said that the current T2V methods still face challenges when generating videos containing customized objects. For example, in view of the conflict between object learning and motion preservation, existing methods usually require additional motion learning for specific motion types, which undoubtedly increases the computational cost, and there are problems with background blur and static video when generating videos. It can be seen that the main shortcomings of existing methods include: 1) existing methods have imprecise control over object motion and camera motion; 2) the generated video quality is poor, the background is often blurred, and the object motion is unnatural; 3) lack of versatility and cannot adapt to the needs of various motion types. Summary of the invention
[0004] The purpose of the present invention is to provide a customized object dynamic video generation method based on the MotionBooth framework in order to overcome the defects of the above-mentioned prior art, and to propose a new MotionBooth framework for realizing dynamic video generation of customized objects, which can accurately control the movement of objects and cameras, maintain the consistency of the appearance of objects, improve the quality of generated videos, and reduce computational costs.
[0005] The purpose of the present invention can be achieved by the following technical solution: A customized object dynamic video generation method based on MotionBooth framework, comprising the following steps:
[0006] S1. Fine-tune the existing T2V model: In the model learning and training phase, introduce subject area loss, video retention loss, and subject token cross-attention loss to enhance subject learning performance. In the model inference phase, manage subject motion and camera motion through training-free technology to build the MotionBooth framework.
[0007] S2. Input the current text content into the MotionBooth framework and output the corresponding dynamic video.
[0008] Furthermore, the subject area loss in step S1 is specifically performed by extracting the subject mask of the training image to calculate the dot product of the binary mask in the latent space.
[0009] Furthermore, the calculation formula of the main area loss is:
[0010]
[0011] Among them, M is the binary mask of the training image, Ci is the fixed sentence format "a[V][class name]", z is the latent variable feature, ∈ is the sampled random noise, N(0,I) is the standard normal distribution, and t is the sampling denoising time step.
[0012] Furthermore, the video preservation loss in step S1 is specifically performed in a joint training process using common videos with titles, wherein image data sampling and video data sampling are performed alternately, and to avoid memory overflow, the Accelerate library is used for gradient accumulation training, and the gradient accumulation value is set to 2.
[0013] Furthermore, the calculation formula of the video retention loss is:
[0014]
[0015] Among them, Cv is the title of the video.
[0016] Furthermore, the subject token cross-attention loss in step S1 specifically introduces a special token "[V]" during the training process, and explicitly connects the token with the subject position on the cross-attention map, and ensures that the attention map is larger at the subject position and smaller outside the subject area through the binary cross-entropy loss.
[0017] Furthermore, the calculation formula of the subject token cross attention loss is:
[0018]
[0019] Among them, matrix A is the cross-attention layer feature extracted from the diffusion model, and the specific extraction location is the third layer of the encoder and the second layer of the decoder.
[0020] Furthermore, in the model inference stage in step S1, camera motion control is achieved by directly moving the noise latent variable, wherein the noise latent variable is translated according to the horizontal and vertical camera motion ratios input by the user; and subject motion control is also achieved by editing the cross-attention map.
[0021] Furthermore, the specific process of the camera motion control is:
[0022] 1. Calculate the moving distance of each step;
[0023] 2. Define the potential displacement distance on each frame;
[0024] 3. Avoid sampling tokens in the subject area according to the subject mask;
[0025] 4. Sample and fill the latent space horizontally and vertically in sequence;
[0026] 5. Finally, shift the original latent variables and fill the holes with the sampled tokens.
[0027] Furthermore, the specific process of the subject motion control is:
[0028] 1. Extract the cross-attention map of the subject position;
[0029] 2. Adjust the cross-attention value to control the subject position according to the bounding box sequence provided by the user;
[0030] 3. Use the adjusted cross-attention map when generating videos.
[0031] Compared with the prior art, the present invention has the following advantages:
[0032] The present invention uses a small number of object images to efficiently fine-tune the T2V model for accurately capturing the shape and attributes of the object, introduces subject area loss and video retention loss in the model learning and training stage, and combines subject token cross-attention loss to effectively enhance the subject learning effect; uses training-free technology to manage and control the movement of objects and cameras in the inference stage; thereby constructs a MotionBooth framework for realizing motion-controllable customized video generation, which can accurately control the movement of objects and cameras, making the generated video dynamically controllable, realizing multiple motion types without retraining, and controlling the movement without retraining, effectively reducing the computing cost; can improve the problems of background blur and unnatural object movement in the video generation process; can also effectively maintain the consistency of the appearance of the object, and improve the quality of the generated video.
[0033] In the present invention, the subject area loss is introduced, that is, the diffusion reconstruction loss is calculated only in the subject area, which can avoid background overfitting; the video preservation loss is introduced, that is, common videos with titles are used for joint training; the subject token cross attention loss is introduced, which can ensure that the attention map is larger at the subject position and smaller outside the subject area. This can greatly enhance the subject learning performance and thus improve the quality of the subsequent generated videos.
[0034] In the model inference stage, the present invention realizes camera motion control by directly moving the noise latent variables on the one hand, and realizes subject motion control by editing the cross-attention map on the other hand, thereby realizing a solution for controlling object and camera motion without training, which not only ensures the accuracy of control, but also can realize various motion types at low cost and high efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a schematic diagram of the method flow of the present invention;
[0036] Figure 2 Schematic diagram of the training and reasoning process of MotionBooth in the embodiment;
[0037] Figure 3 Schematic diagram of the camera motion control process in the embodiment. DETAILED DESCRIPTION
[0038] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0039] Example
[0040] like Figure 1 As shown, a customized object dynamic video generation method based on the MotionBooth framework includes the following steps:
[0041] S1. Fine-tune the existing T2V model: In the model learning and training phase, introduce subject area loss, video retention loss, and subject token cross-attention loss to enhance subject learning performance. In the model inference phase, manage subject motion and camera motion through training-free technology to build the MotionBooth framework.
[0042] S2. Input the current text content into the MotionBooth framework and output the corresponding dynamic video.
[0043] This embodiment applies the above solution and first builds the MotionBooth framework, such as Figure 2As shown in the figure, the training and reasoning process of MotionBooth mainly includes subject learning (training stage), camera control and subject motion control (reasoning stage). In the training stage, subject region loss (Subject Region Loss), video preservation loss (VideoPreservation Loss) and subject token cross-attention loss (Subject Token Cross-Attention Loss) are introduced to enhance the subject learning performance. Specifically:
[0044] 1. Subject Region Loss:
[0045] By extracting the subject mask of the training image (either manually or through a segmentation model), the dot product of the binary mask in the latent space is calculated as follows:
[0046]
[0047] Where M represents the binary mask of the training image and Ci is a fixed sentence format “a[V][class name]”.
[0048] 2. Video Preservation Loss:
[0049] Joint training is performed using common videos with captions, with the following formula:
[0050]
[0051] In the formula, Cv is the title of the video. The specific training method is to alternately sample image data and video data. To avoid memory overflow, the Accelerate library is used for gradient accumulation training, and the gradient accumulation value is set to 2.
[0052] 3. Subject Token Cross-Attention Loss:
[0053] During the training process, a special token "[V]" is introduced, and the token is explicitly connected to the subject position on the cross attention map. The binary cross entropy loss is used to ensure that the attention map is larger at the subject position and smaller outside the subject area. The formula is as follows:
[0054]
[0055] Wherein, matrix A is the cross-attention layer feature extracted from the diffusion model, and the specific extraction position is the third layer of the encoder and the second layer of the decoder.
[0056] In the inference phase, the subject and camera motion are managed through non-training techniques, specifically:
[0057] 1. Camera Movement Control:
[0058] The camera motion control is achieved by directly shifting the noise latent variable. The noise latent variable is translated according to the horizontal and vertical camera motion ratios input by the user, such as Figure 3 As shown, the specific steps are as follows:
[0059] 1. Calculate the moving distance of each step.
[0060] 2. Define the potential displacement distance at each frame.
[0061] 3. Avoid sampling tokens within the body region according to the body mask.
[0062] 4. Sample and fill the latent space horizontally and vertically sequentially.
[0063] 5. Finally, shift the original latent variables and fill the holes with the sampled tokens.
[0064] 2. Subject Motion Control:
[0065] The subject motion control is achieved by editing the cross attention map. The specific steps are as follows:
[0066] 1. Extract the cross-attention map of the subject position.
[0067] 2. Adjust the cross-attention value to control the subject position according to the bounding box sequence provided by the user.
[0068] 3. Use the adjusted cross-attention map when generating videos.
[0069] To verify the effectiveness of this solution, this embodiment conducts quantitative and qualitative experimental comparisons between this solution and other existing methods (DreamBooth, CustomVideo, DreamVideo), and the results are shown in Table 1:
[0070] Table 1
[0071]
[0072] It can be seen from Table 1 that compared with other existing methods, this scheme is superior in both generation quality and control accuracy. The results show that the videos generated by this scheme in various scenarios can maintain high quality and consistency.
[0073] In summary, this scheme uses several images of specific objects to efficiently fine-tune the T2V model to accurately capture the shape and attributes of the object, and enhances the subject learning performance by introducing subject region loss, video preservation loss, and subject token cross-attention loss. In the inference stage, the subject and camera motion are managed through training-free technology (subject motion control is achieved by editing the cross-attention map and camera motion control is achieved based on latent variable movement), which can achieve the following beneficial effects:
[0074] Improved effect - the dynamic effect of the generated video is significantly improved, the background is clearer, and the object movement is natural;
[0075] Precise Control - More precise control over object and camera movement, enabling a variety of motion types without retraining;
[0076] Low computational cost – The proposed control method does not require retraining, which reduces computational cost and complexity.
[0077] When this scheme is actually applied, the video generation effect can be further optimized by adjusting the loss function and the attention map editing method.
Claims
1. A customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The following steps are involved: S1. Fine-tune the existing T2V model: In the model learning and training phase, introduce subject area loss, video retention loss, and subject token cross-attention loss to enhance subject learning performance. In the model inference phase, manage subject motion and camera motion through training-free technology to build the MotionBooth framework. S2. Input the current text content into the MotionBooth framework and output the corresponding dynamic video.
2. According to claim 1, a customized object dynamic video generation method based on the MotionBooth framework, It is characterized in that The subject area loss in step S1 is specifically obtained by extracting the subject mask of the training image to calculate the dot product of the binary mask in the latent space.
3. According to claim 2, a customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The calculation formula of the main area loss is: Among them, M is the binary mask of the training image, Ci is the fixed sentence format "a[V][class name]", z is the latent variable feature, ∈ is the sampled random noise, N(0,I) is the standard normal distribution, and t is the sampling denoising time step.
4. According to claim 3, a customized object dynamic video generation method based on MotionBooth framework, Its characteristics are, The video retention loss in step S1 is specifically performed in a joint training process using common videos with titles, wherein image data sampling and video data sampling are performed alternately. To avoid memory overflow, the Accelerate library is used for gradient accumulation training, and the gradient accumulation value is set to 2.
5. According to claim 4, a customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The calculation formula of the video retention loss is: Among them, Cv is the title of the video.
6. According to claim 5, a customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The subject token cross-attention loss in step S1 specifically introduces a special token "[V]" during the training process, and explicitly connects the token with the subject position on the cross-attention map, and ensures that the attention map is larger at the subject position and smaller outside the subject area through the binary cross-entropy loss.
7. According to claim 6, a customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The calculation formula of the subject token cross attention loss is: Among them, matrix A is the cross-attention layer feature extracted from the diffusion model, and the specific extraction location is the third layer of the encoder and the second layer of the decoder.
8. According to claim 1, a customized object dynamic video generation method based on MotionBooth framework, It is characterized in that The model inference stage in step S1 specifically implements camera motion control by directly moving the noise latent variable, wherein the noise latent variable is translated according to the horizontal and vertical camera motion ratios input by the user; and the subject motion control is also implemented by editing the cross-attention map.
9. The method for generating customized object dynamic video based on MotionBooth framework according to claim 8, It is characterized in that The specific process of the camera motion control is as follows:
1. Calculate the moving distance of each step; 2. Define the potential displacement distance on each frame; 3. Avoid sampling tokens in the subject area according to the subject mask; 4. Sample and fill the latent space horizontally and vertically in sequence; 5. Finally, shift the original latent variables and fill the holes with the sampled tokens.
10. The method for generating customized object dynamic video based on MotionBooth framework according to claim 8, It is characterized in that The specific process of the subject motion control is:
1. Extract the cross-attention map of the subject position; 2. Adjust the cross-attention value to control the subject position according to the bounding box sequence provided by the user; 3. Use the adjusted cross-attention map when generating videos.
Citation Information
Cited By
Graphics video generation method based on non-training strategy and multi-subject attention alignment
CN120050481A
Video generation method and system based on cross-modal collaborative learning
CN120835216A
A video generation method and system based on cross-modal collaborative learning
CN120835216B
