Multi-scale video frame insertion method combined with spatio-temporal feature optimization
By combining the multi-scale video frame interpolation method optimized with spatio-temporal features, the problem of inaccurate motion estimation and incoherent intermediate frames in high-resolution, large-scale motion scenes is solved, and high-quality frame interpolation of video sequences is achieved.
Patent Information
- Application Number
- CN202410661885.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-27
- Publication Date
- 2024-09-13
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing video frame interpolation methods have inaccurate motion estimation and incoherent generated intermediate frames in high-resolution, large-scale motion scenes.
A multi-scale video frame insertion method combined with spatio-temporal feature optimization is adopted. Through the multi-scale feature extraction module, attention module and continuous frame refinement module, spatio-temporal information is extracted and the intermediate frame generation is optimized through the total loss function to ensure the coherence and consistency of the intermediate frames. consistency.
It achieves accurate motion estimation and coherence of intermediate frames in high-resolution, large-scale motion scenes, improving the overall consistency and quality of video sequences.
Smart Images

Figure CN118646912A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of video processing, and in particular relates to a multi-scale video frame insertion method combined with spatiotemporal feature optimization. Background Art
[0002] Video interpolation is an important research direction in the field of video image coding and computer vision. Its research explores the problem of inserting extra frames into video sequences to improve video quality. It has many practical applications in the field of multimedia services, such as video frame rate conversion, video compression, and synthetic virtual viewpoint images.
[0003] With the continuous advancement of deep learning and optical flow networks, video interpolation methods based on optical flow have made significant breakthroughs with the help of deep learning. This is because optical flow technology can provide pixel-level motion estimation of objects or scenes in video sequences, thus providing more accurate dynamic information for video interpolation. Flow-based methods usually follow three steps: 1) Estimate the optical flow between the target frame and the input frame. 2) Warp the input frame or context features according to the optical flow. 3) Refine the warped frame or feature and generate the target frame through a synthesis network.
[0004] There are several common methods to implement multiple video interpolation. The first is to modify the number of output channels of the model and generate all intermediate frames at once. The second is to use a recursive single video interpolation algorithm to generate multiple frames. After k recursions, 2 k The third method is multiple video interpolation based on time conditions. This method is to add a time tag in the training phase to specify the task of generating an intermediate frame at a certain moment. In the inference phase, the intermediate frame at the corresponding moment is generated by specifying a timestamp. Each inference generates one frame, and N-1 inferences are performed to achieve N-fold interpolation.
[0005] However, the above methods all have problems such as inaccurate motion estimation caused by high resolution and large-scale motion scenes, as well as incoherent generation of intermediate frames in video sequences. Summary of the invention
[0006] The present invention aims to provide a multi-scale video interpolation method combined with spatiotemporal feature optimization to solve the above-mentioned technical problems.
[0007] In order to solve the above technical problems, a specific technical solution of a multi-scale video interpolation method combined with spatiotemporal feature optimization of the present invention is as follows:
[0008] A multi-scale video interpolation method combined with spatiotemporal feature optimization includes the following steps:
[0009] Step 1: Data preprocessing;
[0010] Step 2: Construct a coarse frame generation network; including multi-scale feature extraction module, attention module,
[0011] Inter-frame generation module;
[0012] Step 3: Construct a continuous frame refinement module; the continuous frame refinement module is located in the multi-frame optimization part, combined
[0013] Multiple frame information is used to obtain high-quality and coherent intermediate frames through residual compensation;
[0014] Step 4: Construct the total loss function L total =λ r L r +λ m L m +λ prec L prec , where λ r , m and λ prec As the weight parameter of reconstruction loss, intermediate feature loss and perceptual loss;
[0015] Step 5: Train the coarse-frame generation network and the multi-frame refinement network.
[0016] Furthermore, the step 1 includes the following specific steps:
[0017] Step 1.1: Extract images from the video sequence at fixed intervals. In the 8× video interpolation, select the 1st, 9th, 17th and 25th frames as the input images at time -1, 0, 1, 2, which are I -1 , I0, I1 and I2 frames, where I0 and I1 are used as reference frames and frames 10 to 16 are used as supervisory frames;
[0018] Step 1.2: Randomly crop each image so that each image has the same size N×N, 128≤N≤512;
[0019] Step 1.3: Augment the video dataset by randomly flipping, rotating, swapping color channels, and reversing the sequence order of the images.
[0020] Furthermore, step 2 includes the following specific steps:
[0021] Step 2.1: The multi-scale feature extraction module is located at the encoding end and includes four layers of multi-scale feature encoding blocks with the same structure. The four input frames I are respectively -1 , I0, I1 and I2 perform feature extraction in turn to obtain the coding features of each frame;
[0022] The multi-scale feature encoding block is composed of two convolutions to form a downsampling layer, which is then processed separately by multiple different dilated convolution layers, and then fused by convolution, and finally added with the down-sampled features for output; Step 2.2: The attention module is located after the multi-scale feature encoding block, and the attention module includes a channel attention module and a spatiotemporal attention module. The two sub-modules process the input features in parallel and output the features by adding the features of the sub-attention modules;
[0023] The channel attention module first performs 3D global average pooling on the input features, then learns nonlinear mapping through a multi-layer perceptron, and finally limits the weight of each channel to between 0 and 1 through a Sigmoid function. The input features are multiplied by the channel weights and added to obtain output features. The spatiotemporal attention module first performs an average pooling operation on the input features in the channel dimension, then adds the time tag features and concatenates them with the pooled features according to the channel dimension for a 3D convolution operation. Finally, a four-layer weight feature is obtained through a Sigmoid function, which acts on four input features respectively. The input features are multiplied by the channel weights and added to obtain output features.
[0024] Step 2.3: The intermediate frame generation module is located after the attention module. For any target time T i This module and the attention module jointly complete the task of intermediate frame synthesis on one branch. The intermediate frame generation module consists of four upsampling layers, each of which consists of two parameter-sharing optical flow synthesis modules. The bidirectional optical flow synthesis is achieved through the feature interaction operation in each layer and the optical flow refinement operation between layers. The intermediate frame of this branch will be obtained through the frame synthesis operation.
[0025] Furthermore, the feature interaction operation described in step 2.3 refers to the operation of reusing the reference features of the two optical flow synthesis modules in the upsampling layer. The reference features are obtained by performing backward warping operations on the encoding features and the intermediate optical flows of corresponding sizes in the two branches;
[0026] The optical flow synthesis module is composed of a convolution layer, a residual block and a deconvolution layer. The input features combined with the corresponding time features are input into the module for convolution to obtain the intermediate optical flow and context features output by the module.
[0027] The optical flow refinement operation refers to the operation of adding the current intermediate optical flow in each branch to the intermediate optical flow of the previous layer by 2 times bilinear interpolation, and the refined intermediate optical flow is used as the input feature of the next optical flow synthesis module;
[0028] The backward warping operation, for each pixel of the generated image or feature, calculates the coordinates in the original image based on the optical flow information, and the intensity value is derived from the coordinates. The reference frame or the encoded feature of the reference frame is backward warped based on the optical flow to obtain the warped frame or reference feature.
[0029] The frame synthesis operation is a process of synthesizing a coarse frame through a backward warping operation and a spatial sampling operation. Two reference frames are used to perform a backward warping operation with optical flows in two directions to obtain a warped frame, and then a spatial sampling mask is used to perform spatial sampling to obtain a coarse frame.
[0030] Furthermore, the continuous frame refinement module of step 3 includes three downsampling residual layers and an upsampling layer, the feature scale of each layer remains unchanged, the network depth is increased by adding residual blocks, downsampling operations are performed at different depth positions, and information of different feature sizes is obtained. The feature combination of the network adopts an additive method to ensure that the number of input and output channels remains unchanged, and the feature size is restored by upsampling and added to the features of the previous layer to achieve the fusion of different semantic features. The downsampling layer is composed of two convolutional layers, a channel attention layer and an activation function, and the upsampling layer is composed of a convolutional layer, a deconvolutional layer and a channel attention layer, wherein the residual layer is composed of two layers of convolution and an activation function, and the channel attention layer involved in the upsampling layer and the downsampling layer is composed of a 3D global average pooling, a convolutional layer and a Sigmoid function. The convolutions involved in the continuous frame refinement model are all 3D convolutions, and the PReLU activation function is added after the convolutional layer or the channel attention layer.
[0031] Furthermore, the reconstruction loss described in step 4 uses the l1 distance between the generated frame and the target frame
[0032] The intermediate feature loss calculates the loss of the extracted features and the intermediate frame features synthesized by the intermediate frame generation module in the solution process. The loss is calculated for all target frames, that is,
[0033] where φ t (i) It is the output feature of the target frame through the multi-scale pyramid;
[0034] The perceptual loss is calculated by generating the features of each layer of the intermediate frame and the target frame.
[0035] Among them, Φ j is the jth layer map of the VGG-16 network. Further, step 5 includes jointly training the coarse frame generation network and the refinement network to train the four consecutive frames of images I -1, I0, I1 and I2 are sent to the coarse frame synthesis network, and the intermediate frames at different times are generated by executing the decoding end multiple times. Then all the intermediate frame information is sent to the multi-frame refinement network for training. After each iteration of all networks, the total loss function is used for reverse gradient propagation until the total loss function reaches stability and the training is terminated.
[0036] The multi-scale video interpolation method combined with spatiotemporal feature optimization of the present invention has the following advantages: the present invention proposes a multi-scale video interpolation model based on overall optimization of spatiotemporal features to address the problems of inaccurate motion estimation and incoherent generation of intermediate frames in video sequences caused by high-resolution and large-scale motion scenes. By adding an attention fusion module containing spatiotemporal attention and channel attention containing time information, the spatiotemporal information of continuous frames is fully extracted to obtain fusion features with time; and a video interpolation method based on time conditions is adopted to generate intermediate frames of corresponding moments one by one by adding time tags, thereby realizing interpolation at any moment; finally, all the generated intermediate frames are jointly optimized through a refinement module to further extract spatiotemporal features, so that the final intermediate frames have stronger overall consistency and coherence. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 It is the overall structure diagram of the method of the present invention;
[0038] Figure 2 It is a multi-scale feature encoding structure diagram;
[0039] Figure 3 It is a flowchart of attention;
[0040] Figure 4 is the channel attention flow chart;
[0041] Figure 5 It is a flow chart of spatiotemporal attention;
[0042] Figure 6 is a schematic diagram of an intermediate frame generation module;
[0043] Figure 7 It is a continuous frame refinement network structure diagram. DETAILED DESCRIPTION
[0044] In order to better understand the purpose, structure and function of the present invention, a multi-scale video interpolation method combined with spatiotemporal feature optimization of the present invention is further described in detail below with reference to the accompanying drawings.
[0045] The multi-scale video frame insertion method combined with spatiotemporal feature optimization of the present invention comprises the following steps:
[0046] Step 1: Data preprocessing;
[0047] Step 1.1: Extract images from the video sequence at fixed intervals. In the 8× video interpolation, select the 1st, 9th, 17th and 25th frames as the input images at time -1, 0, 1, 2, which are I -1 , I0, I1 and I2 frames, where I0 and I1 are used as reference frames and frames 10 to 16 are used as supervisory frames.
[0048] Step 1.2: Randomly crop each image so that each image has the same size N×N, 128≤N≤512.
[0049] Step 1.3: Augment the video dataset by randomly flipping, rotating, swapping color channels, and reversing the sequence order of the images.
[0050] Step 2: Construct a coarse frame generation network, which includes a multi-scale feature extraction module, an attention module, and an intermediate frame generation module.
[0051] Step 2.1: The multi-scale feature extraction module is located at the encoding end and includes four layers of multi-scale feature encoding blocks with the same structure. The four input frames I are respectively -1 , I0, I1 and I2 are subjected to feature extraction in turn to obtain the coding features of each frame.
[0052] The multi-scale feature encoding block is composed of two convolutional downsampling layers, which are then processed separately by multiple different dilated convolutional layers, and then fused by convolution, and finally added with the downsampled features for output.
[0053] Step 2.2: The attention module is located after the multi-scale feature encoding block, and the attention module includes a channel attention module and a spatiotemporal attention module. The two sub-modules process the input features in parallel and output the features by adding the features of the sub-attention modules.
[0054] The channel attention module first performs 3D global average pooling on the input features, then learns nonlinear mapping through a multi-layer perceptron, and finally limits the weight of each channel to between 0 and 1 through a Sigmoid function. The input features are multiplied by the channel weights and added to obtain the output features.
[0055] The spatiotemporal attention module first performs an average pooling operation on the input features in the channel dimension, then adds the time tag features and concatenates them with the pooled features in the channel dimension for a 3D convolution operation, and finally obtains four layers of weighted features through the Sigmoid function, which are applied to the four input features respectively. The input features are multiplied by the channel weights and added to obtain the output features.
[0056] Step 2.3: The intermediate frame generation module is located after the attention module. For any target time T iThis module and the attention module work together on one branch to complete the task of intermediate frame synthesis. This module consists of four upsampling layers, each of which consists of two parameter-sharing optical flow synthesis modules. The synthesis of bidirectional optical flow is achieved through feature interaction operations in each layer and optical flow refinement operations between layers. The intermediate frame of this branch will be obtained through frame synthesis operations.
[0057] The feature interaction operation refers to the operation of multiplexing the reference features of the two optical flow synthesis modules in the upsampling layer, wherein the reference features are obtained by performing backward warping operations on the encoding features and the intermediate optical flows of corresponding sizes in the two branches.
[0058] The optical flow synthesis module is composed of a convolution layer, a residual block and a deconvolution layer. The input features combined with the corresponding time features are input into the module for convolution to obtain the intermediate optical flow and context features output by the module.
[0059] The optical flow refinement operation refers to the operation of adding the current intermediate optical flow in each branch to the intermediate optical flow of the previous layer by 2 times bilinear interpolation, and the refined intermediate optical flow is used as the input feature of the next optical flow synthesis module.
[0060] The backward warping operation calculates the coordinates of each pixel in the original image based on the optical flow information for each pixel of the generated image or feature, and its intensity value is derived from the coordinates. The reference frame or the encoded feature of the reference frame is backward warped according to the optical flow to obtain the warped frame or reference feature.
[0061] The frame synthesis operation is a process of synthesizing a coarse frame by backward warping and spatial sampling, specifically, using two reference frames and optical flows in two directions to perform backward warping operations to obtain a warped frame, and then using a spatial sampling mask to perform spatial sampling to obtain a coarse frame.
[0062] Step 3: Constructing the continuous frame refinement module
[0063] The continuous frame refinement module is located in the multi-frame optimization part. Its purpose is to obtain high-quality and coherent multiple intermediate frames by combining multi-frame information through residual compensation. The network contains three downsampling residual layers and upsampling layers. The feature scale of each layer remains unchanged. The network depth is increased by adding residual blocks. Downsampling operations are performed at different depth positions to obtain information of different feature sizes. The network's feature combination adopts an addition method to ensure that the number of input and output channels remains unchanged. The feature size is restored by upsampling and added to the previous layer feature to achieve the fusion of different semantic features. The downsampling layer is composed of two convolutional layers, a channel attention layer and an activation function. The upsampling layer is composed of a convolutional layer, a deconvolutional layer and a channel attention layer. Among them, the residual layer is composed of two layers of convolution and an activation function. The channel attention layer involved in the upsampling layer and the downsampling layer is composed of 3D global average pooling, a convolutional layer and a Sigmoid function. The convolutions involved in this model are all 3D convolutions, and the PReLU activation function is added after the convolutional layer or the channel attention layer.
[0064] Step 4: Construct the total loss function L total =λ r L r +λ m L m +λ prec L prec , where λ r , m and λ prec As the weight parameter of reconstruction loss, intermediate feature loss and perceptual loss.
[0065] The reconstruction loss uses the l1 distance between the generated frame and the target frame
[0066] The intermediate feature loss calculates the loss of the extracted features and the intermediate frame features synthesized by the intermediate frame generation module in the solution process. The loss is calculated for all target frames, that is, where φ t (i) It is the output feature of the target frame through the multi-scale pyramid.
[0067] The perceptual loss is calculated by generating the features of each layer of the intermediate frame and the target frame. Among them, Φ j is the j-th layer mapping of the VGG-16 network.
[0068] Step 5: Train the coarse-frame generation network and the multi-frame refinement network.
[0069] The coarse frame generation network and the refinement network are jointly trained. -1, I0, I1 and I2 are sent to the coarse frame synthesis network, and the intermediate frames at different times are generated by executing the decoding end multiple times. Then all the intermediate frame information is sent to the multi-frame refinement network for training. After each iteration of all networks, the total loss function is used for reverse gradient propagation until the total loss function reaches stability and the training is terminated.
[0070] Example:
[0071] like Figure 1 As shown, a multi-scale video interpolation method combined with spatiotemporal feature optimization includes the following steps:
[0072] Step 1: Data preprocessing;
[0073] Step 1.1: Divide samples of a certain sequence length from the video sequence of the GoPro dataset. Each sample has 25 frames, including 4 input frames and 7 target frames. The 1st, 9th, 17th and 25th frames are input frames, and the 10th to 16th frames are target frames.
[0074] Step 1.2: Crop each image so that each image has the same size of 352×352, which meets the training requirements on this dataset.
[0075] Step 1.3: Data augmentation is performed by randomly flipping, rotating, changing color channels, and reversing the order of the video sequence to increase the input data of the model. Such data preprocessing methods better meet the needs of video interpolation technology and improve the effectiveness of the model in practical tasks.
[0076] The GoPro test set, Adobe240 and X4K1000FPS data are used to evaluate the performance of the proposed network.
[0077] Step 2: Construct a coarse frame generation network, which includes a multi-scale feature extraction module, an attention module, and an intermediate frame generation module.
[0078] Step 2.1: The multi-scale feature encoder comprises four layers of multi-scale feature encoding blocks with the same structure. Figure 2 As shown in the figure, for each multi-scale feature encoding block, the input features are sequentially passed through two convolutions with a kernel of 3×3 and strides of 2 and 1, and the feature scale is halved. Then, the output dimensions are halved after each convolution operation through convolutions with a kernel of 1×1 and three 3×3 convolutions with dilation rates of 2, 4, and 6. Among them, the 1×1 convolution only performs dimensionality reduction operations on the previous features, keeping the receptive field unchanged, and convolutions with different dilation rates are used to obtain receptive fields of different scales. The four sets of features are then concatenated and subjected to 1×1 convolution, and finally added to the output features of the second 3×3 convolution to obtain the output features. Each input frame needs to execute the multi-scale feature encoding block four times to obtain the encoded features.
[0079]
[0080] in, I k The i-th layer encoding feature, E m Represents a multi-scale feature encoder.
[0081] Step 2.2: If Figure 3 As shown, the attention module is located after the multi-scale feature encoding block, and the attention module includes a channel attention module and a spatiotemporal attention module. The two sub-modules process the input features in parallel and output the feature Φ=Φ by adding the features of the sub-attention modules. x +Φ y In the video interpolation task of the present invention, since the coding features of the four input frames are obtained by the feature extractor with the same parameters, the same channel weights are set for them to ensure feature consistency. The attention module receives the coding features of four consecutive frames sent by the coding features. The number of channels for each feature is 96. In order to obtain the features in the time dimension, the four features are transformed in dimension and added to the time dimension in sequence to obtain the features containing the time dimension.
[0082] like Figure 4 As shown, the channel attention module first uses 3D global average pooling, acting in the height H, width W and time T directions, extracts the average value of the input features, reduces the time and space dimensions, and obtains a one-dimensional vector with a length consistent with the number of channels. Then, a multi-layer perceptron is used to learn nonlinear mapping to capture the complex relationship between global features, so that the channel attention module can adaptively adjust the channel weights. A simple multi-layer perceptron model is used, consisting of two fully connected layers, with output channels of 48 and 96. The GELU activation function is used after the first fully connected layer to enhance the network's expressiveness. Finally, the Sigmoid function is used to limit the weight of each channel to between 0 and 1, and the input feature is multiplied and added with the channel weight to obtain the output feature.
[0083] Φ x =Sigmoid(MLP(AvgPool3D(Φ T )))·Φ T +Φ T
[0084] Among them, the AvgPool3D operation is
[0085] like Figure 5As shown, the spatiotemporal attention module first performs a channel average pooling operation on the input features without affecting the time and space dimensions. This operation calculates the average value of the input features in the channel dimension. Then, the time label feature T is added. i The pooled features are concatenated according to the channel dimension, and the spatiotemporal information and the label information of the branch task where the attention module is located are obtained through 3D convolution operation. Finally, the four-layer weight feature is obtained through the Sigmoid function, which acts on the four input features respectively, which is consistent with the processing method of the channel attention module.
[0086]
[0087] Among them, [·] represents the feature concatenation of the channel dimension, and Conv represents the 3D convolution operation.
[0088] Step 2.3: If Figure 6 As shown, the intermediate frame generation module is located after the attention module. i This module and the attention module jointly complete the task of intermediate frame synthesis on one branch for video interpolation. This module is a modification based on the dual-branch upsampling module and the decoding feature fusion module in Chapter 3. The present invention modifies the number of input and output channels and features. The method of generating the target frame becomes to iterate multiple times to generate multiple intermediate frames. The module parameters used in each iteration are shared, and time features are added to the input features of each SFB block. The module generates all intermediate frames by iterating N-1 times. The time label is added to better implement the interpolation task at different moments. The module effectively distinguishes the interpolation position of each branch by adding time features. In the process of step-by-step upsampling, the network determines the generation requirements of this iteration by analyzing the time features, and guides the network to generate the target moment T i Motion estimation of the intermediate frame. Specifically, the modification of the number of channels is to add 1 to the number of input channels of each layer, that is, to add the temporal features T and 1-T to the input features of the upper and lower branches respectively. A single channel in the output channel is used as a spatial sampling mask to participate in the subsequent spatial sampling operation and as the input feature of the next upsampling operation.
[0089]
[0090] The feature interaction operation refers to the operation of multiplexing the reference features of the two optical flow synthesis modules in the upsampling layer, wherein the reference features are obtained by performing backward warping operations on the encoding features and the intermediate optical flows of corresponding sizes in the two branches.
[0091] The optical flow synthesis module is composed of a convolution layer, a residual block and a deconvolution layer. The input features combined with the corresponding time features are input into the module for convolution to obtain the intermediate optical flow and context features output by the module.
[0092] The optical flow refinement operation refers to the operation of adding the current intermediate optical flow in each branch to the intermediate optical flow of the previous layer by 2 times bilinear interpolation, and the refined intermediate optical flow is used as the input feature of the next optical flow synthesis module.
[0093]
[0094] The backward warping operation calculates the coordinates of each pixel in the original image based on the optical flow information for each pixel of the generated image or feature, and its intensity value is derived from the coordinates. The reference frame or the encoded feature of the reference frame is backward warped according to the optical flow to obtain the warped frame or reference feature.
[0095]
[0096] The spatial sampling mask of the upper and lower branches is used with the reference features to perform spatial sampling operations, generate target intermediate frame features, and participate in the subsequent loss calculation. The specific steps are to add the two spatial sampling masks and then use the Sigmoid function to obtain the mask involved in the operation, and then synthesize the intermediate frame features with the reference frame according to the mask weight.
[0097]
[0098] The frame synthesis operation is a process of synthesizing a coarse frame through a backward warping operation and a spatial sampling operation. Specifically, two reference frames are used to perform a backward warping operation with optical flows in two directions to obtain a warped frame, and then a spatial sampling mask is used to perform spatial sampling to obtain a coarse frame.
[0099]
[0100] Step 3: Constructing the continuous frame refinement module
[0101] like Figure 7As shown in the figure, the continuous frame refinement module is located in the multi-frame optimization part, and its purpose is to obtain high-quality and coherent multiple intermediate frames by combining multi-frame information through residual compensation. The network contains three downsampling residual layers and upsampling layers. The feature scale of each layer remains unchanged. The network depth is increased by adding residual blocks, and downsampling operations are performed at different depth positions to obtain information of different feature sizes. The feature combination of the network adopts the addition method to ensure that the number of input and output channels remains unchanged. The feature size is restored by upsampling and added to the features of the previous layer to achieve the fusion of different semantic features. The downsampling layer is composed of two convolutional layers, a channel attention layer and an activation function. The first convolution has a step size of 1 in the time dimension and a step size of 2 in the spatial dimension, so that the spatial feature size is halved, and the second convolution kernel has a step size of 1. The upsampling module is composed of a convolutional layer, a deconvolution layer and a channel attention layer. The deconvolution has a step size of 1 in the time dimension and a step size of 2 in the spatial dimension, so that the output spatial feature size is doubled. The residual layer is composed of two layers of convolution and an activation function, and the convolution kernel step size is 1 to ensure that the feature size remains unchanged. The channel attention layer involved in the upsampling and downsampling layers consists of 3D global average pooling, convolution layer and Sigmoid function, which is used to focus on important channel information. The convolutions involved in this model are all 3D convolutions, with a convolution kernel size of 3×3×3 and a deconvolution kernel size of 3×4×4. The PReLU activation function is added after the convolution layer or the channel attention layer.
[0102] First, the feature dimension conversion is performed to convert the N-1 sets of features obtained by the intermediate frame generation module and M t Concatenate according to the time dimension to obtain features containing the time dimension and The relevant features are then sent to the refinement network to obtain residual features of multiple frames, and finally multiple intermediate frames are obtained by adding them.
[0103]
[0104] in, It represents the intermediate frame features of all moments obtained by dimension transformation of time dimension features.
[0105] Through 3D convolution, spatiotemporal features are extracted to enhance the correlation between features in time and space. By introducing the channel attention mechanism, the exchange of information is made more flexible, which promotes effective information transfer between features. In the continuous intermediate frames, due to the large time span, motion estimation and occlusion processing are more difficult. Through the refinement network, all coarse frames are jointly optimized, the characteristics of the spatiotemporal dimension are analyzed, and the correlation and dynamic changes between continuous frames are better captured, so as to better compensate for the coarse frames, so that all the intermediate frames finally synthesized look more natural and coherent in the entire video sequence.
[0106] Step 4: Construct the total loss function L total =λ r L r +λ m L m +λ prec L prec , where λ r , m and λ prec As the weight parameter of reconstruction loss, intermediate feature loss and perceptual loss.
[0107] The reconstruction loss uses the l1 distance between the generated frame and the target frame L1 loss is more sensitive to smaller errors during optimization and helps generate results that are closer to real images.
[0108] The intermediate feature loss is the intermediate feature loss of the intermediate frame at each moment. It is necessary to obtain the encoding features of the frame, that is, the output features of the feature extraction network of the algorithm, and use the target intermediate frame as the input of the multi-scale feature encoder to obtain 4 layers of features of different sizes φ t (1) ,φ t (2) ,φ t (3) and φ t (4) , and the parameters of the feature extraction network are the same as those of other input frames to ensure feature consistency, as shown in formula (4.19). Then, the extracted features are combined with the intermediate frame features ω synthesized by the intermediate frame generation module in the solution process t (i+1) The loss is calculated by performing intermediate frame loss calculation on all target frames, and three intermediate frame features are involved in the calculation for each frame.
[0109] [φ t (1) ,φ t (2) ,φ t (3) ,φ t(4) ]=E m (I t )
[0110]
[0111] where φ t (i) It is the output feature of the target frame through the multi-scale pyramid.
[0112] The perceptual loss is used to distinguish the intermediate frame synthesis task at each moment in the multiple video interpolation task, by calculating the loss of the image on the high-level features, capturing the difference in the image semantic information, not just the difference at the pixel level. The perceptual loss improves the perceptual quality of the image by focusing on important features. The present invention uses the ImageNet pre-trained VGG-16 network to define the perceptual loss, calculates the features of each layer of the generated intermediate frame and the target frame, and calculates the features of each layer of the generated intermediate frame and the target frame.
[0113]
[0114] Among them, Φ j is the j-th layer mapping of the VGG-16 network.
[0115] Step 5: Train the coarse-frame generation network and the multi-frame refinement network.
[0116] The coarse frame generation network and the refinement network are jointly trained. -1 , I0, I1 and I2 are sent to the coarse frame synthesis network, and the intermediate frames at different times are generated by executing the decoding end multiple times. Then all the intermediate frame information is sent to the multi-frame refinement network for training. After each iteration of all networks, the total loss function is used for reverse gradient propagation until the total loss function reaches stability and the training is terminated.
[0117] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited by the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A multi-scale video interpolation method combined with spatiotemporal feature optimization, characterized in that: The steps include: Step 1: Data preprocessing; Step 2: Construct a coarse frame generation network, including a multi-scale feature extraction module, an attention module, and an intermediate frame generation module; Step 3: Construct a continuous frame refinement module; the continuous frame refinement module is located in the multi-frame optimization part, and combines multi-frame information to obtain high-quality and coherent multiple intermediate frames through residual compensation; Step 4: Construct the total loss function L total =λ r L r +λ m L m +λ prec L prec , where λ r , m and λ prec As the weight parameter of reconstruction loss, intermediate feature loss and perceptual loss; Step 5: Train the coarse-frame generation network and the multi-frame refinement network.
2. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 1, characterized in that: The step 1 comprises the following specific steps: Step 1.1: Extract images from the video sequence at fixed intervals. In the 8× video interpolation, select the 1st, 9th, 17th and 25th frames as the input images at time -1, 0, 1, 2, which are I -1 , I0, I1 and I2 frames, where I0 and I1 are used as reference frames and frames 10 to 16 are used as supervisory frames; Step 1.2: Randomly crop each image so that each image has the same size N×N, 128≤N≤512; Step 1.3: Augment the video dataset by randomly flipping, rotating, swapping color channels, and reversing the sequence order of the images.
3. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 1, characterized in that: Step 2 includes the following specific steps: Step 2.1: The multi-scale feature extraction module is located at the encoding end and includes four layers of multi-scale feature encoding blocks with the same structure. The four input frames I are respectively -1 , I0, I1 and I2 perform feature extraction in turn to obtain the coding features of each frame; The multi-scale feature encoding block is composed of two convolutions to form a downsampling layer, which is then processed separately by multiple different dilated convolution layers, and then fused by convolution, and finally added with the down-sampled features for output; Step 2.2: The attention module is located after the multi-scale feature encoding block, and the attention module includes a channel attention module and a spatiotemporal attention module. The two sub-modules process the input features in parallel and output the features by adding the features of the sub-attention modules; The channel attention module first performs 3D global average pooling on the input features, then learns nonlinear mapping through a multi-layer perceptron, and finally limits the weight of each channel to between 0 and 1 through a Sigmoid function. The input features are multiplied by the channel weights and added to obtain the output features. The spatiotemporal attention module first performs an average pooling operation on the input features in the channel dimension, then adds the time tag features and concatenates them with the pooled features in the channel dimension to perform a 3D convolution operation, and finally obtains four layers of weighted features through the Sigmoid function, which act on the four input features respectively. The input features are multiplied by the channel weights and added to obtain the output features; Step 2.3: The intermediate frame generation module is located after the attention module. For any target time T i This module and the attention module jointly complete the task of intermediate frame synthesis on one branch. The intermediate frame generation module consists of four upsampling layers, each of which consists of two parameter-sharing optical flow synthesis modules. The bidirectional optical flow synthesis is achieved through the feature interaction operation in each layer and the optical flow refinement operation between layers. The intermediate frame of this branch will be obtained through the frame synthesis operation.
4. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 3, characterized in that: The feature interaction operation described in step 2.3 refers to the operation of reusing the reference features of the two optical flow synthesis modules in the upsampling layer. The reference features are obtained by performing backward warping operations on the encoding features and the intermediate optical flows of the corresponding sizes in the two branches; The optical flow synthesis module is composed of a convolution layer, a residual block and a deconvolution layer. The input features combined with the corresponding time features are input into the module for convolution to obtain the intermediate optical flow and context features output by the module. The optical flow refinement operation refers to the operation of adding the current intermediate optical flow in each branch to the intermediate optical flow of the previous layer by 2 times bilinear interpolation, and the refined intermediate optical flow is used as the input feature of the next optical flow synthesis module; The backward warping operation, for each pixel of the generated image or feature, calculates the coordinates in the original image based on the optical flow information, and the intensity value is derived from the coordinates. The reference frame or the encoded feature of the reference frame is backward warped based on the optical flow to obtain the warped frame or reference feature. The frame synthesis operation is a process of synthesizing a coarse frame through a backward warping operation and a spatial sampling operation. Two reference frames are used to perform a backward warping operation with optical flows in two directions to obtain a warped frame, and then a spatial sampling mask is used to perform spatial sampling to obtain a coarse frame.
5. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 1, characterized in that: The continuous frame refinement module of step 3 includes three downsampling residual layers and an upsampling layer. The feature scale of each layer remains unchanged. The network depth is increased by adding residual blocks. Downsampling operations are performed at different depth positions to obtain information of different feature sizes. The feature combination of the network adopts an additive method to ensure that the number of input and output channels remains unchanged. The feature size is restored by upsampling and added to the features of the previous layer to achieve the fusion of different semantic features. The downsampling layer is composed of two convolutional layers, a channel attention layer and an activation function. The upsampling layer is composed of a convolutional layer, a deconvolutional layer and a channel attention layer. Among them, the residual layer is composed of two layers of convolution and an activation function. The channel attention layer involved in the upsampling layer and the downsampling layer is composed of 3D global average pooling, a convolutional layer and a Sigmoid function. The convolutions involved in the continuous frame refinement model are all 3D convolutions, and the PReLU activation function is added after the convolutional layer or the channel attention layer.
6. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 1, characterized in that: The reconstruction loss described in step 4 uses the l1 distance between the generated frame and the target frame The intermediate feature loss calculates the loss of the extracted features and the intermediate frame features synthesized by the intermediate frame generation module in the solution process. The loss is calculated for all target frames, that is, in It is the output feature of the target frame through the multi-scale pyramid; The perceptual loss is calculated by generating the features of each layer of the intermediate frame and the target frame. Among them, Φ j is the j-th layer mapping of the VGG-16 network.
7. The multi-scale video interpolation method combined with spatiotemporal feature optimization according to claim 1, characterized in that: The step 5 includes jointly training the coarse frame generation network and the refinement network, and training the four consecutive frames of images I -1 , I0, I1 and I2 are sent to the coarse frame synthesis network, and the intermediate frames at different times are generated by executing the decoding end multiple times. Then all the intermediate frame information is sent to the multi-frame refinement network for training. After each iteration of all networks, the total loss function is used for reverse gradient propagation until the total loss function reaches stability and the training is terminated.
Citation Information
Cited By
Video intermediate frame determination method and device, equipment and storage medium
CN119728899A
