WO2020177214A1 - 一种基于文本不同特征空间的双流式视频生成方法 - Google Patents
一种基于文本不同特征空间的双流式视频生成方法 Download PDFInfo
- Publication number
- WO2020177214A1 WO2020177214A1 PCT/CN2019/085962 CN2019085962W WO2020177214A1 WO 2020177214 A1 WO2020177214 A1 WO 2020177214A1 CN 2019085962 W CN2019085962 W CN 2019085962W WO 2020177214 A1 WO2020177214 A1 WO 2020177214A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- text
- video
- feature
- dual
- features
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/213—Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Definitions
- the present invention relates to the technical fields of pattern recognition, natural language processing, computer vision, etc., and in particular to a video generation method based on different feature spaces of text, which is intelligently generated based on the appearance feature space of objects described in the text and its corresponding motion feature space Video clips that match the text content.
- the present invention provides a dual-stream video generation method based on different feature spaces of text. According to the appearance feature space of the object described in the text and its corresponding motion feature space, the spatial feature and time sequence feature contained in the text are separated and adopted
- the dual-stream method models these features separately, and uses adversarial training methods to guide the generation process and optimize the generation results, making them gradually more realistic, so as to achieve intelligent generation of video clips that conform to the text content.
- the invention also verifies the effectiveness of the method of the invention in a simple object motion video database.
- a dual-stream video generation method based on different feature spaces of the text by separating the spatial and temporal features contained in the text, and using the dual-stream method to model these features separately, and use adversarial training for training to achieve intelligence
- Generate high-quality video clips that conform to the text content including: text feature extraction process, dual-stream video generation process and adversarial training process.
- the present invention analyzes the input text content, separates the obtained feature information, and extracts the information of the appearance feature space and the motion feature space respectively.
- the text feature extraction process specifically includes the following steps:
- LSTM long-term memory network
- the bidirectional long and short-term memory network is divided into upper and lower layers, and a more comprehensive understanding can be obtained by analyzing the text in a positive order and a reverse order respectively.
- T x +T y uses vector addition.
- the calculation process can be expressed as Equation 2:
- Each value w ai in the weight represents the degree of attention to the features of different positions in the text. The larger the value, the more description of the appearance feature.
- the feature after the “attention” can be obtained by the weighted sum.
- the motion feature T m contained in the text feature can also be extracted in this way.
- the triplet constraint is introduced to adjust the text distribution, that is, the distance between the matched text image pair (T a , G + ) is shortened, and the unmatched text image pair (T a, G - distance), to ensure that the appearance of isolated features is accurate and meaningful.
- the triple loss of appearance features can be expressed as Equation 4:
- ⁇ is a hyperparameter, which represents the maximum value of the difference between the text feature and the distance between the positive and negative samples.
- the objective function L of the text feature extraction process is lost by the triplet of appearance features Triple loss with motion characteristics
- the composition can be expressed as formula 5:
- the present invention introduces a dual-stream video generator to generate a video, first uses the extracted appearance feature T a to generate a static image, and then applies the learned motion feature T m to this image to derive the subsequent video Frame, which is to generate video in a "static first and then moving" way.
- the appearance feature T a For the appearance feature T a , first use a single-layer fully connected network structure to map it to 4*4*1024 dimensions, and reorganize the dimensions to (4, 4, 1024), and then pass the 2D deconvolutional neural network (2D deconvolution neural network) to generate static graph F.
- the 2D deconvolutional neural network is composed of 5 deconvolution layers.
- the receptive field size of each deconvolution layer is 4*4, the step size is 2, and the final output image size is 64*64.
- a random variable Z is introduced, which is sampled from a Gaussian distribution, so that the objects in the generated static image can have slightly different appearances and different initial positions.
- Equation 6 For the motion feature T m , the method adopted is to use it to learn the parameters of the affine transform.
- a single affine transform has six parameters, expressed as a matrix
- the transformation process can be expressed as Equation 6:
- (x k, y k) is the pre-conversion coordinates of a point
- (x 'k, y' k) corresponding to the transformed coordinates.
- a single affine can only implement operations such as translation, scaling, rotation, and flipping.
- a total of L*K*6 affine transformation parameters are required.
- the motion feature T m is mapped to a parameter of a specified dimension through a double-layer fully connected network.
- Equation 7 The combination process of the transformation graph can be expressed as Equation 7:
- the dual-stream video generator is constructed through the above process.
- the adversarial training process is optimized by alternately training dual-stream video generators and discriminators to obtain the most optimized generator so that the generated video content tends to be real;
- the present invention uses the adversarial training process, and the adversarial training uses the idea of zero-sum game to improve the performance of both the generator and the discriminator alternately, and then uses the trained generator to complete the text to video generation task.
- the present invention specifically uses the two discriminators described in the document [2] (Pan Y, Qiu Z, Yao T, et al. To Create What You Tell: Generating Videos from Captions[J].2018.): frame discriminator and The video discriminator guides and trains the model from two aspects: the quality of each frame and the continuity of the overall motion.
- text features are added to strengthen the training process, so that the generated video can meet the description of the input text and achieve the accuracy of the generation.
- the frame discriminator is a four-layer 2D convolutional neural network structure; for the generated video Every frame in And the real video as a reference Every frame in Text appearance features with positive and negative samples added versus Compose real graphic pairs Unmatched graphic pair And generate graphic pairs
- the traditional discriminator can only reduce the error between the real data distribution and the predicted distribution.
- the addition of text feature reinforcement training can further narrow the distance between the predicted image data distribution and the real and appearance of the image data distribution that conforms to the description, so as to achieve accurate generation
- the loss function expression is Equation 8:
- N is the number of data in one iteration
- c k is the category of real data
- l is the length of the generated video.
- one of the optimization goals of the above-mentioned dual-stream video generator is to make the generated image data distribution as similar as possible to the real and appearance-matched image data distribution under the premise that the prediction category of the frame discriminator is the real data category.
- the optimized function expression is Equation 10:
- the discriminator is a four-layer 3D convolutional neural network structure; similarly, the generated video V g and the real video V r as a reference are added with positive and negative Sample text movement characteristics versus Compose real video text pairs Unmatched video text pair And generate video text pairs Its function is to narrow the distance between the predicted video data distribution and the real video data distribution whose motion conforms to the description.
- the loss function expression is Equation 11:
- D(R V ), D(W V )), and D(G V )) are the class predictions of different video text pairs by the discriminator.
- another optimization goal of the dual-stream video generator is On the premise that the prediction category of the detector is the real data category, the generated video data distribution is as similar as possible to the real and motion-matched video data distribution.
- the optimization function expression is Equation 12:
- the objective function of the discriminator in the confrontation training consists of the loss function of the frame discriminator and the video discriminator, which can be expressed as Equation 13:
- Equation 14 The objective function of the dual-stream video generator also consists of two parts, which can be expressed as Equation 14:
- the objective functions of the discriminator and the generator are alternately trained to obtain the most optimized generator, which can realize the video generation based on text content.
- the present invention provides a dual-stream video generation method based on different feature spaces of text. According to the appearance feature space of the object described in the text and its corresponding motion feature space, the spatial feature and time sequence feature contained in the text are separated and adopted
- the dual-stream approach models these features separately, and uses adversarial training methods to optimize the generated results, making them gradually more realistic, so as to achieve intelligent generation of video clips that conform to the text content.
- Compared with the existing technology, its technical advantages are reflected in the following two aspects:
- the video is generated in a dual-stream manner, which avoids overestimating the ability of a single model and realizes accurate learning of text features.
- the model can adaptively maintain timing consistency, that is, the continuity of object motion in the video, without the need for There are ways to add additional discriminators that guide the continuity of actions in the confrontation training.
- Fig. 1 is a flowchart of the method provided by the present invention.
- FIG. 2 is an example diagram of a result of generating a dual-stream video according to an input text according to an embodiment of the present invention
- the present invention provides a dual-stream video generation method based on different feature spaces of text. By separating the spatial and temporal features contained in the text, and using the dual-stream method to model these features separately, maximizing the learning ability of specified features , And use adversarial training methods to optimize the generated results.
- the method provided by the present invention includes: a text feature extraction process, a dual-stream video generation process, and an adversarial training process;
- Figure 1 shows the process of the method provided by the present invention, and the specific steps are as follows:
- the weight learning network is two parallel fully connected networks, and the last layer of the fully connected network uses the softmax activation function.
- Each value w ai in the weight represents the degree of attention to the features of different positions in the text. The larger the value, the more description of the appearance feature. The feature after the “attention” can be obtained by the weighted sum.
- the motion feature T m contained in the text feature can also be extracted in this way.
- the appearance feature T a For the appearance feature T a , first use a single-layer fully connected network structure to map it to 4*4*1024 dimensions, and then generate a static image F through a 2D deconvolution neural network (2D deconvolution neural network).
- the 2D deconvolutional neural network is composed of 5 deconvolution layers, and the receptive field size of each deconvolution layer is 4*4, and the step size is 2.
- a random variable Z is introduced, which is sampled from a Gaussian distribution, so that the objects in the generated static image can have slightly different appearances and different initial positions.
- the frame discriminator and the video discriminator are used to guide the quality of the generated video frames and the movement of the video, and the training process is strengthened by adding appearance characteristics T a and movement characteristics T m respectively , so that the generated video can conform to the text description.
- the objective functions of the discriminator and generator are alternately trained to obtain the most optimized generator.
- Figure 2 is this embodiment An example diagram of the result of video generation. It can be seen from FIG. 2 that the present invention can accurately generate video clips that meet the text description.
- the model of the present invention can adaptively generate video clips with consistent timing, without the need for confrontation training. Using an additional motion discriminator to guide it is also the technical advantage of the present invention over existing methods.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Evolutionary Computation (AREA)
- Molecular Biology (AREA)
- Computational Linguistics (AREA)
- Software Systems (AREA)
- Mathematical Physics (AREA)
- Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Bioinformatics & Computational Biology (AREA)
- Image Analysis (AREA)
- Processing Or Creating Images (AREA)
Abstract
一种基于文本不同特征空间的双流式视频生成方法,包括:文本特征提取过程、双流式视频生成过程和对抗性训练过程。本发明根据文本中所描述的物体外观特征空间与其相应的运动特征空间,通过分离文本中所包含的空间特征和时序特征,并采用双流的方式分别对这些特征建模,利用对抗训练的方式来优化生成结果,使其逐渐趋于真实,从而实现智能化生成符合文本内容的视频片段,在素材积累和数据集自动生成方面具有广泛的市场需求和应用前景。
Description
本发明涉及模式识别、自然语言处理、计算机视觉等技术领域,尤其涉及一种基于文本不同特征空间的视频生成方法,根据文本中所描述的物体外观特征空间与其相应的运动特征空间,智能化生成符合文本内容的视频片段。
近年来,随着计算机视觉领域的飞速发展和生成对抗网络的提出,图像生成的研究受到了越来越广泛的关注,其在素材积累,数据集自动生成方面有非常积极的意义。视频相比于图像它更加生动,生成难度也更大,因此对于视频生成方面的探索更加有研究意义。同时,如果与大多数的图像生成方法一样随机地生成视频并不具有太多实用价值,用户更多地会想要基于某种给定信息来生成,比如,用户输入“一个人在走路”,期望得到与所输入文本相匹配的视频片段,而不是一些随机的、无意义的视频。如此看来,传统的生成方法已经不能满足用户对于生成结果指向性的、匹配性的要求。基于文本的视频生成面临的挑战主要是如何有效地理解文本内容(“什么物体在进行着怎么样的运动”),并且生成结果要保证其每一帧的生成质量和整个视频在时序上动作的连贯性。
现有的方法大多对整个文本进行统一地处理,对提取到的特征直接生成整个视频片段,但是,这样的处理高估了单一模型的学习能力,不仅需要学习空间特征(外观信息),还要学习时序特征(运动信息),使得模型对于两种特征都不能充分地理解,难以有效地进行高质量的生成。
发明内容
本发明提供了一种基于文本不同特征空间的双流式视频生成方法,根据文本中所描述的物体外观特征空间与其相应的运动特征空间,通过分离文本中所包含的空间特征和时序特征,并采用双流的方式分别对这些特征建模,利用对抗训练的方式来指导生成过程和优化生成结果,使其逐渐趋于真实,从而实现智能化生成符合文本内容的视频片段。本发明还通过在简单物体运动视频数据库中验证了本发明方法的有效性。
本发明的技术方案是:
一种基于文本不同特征空间的双流视频生成方法,通过分离文本中所包含的空间特征和时序特征,并采用双流的方式分别对这些特征建模,并利用对抗训练的方式进行训练,实现智能化生成符合文本内容的真实高的视频片段;包括:文本特征提取过程、双流式视频生成过程和对抗性训练过程。
1)文本特征提取过程;
本发明解析了输入的文本内容,对得到的特征信息进行了分离,分别提取了外观特征空间与运动特征空间的信息。
需要注意的是,为了确保输入后续视频生成过程的文本特征是有意义的,文本特征提取过程要经过提前训练,并在后续其他模块的训练过程中保持不变。
文本特征提取过程具体包括如下步骤:
11)提取得到文本的外观特征T
a和运动特征T
m;
对输入的文本,采用双向的长短期记忆网络(bidirectional long short-term memory,LSTM)实现对文本特征的映射,同时引入了注意力关注机制(attention mechanism)结构进行外观特征和运动特征的分离。
具体操作如下:
111)双向长短期记忆网络分为上下两层,分别对文本做一个正序和逆序的解析,可以得到更全面的理解。文本中的每一个词依次输入长短期记忆网络的每个时间节点(time step),每个时间节点处的维度为256维,提取到的特征分别表示为正序文本特征T
x={t
x1,t
x2,…,t
xn}和逆序文本特征T
y={t
y1,t
y2,…,t
yn},n表示文本的长度,然后通过取均值的方式得到需要的文本特征T={t
1,t
2,…,t
n},表示为式1:
T=(T
x+T
y)/2 (式1)
其中T
x+T
y采用的是向量加法。
112)在注意关注机制结构中,文本特征T经过两组并行的全连接网络(fully-connected),全连接网络的最后一层使用softmax激活函数,得到两组权重w
a={w
a1,w
a2,…,w
an}和w
b={w
b1,w
b2,…,w
bn},并且满足
和
分别用于提取外观特征和运动特征。以外观特征的提取为例,其计算过程可以表示为式2:
权重中每个值w
ai代表了对文本中不同位置特征的关注程度,值越大代表其对于外观特征的描述更多,通过加权和的方式可得到“关注”后的特征。同理,文本特征中包含的运动特征T
m也可以采用这种方式来进行提取。
12)对提取的外观特征T
a和运动特征T
m,需要在数据集中选择正负样本,同时引入三元组损失(triplet loss),实现文本特征准确的分离。
具体操作如下:
121)在训练提取外观特征过程中,定义三元组Φ
a=(T
a,G
+,G
-),其中T
a为参照用外观特征,G
+为正样本,是包含符合文本描述的物体的视频帧,G
-为负样本,是包含文本描述不同的物体的视频帧。此时关注的是外观特征,只需要物体类型符合文本描述即可,使用的仅是视频中的一帧。对选取的视频帧,使用2D卷积神经网络(2D convolution neural network)来提取其空间特征(spatial feature),并在最后利用一个单层全连接网络结构将其映射到T
a的同构空间,为后续的图文匹配做准备。使用L2范数计算的不同模态数据间距离,表示为式3:
以外观特征T
a为参照物,引入三元组约束(triplet constraint)调整文本分布,即拉近匹配的文本图像对(T
a,G
+)的距离,同时增加不匹配的文本图像对(T
a,G
-)的距离,确保分离出的外观特征是准确的、有意义的。外观特征的三元组损失可以表示为式4:
其中α为超参数,表示文本特征与正负样本间距离之差的最大值。
122)相似地,在训练提取动作特征过程中,选取包含符合文本描述的运动的视频V
+,此时关注的是运动特征,需要使用整个视频,但视频中包含的物体类型可以忽略。对选取的视频帧,使用3D卷积神经网络(3D convolution neural network)来提取其时序特征(temporal feature),并在最后利用一个单层全连接网络结构将其映射到T
m的同构空间。
2)双流式视频生成器的构建过程
本发明引入双流式视频生成器来生成视频,先利用提取的外观特征T
a生成一张静态图(static image),再将学习到的运动特征T
m作用于这张图上来衍生出后续的视频帧,即以一种“先静后动”的方式来生成视频。
执行如下操作:
21)对外观特征T
a,先利用一个单层全连接网络结构将其映射到4*4*1024维度,并维度 重组为(4,4,1024),再通过2D反卷积神经网络(2D deconvolution neural network)来生成静态图F。其中,2D反卷积神经网络由5层反卷积层组成,每层反卷积层的感受野大小为4*4,步长为2,最终输出的图像大小为64*64。同时为了对同样的文本生成更多样性的视频,引入一个随机变量Z,该随机变量从高斯分布采样,使得生成的静态图中的物体可以有略微不同的外观和不同的初始位置。
其中(x
k,y
k)为变换前某一点的坐标,(x′
k,y′
k)为变换后对应的坐标。单一的仿射只能实现平移、缩放、旋转、翻转等操作,为了对复杂的运动建模,需要使用K组仿射变换参数分别作用于上述静态图F,来得到K张变换后的图F′={f′
1,f′
2,…,f′
K},再通过将这K张变换图组合起来得到后续的一帧。假定需要生成长度为L的视频片段,则共需要L*K*6个仿射变换参数,本发明中将运动特征T
m通过一个双层的全连接网络映射为指定维度的参数。
在将K张变换后的图F′={f′
1,f′
2,…,f′
K}组合在一起的过程中,需要评估在每个坐标位置上每张变换图的置信度,置信度越高说明在该位置上该变换图越接近真实的视频帧,通过引入掩码(mask)来实现置信度的自动评估。掩码的生成需要结合外观特征T
a、运动特征T
m和随机变量Z,在有初始状态以及运动趋势等信息的指导下才能更好地生成掩码。在将这些特征信息拼接后,经过一个3D反卷积神经网络(3D deconvolution neural network)来生成掩码M={m
1,m
2,…,m
K},网络的最后一层使用softmax激活函数对每一个坐标位置(i,j)上的置信度进行归一化,即满足
变换图的结合过程可以表示为式7:
其中F
next为生成的下一帧图像。
通过上述过程构建得到双流式视频生成器。
3)对抗性训练过程,通过交替训练双流式视频生成器和辨别器进行优化,得到最优化的生成器,使得生成的视频内容趋于真实;
本发明使用对抗性训练过程,对抗性训练利用零和博弈的思想,通过交替训练生成器和辨别器的方式同时提高两者的性能,然后取用训练好的生成器来完成文本到视频的生成任务。 本发明具体采用文献[2](Pan Y,Qiu Z,Yao T,et al.To Create What You Tell:Generating Videos from Captions[J].2018.)中记载的两个辨别器:帧辨别器和视频辨别器,分别从每一帧的质量和整体运动的连贯性两方面来指导和训练模型,同时加入文本特征来强化训练过程,使得生成的视频可以符合输入文本描述,实现生成的准确性。
执行操作如下:
31)使用帧辨别器(frame-level discriminator)的方法,帧辨别器是四层的2D卷积神经网络结构;对生成的视频
中的每一帧
和作为参照的真实的视频
中的每一帧
加入正负样本的文本外观特征
与
组成真实图文对
不匹配图文对
以及生成图文对
传统的辨别器只能缩小真实数据分布与预测分布的误差,加入文本特征强化训练可以进一步拉近与预测的图像数据分布与真实且外观符合描述的图像数据分布之间的距离,实现生成的准确性,其损失函数表达式为式8:
其中l为生成视频的长度。
与之相对的,上述双流式视频生成器的优化目标之一为在假定帧辨别器的预测类别为真实数据类别的前提下使得生成的图像数据分布与真实且外观匹配的图像数据分布尽可能相似,优化函数表达式为式10:
32)使用视频辨别器(video-level discriminator)的方法,辨别器是四层的3D卷积神经网络结构;相似地,对生成的视频V
g和作为参照的真实的视频V
r,加入正负样本的文本运动特征
与
组成真实视频文本对
不匹配的视频文本对
以及生成视频文本对
其作用是拉近预测的视频数据分布与真实且运动符合描述的视频数据分布之间的距离,其损失函数表达式为式11:
其中D(R
V)、D(W
V))和D(G
V))为辨别器对不同视频文本对的类别预测,同样的,双流式视频生成器的另一个优化目标为在假定视频辨别器的预测类别为真实数据类别的前提下使得生成的视频数据分布与真实且运动匹配的视频数据分布尽可能相似,优化函数表达式为式12:
对抗训练中辨别器的目标函数由帧辨别器和视频辨别器的损失函数组成,可以表示为式13:
双流式视频生成器的目标函数同样也由两部分组成,可以表示为式14:
辨别器与生成器的目标函数交替训练,得到最优化的生成器,即可实现基于文本内容的视频生成。
与现有技术相比,本发明的有益效果是:
本发明提供了一种基于文本不同特征空间的双流式视频生成方法,根据文本中所描述的物体外观特征空间与其相应的运动特征空间,通过分离文本中所包含的空间特征和时序特征,并采用双流的方式分别对这些特征建模,利用对抗训练的方式来优化生成结果,使其逐渐趋于真实,从而实现智能化生成符合文本内容的视频片段。与现有技术相比,其技术优势体现在以下两方面:
(一)通过分离文本特征中的外观特征和动作特征,采用双流式的方式生成视频,避免了高估单一模型的能力,实现对文本特征的准确学习。
(二)通过对运动特征的单独建模,并采用一种“先静后动”的生成方式,模型自适应地可以保持时序一致性,即视频中物体运动的连贯性,而不需要如已有方法在对抗训练中添加额外的指导动作连贯性的辨别器。
图1是本发明提供方法的流程框图。
图2是本发明实施例根据输入文本生成双流式视频的结果示例图;
其中,(a)-(j)的输入文本分别为:
(a)“The digit 0 is moving left and right.”;
(b)“The digit 1 is moving up and down.”;
(c)“The digit 2 is moving left and right.”;
(d)“The digit 3 is moving left and right.”;
(e)“The digit 4 is moving up and down.”;
(f)“The digit 5 is moving left and right.”;
(g)“The digit 6 is moving up and down.”;
(h)“The digit 7 is moving up and down.”;
(i)“The digit 8 is moving left and right.”;
(j)“The digit 9 is moving up and down.”。
下面结合附图,通过实施例进一步描述本发明,但不以任何方式限制本发明的范围。
本发明提供了一种基于文本不同特征空间的双流视频生成方法,通过分离文本中所包含的空间特征和时序特征,并采用双流的方式分别对这些特征建模,最大化对指定特征的学习能力,并利用对抗训练的方式来优化生成结果。
本发明提供的方法包括:文本特征提取过程、双流式视频生成过程和对抗性训练过程;图1所示是本发明提供方法的流程,具体步骤如下:
1、进行文本特征提取和分离,参见步骤11)-13)
11)利用双向长短时记忆网络,针对输入的文本,提取正序文本特征T
x={t
x1,t
x2,…,t
xn}和逆序文本特征T
y={t
y1,t
y2,…,t
yn},n表示文本的长度,然后通过取均值的方式T=(T
x+T
y)/2得到需要的文本特征T={t
1,t
2,…,t
n}。
12)引入注意力关注机制,学习两组权重w
a={w
a1,w
a2,…,w
an}和w
b={w
b1,w
b2,…,w
bn},并且满足
和
分别用于提取外观特征T
a和运动特征T
m。以外观特征为例,
权重的学习网络是两组并行的全连接网络,全连接网络的最后一层使用softmax激活函数。
权重中每个值w
ai代表了对文本中不同位置特征的关注程度,值越大代表其对于外观特征的描述更多,通过加权和的方式可得到“关注”后的特征。
同理,文本特征中包含的运动特征T
m也可以采用这种方式来进行提取。
13)文本特征提取和分离的训练过程,以外观特征的提取为例,通过引入三元组约束 (triplet constraint)调整文本分布,并且通过计算文本特征与图像特征在同构空间的欧式距离,即拉近匹配的文本图像对(T
a,G
+)的距离,同时增加不匹配的文本图像对(T
a,G
-)的距离,确保分离出的特征是准确的、有意义的。运动特征的提取过程与此相似,优化匹配的文本视频对(T
m,V
+)的距离,增加不匹配的文本视频对(T
m,V
-)的距离。
2、双流式视频生成过程,参见步骤21-22)
21)对外观特征T
a,先利用一个单层全连接网络结构将其映射到4*4*1024维度,再通过2D反卷积神经网络(2D deconvolution neural network)来生成静态图F。2D反卷积神经网络由5层反卷积层组成,每层反卷积层的感受野大小为4*4,步长为2.
为了对同样的文本生成更多样性的视频,引入一个随机变量Z,该随机变量从高斯分布采样,使得生成的静态图中的物体可以有略微不同的外观和不同的初始位置。
22)对运动特征T
m,学习仿射变换(affine transform)的参数来对运动规律建模,通过将这些参数运用到静态图F上得到一组变换图,再与掩码结合来生成视频。掩码的生成需要结合外观特征T
a、运动特征T
m和随机变量Z,经过一个3D反卷积神经网络来生成掩码,网络的最后一层使用softmax激活函数。
3、对抗性训练过程,参见如下步骤:
使用帧辨别器和视频辨别器,对生成的视频帧质量和视频的运动进行指导,并通过分别加入外观特征T
a和运动特征T
m强化训练过程,使生成的视频可以符合文本描述。辨别器与生成器的目标函数交替训练,得到最优化的生成器。
本发明实施主要是在文献[1](Xue T,Wu J,Bouman K L,et al.Visual Dynamics:Probabilistic Future Frame Synthesis via Cross Convolutional Networks[J].2016.)提供的Moving MNIST数据集上进行,并且通过与文献[2](Pan Y,Qiu Z,Yao T,et al.To Create What You Tell:Generating Videos from Captions[J].2018.)记载的方法进行比较,图2是本实施例进行视频生成的结果示例图,通过图2可以看出,本发明可以准确地生成出符合文本描述的视频片段,采用本发明模型能够自适应地生成时序一致的视频片段,不需要在对抗训练中使用额外的运动辨别器来对其指导,这也是本发明优于现有方法的技术优势。
需要注意的是,公布实施例的目的在于帮助进一步理解本发明,但是本领域的技术人员可以理解:在不脱离本发明及所附权利要求的精神和范围内,各种替换和修改都是可能的。因此,本发明不应局限于实施例所公开的内容,本发明要求保护的范围以权利要求书界定的范围为准。
Claims (10)
- 一种基于文本不同特征空间的双流式视频生成方法,通过分离文本中所包含的空间特征和时序特征,采用双流的方式进行特征建模,并利用对抗训练的方式进行训练,实现智能化生成符合文本内容的真实高的视频片段;包括:文本特征提取过程、双流式视频生成器构建过程和对抗性训练过程;1)文本特征提取过程,执行如下操作:11)提取得到文本的外观特征T a和运动特征T m;12)对提取的外观特征T a和运动特征T m,在数据集中选择正负样本,同时引入三元组损失,准确分离文本特征,具体执行如下操作:121)在训练提取外观特征过程中,定义三元组Φ a=(T a,G +,G -),其中:T a为参照用外观特征;G +为正样本,是包含符合文本描述的物体的视频帧;G -为负样本,是包含文本描述不同的物体的视频帧;外观特征只需物体类型符合文本描述;选取视频中的一帧;对选取的视频帧,使用2D卷积神经网络提取视频空间特征,并利用一个单层全连接网络结构将视频空间特征映射到T a的同构空间;使用L2范数计算不同模态数据间的距离,即同构空间内图像与文本之间的欧式距离122)在训练提取动作特征过程中,选取包含符合文本描述的运动的视频V +;使用整个视频,可忽略视频中包含的物体类型;对选取的视频帧,使用3D卷积神经网络提取视频时序特征,并利用一个单层全连接网络结构将视频时序特征映射到T m的同构空间;2)双流式视频生成器的构建过程,执行如下操作:21)利用提取的外观特征T a,通过2D反卷积神经网络生成一张静态图;22)利用运动特征T m学习仿射变换的参数,作用于该静态图上,并通过掩码结合来衍 生出后续的视频帧;由此构建双流式视频生成器;3)对抗性训练过程,通过交替训练双流式视频生成器和辨别器,并通过分别加入外观特征T a和运动特征T m强化训练过程进行优化,得到最优化的生成器,使得生成的视频内容符合文本描述;通过上述步骤,实现基于文本不同特征空间的双流式视频生成。
- 如权利要求1所述基于文本不同特征空间的双流式视频生成方法,其特征是,步骤11)具体执行如下操作:111)对输入的文本,采用双向长短期记忆网络实现对文本特征的映射,提取正序文本特征T x={t x1,t x2,…,t xn}和逆序文本特征T y={t y1,t y2,…,t yn},其中n表示文本的长度;然后通过取均值的方式T=(T x+T y)/2得到需要的文本特征T={t 1,t 2,…,t n};112)引入关注机制对不同类型的文本特征进行分离,得到外观特征T a和运动特征T m:
- 如权利要求2所述基于文本不同特征空间的双流式视频生成方法,其特征是,步骤111)中所述的双向长短期记忆网络分为上下两层,分别对文本进行正序和逆序的解析;文本中的每一个词依次输入双向长短期记忆网络的每个时间节点,每个时间节点处的维度为256维,提取到正序文本特征和逆序文本特征。
- 如权利要求1所述基于文本不同特征空间的双流式视频生成方法,其特征是,步骤21)具体执行如下操作:211)利用一个单层全连接网络结构,将外观特征T a映射到4*4*1024维度,将维度重组为(4,4,1024);212)再通过2D反卷积神经网络生成静态图;其中,2D反卷积神经网络由5层反卷积层组成,每层反卷积层的感受野大小为4*4,步长为2,输出的图像大小为64*64;213)同时引入一个随机变量Z,该随机变量从高斯分布采样,使得生成的静态图中的物体可以有略微不同的外观和不同的初始位置,以使得对同样的文本生成更多样性的视频。
- 如权利要求7所述基于文本不同特征空间的双流式视频生成方法,其特征是,步骤222)中,假定需要生成长度为L的视频片段,则共需要L*K*6个仿射变换参数,将运动特征T m通过一个双层的全连接网络映射为指定维度的参数;在将K张变换后的图F′={f′ 1,f′ 2,…,f′ K}组合在一起的过程中,评估在每个坐标位置上每张变换图的置信度;置信度越高说明在该位置上该变换图越接近真实的视频帧;具体通过外观特征T a、运动特征T m和随机变量Z,在有初始状态及运动趋势信息的指导下,经过一个3D反卷积神经网络生成掩码M={m 1,m 2,…,m K};再通过掩码实现置信度的自动评估;网络的最后一层使用softmax激活函数对每一个坐标位置(i,j)上的置信度进行归一化,即满足变换图的过程表示为式7:其中,F next为生成的下一帧图像。
- 如权利要求1所述基于文本不同特征空间的双流式视频生成方法,其特征是,步骤3)中,所述辨别器包括帧辨别器和视频辨别器;对抗性训练过程具体执行如下操作:31)帧辨别器采用四层的2D卷积神经网络结构;使用帧辨别器的方法,对生成的视频 中的每一帧 和作为参照的真实的视频 中的每一帧 加入正负样本的文本外观特征 与 组成真实图文对 不匹配图文对 及生成图文对 进行强化训练,由此拉近预测的图像数据分布与真实且外观符合描述的图像数据分布之间的距离,提高生成视频的准确性;损失函数表达式为式8:帧辨别器的目标函数表示为式9:其中,l为生成视频的长度;双流式视频生成器的优化目标之一为:在假定帧辨别器的预测类别为真实数据类别的前提下,使得生成的图像数据分布与真实且外观匹配的图像数据分布尽可能相似,优化函数表达式为式10:32)视频辨别器采用四层的3D卷积神经网络结构;使用视频辨别器的方法,对生成的视频V g和作为参照的真实的视频V r,加入正负样本的文本运动特征 与 组成真实视频 文本对 不匹配的视频文本对 及生成视频文本对 进行训练,由此达到拉近预测的视频数据分布与真实且运动符合描述的视频数据分布之间的距离的效果;损失函数表达式为式11:其中,D(R V)、D(W V))和D(G V))为辨别器对不同视频文本对的类别预测;双流式视频生成器的另一个优化目标为:在假定视频辨别器的预测类别为真实数据类别的前提下使得生成的视频数据分布与真实且运动匹配的视频数据分布尽可能相似,优化函数表达式为式12。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201910172420.0A CN109978021B (zh) | 2019-03-07 | 2019-03-07 | 一种基于文本不同特征空间的双流式视频生成方法 |
| CN201910172420.0 | 2019-03-07 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020177214A1 true WO2020177214A1 (zh) | 2020-09-10 |
Family
ID=67078179
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2019/085962 Ceased WO2020177214A1 (zh) | 2019-03-07 | 2019-05-08 | 一种基于文本不同特征空间的双流式视频生成方法 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109978021B (zh) |
| WO (1) | WO2020177214A1 (zh) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113449135A (zh) * | 2021-08-31 | 2021-09-28 | 阿里巴巴达摩院(杭州)科技有限公司 | 图像生成系统与方法 |
| CN116012479A (zh) * | 2022-12-30 | 2023-04-25 | 联想(北京)有限公司 | 一种视频生成方法、装置和电子设备 |
| CN118590707A (zh) * | 2024-04-19 | 2024-09-03 | 抖音视界有限公司 | 视频处理的方法、装置、电子设备和计算机程序产品 |
| GB2635932A (en) * | 2023-10-30 | 2025-06-04 | Adobe Inc | Customizing motion and appearance in video generation |
Families Citing this family (8)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110610124B (zh) * | 2019-07-30 | 2021-11-30 | 珠海亿智电子科技有限公司 | 一种基于生成对抗网络的图像生成方法 |
| CN110717054B (zh) * | 2019-09-16 | 2022-07-15 | 清华大学 | 基于对偶学习的跨模态文字生成视频的方法及系统 |
| CN110929098B (zh) * | 2019-11-14 | 2023-04-07 | 腾讯科技(深圳)有限公司 | 视频数据的处理方法、装置、电子设备及存储介质 |
| CN111669515B (zh) * | 2020-05-30 | 2021-08-20 | 华为技术有限公司 | 一种视频生成方法及相关装置 |
| CN115408561A (zh) * | 2022-09-05 | 2022-11-29 | 山东新一代信息产业技术研究院有限公司 | 基于gan网络实现根据文本标题生成动态视频的方法 |
| CN115249062B (zh) * | 2022-09-22 | 2023-02-03 | 武汉大学 | 一种文本生成视频的网络模型、方法及装置 |
| CN116939325A (zh) * | 2023-06-05 | 2023-10-24 | 阿里巴巴(中国)有限公司 | 视频生成方法 |
| CN117835012B (zh) * | 2023-12-27 | 2024-07-26 | 北京智象未来科技有限公司 | 可控视频生成方法、装置、设备、存储介质 |
Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104731959A (zh) * | 2015-04-03 | 2015-06-24 | 北京威扬科技有限公司 | 基于文本的网页内容生成视频摘要的方法、装置及系统 |
| WO2017209307A1 (en) * | 2016-06-01 | 2017-12-07 | Mitsubishi Electric Corporation | Method and system for generating multimodal digital image |
| CN107609460A (zh) * | 2017-05-24 | 2018-01-19 | 南京邮电大学 | 一种融合时空双重网络流和attention机制的人体行为识别方法 |
| CN108090940A (zh) * | 2011-05-06 | 2018-05-29 | 西尔股份有限公司 | 基于文本的视频生成 |
| CN108596265A (zh) * | 2018-05-02 | 2018-09-28 | 中山大学 | 基于文本描述信息和生成对抗网络的视频生成模型 |
| CN108830212A (zh) * | 2018-06-12 | 2018-11-16 | 北京大学深圳研究生院 | 一种视频行为时间轴检测方法 |
| CN109325135A (zh) * | 2018-10-26 | 2019-02-12 | 平安科技(深圳)有限公司 | 基于文本的视频生成方法、装置、计算机设备及存储介质 |
Family Cites Families (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106934346B (zh) * | 2017-01-24 | 2019-03-15 | 北京大学 | 一种目标检测性能优化的方法 |
| CN108304864B (zh) * | 2018-01-17 | 2020-07-17 | 清华大学 | 深度对抗度量学习方法及装置 |
| CN109344266B (zh) * | 2018-06-29 | 2021-08-06 | 北京大学深圳研究生院 | 一种基于双语义空间的对抗性跨媒体检索方法 |
-
2019
- 2019-03-07 CN CN201910172420.0A patent/CN109978021B/zh not_active Expired - Fee Related
- 2019-05-08 WO PCT/CN2019/085962 patent/WO2020177214A1/zh not_active Ceased
Patent Citations (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108090940A (zh) * | 2011-05-06 | 2018-05-29 | 西尔股份有限公司 | 基于文本的视频生成 |
| CN104731959A (zh) * | 2015-04-03 | 2015-06-24 | 北京威扬科技有限公司 | 基于文本的网页内容生成视频摘要的方法、装置及系统 |
| WO2017209307A1 (en) * | 2016-06-01 | 2017-12-07 | Mitsubishi Electric Corporation | Method and system for generating multimodal digital image |
| CN107609460A (zh) * | 2017-05-24 | 2018-01-19 | 南京邮电大学 | 一种融合时空双重网络流和attention机制的人体行为识别方法 |
| CN108596265A (zh) * | 2018-05-02 | 2018-09-28 | 中山大学 | 基于文本描述信息和生成对抗网络的视频生成模型 |
| CN108830212A (zh) * | 2018-06-12 | 2018-11-16 | 北京大学深圳研究生院 | 一种视频行为时间轴检测方法 |
| CN109325135A (zh) * | 2018-10-26 | 2019-02-12 | 平安科技(深圳)有限公司 | 基于文本的视频生成方法、装置、计算机设备及存储介质 |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113449135A (zh) * | 2021-08-31 | 2021-09-28 | 阿里巴巴达摩院(杭州)科技有限公司 | 图像生成系统与方法 |
| US11714849B2 (en) | 2021-08-31 | 2023-08-01 | Alibaba Damo (Hangzhou) Technology Co., Ltd. | Image generation system and method |
| CN116012479A (zh) * | 2022-12-30 | 2023-04-25 | 联想(北京)有限公司 | 一种视频生成方法、装置和电子设备 |
| GB2635932A (en) * | 2023-10-30 | 2025-06-04 | Adobe Inc | Customizing motion and appearance in video generation |
| US12568288B2 (en) | 2023-10-30 | 2026-03-03 | Adobe Inc. | Customizing motion and appearance in video generation |
| CN118590707A (zh) * | 2024-04-19 | 2024-09-03 | 抖音视界有限公司 | 视频处理的方法、装置、电子设备和计算机程序产品 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109978021A (zh) | 2019-07-05 |
| CN109978021B (zh) | 2022-09-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020177214A1 (zh) | 一种基于文本不同特征空间的双流式视频生成方法 | |
| CN113283298B (zh) | 基于时间注意力机制和双流网络的实时行为识别方法 | |
| WO2023280065A1 (zh) | 一种面向跨模态通信系统的图像重建方法及装置 | |
| CN114049381A (zh) | 一种融合多层语义信息的孪生交叉目标跟踪方法 | |
| CN112597883A (zh) | 一种基于广义图卷积和强化学习的人体骨架动作识别方法 | |
| CN108363973B (zh) | 一种无约束的3d表情迁移方法 | |
| CN109712108B (zh) | 一种基于多样鉴别性候选框生成网络的针对视觉定位方法 | |
| CN106971414A (zh) | 一种基于深度循环神经网络算法的三维动画生成方法 | |
| WO2025086778A1 (zh) | 知识蒸馏方法和电子设备 | |
| CN113205043B (zh) | 一种基于强化学习的视频序列二维姿态估计方法 | |
| CN112052795A (zh) | 一种基于多尺度时空特征聚合的视频行为识别方法 | |
| WO2023142886A1 (zh) | 表情迁移方法、模型训练方法和装置 | |
| CN114202801A (zh) | 基于注意力引导空域图卷积简单循环单元的手势识别方法 | |
| CN117237488A (zh) | 一种三维数字人驱动方法、介质及系统 | |
| Zhang et al. | 3D graph convolutional feature selection and dense pre-estimation for skeleton action recognition | |
| Zhang et al. | Student classroom teaching behavior recognition based on dscnn model in intelligent campus education | |
| CN117636390A (zh) | 基于知识蒸馏的视频人体姿态估计方法 | |
| CN114783039B (zh) | 一种3d人体模型驱动的运动迁移方法 | |
| Zhen et al. | Dance video action recognition algorithm based on improved hypergraph convolutional networks | |
| CN114399829B (zh) | 基于生成式对抗网络的姿态迁移方法、电子设备及介质 | |
| Wang et al. | SignAligner: Harmonizing Complementary Pose Modalities for Coherent Sign Language Generation | |
| CN111339782A (zh) | 一种基于多层次语义解析的手语翻译系统及方法 | |
| Xu et al. | Intra-inter region adaptive graph convolutional networks for skeleton-based action recognition | |
| CN111209433A (zh) | 一种基于特征增强的视频分类算法 | |
| CN114863548B (zh) | 基于人体运动姿态非线性空间特征的情绪识别方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19917794 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 19917794 Country of ref document: EP Kind code of ref document: A1 |



