Video encoding and decoding method, training method, device and electronic device
Predicted frames are generated through deformable convolution technology in deep neural networks, which solves the video encoding and decoding efficiency and quality problems of existing technologies in complex motion scenes, and achieves efficient frame reconstruction and compression.
Patent Information
- Application Number
- CN202180005733.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2021-05-13
- Filing Date
- 2021-06-10
- Publication Date
- 2024-09-13
- Estimated Expiration
- 2041-06-10
AI Technical Summary
Existing video coding and decoding technology is difficult to effectively compress and reconstruct frames when dealing with complex and long-range motion, resulting in poor compression efficiency and visual quality. Moreover, traditional motion estimation methods are error-prone, affecting coding and decoding performance.
Using deformable convolution technology based on deep neural networks, predicted frames are generated through temporal deformable convolution, using feature information in previously reconstructed reference frames to adapt to complex movements, generate high-quality predicted frames, and train through end-to-end Optimize neural network parameters to improve encoding and decoding performance.
It achieves efficient video encoding and decoding in complex motion scenes, improves compression performance and visual quality, reduces motion estimation errors, and improves encoding and decoding efficiency.
Smart Images

Figure CN114503576B_ABST
Abstract
Description
[0001] Incorporation by Reference
[0002] This disclosure claims priority to U.S. Patent Application No. 17 / 319,932, filed on May 13, 2021, entitled "Predicted Frame Generation by Deformable Convolution for Video Coding," which claims priority to U.S. Provisional Application No. 63 / 052,231, filed on July 15, 2020, entitled "Predicted Frame Generation by Deformable Convolution." The disclosure of the prior application is incorporated herein by reference in its entirety. Technical Field
[0003] The present disclosure relates to video coding and decoding, and in particular to a video coding and decoding method, a training method, a device and an electronic device. Background Art
[0004] The background description provided herein is intended to generally present the context of the present disclosure. To the extent described in this background section, the work of the inventors currently named, as well as various aspects of the description that may not have the qualification of being prior art at the time of filing of this disclosure, are neither explicitly nor implicitly considered to be prior art of the present application.
[0005] Neural networks are based on a collection of interconnected nodes (also called neurons) that loosely mimic neurons in biological brains. Neurons can be organized into multiple layers. Neurons in one layer can connect to neurons in the previous layer and neurons in the next layer.
[0006] A connection between two neurons, like a synapse in a biological brain, can pass a signal from one neuron to another. The neuron that receives the signal then processes the signal and can signal other connected neurons. In some examples, to find the output of a neuron, the inputs to the neuron are weighted by using the weights of the connections from the inputs to the neuron, and the weighted inputs are summed to generate a weighted sum. A bias can be added to the weighted sum. In turn, the weighted sum is passed through an activation function to produce an output. Summary of the invention
[0007] Aspects of the present disclosure provide a method for video encoding and decoding based on a deep neural network at a video encoding and decoding device. The method may include: performing deformable convolution by a deformable convolution deep neural network (DNN) to generate one or more first feature maps based on a set of previously reconstructed reference frames; generating a predicted frame based on the one or more first feature maps; and reconstructing a current frame based on the predicted frame.
[0008] In an embodiment, a set of second feature maps corresponding to a previously reconstructed reference frame may be generated based on a feature extraction DNN. An offset generation DNN may be used to generate one or more offset maps corresponding to the second feature maps, respectively. Each offset map may be generated based on the following inputs of the offset generation DNN: a second feature map corresponding to the offset map being generated; and a second feature map corresponding to a target frame, the target frame being one of the previously reconstructed reference frames. The one or more offset maps may have the same target frame.
[0009] In an embodiment, when the current frame and the previously reconstructed reference frame are arranged in display order, the target frame is adjacent to the current frame. In an embodiment, when the current frame is a P frame, the target frame is the last frame of the previously reconstructed reference frame. When the current frame is a B frame, the target frame is the last frame of the previously reconstructed reference frame that precedes the current frame in display order.
[0010] In an embodiment, a second feature map may be received as an input to a deformable convolutional DNN. One or more first feature maps corresponding to the second feature maps may be generated, respectively. In an embodiment, the deformable convolutional DNN includes one or more deformable convolutional layers, each deformable convolutional layer is associated with a deformable convolutional kernel, and at one of the one or more deformable convolutional layers corresponding to each second feature map, a deformable convolution is performed based on the corresponding deformable convolutional kernel and the offset map of the corresponding second feature map.
[0011] In an embodiment, one or more aligned frames may be constructed using a frame reconstruction DNN based on the one or more first feature maps and previously reconstructed reference frames. A predicted frame may be generated using a frame synthesis DNN based on the one or more aligned frames.
[0012] In an embodiment, the method may further include: using a four-dimensional (4D) tensor as input, generating a 4D feature tensor using a feature extraction DNN, the 4D tensor being formed by the set of previously reconstructed reference frames. Each frame may include multiple channels. In an embodiment, the 4D feature tensor may be received as input to a deformable convolutional DNN. A fused aligned feature map may be generated.
[0013] In an embodiment, the deformable convolutional DNN includes one or more 3D deformable convolutional layers, each 3D deformable convolutional layer is associated with a 3D deformable convolution kernel and a 3D offset map, and in one of the one or more deformable convolutional layers, a 3D deformable convolution is performed based on the corresponding 3D deformable convolution kernel and the corresponding 3D offset map. In an embodiment, the method may also include: using the fused aligned feature map as an input of the frame reconstruction DNN, and using the frame reconstruction DNN to generate a predicted frame.
[0014] Aspects of the present disclosure also provide a neural network training method. The method may include inputting a set of reference frames into a prediction frame generation module to generate a prediction frame. The prediction frame generation module may include a neural network with parameters to be optimized. The neural network may include a deformable convolutional DNN. The loss of a loss function may be determined. The loss function may include: a compression loss indicating a bit rate estimated based on a difference between a predicted frame and a calibrated true frame, and a reconstruction quality loss indicating a quality of the predicted frame relative to the calibrated true frame. Back propagation may be performed based on the loss of the loss function to update the parameters of the neural network in the prediction frame generation module.
[0015] In an embodiment, the reference frame is selected from a frame sequence of a video based on a temporal downsampling operation, and frames in the frame sequence that are not selected by the downsampling operation are used as calibration ground truth frames.
[0016] In an embodiment, the loss function also includes an alignment loss indicating an alignment error. The training method may also include: using a feature extraction deep neural network (DNN) in a prediction frame generation module to generate first feature maps corresponding to reference frames respectively; using a deformable convolutional DNN in the prediction frame generation module to generate second feature maps corresponding to the first feature maps respectively; and determining the difference between one of the second feature maps and the first feature map corresponding to the target frame, wherein the target frame is one of the reference frames input to the prediction frame generation module. The difference is part of the alignment loss. In an embodiment, when the calibration real frame and the reference frame are arranged in display order, the target frame is a reference frame adjacent to the calibration real frame.
[0017] In an embodiment, the method of neural network training may further include: generating a residual signal between a calibrated real frame and a predicted frame; then performing residual encoding and decoding on the residual signal to generate a reconstructed residual signal; combining the calibrated real frame with the reconstructed residual signal to generate a reconstructed reference frame, and including the reconstructed reference frame in the set of reference frames.
[0018] Various aspects of the present disclosure also provide a video encoding and decoding device based on a deep neural network, including: a deformable convolution module, used to perform deformable convolution through a deformable convolution deep neural network DNN to generate one or more first feature maps based on a set of previously reconstructed reference frames; based on the one or more first feature maps, generate a predicted frame; and a frame reconstruction module, used to reconstruct a current frame based on the predicted frame.
[0019] Aspects of the present disclosure also provide a non-transitory computer-readable medium storing instructions, which, when executed by a processor, causes the processor to perform the video encoding and decoding method.
[0020] Aspects of the present disclosure also provide an electronic device, including: a memory for storing computer-readable instructions; a processor for reading the computer-readable instructions and executing the aforementioned method as instructed by the computer-readable instructions. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Other features, nature, and various advantages of the disclosed subject matter will become more apparent from the following detailed description and accompanying drawings, in which:
[0022] Figure 1 The predicted frame generation process using 2D temporal deformable convolution according to an embodiment of the present disclosure is shown.
[0023] Figure 2 Another prediction frame generation process using 3D temporal deformable convolution according to an embodiment of the present disclosure is shown.
[0024] Figure 3 The neural network training process according to an embodiment of the present disclosure is shown.
[0025] Figure 4 A video encoder according to an embodiment of the present disclosure is shown.
[0026] Figure 5 A video decoder according to an embodiment of the present disclosure is shown.
[0027] Figure 6 The video encoding and decoding process according to an embodiment of the present disclosure is shown.
[0028] Figure 7 The neural network training process according to an embodiment of the present disclosure is shown.
[0029] Figure 8 is a schematic diagram of a computer system according to an embodiment. DETAILED DESCRIPTION
[0030] I. Temporal Deformable Convolution
[0031] The present disclosure provides a video encoding and decoding method based on an artificial neural network. For example, a deformable convolution in a deep neural network (DNN) can be used to generate a prediction frame. In addition, a deformable convolution can be performed on a reference frame sequence spanning a period of time. Features that change in time in each frame can be collected, these features can be aligned with a target frame (used as an alignment basis), and then synthesized into a prediction frame. Therefore, the technology for generating a prediction frame as disclosed in the present application can be named a prediction frame generation technology based on time deformable convolution.
[0032] The present disclosure provides various embodiments, including embodiments based on two-dimensional (2D) deformable convolution or three-dimensional 3D deformable convolution. By jointly considering the quality of the generated prediction frame and the compressibility of the residual (the difference between the prediction frame and the calibrated true (ground truth) frame), the temporal deformable convolution can effectively adapt to the complex, long-range motion (in the temporal and temporal domains) that often appears in the video, and improve the compression performance. The terms "frame" and "picture" can be used interchangeably in the present disclosure.
[0033] II. Hand-crafted and Learning-based Video Codecs
[0034] Traditional video codec standards such as H.264 / Advanced Video Codec (H.264 / AVC), High Efficiency Video Codec (HEVC), and Versatile Video Codec (VVC) share a similar block-based hybrid prediction / transformation framework. For example, individual codec tools such as intra / inter prediction, integer transform, and context-adaptive entropy codec are intensively hand-designed to optimize overall efficiency. The spatiotemporal pixel neighborhood is fully utilized for prediction signal construction to obtain the corresponding residual for subsequent transform, quantization, and entropy codec. On the other hand, the essence of DNN is to extract different levels of spatiotemporal excitations (e.g., corresponding to different layers in DNN) by analyzing the spatiotemporal information of the receptive fields from neighboring pixels. The ability to explore highly nonlinear and non-local spatiotemporal correlations provides a promising opportunity to greatly improve the compression quality.
[0035] In an example, the inter-frame prediction process of the video compression framework may be performed as follows: An input video x includes a plurality of image frames (or pictures) x1, ..., x T In the first motion estimation step, the frames in the video can be divided into spatial blocks. Each block can also be recursively divided into smaller blocks, for example based on a tree structure (e.g., a quadtree or a binary tree). For each block, the current frame x can be calculated. t With a set of previously reconstructed frames A set of motion vectors m between t Note that the subscript t refers to the current t-th encoding cycle, which may not match the timestamp of the image frame. Moreover, Contains frames from multiple previous encoding cycles.
[0036] In the second motion compensation step, based on the motion vector m t Copy Previous Frame The corresponding pixels of the predicted frame are obtained You can get the original frame x t With predicted frame The residual r t : In the third step, the residual r t quantization (usually after a transform (e.g., DCT), where r t The DCT coefficients are quantized to obtain better quantization performance). The quantization step gives the quantized Motion vector m t and quantified Through entropy coding and decoding, it is encoded into a bit stream, which can be sent to the decoder.
[0037] At the decoder side, the quantized Dequantize (usually by an inverse transform (e.g., inverse DCT) to the dequantized coefficients) to obtain the recovered residual Then Add back To obtain the reconstructed
[0038] Motion estimation is a key part of the above video compression process. The traditional block-based motion vector m t Does not work well for non-translational motion and will produce invalid prediction frames and the residual r which greatly impairs the compression efficiency t . To address this problem, various learning-based techniques can be used. For example, learning-based optical flow methods can be used to provide accurate motion information at the pixel level. However, optical flow methods are prone to errors, especially along the boundaries of moving objects. In CVPR (Computer Vision and Pattern Recognition), 2020, R. Yang, F. Mentzer, L. Van Gool, and R. Timofte's work "Learning for video compression with hierarchical quality and recurrent enhancement" describes an example of an optical flow method, which is incorporated into this application by introduction.
[0039] In the absence of explicit motion estimation, frame interpolation can be used to obtain the previously reconstructed Directly compute additional synthetic frames To help generate more efficient residuals. However, these previously reconstructed frames are interpolated based on spatially co-located patches, which cannot handle medium to large motions, which limits the effectiveness of these methods. An example of a frame interpolation method is described in the work "Deep Frame Prediction for Video Coding" by H. Choi, I. Bajic, IEEE Trans. CSVT (IEEE Transactions on Circuits and Systems for Video Technology), 2019, which is incorporated herein by reference.
[0040] III. Prediction Frame Generation via Temporal Deformable Convolution
[0041] In various embodiments, the reference frame may be reconstructed based on the previously reconstructed reference frame. Generate potentially high-quality synthetic prediction frames Therefore, it is possible to predict the frame Generate a highly compressible residual frame r t . You can use an end-to-end trained or learnable DNN (E2E DNN) to calculate the predicted frame In different embodiments, 2D temporal deformable convolution or 3D temporal deformable convolution can be used to handle complex, long-range motion to generate high-quality prediction frames. The temporally deformable convolution-based codec approach can flexibly support different objectives, including compression efficiency and visual quality, without obvious error-prone motion estimation or image distortion.
[0042] 1. Prediction frame generation using 2D deformable convolution
[0043] Figure 1 A prediction frame generation process (100) using 2D temporal deformable convolution according to an embodiment of the present disclosure is shown. The process (100) may occur in a prediction frame generation module (150) in a video coding system (e.g., an encoder or a decoder). The prediction frame generation module (150) may be based on an E2E DNN. Figure 1 In the specific example shown, the E2E DNN may include a feature extraction DNN (111), an offset generation DNN (112), a deformable convolution DNN (113), a frame reconstruction DNN (114), and a frame synthesis DNN (115).
[0044] By executing the process (100), the prediction frame generation module (150) can use a set of n previously reconstructed frames As input, generate potential high-quality prediction frames For example, previously reconstructed frames may be stored in a reference picture buffer in a video codec system. It can be used to encode the current frame at the encoder or reconstruct the current frame at the decoder. The current frame, denoted by x t , refers to the frame currently being processed (being encoded or reconstructed).
[0045] The process (100) may include operations performed at the following modules: a feature extraction module (101), an offset generation module (102), a deformable convolution module (103), a frame reconstruction module (104), and a frame synthesis module (105). These modules (101-105) employ corresponding DNNs (111-115) to perform Figure 1 The corresponding operation in the example.
[0046] like Figure 1 As shown, the feature extraction module (101) uses the reference frame Each frame in As input, the feature map is calculated by forward derivation using the feature extraction DNN (111).
[0047] Reference Frame Frames in Can be used as In some embodiments, the target frame is a reference (target frame) to which all other frames in the image are aligned. It can be from In some embodiments, the target frame The choice can depend on the current frame x t timing.
[0048] In one example, to determine the target frame based on The timestamps of the reference frames in the P frame are sorted in accenting order (e.g., display order). t When encoding, all these previously reconstructed frames are t Before. Target frame Can be set to Yes
[0049] When the current processing is to encode a B frame, the reference frame Some reference frames in the B frame can be before the B frame, and some reference frames can be after the B frame. The current frame x t Adjacent (in the current frame x tA frame before or after (before or after) can be selected as the target frame. For example, a previously reconstructed frame In x t Before, the remaining frames In x t After that. Therefore, the frame Use as target frame.
[0050] When the current goal is to encode low-latency B frames, the target frame can be Set to the last frame All of these previously reconstructed frames are in x t Before.
[0051] The offset generation module (102) is based on the reconstructed frame and Or based on the extracted features and Calculate each feature map The offset diagram ΔP j→i,t-1 In this example, the feature map and Used as input, after the offset generation DNN (112), to generate the offset map ΔP j→i,t-1 In this example, the feature map and Before being input into the offset generation DNN (112), concatenation may be performed to form a concatenated feature map.
[0052] The deformable convolution module (103) uses a deformable convolution DNN (113) based on the corresponding feature map and the corresponding offset map ΔP j→i,t-1 , calculate the aligned feature map Corresponding to each extracted feature map One or more aligned feature maps can be generated
[0053] As an example, let w k (k=1, ..., K) represents the weight coefficient of the 2D deformable convolution kernel, let p k represents the predetermined offset of the kth position in the kernel. For example, a 3×3 kernel is defined, where K=9 and p k ∈{(-1,-1),(-1,0),···,(1,1)}. The 2D deformable convolution layer is based on the input feature f in And the learnable offset map ΔP, calculate the output feature f out , where the feature at sampling position p0 is given by:
[0054]
[0055] Due to the irregular position p0+p k +Δp k may not be an integer, so this deformable convolution operation can be performed by using interpolation (e.g., bilinear interpolation).
[0056] The deformable convolutional DNN (113) can be formed by stacking several such deformable convolutional layers (each followed by a nonlinear activation layer such as ReLU) and other DNN layers (e.g., a bottleneck layer). In examples, each deformable convolutional layer can use the same or different 2D deformable convolutional kernels. In examples, each deformable convolutional layer can use the same offset map or different offset maps.
[0057] Deformable convolution has an enhanced ability to handle geometric transformations in the spatial domain (e.g., different scaling or deformation at different locations). For frame sequences caused by various types of motion, different scaling or deformation can occur at different times. Through the deformable convolution at the deformable convolution DNN (113), features at different times (after different deformations / scaling) can be collected in the resulting feature map. In addition, those feature maps are aligned with the target moment corresponding to the target frame (and the current frame). Then, based on the aligned feature map, a predicted frame can be constructed. It can be seen that the temporal deformable convolution can handle motion in the frame sequence to generate a predicted frame corresponding to the moment of the target frame (and the current frame).
[0058] The alignment error calculation module (106) can calculate the alignment loss To measure aligned features With the extracted feature map For example, the L1 norm (absolute mean error) or L2 norm (mean square error) can be used for These alignment losses can be similarly calculated during training and used as part of the loss function.
[0059] In the example, the aligned feature map is used and optionally using the extracted feature maps The frame reconstruction module (104) uses the frame reconstruction DNN (114) to generate a corresponding feature map for each aligned feature map through feed-forward derivation calculation. Aligned frames Then, the aligned frames The synthesized prediction frame can be generated by using the frame synthesis DNN (115) through the frame synthesis module (105).
[0060] In various embodiments, there may be different ways to Generate prediction frame In the example, the frames are aligned The number of may be less than n. In an example, one DNN may replace both the frame reconstruction DNN (114) and the frame synthesis DNN (115) to operate according to the aligned feature maps Generate prediction frame In the example, the feature maps have been aligned can first be synthesized into one or more (less than n) feature maps, which are then used to generate the predicted frame
[0061] In some embodiments, the offset generation module (102) and the offset generation DNN (112) may be removed from the process 100 or the predicted frame generation module (150). Accordingly, the offset map is not explicitly generated. The offset Δp at each pixel position used in each 2D deformable convolution layer of the deformable convolution DNN (113) is k can be considered as trainable model parameters, which together with (multiple) 2D deformable convolution kernels can be learned during the training process.
[0062] Please note that in the present disclosure, there is no restriction on the specific network structure (type of layers, number of layers, kernel size, etc.) of the feature extraction DNN (111), offset generation DNN (112), deformable convolution DNN (113), frame reconstruction DNN (114), or frame synthesis DNN (115). For example, any backbone network (e.g., ResNet) can be used as a feature extraction DNN; a set of regular convolution layers and bottleneck layers can be stacked as an offset generation DNN; a set of deformable convolution layers can be stacked as a deformable convolution DNN; several convolution layers with skip connections can be stacked together as a frame reconstruction DNN; and several residual block layers can be stacked together as a frame synthesis DNN.
[0063] 2. Prediction frame generation using 3D deformable convolution
[0064] Figure 2 Another prediction frame generation process (200) using 3D temporal deformable convolution according to an embodiment of the present disclosure is shown. The process (200) may occur in a prediction frame generation module (250) in a video coding system (e.g., an encoder or a decoder). The prediction frame generation module (250) may be based on an E2E DNN. Figure 2 In the specific example shown, the E2E DNN may include a feature extraction DNN (211), a deformable convolution and feature fusion DNN (212), and a frame reconstruction DNN (213).
[0065] By executing the process (200), the prediction frame generation module (250) can use a set of n previously reconstructed frames As input, generate a (potentially high-quality) prediction frame Used to encode and decode video. Predicted frame It can be used to encode the current frame at the encoder or to reconstruct the current frame at the decoder.
[0066] The process (200) may include operations performed in the following modules: a feature extraction module (201), a deformable convolution and feature fusion module (202), and a frame reconstruction module (203). These modules (201-203) use corresponding DNNs (211-213) to perform corresponding operations.
[0067] In the example, the input frame can be stacked together to form a 4-dimensional (4D) input tensor of size (n, c, h, w), where c is the number of channels (e.g., 3 for color frames) and (h, w) gives the resolution (e.g., height and width) of the video frame. Figure 2 As shown, the feature extraction module (201) can use the feature extraction DNN (211) to calculate the 4D feature tensor through forward derivation. Various DNNs with various structures may be used to implement the feature extraction module (201).
[0068] In an embodiment, to calculate the feature map To collect spatiotemporal features in the video, the feature extraction DNN (211) uses the 3D convolutional layer (C3D) described in the work "Learning spatiotemporal features with 3d convolutional networks" by D. Tran et al., ICCV (International Conference on Computer Vision), 2015, which is incorporated by reference in its entirety into this application.
[0069] In another embodiment, a method similar to Figure 1 The 2D convolutional layer of the method described in the example is used to calculate each individual feature map And then concatenated into a 4D tensor. In any case of the embodiment, the output of the feature extraction module (201) can be a 4D feature tensor.
[0070] To perform 3D temporal deformable convolution, let w k (k=1, ..., K) represents the weight coefficient of the 3D deformable convolution kernel, let p k represents the predetermined offset of the kth position in the kernel. For example, a 3×3×3 kernel is defined, where K=27 and p k∈{(-1,-1,-1),(-1,-1,0),···,(1,1,1)}. The 3D deformable convolution layer is based on the input feature f in and learnable offset ΔP, calculate the output feature f out , where the feature at sampling position p0 is given by:
[0071]
[0072] Due to the irregular position p0+p k +Δp k Might not be an integer, so this deformable convolution operation can be performed by using interpolation in 3D space (e.g., bilinear interpolation).
[0073] like Figure 2 As shown, the deformable convolution and feature fusion DNN (212) can be formed by stacking several of the above-mentioned 3D deformable convolution layers (each followed by a non-linear activation layer such as ReLU) and other DNN layers (such as a bottleneck layer). It can be a reference to which all other frames will be aligned. The deformable convolution and feature fusion module (202) is based on the 4D feature tensor Use deformable convolution and feature fusion DNN (212) to compute fused aligned feature maps
[0074] Then, the frame reconstruction module (203) is based on the fused aligned feature map Use the frame reconstruction DNN (213) to calculate the reconstructed prediction frame like Figure 2 As described, the method for generating aligned feature maps Figure 1 In contrast, in Figure 2 There is no explicit spatial alignment in this pipeline. Instead, the 3D deformable convolution directly learns the spatiotemporal offsets to produce a fused aligned feature map
[0075] Similar to Figure 1 In the example of, there is no restriction on the specific network structure (type of layer, number of layers, kernel size, etc.) on the feature extraction DNN (211), the deformable convolution and feature fusion DNN (212), or the frame reconstruction DNN (213).
[0076] IV. Training Process of Prediction Frame Generation via Temporal Deformable Convolution
[0077] Figure 3 The neural network training process (300) according to an embodiment of the present disclosure is shown. During the training process (300), the model parameters of the neural network in the prediction frame generation module (301) can be optimized and determined. For example, Figure 1 or Figure 2 The predicted frame generation module (150) or (250) in the example can be placed in place of the predicted frame generation module (301) and trained using the training process (300).
[0078] In an embodiment, during the current iteration of the training process (300), a process similar to Figure 1 and Figure 2 In this example, the prediction frame generation module (301) receives a set of reference frames And generate the current frame x t The predicted frame The neural network in the prediction frame generation module (301) may be configured with model parameters updated at the end of the last iteration. In some embodiments, for training purposes, the set of reference frames may be , using the original frames in the downsampled video sequence, which will be described later.
[0079] After obtaining the predicted frame from the predicted frame generation module (301) Afterwards, the addition module (311) can be used to obtain the original frame (current frame) x as follows t With predicted frame The residual r t :
[0080]
[0081] Then, the compression loss L compress (r t ) can be calculated by the compression loss calculation module (304) to measure the residual r t For example, the residual r t The L1 norm (mean absolute error) of can be used to improve the overall sparsity of the residual for better compression. More sophisticated statistical rate estimation methods can also be used here.
[0082] For example, the residual r can be estimated t The entropy of each element in . Based on the estimated entropy, the t Therefore, the bit rate (e.g., bits per pixel (BPP) or bits per second (BPS)) can be determined and used as the compression loss L compress (r t ), used to adjust the current frame x tEncoding and decoding are performed. Various techniques for estimating entropy and rate loss may be employed in various embodiments. An example of a rate loss estimation method is described in “End-to-end Optimized Image Compression” by J. Balle et al. at the International Conference on Learning Representations (ICLR) 2017.
[0083] Reconstruction quality loss It can be calculated by the reconstruction quality loss calculation module (305) to measure the reconstructed aligned prediction frame In the example, it can be relative to the current frame x t To determine the reconstructed aligned prediction frame quality.
[0084] In an embodiment, during the training process (300), the original video sequence is temporally downsampled so that the synthetic aligned predicted frames are available with the calibration ground truth frames. For example, the original T frames x1, x2, ..., x T Downsampled in time to T / 2 frames x2,x4,…,x T Using the downsampled sequence, the prediction frame generation module (301) can calculate the corresponding to a given reference frame The predicted frame Corresponding to the reference frame The calibration real frame is available. In this example, it does not belong to the downsampled frames x2,x4,…,x T The frame can be used as the calibration real frame Calibrate the real frame Can be used as the current frame x t . Downsample frames x2,x4,…,x T In the calibration real frame Adjacent frames can be used as reference frames Then, and The L2 norm (MSE) between
[0085] Compression loss L compress (r t ) and quality loss Can be combined into:
[0086]
[0087] In addition, if Figure 3 As shown, for the case where the prediction frame generation module (301) uses 2D deformable convolution, the set of alignment losses can also be calculated as follows: (As by Figure 3 The dotted line option in ) is added to the above joint loss:
[0088]
[0089] Then, the joint loss L can be calculated and back-propagated through the back-propagation module (306). joint The gradient of (Equation 4 or Equation 5) is used to update the DNN model parameters (e.g., weight coefficients, offsets, etc.) in the prediction frame generation module (301). For example, the model parameters can be Figure 1 The model parameters in the DNN (111-115) in the example, or Figure 2 Model parameters in the DNN (211-213) in the example.
[0090] In an embodiment, the residual r t The residual encoding module (302) encodes the based on The residual decoding module (303) calculates the decoded residual The decoded residual Added back to the predicted frame at the addition module (312) To calculate the new reconstructed frame Then, in the example, add the predicted frame and / or reconstructed frames To build a previously constructed frame set For example, the earliest frame farthest from the current frame may be removed from the frame set. Then, the system enters the next encoding cycle (training cycle or iteration) from t to t+1.
[0091] V. CODEC SYSTEM USING PREDICTED FRAME GENERATION VIA TEMPORAL DEFORMABLE CONVOLUTION
[0092] Figure 4 FIG. 4 shows a video encoder ( 400 ) according to an embodiment of the present disclosure. The video encoder ( 400 ) may include a prediction frame generation module ( 401 ) configured to perform a temporally deformable convolution to generate a prediction frame for a current frame x t Predicted frame to be encoded In addition, the video encoder (400) may further include a residual encoding module (402), a residual decoding module (403), a first adding module (411) and a second adding module (412). Figure 4 Coupled together as shown.
[0093] Given a set of n previously reconstructed frames (e.g., stored in a reference frame buffer) as input, the prediction frame generation module (401) can generate the prediction frame by using Figure 1The framework shown in (based on 2D deformable convolutions) or Figure 2 The framework shown in (based on 3D deformable convolution) generates a predicted frame Then, the first addition module (411) can be used to calculate the original frame x t With predicted frame The residual r t . Residual r t The residual encoding module (402) may be used to encode to generate a compressed representation
[0094] Based on compressed representation The residual decoding module (403) calculates the decoded residual At the second adding module (412), the decoded residual Add back to the predicted frame To calculate the new reconstructed frame
[0095] Compressed Representation (After entropy coding and decoding) can be sent to the decoder side, for example, in the bitstream. Then, the reconstructed and / or the generated prediction frames To the set of frames The coding system (400) enters the next coding cycle from t to t+1.
[0096] Figure 5 FIG. 5 shows a video decoder (500) according to an embodiment of the present disclosure. The video decoder (500) may include a prediction frame generation module (501) configured to perform a temporally deformable convolution to generate a prediction frame for reconstructing a current frame x. t The predicted frame In addition, the video encoder (500) may further include a residual decoding module (502) and an addition module (511). These components are as follows: Figure 5 Coupled together as shown.
[0097] like Figure 5 As shown, upon receiving a compressed representation of a bitstream generated, for example, from a video encoder (400) Afterwards, the residual decoding module (502) calculates the decoded residual Given a set of previously reconstructed frames The prediction frame generation module (501) calculates the prediction frame Then, in the addition module (511), the predicted frame and residual Add them together to get the value corresponding to the current frame x t Reconstructed frame of
[0098] You can add the rebuilt and / or the generated prediction frames The set of reference frames The decoding system (500) enters the next decoding cycle from t to t+1.
[0099] Please note that there is no restriction on the types of encoding methods and decoding methods used by the residual encoding module and the residual decoding module in the video encoder (400) or the decoder (500). For example, the residual signal processing method in the HEVC or VVC coding and decoding standard or other non-standard methods can be used in the residual processing modules (402), (403) and (502).
[0100] VI. Video Encoding and Decoding Process Based on Predicted Frame Generation via Temporally Deformable Convolution
[0101] Figure 6 The video encoding and decoding process (600) according to an embodiment of the present disclosure is shown. The process (600) can be performed at a video encoder or a video decoder to generate a predicted frame. The process (600) can start from (S601) and proceed to (S610).
[0102] At (S610), deformable convolution may be performed by a deformable convolutional DNN to generate one or more first feature maps based on a set of previously reconstructed reference frames.
[0103] For example, a set of second feature maps corresponding to a previously reconstructed reference frame may be generated based on a feature extraction DNN. An offset generation DNN may be used to generate one or more offset maps corresponding to the second feature maps, respectively. For example, each offset map may be generated based on the following inputs to the offset generation DNN: a second feature map corresponding to the offset map being generated, and a second feature map corresponding to a target frame, the target frame being one of the previously reconstructed reference frames. The one or more offset maps may have the same target frame.
[0104] In an example, the target frame may be any one of the one or more reconstructed reference frames. In an example, when the current frame and the previously reconstructed reference frame are arranged in display order, the target frame is adjacent to the current frame. In an example, when the current frame is a P frame, the target frame may be the last frame of the previously reconstructed reference frame. When the current frame is a B frame, the target frame may be the last frame of the previously reconstructed reference frame that precedes the current frame in display order.
[0105] In an example, the deformable convolutional DNN may receive a second feature map as input and generate one or more first feature maps corresponding to the second feature map, respectively. For example, the deformable convolutional DNN may include one or more deformable convolutional layers, each deformable convolutional layer being associated with a deformable convolutional kernel. In one of the one or more deformable convolutional layers corresponding to each second feature map, a deformable convolution is performed based on the corresponding deformable convolutional kernel and the offset map of the corresponding second feature map.
[0106] At (S620), a predicted frame may be generated based on the one or more first feature maps. For example, a frame reconstruction DNN may be used to reconstruct one or more aligned frames based on the one or more first feature maps and previously reconstructed reference frames. A predicted frame may be generated based on the one or more aligned frames using a frame synthesis DNN.
[0107] At (S630), the current frame may be reconstructed based on the predicted frame. For example, at the decoder side, the predicted frame may be combined with the reconstructed residual frame (or signal) to generate a reconstructed current frame. The reconstructed current frame may then be used as a reference frame for decoding the next current frame.
[0108] In some examples, the reconstruction of the current frame may be block-based. For example, for the current block being processed (partitioned from the current frame), the corresponding prediction block may be partitioned from the prediction frame and combined with the residual signal of the current block to reconstruct the current block.
[0109] At the encoder side, a residual signal may be generated between the current frame and the predicted frame. The residual signal may then be encoded into a compressed representation and sent in a bitstream. The compressed representation may then be decoded to generate a reconstructed residual signal. The reconstructed signal may then be combined with the predicted frame to generate a reconstructed current frame. The reconstructed current frame may be used as a reference frame for encoding and decoding the next current frame. The process (600) may proceed to (S699) and may end at (S699).
[0110] Figure 7 The neural network training process (700) according to an embodiment of the present disclosure is shown. The process (700) may start from (S701) and proceed to (S710).
[0111] At (S710), a set of reference frames are input to a prediction frame generation module to generate a prediction frame. The prediction frame generation module may include a neural network with parameters to be optimized. The neural network may include a deformable convolutional deep neural network (DNN). In an example, based on a temporal downsampling operation, a reference frame is selected from a frame sequence of a video. The frames in the frame sequence that are not selected by the downsampling operation are used as calibration real frames.
[0112] At (S720), a loss of a loss function may be determined. The loss function may include a compression loss indicating a bit rate estimated based on a difference between the predicted frame and the nominal true frame, and a reconstruction quality loss indicating a quality of the predicted frame relative to the nominal true frame.
[0113] In the example, the loss function may further include an alignment loss indicating an alignment error. The alignment loss may be determined as follows. A feature extraction DNN in a prediction frame generation module may be used to generate first feature maps corresponding to reference frames, respectively. A deformable convolution DNN in a prediction frame generation module may be used to generate second feature maps corresponding to the first feature maps, respectively. When the calibrated real frame and the reference frame are arranged in a display order, the difference between one of the second feature maps and the first feature map corresponding to the reference frame adjacent to the calibrated real frame is determined. The difference relative to the first feature map corresponding to the reference frame adjacent to the calibrated real frame may be determined for each second feature map. The difference may be included in the alignment loss.
[0114] At (S730), back propagation may be performed based on the loss and the loss function to update the parameters of the neural network in the prediction frame generation module. The process (700) may proceed to (S799) and end at (S799).
[0115] VII. Computer System
[0116] The techniques disclosed in this application (e.g., functions, modules, elements, methods, processes, operations in various embodiments or examples) can be implemented by processing circuits (e.g., one or more processors or one or more integrated circuits). In some examples, the techniques can be implemented as computer software using computer-readable instructions and physically stored in one or more computer-readable media.
[0117] The computer software may be encoded using any suitable machine code or computer language, which may be subjected to assembly, compilation, linking or similar mechanisms to create code comprising instructions that may be executed directly or through interpretation, microcode execution, etc., by one or more computer central processing units (CPUs), graphics processing units (GPUs), etc.
[0118] The instructions may be executed on various types of computers or computer components, including, for example, personal computers, tablets, servers, smart phones, gaming devices, Internet of Things devices, etc.
[0119] Figure 8 A computer system (800) suitable for implementing some embodiments of the disclosed subject matter is shown. Figure 8The components for computer system (800) shown in the example are exemplary in nature and are not intended to imply any limitation on the scope of use or functionality of computer software implementing embodiments of the present application. Nor should the configuration of components be interpreted as having any dependency or requirement on any one or combination of components shown in the exemplary embodiment of computer system (800).
[0120] The computer system (800) may include certain human-machine interface input devices. Such human-machine interface input devices may be responsive to input from one or more human users, for example, through tactile input (e.g., keystrokes, swipes, data glove movements), audio input (e.g., voice, taps), visual input (e.g., gestures), olfactory input (not depicted). Human-machine interface devices may also be used to capture certain media that may not be directly related to a person's conscious input, such as audio (e.g., speech, music, ambient sound), images (e.g., scanned images, photographic images obtained from a still image camera), and videos (e.g., two-dimensional video, three-dimensional video including stereoscopic video).
[0121] Input human interface devices may include one or more of the following (only one of each is depicted): keyboard (801), mouse (802), track pad (803), touch screen (810), data gloves (not shown), joystick (805), microphone (806), scanner (807), camera (808).
[0122] The computer system (800) may also include certain human-machine interface output devices. Such human-machine interface output devices may stimulate the senses of one or more human users through, for example, tactile output, sound, light, and smell / taste. Such human-machine interface output devices may include tactile output devices (e.g., tactile feedback of a touch screen (810), a data glove (not shown), or a joystick (805), although there may also be tactile feedback devices that do not serve as input devices), audio output devices (e.g., speakers (809), headphones (not depicted)), visual output devices (e.g., screens (810), including cathode ray tube (CRT) screens, liquid crystal display (LCD) screens, plasma screens, organic light emitting diode (OLED) screens, each with or without touch screen input capabilities, each with or without tactile feedback capabilities - some of which are capable of outputting two-dimensional visual output or output greater than three dimensions through, for example, stereographic output; virtual reality glasses (not depicted), holographic displays, and smoke boxes (not depicted), and printers (not depicted).
[0123] The computer system (800) may also include human-accessible storage devices and associated media for the storage devices, such as optical media, including CD / DVD ROM / RW (820) with CD / DVD and other media (821), thumb drives (822), removable hard drives or solid-state drives (823), older magnetic media such as tapes and floppy disks (not depicted), ROM / application-specific integrated circuit (ASIC) / programmable logic device (PLD)-based special devices, such as security protection devices (not depicted), and the like.
[0124] Those skilled in the art will also understand that the term "computer-readable medium" used in connection with the presently disclosed subject matter does not encompass transmission media, carrier waves, or other transient signals.
[0125] The computer system (800) may also include an interface (854) to one or more communication networks (855). The one or more networks (855) may be, for example, wireless, wired, optical. The one or more networks (855) may also be local, wide area, metropolitan, vehicle-mounted and industrial, real-time, delay-tolerant, etc. Examples of the one or more networks (855) include local area networks such as Ethernet, wireless LAN, cellular networks including Global System for Mobile Communications (GSM), third generation (3G), fourth generation (4G), fifth generation (5G), long term evolution (LTE), etc., TV wired or wireless wide area digital networks including cable TV, satellite TV and terrestrial broadcast TV, vehicle-mounted networks and industrial networks including controller area network bus (CANBus), etc. Some networks typically require an external network interface adapter attached to some general data port or peripheral bus (849) (e.g., a universal serial bus (USB) port of the computer system (800)); other networks are typically integrated into the core of the computer system (800) by attaching to a system bus as described below (e.g., integrated into a PC computer system through an Ethernet interface, or integrated into a smart phone computer system through a cellular network interface). Using any of these networks, the computer system (800) can communicate with other entities. Such communications can be one-way receive only (e.g., broadcast TV), one-way send only (e.g., CANBus connected to some CANBus devices), or bidirectional, for example, using a local area digital network or a wide area digital network to connect to other computer systems. Certain protocols and protocol stacks can be used on each of those networks and network interfaces as described above.
[0126] The above-mentioned human-machine interface device, human-accessible storage device, and network interface may be attached to the core (840) of the computer system (800).
[0127] The core (840) may include one or more central processing units (CPUs) (841), graphics processing units (GPUs) (842), dedicated programmable processing units in the form of field programmable gate areas (FPGAs) (843), hardware accelerators for certain tasks (844), graphics adapters (850), and the like. These devices, along with read-only memory (ROM) (845), random access memory (846), and internal mass storage devices (847) such as internal non-user accessible hard drives, solid-state drives (SSDs), etc., may be connected via a system bus (848). In some computer systems, the system bus (848) may be accessible in the form of one or more physical plugs to enable expansion by additional CPUs, GPUs, and the like. Peripheral devices may be attached to the core's system bus (848) directly or via a peripheral bus (849). In an example, a screen (810) may be connected to a graphics adapter (850). Architectures for peripheral buses include peripheral component interconnect (PCI), USB, and the like.
[0128] The CPU (841), GPU (842), FPGA (843), and accelerator (844) may execute certain instructions, which in combination may constitute the above-mentioned computer code. The computer code may be stored in ROM (845) or RAM (846). Transient data may also be stored in RAM (846), while permanent data may be stored, for example, in an internal mass storage device (847). Fast storage and retrieval of any memory device may be achieved by using a cache memory, which may be closely associated with one or more CPUs (841), GPUs (842), mass storage devices (847), ROMs (845), RAMs (846), etc.
[0129] The computer readable medium may have computer codes for performing various computer-implemented operations. The media and computer codes may be media and computer codes designed and constructed specifically for the purpose of this application, or may be of a type well known and available to technicians in the computer software field.
[0130] By way of example and not limitation, a computer system having the architecture (800) and in particular the core (840) may provide functionality resulting from the execution of software embodied in one or more tangible computer-readable media by a processor (including a CPU, GPU, FPGA, accelerator, etc.). Such computer-readable media may be media associated with the user-accessible mass storage device introduced above and certain storage devices of the non-temporary nature of the core (840) (e.g., a core internal mass storage device (847) or ROM (845)). Software implementing various embodiments of the present application may be stored in such devices and executed by the core (840). Depending on specific needs, the computer-readable medium may include one or more memory devices or chips. The software may enable the core (840) and, in particular, the processor therein (including a CPU, GPU, FPGA, etc.) to perform specific processes or specific portions of specific processes described herein, including defining data structures stored in the RAM (846) and modifying such data structures according to processes defined by the software. Additionally or alternatively, the computer system may provide functionality produced by logic hardwired or otherwise embodied in circuits (e.g., accelerators (844)) that may operate in place of or in conjunction with software to perform specific processes or specific portions of specific processes described herein. References to software may encompass logic, and vice versa, where appropriate. References to computer-readable media may encompass circuits (e.g., integrated circuits (ICs)) storing software for execution, circuits embodying logic for execution, or both, where appropriate. The present application encompasses any suitable combination of hardware and software.
[0131] Although the present application describes several exemplary embodiments, various modifications, permutations and combinations, and various alternative equivalents are possible within the scope of the present application. Therefore, it should be understood that within the spirit and scope of the application, those skilled in the art can design various systems and methods that are not explicitly shown or described herein but can embody the principles of the present application.
Claims
1. A video encoding and decoding method based on deep neural network, It is characterized in that include: Performing deformable convolution by a deformable convolutional deep neural network (DNN) to generate one or more first feature maps based on a set of previously reconstructed reference frames; Based on the one or more first feature maps, generating a prediction frame; as well as Reconstructing a current frame based on the predicted frame; The method further comprises: generating a set of second feature maps corresponding to the previously reconstructed reference frame based on the feature extraction DNN; and Using the offset generation DNN, one or more offset maps corresponding to the second feature map are generated respectively, each offset map is generated based on the following input of the offset generation DNN: a second feature map corresponding to the offset map being generated, and a second feature map corresponding to a target frame, the target frame being one of the previously reconstructed reference frames, wherein the one or more offset maps have the same target frame; The performing deformable convolution by the deformable convolution DNN to generate one or more first feature maps includes: receiving the second feature map as an input of the deformable convolutional DNN; and The one or more first feature maps corresponding to the second feature map are generated respectively.
2. The method according to claim 1, It is characterized in that When the current frame and the previously reconstructed reference frame are arranged in a display order, the target frame is adjacent to the current frame.
3. The method according to claim 1, It is characterized in that When the current frame is a P frame, the target frame is the last frame in the previously reconstructed reference frames; and When the current frame is a B frame, the target frame is the last frame among the previously reconstructed reference frames that precede the current frame in display order.
4. The method according to claim 1, It is characterized in that The deformable convolutional DNN includes one or more deformable convolutional layers, each deformable convolutional layer is associated with a deformable convolutional kernel, and At one of the one or more deformable convolutional layers corresponding to each second feature map, a deformable convolution is performed based on the corresponding deformable convolution kernel and the offset map of the corresponding second feature map.
5. The method according to claim 1, It is characterized in that The generating a predicted frame based on the one or more first feature maps comprises: reconstructing one or more aligned frames using a frame reconstruction DNN based on the one or more first feature maps and the previously reconstructed reference frame; and Based on the one or more aligned frames, the predicted frame is generated using a frame synthesis DNN.
6. The method according to claim 1, It is characterized in that Also includes: A feature extraction DNN is used to generate a 4D feature tensor using a four-dimensional 4D tensor as input, wherein the 4D tensor is formed by the set of previously reconstructed reference frames, each frame including a plurality of channels.
7. The method according to claim 6, It is characterized in that The performing deformable convolution by the deformable convolution DNN to generate one or more first feature maps includes: Receiving the 4D feature tensor as input to the deformable convolutional DNN; and Generate a fused aligned feature map.
8. The method according to claim 7, It is characterized in that The deformable convolutional DNN includes one or more 3D deformable convolutional layers, each 3D deformable convolutional layer is associated with a 3D deformable convolutional kernel and a 3D offset map, and in one of the one or more deformable convolutional layers, a 3D deformable convolution is performed based on the corresponding 3D deformable convolutional kernel and the corresponding 3D offset map.
9. The method according to claim 7, It is characterized in that Also includes: The fused aligned feature map is used as an input of a frame reconstruction DNN, and the predicted frame is generated using the frame reconstruction DNN.
10. A neural network training method, It is characterized in that include: Inputting a set of previously reconstructed reference frames into a prediction frame generation module to generate a prediction frame, wherein the prediction frame generation module includes a neural network with parameters to be optimized, wherein the neural network includes a deformable convolutional deep neural network (DNN); Determine a loss of a loss function, wherein the loss function includes: compression loss, indicating an estimated bit rate based on the difference between the predicted frame and a nominal true frame, and A reconstruction quality loss indicating the quality of the predicted frame relative to the calibrated true frame; and Based on the loss of the loss function, performing back propagation to update the parameters of the neural network in the prediction frame generation module; The loss function also includes an alignment loss indicative of an alignment error, and The method further comprises: Using the feature extraction deep neural network DNN in the prediction frame generation module, respectively generating first feature maps corresponding to the reference frames, Using the deformable convolutional DNN in the prediction frame generation module, respectively generating second feature maps corresponding to the first feature maps, and Determining a difference between one of the second feature maps and a first feature map corresponding to a target frame, wherein the target frame is one of the reference frames input to the predicted frame generation module, the difference being a portion of the alignment loss.
11. The method according to claim 10, It is characterized in that The reference frame is selected from a frame sequence of a video based on a temporal downsampling operation, and a frame in the frame sequence that is not selected by the downsampling operation is used as the calibration true frame.
12. The method according to claim 10, It is characterized in that When the calibrated real frame and the reference frame are arranged in a display order, the target frame is a reference frame adjacent to the calibrated real frame.
13. The method according to claim 10, It is characterized in that The method further comprises: Generating a residual signal between the calibrated real frame and the predicted frame; Then performing residual encoding and decoding on the residual signal to generate a reconstructed residual signal; combining the calibrated true frame with the reconstructed residual signal to generate a reconstructed reference frame; and The reconstructed reference frame is included into the set of reference frames.
14. A video encoding and decoding device based on deep neural network, It is characterized in that include: A deformable convolution module, configured to perform deformable convolution through a deformable convolution deep neural network DNN to generate one or more first feature maps based on a set of previously reconstructed reference frames; Based on the one or more first feature maps, generating a prediction frame; as well as A frame reconstruction module, used for reconstructing a current frame based on the predicted frame; The device also includes: a feature extraction module for generating a set of second feature maps corresponding to the previously reconstructed reference frame based on the feature extraction DNN; and An offset generation module is used to use the offset generation DNN to generate one or more offset maps corresponding to the second feature map, each offset map is generated based on the following inputs of the offset generation DNN: a second feature map corresponding to the offset map being generated, and a second feature map corresponding to a target frame, the target frame being one of the previously reconstructed reference frames, wherein the one or more offset maps have the same target frame; The deformable convolution module performs deformable convolution through the deformable convolution DNN to generate one or more first feature maps, including: receiving the second feature map as an input of the deformable convolutional DNN; and The one or more first feature maps corresponding to the second feature map are generated respectively.
15. An electronic device, It is characterized in that include: a memory for storing computer readable instructions; A processor, configured to read the computer-readable instructions and execute the method according to any one of claims 1 to 13 as instructed by the computer-readable instructions.
