Silent video mimicking method, electronic equipment and storage medium

Combining visual coding and text coding through the Unet network, using event occurrence signals for audio generation, solving the problem of out-of-synchronization of sound and picture in silent video foley and low audio quality, achieving high-quality, synchronous audio generation, and supporting text control .

CN118828050APending Publication Date: 2024-10-22SHANGHAI ARTIFICIAL INTELLIGENCE INNOVATION CENT
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410828992.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

The audio quality generated by the existing soundless video Foley method is poor and the audio and video are out of sync, making it difficult to generate high-quality, synchronized audio.

Method used

The Unet network is used for audio generation, visual coding and text coding are injected through feature extraction and parallel cross-attention mechanisms, and event occurrence signals are obtained using event occurrence detection. The residuals are added to the decoder layer layer by layer to achieve audio generation.

Benefits of technology

Improve audio-visual synchronization, achieve high-quality audio generation, and allow text to control foley generation, improving the correlation and synchronization of audio and video.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118828050A_ABST
    Figure CN118828050A_ABST
Patent Text Reader

Abstract

The invention relates to a silent video mimicking method, electronic equipment and a storage medium, the method uses a Unet network after injection processing to generate video mimicking of a silent video to be mimicked, and the injection processing comprises the following steps: respectively carrying out feature extraction on the silent video and a cue word obtained in advance to obtain a visual code and a text code; based on a parallel cross attention mechanism, injecting the visual code and the text code into a cross attention layer of a pre-constructed Unet network; for the silent video, obtaining an event occurrence signal through event occurrence detection; and injecting the event generation signal into a decoder layer of the Unet network in a layer-by-layer residual addition mode. Compared with the prior art, the method has the advantages of improving sound and picture synchronization, realizing text-controlled simulated sound generation and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of audio generation, and in particular to a silent video audio mimicry method, electronic equipment, and storage medium. Background Art

[0002] In movies, video games and other media, sound effects are an important element to ensure an immersive audio-visual experience for the audience. Even the most stunning visual effects will not convey the mood and perfect artistic expression of the work without powerful and appropriate sounds. However, in the process of traditional film and television production, because the shooting scene is usually noisy and some sounds (such as heartbeats, needles falling to the ground, etc.) are difficult to record, professional sound effects are usually required in post-production to add synchronized sound effects that match the content of the picture.

[0003] The manual sound-making process is complex, laborious and time-consuming. Professional sound-making artists usually need to first collect relevant sound-making props, create and record sounds in real time according to the content of the picture, and finally add the sounds to the video and make adjustments.

[0004] The existing silent video mimicry method has the following disadvantages:

[0005] (1) The audio quality generated by current methods is poor: For methods based on models to generate audio from silent videos, such methods are highly dependent on high-quality training data to achieve good model results. However, the currently available large-scale video-audio paired datasets are usually crawled from the Internet in a legal manner. The audio in the video usually contains complex environmental sounds and noise, resulting in poor audio quality in the dataset, which limits the ability of the model to generate high-quality audio after learning.

[0006] (2) Audio and video are out of sync: In order to ensure audio quality, some methods rely on the basic model of Wensheng audio to build a two-stage model for audio generation. This type of method maps video information to the text feature space to simulate the sound of silent videos. However, due to the information loss in the mapping of video information to the text feature space, and the model training process is not directly supervised by the final audio, the generated audio is not related to the video or is out of sync.

[0007] In summary, there is currently a lack of a silent video audio method to solve or partially solve the above-mentioned problems. Summary of the invention

[0008] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a silent video audio simulation method to solve or partially solve the problem of audio and video being out of sync.

[0009] The purpose of the present invention can be achieved by the following technical solutions:

[0010] One aspect of the present invention provides a method for mimicking a silent video, which generates a video mimicking of a silent video to be mimicked using a Unet network after injection processing, wherein the injection processing comprises the following steps:

[0011] For the silent video and the pre-acquired prompt words, feature extraction is performed to obtain visual coding and text coding respectively;

[0012] Based on the parallel criss-cross attention mechanism, the visual encoding and the text encoding are injected into the criss-cross attention layer of the pre-built Unet network;

[0013] For the silent video, obtaining an event occurrence signal through event occurrence detection;

[0014] The event occurrence signal is injected into the decoder layer of the Unet network by adding residuals layer by layer.

[0015] As a preferred technical solution, the process of injecting the visual encoding and the text encoding into the cross attention layer of the pre-built Unet network includes the following steps:

[0016] Input the text encoding into the cross attention layer of the Unet network to obtain the attention output corresponding to the text encoding;

[0017] Inputting the visual encoding into a trainable cross-attention layer based on visual conditions to obtain an attention output corresponding to the visual encoding;

[0018] The attention output corresponding to the text encoding and the attention output corresponding to the visual encoding are superimposed as the final output of the cross attention layer of the Unet network.

[0019] As a preferred technical solution, the cross-attention layer based on visual conditions has the same structure as the cross-attention layer of the Unet network.

[0020] As a preferred technical solution, by denoising the audio in each denoising step and comparing it with the original audio of the sample, the training of the cross-attention layer is implemented based on the following optimization objective function:

[0021]

[0022] in, represents the loss function value, ∈ represents the noise added by the diffusion process, ∈ θ represents a trainable noise estimation network, t represents the noise addition time step, z t represents the noise hidden variable, T em and V embThey represent text encoding and visual encoding respectively. During the training process, the information of text encoding is randomly discarded with a preset probability.

[0023] As a preferred technical solution, the process of injecting the event occurrence signal into the decoder layer of the Unet network comprises the following steps:

[0024] The event occurrence signal and the preset dependent variable are input into a trainable timing adaptation network to obtain an encoded signal, and the encoded signal is injected into the decoder layer of the Unet network by adding residuals layer by layer.

[0025] As a preferred technical solution, the timing adaptation network is trained through a scattered loss function.

[0026] As a preferred technical solution, based on the silent video, a trainable event occurrence detector is used to obtain an event occurrence signal, wherein during the training process, the event occurrence detector is trained by calculating the binary cross entropy based on the manually labeled binary event occurrence signal.

[0027] As a preferred technical solution, the process of obtaining the visual code includes the following steps:

[0028] The silent video is extracted using a pre-trained multimodal visual encoder, and the visual encoding is obtained by integrating and mapping the features of each video frame.

[0029] Another aspect of the present invention provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the silent video audio mimicry method described above.

[0030] Another aspect of the present invention provides a computer-readable storage medium, comprising one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the aforementioned silent video audio emulation method.

[0031] Compared with the prior art, the present invention has at least one of the following beneficial effects:

[0032] (1) Improving audio-visual synchronization: To address the audio-visual asynchrony problem in current solutions, the present invention performs event detection on silent videos to obtain event occurrence signals, and injects the event occurrence signals into the decoder layer of the Unet network by adding residuals layer by layer. The injected Unet network is used to generate audio. By introducing the event occurrence signal, the generated audio can conform to the event occurrence signal, thereby achieving the effect of audio-visual synchronization.

[0033] (2) Realizing text-controlled onomatopoeia generation: In the process of injecting the Unet network, the present invention takes into account both video information and text information, and randomly discards text input information with a preset probability, thereby fully extracting and successfully injecting visual semantic information into the Unet network. This will not affect the fusion of visual semantics and text semantics to control audio generation, and in the process of generating audio from video, the relevance of the generated audio can be controlled by text, thereby achieving a further editing effect.

[0034] (3) High-quality audio generation: The present invention is built on a high-quality Vincent audio model, which is usually trained on a high-quality audio dataset. Therefore, compared with the current video-audio mimicry model trained on a video-audio dataset, the present invention can achieve higher-quality audio generation effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 A schematic diagram of the overall framework for generating audio for silent video during training and reasoning in an embodiment;

[0036] Figure 2 A schematic diagram of the framework of the semantic control module in the embodiment;

[0037] Figure 3 A schematic diagram of a result of video mimeographing based on text control in an embodiment;

[0038] Figure 4 Schematic diagram of the framework of the timing control module in the embodiment. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0040] Example 1

[0041] In view of the problems existing in the aforementioned prior art, this embodiment provides a method for audio mimicry of a silent video, by injecting an audio generator based on a Unet network, and using the injected audio generator to generate video audio mimicry of the silent video to be mimicked.

[0042] See also Figure 1The figure shows the overall framework of the method in the training stage (left) and the reasoning stage (right). The framework includes a semantic adapter (SA) and a timing control module. The timing control module mainly includes an event occurrence detector (TD) and a temporal adapter (TA) based on the event occurrence signal.

[0043] The overall framework of this embodiment is constructed based on a pre-trained Vincent audio basic model. Specifically, this embodiment adopts the basic model of Auffusion. In addition, this embodiment constructs two key modules, namely the semantic control module and the timing control module, to achieve a better video sound effect than the existing technology. Figure 1 As shown, in the training phase, the semantic control module and the timing control module can be trained separately. It should be noted that Figure 1 The audio generators (AG) that appear in are all the same audio generator.

[0044] It should be noted that, under the premise of no conflict, the Vincent audio basic model can be implemented using other models.

[0045] The semantic control module extracts semantic features from the video by inputting it, and injects them into the pre-trained audio generator to generate semantically related audio content. In this process, only the parameters of the semantic control module are trainable, and the parameters of the audio generator are fixed and cannot be trained. The training process uses the real audio signal in the audio-video dataset as supervision and the diffusion loss as the optimization function for training.

[0046] The timing control module is dedicated to further improving the quality of synchronization between generated audio and visual cues in video. Specifically, the timing control module mainly includes an event occurrence detector (timestamp detector, TD) and a temporal adapter (temporal adapter, TA) based on the event occurrence signal. Among them, the input of the event occurrence detector is a video, and the time when the sound event occurs is determined based on the visual cues in the video. In this process, the optimization objective function of the event occurrence detector is the binary cross entropy loss, and the true value is the event occurrence time manually marked in the data set. At the same time, the input of the temporal adapter is a binary signal, marking whether there is a sound event at the corresponding moment. The temporal adapter extracts features based on this event occurrence signal and injects it into the audio generator, so that the generated audio can conform to the event occurrence signal, thereby achieving the effect of audio and video synchronization. In this process, the optimization objective function of the temporal adapter is the diffusion loss, and the true value is the audio signal of the corresponding video.

[0047] In the inference phase, the semantic control module and the timing control module can be inserted into the audio generator to generate video audio after training. At the same time, the framework also allows text input to generate video audio based on text description. The semantic control module and the timing control module are further introduced below.

[0048] (1) Semantic control module.

[0049] See also Figure 2 The semantic control module mainly consists of two steps, namely semantic feature extraction and semantic feature injection. This module can be directly plugged into the pre-trained audio generator (i.e. Figure 2 The UNet network in is used to generate audio.

[0050] In the semantic feature extraction part, this embodiment uses a pre-trained multimodal visual encoder (CLIP) to extract the input video, and then integrates and further maps the features of all video frames through several layers of trainable linear layers and normalization layers to obtain visual encoding. The process can be expressed by the following formula:

[0051] V emb =MLP(AvgPooling(τ vis (v)))

[0052] Where v represents the input video, τ vis represents the CLIP visual encoder, AvgPooling represents the operation of averaging all extracted video frame information, and MLP represents the newly inserted trainable linear layer.

[0053] After obtaining the visual encoding, the visual encoding is injected into the audio generation model so that the generated audio conforms to the video features. In this step, the visual encoding is injected using a parallel cross-attention mechanism. Specifically, the audio generation model is built based on the UNet network, which includes multiple cross-attention layers. The input condition of each cross-attention layer is the text encoding. The text information is injected into the audio features through the attention mechanism between the text encoding and the audio features. This embodiment first copies a parallel cross-attention layer as a cross-attention layer based on visual conditions, while retaining the original cross-attention layer of text conditions. In this way, the audio generation model can use visual information as a condition for audio generation without losing the original ability to generate audio based on text conditions. The process can be expressed as follows:

[0054]

[0055] Among them, Temb and V emb Represent the extracted text encoding and visual encoding respectively, and They represent the pre-trained fixed-parameter text encoding mapping layers, and They represent the newly inserted mapping layers for visual encoding mapping. During the training process, the semantic control layer is optimized by denoising the audio in each denoising step and comparing it with the original audio in the data. The specific optimization objective function is as follows:

[0056]

[0057] Among them, ∈ represents the noise added by the diffusion process, ∈ θ represents a trainable noise estimation network, t represents the noise addition time step, z t represents the noise added latent variable.

[0058] During the training process, the text input information is randomly discarded with a preset probability (set to 90% in this embodiment), so that the semantic control module can fully extract and successfully inject the visual semantic information into the audio generator, while not affecting the fusion of visual semantics and text semantics to control audio generation. Through such training, when performing video mimicry, the effect of mimicry can be controlled by text. Figure 3 As shown, given a video of a drum set, there are many possible sound effects. The method of this embodiment allows the user to specify the desired sound effect through text. For example, given a positive prompt word "bass", you can see that the generated audio is bass, and vice versa. At the same time, given a video of a horse running in the sand, the user can suppress the audio generation model from generating wind noise by inputting a negative prompt word "wind noise", thereby greatly improving the audio generation result.

[0059] (2) Timing control module.

[0060] See also Figure 4 It is the overall framework of the timing control module. Among them, the timing control module is mainly composed of an event occurrence detector and a timing adapter based on the event occurrence signal. First, this embodiment constructs an event occurrence detector through a multi-layer convolutional neural network. The input of the detector is a video. The detector encodes feature extraction information from the video and inputs a binary vector related to the length of the video. If the value of the vector is 1, it means that there is sound at the current moment, and if it is 0, it means that there is no sound. In this process, the true value of the detector is the binary event occurrence signal manually marked in the data set, and the detector is optimized by binary cross entropy. The specific optimization objective function is as follows:

[0061]

[0062] Among them, N represents the number of samples of a single gradient return, y represents the manually labeled target value of the event, Represents the predicted value of the output of the event occurrence detector.

[0063] The network structure of the timing adapter is built based on ControlNet. It is initialized by copying the encoder part of the Unet network. Its input is a binary vector representing the event signal. The encoder encodes the input vector through layer-by-layer convolutional layers. At the same time, the features encoded layer by layer are injected into the corresponding layer of the decoder of the Unet network layer by layer through residual addition. In this process, only the timing adapter is trainable, while the parameters of the entire Unet network are fixed and unchanged. The input is the audio information of the corresponding video. The process is optimized by the diffusion loss function.

[0064] In summary, this embodiment provides a trainable and pluggable semantic control module based on the Vincent video basic model for the task of video mimicry. The module is compatible with the existing Vincent audio model. By inputting a video, it can extract semantic features from the video and appropriately inject the features into the Vincent audio model to guide the model to generate audio that is consistent with the video semantics. In addition, in order to further improve the synchronization quality of the generated audio and video, a timing control module is provided; the module can detect the signal of the event from the video, and based on the signal, guide the Vincent audio model to generate audio synchronized with the visual clues.

[0065] By providing a trainable and pluggable semantic control module and a timing control module, and based on end-to-end video-audio diffusion loss optimization, high-quality audio generation that is related to and synchronized with the picture can be achieved; when the training is completed, the semantic control module can extract visual features from the video provided by the user and inject them into the Vincent audio model, thereby controlling the audio generation to conform to the video content; after the training of the timing control module is completed, the event detector detects the signal of the sound occurrence from the video, and then inputs the signal into the timing adapter, so that the audio generation of the Vincent audio can follow the event occurrence signal, thereby achieving the effect of audio and video synchronization.

[0066] Example 2

[0067] This example provides an electronic device, including: one or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the silent video audio mimicry method as described in Example 1.

[0068] Example 3

[0069] This embodiment provides a computer-readable storage medium, including one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs include instructions for executing the silent video audio mimicry method as described in Embodiment 1.

[0070] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A silent video audio method, characterized in that: The video audio of the silent video to be audio-stitched is generated by using the Unet network after the injection processing, wherein the injection processing includes the following steps: For the silent video and the pre-acquired prompt words, feature extraction is performed to obtain visual coding and text coding respectively; Based on the parallel criss-cross attention mechanism, the visual encoding and the text encoding are injected into the criss-cross attention layer of the pre-built Unet network; For the silent video, obtaining an event occurrence signal through event occurrence detection; The event occurrence signal is injected into the decoder layer of the Unet network by adding residuals layer by layer.

2. A silent video audio method according to claim 1, characterized in that: The process of injecting the visual encoding and text encoding into the cross-attention layer of the pre-built Unet network includes the following steps: Input the text encoding into the cross attention layer of the Unet network to obtain the attention output corresponding to the text encoding; Inputting the visual encoding into a trainable cross-attention layer based on visual conditions to obtain an attention output corresponding to the visual encoding; The attention output corresponding to the text encoding and the attention output corresponding to the visual encoding are superimposed as the final output of the cross attention layer of the Unet network.

3. A silent video audio method according to claim 2, characterized in that: The visual condition-based cross-attention layer has the same structure as the cross-attention layer of the Unet network.

4. The method for mimicking sound of a silent video according to claim 2, characterized in that: The cross-attention layer is trained by denoising the audio in each denoising step and comparing it with the original audio of the sample based on the following optimization objective function: in, represents the loss function value, ∈ represents the noise added by the diffusion process, ∈ θ represents a trainable noise estimation network, t represents the noise addition time step, z t represents the noise hidden variable, T emb and V emb They represent text encoding and visual encoding respectively. During the training process, the information of text encoding is randomly discarded with a preset probability.

5. The method for mimicking sound of a silent video according to claim 1, characterized in that: The process of injecting the event occurrence signal into the decoder layer of the Unet network comprises the following steps: The event occurrence signal and the preset dependent variable are input into a trainable timing adaptation network to obtain an encoded signal, and the encoded signal is injected into the decoder layer of the Unet network by adding residuals layer by layer.

6. A silent video audio emulation method according to claim 5, characterized in that: The timing adaptation network is trained by a scattered loss function.

7. The method for mimicking sound of a silent video according to claim 1, characterized in that: Based on the silent video, an event occurrence signal is obtained using a trainable event occurrence detector, wherein during the training process, the event occurrence detector is trained by calculating the binary cross entropy based on the manually labeled binary event occurrence signal.

8. The method for mimicking sound of a silent video according to claim 1, characterized in that: The process of obtaining the visual code comprises the following steps: The silent video is extracted using a pre-trained multimodal visual encoder, and the visual encoding is obtained by integrating and mapping the features of each video frame.

9. An electronic device, characterized in that: include: One or more processors and a memory, wherein the memory stores one or more programs, and the one or more programs include instructions for executing the silent video audio emulation method according to any one of claims 1-8.

10. A computer-readable storage medium, characterized in that: The method comprises one or more programs for execution by one or more processors of an electronic device, wherein the one or more programs comprise instructions for executing the silent video emulation method according to any one of claims 1 to 8.

Citation Information

Cited By

  • Audio generation method, device and equipment and computer readable storage medium

    CN120358378A

  • Audio generation method, device, equipment and computer-readable storage medium

    CN120358378B