Attention-Based Context Modeling for Image and Video Compression
By employing an attention layer and hyperprior models in neural networks to segment and process latent tensors, the method enhances entropy estimation in video compression, addressing the challenge of high compression ratios with minimal quality loss.
Patent Information
- Application Number
- JP2024520661
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2021-10-20
- Publication Date
- 2024-10-23
- Estimated Expiration
- 2041-10-20
AI Technical Summary
Existing video compression techniques face challenges in achieving high compression ratios with minimal loss in image quality, particularly due to limitations in entropy estimation methods that fail to account for spatial and cross-channel correlations within latent tensors.
The use of an attention layer within a neural network to segment and process latent tensors, adapting the importance of previously coded segments for entropy encoding, and incorporating hyperprior models to enhance redundancy estimation.
This approach improves entropy estimation performance by effectively utilizing spatial and cross-channel correlations, leading to reduced bitstream size and maintained image quality.
Smart Images

Figure 2024538685000001_ABST
Abstract
Description
[Technical field]
[0001] Embodiments of the present invention relate to the field of artificial intelligence (AI) based video or picture compression techniques, and in particular to context models that use attention layers in neural networks to process elements of a latent tensor. [Background technology]
[0002] Video coding (video encoding and decoding) is used in a wide range of digital video applications, such as digital TV broadcasting, video distribution over the Internet and mobile networks, real-time conversation applications such as video chat and video conferencing, DVDs and Blue-ray discs, video content acquisition and editing systems, and camcorders for security applications.
[0003] The amount of video data required to represent even a relatively short video is significant, resulting in difficulties when the data is to be streamed or otherwise communicated over communication networks with limited bandwidth capacity. Thus, video data is typically compressed before being communicated over modern telecommunication networks. The size of the video can also be an issue when the video is stored on a storage medium because memory resources may be limited. Video compression devices often use software and / or hardware at the source side to code the video data before transmission or storage, thereby reducing the amount of data required to represent a digital video picture. The compressed data is then received at the destination side by a video decompression device, which decodes the video data. Due to limited network resources and the growing demand for higher video quality, improved compression and decompression techniques are desired that improve compression ratios with little or no sacrifice in image quality.
[0004] In recent years, deep learning has become increasingly popular in the field of picture and video encoding and decoding. Summary of the Invention
[0005] Embodiments of the present disclosure provide apparatus and methods for entropy encoding and decoding of a latent tensor that include dividing the latent tensor into segments and obtaining a probabilistic model for entropy encoding of a current element of the latent tensor by processing a set of elements through one or more layers of a neural network, including an attention layer.
[0006] According to an embodiment, a method for entropy encoding of a latent tensor is provided, the method including: dividing the latent tensor into a plurality of segments in a spatial dimension, each segment including at least one latent tensor element; processing an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer; and obtaining a probabilistic model for entropy encoding of a current element of the latent tensor based on the processed plurality of segments.
[0007] The method considers spatial correlations in the latent tensor and spatial adaptation for implicit entropy estimation. An attention mechanism adaptively weights the importance of previously coded latent segments. The contribution of the segments to the entropy modeling of the current element corresponds to their respective importance. Thus, the performance of the entropy estimation is improved.
[0008] In an exemplary implementation, splitting the latent tensor includes splitting the latent tensor into two or more segments in the channel dimension.
[0009] Segmenting the latent tensor in the channel dimension improves the performance of the entropy estimation since it allows the use of cross-channel correlation for context modeling.
[0010] For example, processing the placement may include placing multiple segments in a predefined order, where segments with the same spatial coordinates are grouped together.
[0011] Such an arrangement can improve the performance of the entropy estimation by focusing on cross-channel correlations due to the relative processing order.
[0012] In an exemplary implementation, processing the arrangement includes arranging the multiple segments such that segments having different spatial coordinates are consecutively arranged in a predefined order.
[0013] Such an arrangement can improve the performance of the entropy estimation by focusing on spatial correlations due to the associated processing order.
[0014] For example, processing with a neural network may include applying a first neural sub-network to extract features of the plurality of segments and providing an output of the first neural sub-network as an input to a subsequent layer in the neural network.
[0015] Processing the neural network input to extract features of multiple segments allows the attention layer to focus on independent deep features of the input.
[0016] In an exemplary implementation, processing with the neural network further includes providing position information of the plurality of segments as input to at least one attention layer.
[0017] Positional encoding allows the attention layer to exploit the order of the input sequence.
[0018] In an exemplary implementation, processing the arrangement of the plurality of segments includes selecting a subset of segments from the plurality of segments, the subset being provided as an input to a subsequent layer in the neural network.
[0019] Selecting a subset of segments allows support for larger sized latent tensors with reduced memory size and / or reduced amount of processing required.
[0020] For example, processing with at least one attention layer in the neural network may further include applying a mask that masks elements in the attention layer that follow the current element in the processing order of the latent tensor.
[0021] Applying the mask ensures that only previously coded elements can be processed, so the coding order is preserved. The mask reflects to the coding side the availability of information at the decoding side.
[0022] In an exemplary implementation, the neural network includes a second neural sub-network, which processes the output of the attention layer.
[0023] The neural sub-network may process the features output by the attention layer to provide probabilities for the symbols used for encoding, allowing efficient encoding and / or decoding.
[0024] For example, at least one of the first neural sub-network and the second neural sub-network is a multi-layer perceptron.
[0025] Multi-layer perceptrons can provide an efficient implementation of neural networks.
[0026] In an exemplary implementation, at least one attention layer in the neural network is a multi-head attention layer.
[0027] A multi-head attention layer can improve probability estimation by processing different representations of the input in parallel, providing more projection and attention computations corresponding to various viewpoints of the same input.
[0028] For example, at least one attention layer in a neural network is included in a transformer sub-network.
[0029] The transformer sub-network may provide an efficient implementation of the attention mechanism.
[0030] In an exemplary implementation, the method further includes padding a beginning of the arrangement of the plurality of segments with a zero segment prior to processing by the neural network.
[0031] The padding with zeros at the beginning of the constellation reflects the availability of information at the decoding side, so that the causality of the coding order is preserved.
[0032] For example, the method may further comprise entropy encoding the current element into a first bitstream using the obtained probability model.
[0033] The size of the bitstream can be reduced by using a probabilistic model obtained by processing multiple segments through a neural network with an attention layer.
[0034] In an exemplary implementation, the method further includes quantizing the latent tensor before dividing it into segments.
[0035] Quantized latent tensors allow for a more efficient encoding process because they result in simplified probability models, and such latent tensors can be compressed and processed with reduced complexity and more efficiently represented in the bitstream.
[0036] For example, the method may further comprise selecting a probability model for the entropy encoding according to a computational complexity and / or a characteristic of the first bitstream.
[0037] Allowing a choice of context modeling strategies can allow for better performance during the encoding process and provide flexibility in adapting the encoded bitstream to a desired application.
[0038] In an exemplary implementation, the method further includes hyper-encoding the latent tensor to obtain a hyper-latent tensor, entropy encoding the hyper-latent tensor into a second bitstream, entropy decoding the second bitstream, and hyper-decoding the hyper-latent tensor to obtain a hyper-decoder output.
[0039] Introducing a hyperprior model can further improve the probability model and thus the coding efficiency by determining additional redundancy in the latent tensor.
[0040] For example, the method may further include dividing the hyperdecoder output into a plurality of hyperdecoder output segments, each hyperdecoder output including one or more hyperdecoder output elements, and for each segment in the plurality of segments, concatenating the segment with a set of hyperdecoder output segments in the plurality of hyperdecoder output segments before obtaining the probability model.
[0041] The probability model can be further refined by concatenating the hyperdecoder output with each segment in the plurality of segments.
[0042] In an exemplary implementation, the set of hyperdecoder output segments associated with each segment includes one or more of the following: a hyperdecoder output segment corresponding to the respective segment, or a plurality of hyperdecoder output segments corresponding to the same channel as the respective segment, or a plurality of hyperdecoder output segments that are spatially proximate to the respective segment, or a plurality of hyperdecoder output segments including a neighboring segment that is spatially proximate to the respective segment and a segment that corresponds to the same channel as the neighboring segment.
[0043] The probability model can be further improved by including each set of hyper-decoder output segments. The performance and complexity behavior can depend on the set of hyper-decoder output segments and the content being encoded.
[0044] The method further comprises adaptively selecting the set of hyper-decoder output segments according to a computational complexity and / or a characteristic of the first bitstream.
[0045] Allowing the selection of additional hyperprior modeling strategies can allow for better performance during the encoding process and provide flexibility in adapting the encoded bitstream to a desired application.
[0046] In an exemplary implementation, one or more of the steps of processing with a neural network and entropy encoding the current element are performed in parallel for each segment in the multiple segments.
[0047] Parallel processing of the segments can result in faster encoding into a bitstream.
[0048] According to an embodiment, there is provided a method for encoding image data, comprising: obtaining a latent tensor by processing the image data with a self-encoding convolutional neural network; and entropy encoding the latent tensor into a bitstream using a probability model generated according to any of the above methods.
[0049] Given that the latent tensors for image reconstruction may still have significant size, entropy coding may be simply and advantageously applied to image encoding to effectively reduce data rates, for example when transmission or storage of pictures or video is desired.
[0050] According to an embodiment, a method for entropy decoding of a latent tensor is provided, comprising: initializing the latent tensor with zeros; dividing the latent tensor into a plurality of segments in a spatial dimension, each segment including at least one latent tensor element; processing an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer; and obtaining a probabilistic model for entropy decoding of a current element of the latent tensor based on the processed plurality of segments.
[0051] The method considers spatial correlations in the latent tensor and spatial adaptation for implicit entropy estimation. An attention mechanism adaptively weights the importance of previously coded latent segments. The contribution of the segments to the entropy modeling of the current element corresponds to their respective importance. Thus, the performance of the entropy estimation is improved.
[0052] In an exemplary implementation, splitting the latent tensor includes splitting the latent tensor into two or more segments in the channel dimension.
[0053] Segmenting the latent tensor in the channel dimension improves the performance of the entropy estimation since it allows the use of cross-channel correlation for context modeling.
[0054] For example, processing the placement may include placing multiple segments in a predefined order, where segments with the same spatial coordinates are grouped together.
[0055] Such an arrangement can improve the performance of the entropy estimation by focusing on cross-channel correlations due to the relative processing order.
[0056] In an exemplary implementation, processing the arrangement includes arranging the multiple segments such that segments having different spatial coordinates are consecutively arranged in a predefined order.
[0057] Such an arrangement can improve the performance of the entropy estimation by focusing on spatial correlations due to the associated processing order.
[0058] For example, processing with a neural network may include applying a first neural sub-network to extract features of the plurality of segments and providing an output of the first neural sub-network as an input to a subsequent layer in the neural network.
[0059] Processing the neural network input to extract features of multiple segments allows the attention layer to focus on independent deep features of the input.
[0060] In an exemplary implementation, processing with a neural network further includes providing position information of the plurality of segments as input to at least one attention layer.
[0061] Positional encoding allows the attention layer to exploit the order of the input sequence.
[0062] In an exemplary implementation, processing the arrangement of the plurality of segments includes selecting a subset of segments from the plurality of segments, the subset being provided as an input to a subsequent layer in the neural network.
[0063] Selecting a subset of segments allows support for larger sized latent tensors with reduced memory size and / or reduced amount of processing required.
[0064] In an exemplary implementation, the neural network includes a second neural sub-network, which processes the output of the attention layer.
[0065] The neural sub-network may process the features output by the attention layer to provide probabilities for the symbols used for encoding, allowing efficient encoding and / or decoding.
[0066] For example, at least one of the first neural sub-network and the second neural sub-network is a multi-layer perceptron.
[0067] Multi-layer perceptrons can provide an efficient implementation of neural networks.
[0068] In an exemplary implementation, at least one attention layer in the neural network is a multi-head attention layer.
[0069] A multi-head attention layer can improve probability estimation by processing different representations of the input in parallel, providing more projection and attention computations corresponding to various viewpoints of the same input.
[0070] For example, at least one attention layer in a neural network is included in a transformer sub-network.
[0071] The transformer sub-network may provide an efficient implementation of the attention mechanism.
[0072] In an exemplary implementation, the method further includes padding a beginning of the arrangement of the plurality of segments with a zero segment prior to processing by the neural network.
[0073] The padding with zeros at the beginning of the constellation reflects the availability of information at the decoding side, so that the causality of the coding order is preserved.
[0074] For example, the method may further include entropy decoding the current element into the first bitstream using the obtained probability model.
[0075] The size of the bitstream can be reduced by using a probabilistic model obtained by processing multiple segments through a neural network with an attention layer.
[0076] For example, the method may further comprise selecting a probability model for the entropy encoding according to a computational complexity and / or a characteristic of the first bitstream.
[0077] Allowing a choice of context modeling strategies can allow for better performance during the encoding process and provide flexibility in adapting the encoded bitstream to a desired application.
[0078] In an exemplary implementation, the method further includes entropy decoding the hyper-latent tensor from the second bitstream, and hyper-decoding the hyper-latent tensor to obtain a hyper-decoder output.
[0079] Introducing a hyperprior model can further improve the probability model and thus the coding efficiency by determining additional redundancy in the latent tensor.
[0080] For example, the method may further include dividing the hyperdecoder output into a plurality of hyperdecoder output segments, each hyperdecoder output including one or more hyperdecoder output elements, and for each segment in the plurality of segments, concatenating the segment with a set of hyperdecoder output segments in the plurality of hyperdecoder output segments before obtaining the probability model.
[0081] The probability model can be further refined by concatenating the hyperdecoder output with each segment in the plurality of segments.
[0082] In an exemplary implementation, the set of hyperdecoder output segments associated with each segment includes one or more of the following: a hyperdecoder output segment corresponding to the respective segment, or a plurality of hyperdecoder output segments corresponding to the same channel as the respective segment, or a plurality of hyperdecoder output segments that are spatially proximate to the respective segment, or a plurality of hyperdecoder output segments including a neighboring segment that is spatially proximate to the respective segment and a segment that corresponds to the same channel as the neighboring segment.
[0083] The probability model can be further improved by including each set of hyper-decoder output segments. The performance and complexity behavior can depend on the set of hyper-decoder output segments and the content being encoded.
[0084] The method further comprises adaptively selecting the set of hyper-decoder output segments according to a computational complexity and / or a characteristic of the first bitstream.
[0085] Allowing the selection of additional hyperprior modeling strategies can allow for better performance during the encoding process and provide flexibility in adapting the encoded bitstream to a desired application.
[0086] According to an embodiment, there is provided a method of decoding image data, comprising entropy decoding a latent tensor (4020) from a bitstream according to any of the methods described above, and obtaining image data by processing the latent tensor with an auto-encoding convolutional neural network.
[0087] Since the latent tensors for image reconstruction may still have a significant size, entropy decoding may be simply and advantageously applied to image decoding to effectively reduce data rates, for example when transmission or storage of pictures or video is desired.
[0088] In an exemplary implementation, a computer program is stored on a non-transitory medium and includes code instructions that, when executed by one or more processors, cause the one or more processors to perform the method steps according to any of the methods described above.
[0089] According to an embodiment, an apparatus for entropy encoding of a latent tensor is provided, the apparatus having a processing circuit configured to divide a latent tensor into a plurality of segments in a spatial dimension, each segment including at least one latent tensor element, process an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer, and obtain a probabilistic model for entropy encoding of a current element of the latent tensor based on the processed plurality of segments.
[0090] According to an embodiment, an apparatus for entropy decoding of a latent tensor is provided, the apparatus having a processing circuit configured to initialize a latent tensor with zeros, divide the latent tensor into a plurality of segments in spatial dimensions, each segment including at least one latent tensor element, process an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer, and obtain a probabilistic model for entropy decoding of a current element of the latent tensor based on the processed plurality of segments.
[0091] The apparatus provides the advantages of the above-mentioned methods.
[0092] The present invention may be implemented in hardware (HW) and / or software (SW), or any combination thereof. Further, HW-based implementations may be combined with SW-based implementations.
[0093] The details of one or more embodiments are set forth in the accompanying drawings and the description below. Other features, objects, and advantages will be apparent from the description, drawings, and claims. [Brief description of the drawings]
[0094] Hereinafter, embodiments of the invention will be described in more detail with reference to the accompanying figures and drawings.
[0095] [Figure 1] FIG. 2 is a schematic diagram representing channels processed by layers of a neural network. [Diagram 2] FIG. 1 is a schematic diagram showing a neural network autoencoder. [Figure 3a] FIG. 1 is a schematic diagram illustrating an exemplary network architecture on the encoder and decoder side including a hyperprior model. [Figure 3b] FIG. 1 is a schematic diagram showing a general network architecture on the encoder side including a hyperprior model. [Figure 3c]FIG. 1 is a schematic diagram showing a typical decoder-side network architecture including a hyperprior model. [Figure 4] FIG. 1 is a schematic diagram of a latent tensor obtained from an input image. [Figure 5a] 1 shows a first embodiment of a transformer network. [Figure 5b] 2 shows a second embodiment of a transformer network. [Figure 6a] FIG. 1 is a schematic diagram showing an attention network. [Figure 6b] FIG. 1 is a schematic diagram showing a multi-head attention network. [Figure 7a] 1 shows an example of context modeling using attention and placement according to a first embodiment. [Figure 7b] 13 shows an example of context modeling using attention and placement according to the second or third embodiment. [Figure 8] 1 illustrates an exemplary separation of latent tensors into segments and an exemplary arrangement of the segments. [Figure 9] 1 illustrates an exemplary separation of a latent tensor into segments, including a separation in the channel dimension, and an exemplary arrangement of the segments. [Figure 10a] Represents the padding for the segment alignment. [Figure 10b] It represents the padding of the arrangement in the first coding order of the segments that includes separation in the channel dimension. [Figure 10c] 4 represents the padding of the arrangement in the second coding order of segments that includes separation in the channel dimension. [Figure 11] We present an example of concatenating a set of processed segments of a latent tensor and a set of hyperprior output segments. [Figure 12] We present a further embodiment of concatenating the processed segments of the latent tensor and the set of hyperprior output segments. [Figure 13]a represents an exemplary processing order of segments of a latent tensor, b represents an exemplary processing order of segments of a latent tensor including separation in the channel dimension, where segments with the same spatial coordinates are processed consecutively, and c represents an exemplary processing order of segments of a latent tensor including separation in the channel dimension, where segments with the same channel segment index are processed consecutively. [Figure 14] a represents an exemplary processing order of segments of a latent tensor, where a subset of the segments are used for context modeling; b represents an exemplary processing order of segments of a latent tensor including separation in the channel dimension, where segments of the same spatial coordinate are processed consecutively and a subset of the segments are used for context modeling; and c represents an exemplary processing order of segments of a latent tensor including separation in the channel dimension, where segments of the same channel segment index are processed consecutively and a subset of the segments are used for context modeling. [Figure 15] 1 is a block diagram illustrating an example of a video coding system configured to implement embodiments of the present invention. [Figure 16] 2 is a block diagram illustrating another example of a video coding system configured to implement embodiments of the present invention. [Figure 17] FIG. 1 is a block diagram illustrating an example of an encoding device or a decoding device. [Figure 18] FIG. 11 is a block diagram illustrating another example of an encoding device or a decoding device. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0096] In the following description, reference is made to the accompanying figures, which form part of this disclosure and which show, by way of example, specific aspects of embodiments of the present invention or in which embodiments of the present invention may be used. It is understood that embodiments of the present invention may be used in other aspects and may include structural or logical changes not shown in the figures. Therefore, the following detailed description should not be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.
[0097] For example, in connection with a described method, the disclosure also applies to a corresponding device or system configured to perform the method, and vice versa. For example, when one or more specific method steps are described, the corresponding device may include one or more units, e.g., functional units, for performing the described one or more steps (e.g., one unit performing one or more steps, or multiple units each performing one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated. On the other hand, for example, when a specific apparatus is described based on one or more units, e.g., functional units, the corresponding method may include one step for performing the function of one or more units (e.g., one step for performing the function of one or more units, or multiple steps each performing one or more functions of the multiple units), even if such one or more steps are not explicitly described or illustrated. Furthermore, it is understood that features of various exemplary embodiments and / or aspects described herein may be combined with each other, unless specifically stated otherwise.
[0098] In image / video compression algorithms, entropy estimation is one of the components that provides great benefits. Entropy estimation includes, for example, explicit entropy estimation and / or implicit entropy estimation. Explicit entropy estimation can be realized by a hyperprior that compresses the entropy estimation parameters and transmits side information via a second bitstream. Implicit entropy estimation can use already decoded elements of the first bitstream and include them in the entropy estimation of the primary bitstream while considering the causality of the coding order. Implicit entropy estimation is usually called an autoregressive context model and can typically be a two-dimensional (2D) masked convolution. However, 2D masked convolution provides a finite small support. This limits the performance of implicit entropy estimation since long-distance dependencies are not considered.
[0099] Furthermore, convolution kernels, once trained, are inherently unable to adapt to the characteristics of the bitstream, i.e., the latent tensor elements. Because the same kernel is applied to every position in the compressed bitstream, convolution kernels are position-independent. This limits the performance of implicit models, since they can only learn position-specific dependencies. Even when the kernel size of masked convolutions is increased, the performance of implicit models barely improves, since their non-adaptivity allows them to exploit a fixed set of position-specific internal relationships between previously coded elements.
[0100] Furthermore, the implicit model with 2D masked convolution encodes / decodes all channels of the latent tensor at once and does not exploit any cross-channel correlation. Since there is no per-channel autoregression, the channel elements of the currently coded latent element do not have access to the information of other spatially co-located elements with different channel indices. The lack of per-channel autoregression also leads to poor performance.
[0101] Autoencoders and Unsupervised Learning An autoencoder is a type of executive neural network used to learn efficient data coding in an unsupervised manner. Its schematic is shown in Figure 2. The goal of an autoencoder is to learn a representation (encoding) of a set of data, usually for dimensionality reduction, by training the network to ignore signal “noise”. Along with the reduction side, a reconstruction side is also learned, where the autoencoder tries to generate a representation from the reduced encoding that is as close as possible to the original input, hence the name. In the simplest case, given one hidden layer, the encoder stage of an autoencoder takes an input x and maps it to h: h = σ(Wx+b) This image h is usually called the code, latent variable, or latent representation. Here, σ is an element-wise activation function, such as the sigmoid function or the rectified linear unit. W is a weight matrix and b is a bias vector. The weights and biases are usually initialized randomly and then iteratively updated during training through backpropagation. The decoder stage of the autoencoder then maps h to a reconstruction x' of the same shape as x: x'=σ'(W'h'+b') Here, σ', W', and b' for the decoder can be unrelated to the corresponding σ, W, and b for the encoder.
[0102] Variational autoencoder models make strong assumptions about the distribution of the latent variables. They use a variational approach to latent representation learning, which results in an additional loss component and a specific estimator for the training algorithm called the Stochastic Gradient Variational Bayesian (SGVB) estimator. The data is represented by a directed graphical model p θ (x|h), and the encoder estimates the posterior distribution p θ Approximation q to (h|x) φSuppose we are learning (h|x), where φ and θ represent the parameters of the encoder (recognition model) and decoder (generative model), respectively. The probability distribution of the latent vectors in a VAE typically matches the probability distribution of the training data much more closely than a standard autoencoder.
[0103] Recent advances in the field of artificial neural networks, especially convolutional neural networks, have sparked the interest of researchers in applying neural network-based techniques to the task of image and video compression. For example, end-to-end optimized image compression using networks based on variational autoencoders has been proposed.
[0104] Data compression is therefore considered a fundamental and well-studied problem in engineering, and is commonly formulated with the goal of designing a code for a given set of discrete data with minimal entropy. The problem is closely related to probabilistic source modeling, since the solution relies heavily on knowledge of the probabilistic structure of the data. However, since all practical codes must have finite entropy, continuous-valued data (such as a vector of image pixel intensities) must be quantized to a finite set of discrete values, which introduces error.
[0105] This situation, known as the lossy compression problem, requires a tradeoff between two competing costs: the entropy of the discretized representation (rate) and the error resulting from quantization (distortion). Various compression applications, such as data storage or transmission over limited-capacity channels, call for different rate-distortion tradeoffs.
[0106] Joint optimization of rate and distortion is difficult. Without further constraints, the general problem of optimal quantization in a high-dimensional space is intractable. For this reason, most existing image compression methods work by linearly transforming the data vector into an appropriate continuous-valued representation, quantizing its elements separately, and encoding the resulting discrete representation using a reversible entropy code. This scheme is called transform coding, since the transform plays a central role.
[0107] For example, JPEG uses a discrete cosine transform on blocks of pixels, and JPEG 2000 uses a multi-scale orthogonal wavelet decomposition. Typically, the three components of a transform coding method, the transform, the quantizer, and the entropy code, are optimized separately (often by manual parameter tuning). Modern video compression standards such as HEVC, VVC, and EVC also use transformed representations to code the residual signal after prediction. Several transforms are used for this purpose, such as the discrete cosine transform (DCT) and discrete sine transform (DST) and the low-frequency non-separable manually optimized transform (LFNST).
[0108] Variational Image Compression The variational autoencoder (VAE) framework can be considered as a nonlinear transform coding model. The transformation process can be divided into four main parts. Figure 3a illustrates the VAE framework. In Figure 3a, the encoder 310 maps the input image x 311 to a latent representation (denoted as y) via a function y = f(x). This latent representation may also be referred to below as a part of the "latent space" or a point in the "latent space". The function f() is a transformation function that transforms the input signal 311 to a more compressible representation y.
[0109] The input image 311 to be compressed is represented as a 3D tensor with size H×W×C, where H and W are the height and width of the image, and C is the number of color channels. In a first step, the input image passes through an encoder 310, which downsamples the input image 311 by applying multiple convolutions and nonlinear transformations to generate a latent space feature tensor (hereafter latent tensor) y. (This is not resampling in the classical sense, but in deep learning, down- and upsampling are common terms for changing the height and width size of a tensor.) The latent tensor y 4020 corresponding to the input image 4010, shown exemplarily in FIG. 4, is (H / D e )×(W / D e )×C e where De is the downsampling factor of the encoder and Ce is the number of channels.
[0110] The difference between pixels of the input / output images and the latent tensor is shown in Figure 4. The latent tensor 4020 is a multi-dimensional array of elements and does not typically represent picture information. Two of the dimensions relate to the height and width of the image, and the information and content relate to lower resolution representations of the image. The third dimension, the channel dimension, relates to different representations of the same image in the latent space.
[0111] A latent space can be understood as a representation of compressed data where similar data points are close to each other in the latent space. The latent space is useful for learning features of the data or finding simpler representations of the data for analysis. The quantizer 330 converts the latent representation y into
number
number
[0112] The entropy estimate of the latent tensor y can be improved by further applying an optional hyperprior model.
[0113] In the first step to obtain the hyperprior model, the hyperencoder 320 is applied to the latent tensor y, which downsamples the latent tensor to a hyperlatent tensor z by convolution and nonlinear transformation. The latent tensor x is then decomposed into a hyperlatent tensor z by (H / D h )×(W / D h )×C h It has a size of
[0114] In the next step, a quantizer 331 may be run on the latent tensor z. The factorization entropy model 342 calculates the quantized hyperlatent tensor
number
number
number
[0115] The factorized entropy model 342 serves as a codebook with parameters available at the decoder side. The entropy decoder 343 recovers the quantized hyper-latent tensor from the bitstream 341 by using the factorized entropy model 342. The recovered quantized hyper-latent tensor is upsampled in the hyper-decoder 350 by applying multiple convolution operations and nonlinear transformations. The hyper-decoder output tensor 430 is denoted by ψ.
[0116] The HyperEncoder / Decoder (also known as the HyperPrior) 330-350 encodes the quantized latent representation in a way that achieves rates achievable by lossless entropy source coding.
number
number
number
number
number
[0117] In FIG. 3a, component AE370 is an arithmetic coding module, which:
number
number
[0118] Arithmetic Decoding (AD) 372 is the process of undoing the binarization process, where binary digits are converted back to sample values. Arithmetic decoding is provided by arithmetic decoding module 372.
[0119] In Fig. 3a there are two sub-networks connected to each other. A sub-network in this context is a logical division between parts of an overall network. For example, in Fig. 3a the modules 310, 320, 370, 372 and 380 are called the "encoder / decoder" sub-network. The "encoder / decoder" sub-network is responsible for encoding (generation) and decoding (parsing) the first bitstream, the "y bitstream". The second network in Fig. 3a has the modules 330, 331, 340, 343, 350 and 360 and is called the "hyperencoder / decoder" sub-network. The second sub-network is responsible for generating the second bitstream, the "z bitstream". The purpose of the two sub-networks is different.
[0120] The first subnetwork is responsible for: Converting 310 the input image 311 to its latent representation y (it is easier to compress x), Latent expression y
number
number
[0121] The purpose of the second sub-network is to obtain statistical properties of the samples of "y bitstream" (e.g., mean, variance, and correlation between samples of y bitstream) such that compression of the y bitstream by the first sub-network is more efficient. The second sub-network generates a second bitstream, "z bitstream", which contains said information (e.g., mean, variance, and correlation between samples of y bitstream).
[0122] The second network is
number
number
number
number
number
number
number
number
number
number
number
number
[0123] FIG. 3a describes an example of a VAE (variational autoencoder), the details of which may vary in different implementations. For example, in a specific implementation, there may be additional components to more efficiently obtain statistical characteristics of samples of the first bitstream. In one such implementation, there may be a context modeler, which is directed to extracting cross-correlation information of the y bitstream. The statistical information provided by the second sub-network may be used by the AE (arithmetic encoder) 370 and AD (arithmetic decoder) 372 components.
[0124] Figure 3a shows the encoder and decoder in a single diagram. As will be apparent to those skilled in the art, the encoder and decoder may be, and very often are, embedded in different devices.
[0125] Figures 3b and 3c show separately the encoder and decoder components corresponding to the VAE framework. As input, the encoder receives a picture according to some embodiments. The input picture may include one or more channels, such as color channels or other types of channels, e.g. depth channels or motion information channels. The outputs of the encoder (shown in Figure 3b) are a y bitstream and a z bitstream. The y bitstream is the output of a first sub-network of the encoder, and the z bitstream is the output of a second sub-network of the encoder.
[0126] Similarly, in FIG. 3c, two bitstreams, y bitstream and z bitstream, are received as input and the reconstructed (decoded) image is
number
[0127] Specifically, as can be seen in Fig. 3b, the encoder comprises an encoder 310 which converts an input x into a signal y, which is then fed to a quantizer 320. The quantizer 320 feeds information to an arithmetic coding module 370 and to a hyper-encoder 330, which may receive the signal y rather than a quantized version. The hyper-encoder 330 feeds the z bitstream already discussed above to a hyper-decoder 350, which then feeds information to an arithmetic coding module 370. The sub-steps discussed above with reference to Fig. 3a may also be part of this encoder.
[0128] The output of the arithmetic coding module is the y bit stream. The y bit stream and the z bit stream are the output of the coding of the signal, which are then fed (transmitted) to the decoding process. The unit 310 is called the "encoder", but the complete sub-network depicted in FIG. 3b can also be called the "encoder". The process of coding generally refers to a unit (module) that converts an input into a coded (e.g. compressed) output. From FIG. 3b it can be seen that the unit 310 can in fact be considered as the core of the whole sub-network, since it performs the conversion of the input x into y, which is a compressed version of x. The compression in the encoder 310 can be achieved, for example, by applying a neural network, or in general, any processing network that includes one or more layers. In such a network, the compression can be performed by cascaded processes, including downsampling, which reduces the size and / or number of the channels of the input. Thus, the encoder can be called, for example, a neural network (NN)-based encoder.
[0129] The remaining parts in the figure (quantization unit, hyperencoder, hyperdecoder, arithmetic encoder / decoder) are all parts that either improve the efficiency of the encoding process or are involved in converting the compressed output y into a series of bits (bitstream). Quantization may be provided to further compress the output of the NN encoder 310 by lossy compression. The AE 370, in combination with the hyperencoder 330 and hyperdecoder 350 used to configure the AE 370, can perform binarization, which allows the quantized signal to be further compressed by lossless compression. Therefore, the entire sub-network of FIG. 3b can also be called the "encoder".
[0130] Most deep learning (DL) based image / video compression systems reduce the dimensionality of a signal before converting it into binary digits (bits). For example, in the VAE framework, an encoder, which is a nonlinear transform, maps an input image x to y, where y has a smaller width and height than x. Since y has a smaller width and height, and thus a smaller size, the dimensionality (size) of the signal is reduced, and therefore it is easier to compress the signal y. In general, an encoder does not necessarily need to reduce the size in both (or generally, all) dimensions. Rather, some exemplary implementations may provide an encoder that reduces the size in only one dimension (or generally, a subset of the dimensions).
[0131] The arithmetic encoder and decoder are specific implementations of entropy coding. The AE and AD can be replaced by any other entropy coding means. Also, the quantization operation and the corresponding quantization unit are not necessarily present and / or can be replaced by other units.
[0132] Artificial Neural Networks Artificial neural networks (ANNs), or connectionist systems, are computing systems loosely inspired by the biological neural networks that make up animal brains. Such systems typically "learn" to perform tasks by studying examples, without being programmed with task-specific rules. For example, in image recognition, a system can learn to identify images that contain cats by analyzing example images that have been manually labeled as "cat" or "no cat" and then using the results to identify cats in other images. They do this without any prior knowledge of cats, such as that cats have fur, tails, whiskers, and cat-like faces. Instead, they automatically generate discriminative characteristics from the examples they process.
[0133] ANNs are based on a collection of connected units or nodes called artificial neurons, loosely modeled on neurons in the biological brain. Similar to synapses in the biological brain, each connection can send signals to other neurons. When an artificial neuron receives a signal, it can process it and send a signal to the neurons connected to it.
[0134] In an ANN implementation, the "signals" in the connections are real numbers, and the output of each neuron is calculated by some nonlinear function of the sum of the inputs. The connections are called edges. Neurons and edges usually have weights that are adjusted as the learning progresses. The weights increase or decrease the strength of the signal in the connection. Neurons may have a threshold such that a signal is sent only if the aggregate signal exceeds that threshold. Neurons are usually aggregated into layers. Different layers may perform different transformations on their inputs. Signals travel from the first layer (the input layer) to the last layer (the output layer), possibly after passing through the layer multiple times.
[0135] The original goal of the ANN approach was to solve problems in the same way as the human brain. Over time, attention shifted to performing specific tasks, straying from biology. ANNs are used for a variety of tasks, including computer vision, speech recognition, machine translation, filtering in social networks, playing board and video games, medical diagnosis, and even activities traditionally thought of as exclusive to humans, such as painting.
[0136] The name "convolutional neural network" (CNN) refers to the network's use of a mathematical operation called convolution, which is a special kind of linear operation. A convolutional network is a neural network that uses convolution instead of the more common matrix multiplication in at least one layer.
[0137] FIG. 1 shows a schematic representation of the general concept of processing by a neural network such as a CNN. A convolutional neural network consists of an input layer and an output layer, as well as multiple hidden layers. The input layer is the layer to which the input (e.g., a portion of the image shown in FIG. 1) is fed for processing. The hidden layers of a CNN usually consist of a series of convolutional layers that convolve by multiplication or other dot products. The result of the layers is one or more feature maps (f.maps in FIG. 1), sometimes also called channels. Some or all layers may include subsampling. As a result, the feature maps may be smaller, as represented in FIG. 1. The activation function of a CNN is usually a ReLU (Renormalized Logical Unit) layer, followed by additional convolutions, such as pooling layers, fully connected layers, and normalization layers, called hidden layers because their inputs and outputs are masked by the activation function and the final convolution. The layers are colloquially called convolutions, but this is by convention. Mathematically, it is technically a sliding dot product or cross-correlation. This is important for the index into the matrix because it affects how the weight at a particular index point is determined.
[0138] As shown in Figure 1, when programming a CNN to process images, the input is a tensor with the shape (number of images) x (image width) x (image height) x (image depth). Then, after passing through the convolutional layers, the image is abstracted into a feature map with the shape (number of images) x (feature map width) x (feature map height) x (feature map channels). A convolutional layer in a neural network should have the following attributes: width and height defined by the convolution kernel (hyperparameters), number of input and output channels (hyperparameters). The depth of the convolutional filter (input channels) should be equal to the number of channels (depth) of the input feature map.
[0139] Traditional multi-layer perceptron (MLP) models have been used for image recognition. However, full connections between nodes make them problematic in terms of high dimensionality and do not scale well for high-resolution images. A 1000x1000 pixel image with RGB color channels has 3 million weights, too many to be efficiently processed at scale with full connections. Furthermore, such network architectures do not take into account the spatial structure of the data, treating far-away input pixels the same as nearby pixels. This ignores the locality of reference in the image data, both computationally and semantically. Thus, full connections of neurons are wasteful for purposes such as image recognition, which are dominated by spatially local input patterns.
[0140] Convolutional neural networks are biologically inspired variants of multi-layer perceptrons specifically designed to emulate the operation of the visual cortex. These models mitigate the challenges posed by MLP architectures by exploiting the strong spatially local correlations present in natural images. Convolutional layers are the core building blocks of CNNs. The parameters of this layer consist of a set of learnable filters (kernels as shown above) whose receptive fields are small but span the entire depth of the input volume. During the forward pass, each filter is convolved across the width and height of the input volume, and a dot product is calculated between the entries of the filter and the input, generating a two-dimensional activation map for that filter. As a result, the network learns filters that are activated when it detects a certain type of feature at a certain spatial location in the input.
[0141] Stacking the activation maps of all filters along the depth dimension forms the complete output volume of the convolutional layer. Therefore, every entry in the output volume can also be interpreted as the output of a neuron that looks into a small region in the input and shares parameters with neurons in the same activation map. A feature map or activation map is the output activation of a given filter. Feature map and activation have the same meaning. In some papers it is called an activation map because it is a mapping that corresponds to the activation of different parts of the image, and also a mapping of where in the image a certain type of feature is found, so it is called a feature map. High activation means that a certain feature is found.
[0142] Another important concept in CNNs is pooling, a form of nonlinear downsampling. There are several nonlinear functions that implement pooling, among which the most common is max pooling, which divides the input image into a set of non-overlapping rectangles and outputs the maximum value for each such subregion.
[0143] Intuitively, the exact location of a feature is less important than its rough location relative to other features. This is the idea behind the use of pooling in convolutional neural networks. Pooling layers serve to progressively reduce the representation space size, reducing the number of parameters, memory footprint, and computation in the network, thereby also controlling overfitting. It is common in CNN architectures to periodically insert pooling layers between successive convolutional layers. The pooling operation introduces another form of translation invariance.
[0144] A pooling layer operates independently on every depth slice of the input and spatially modifies its size. The most common form is a pooling layer with a filter of size 2 × 2, applied by 2 along both width and height with a stride of 2 for each depth slice of the input, discarding 75% of the activations. In this case, all max operations exceed 4 numbers. The depth dimension remains unchanged. In addition to max pooling, the pooling unit can use other functions such as average pooling and L2 norm pooling. Average pooling was historically popular, but has become less used recently compared to max pooling, which in practice often outperforms it. Due to aggressive reductions in representation size, there is a recent trend to use smaller filters or to discard pooling layers altogether. "Region of interest" pooling (also known as ROI pooling) is a variant of max pooling, where the output size is fixed and the input rectangle is a parameter. Pooling is a key component of convolutional neural networks for object detection based on the Fast R-CNN architecture.
[0145] The ReLU above stands for Rectified Linear Unit, and applies a non-saturating activation function. By setting negative values to zero, they are effectively removed from the activation map. It enhances the non-linearity of the decision function and the entire network without affecting the receptive fields of the convolutional layers. Other functions are also used to enhance the non-linearity, for example, saturated hyperbolic tangent and sigmoid functions. ReLU is often preferred over other functions because it allows neural networks to be trained several times faster without significantly affecting the accuracy of generalization.
[0146] After several convolutional and max pooling layers, the higher level inference of a neural network is performed via fully connected layers. As in regular (non-convolutional) artificial neural networks, neurons in a fully connected layer connect with all activations of the previous layer. Their activations can therefore be computed as an affine transformation with a matrix multiplication followed by a bias offset (vector addition of a learned or fixed bias term).
[0147] The "loss layer" (containing the computation of the loss function) specifies how training penalizes deviations between predicted (output) labels and true labels, and is usually the final layer of a neural network. Various loss functions suitable for different tasks may be used: softmax loss is used to predict one class out of K mutually exclusive classes; sigmoid cross entropy loss is used to predict K independent probability values in [0,1]; Euclidean loss is used for regression to real-valued labels.
[0148] In summary, FIG. 1 shows the data flow in a typical convolutional neural network. First, the input image passes through a convolutional layer and is abstracted into a feature map containing a number of channels corresponding to the number of filters in the set of learnable filters in this example. The feature map is then subsampled, for example using a pooling layer, thereby reducing the dimensionality of each channel of the feature map. The data is then sent to another convolutional layer, which may have a different number of output channels. As mentioned above, the number of input and output channels are hyperparameters of the layer. To establish the connectivity of the network, these parameters need to be synchronized between two connected layers, so that the number of input channels of the current layer should be equal to the number of output channels of the previous layer. For the first layer, which processes input data, e.g., an image, the number of input channels is usually equal to the number of channels of the data representation, e.g., three channels in the case of an RGB or YUV representation of an image or video, or one channel in the case of a grayscale image or video representation.
[0149] Attention Mechanism in Deep Learning Attention mechanisms are deep learning techniques that allow neural networks to enhance or focus on important parts of the input and fade out irrelevant parts. This simple yet powerful concept can be applied in areas such as natural language processing, recommendation, healthcare analytics, image processing, and speech recognition, for example.
[0150] Traditionally, attention is computed over the entire input sequence (global attention). Despite its simplicity, such an approach can be computationally expensive. Local attention could be a solution.
[0151] One implementation of an attention mechanism is the so-called Transformer model. The Transformer model applies an attention layer followed by a feed-forward neural network. Two examples of the Transformer block are shown in Fig. 5a and Fig. 5b. In the Transformer model, the input tensor x is first fed into a neural network layer to extract features of the input tensor. This results in a so-called embedding tensor e 5010, which contains the latent space elements that are used as input to the Transformer. The input tensor x and the embedding tensor e have size S × d input and S × d e where S is the number of consecutive elements and d is the dimension of each consecutive element. A positional encoding 5020 may be added to the embedding tensor. The positional encoding 5020 allows the transformer to take into account the order of the input sequence. Such a positional encoding provides a representation of the position of an element within the arrangement of elements of the input tensor. These encodings may be learned, or alternatively a predefined tensor may represent the order of the sequence.
[0152] Once the positional encoding 5020 is calculated, it is piecewise added to the embedding vector 5010. The input vector is then prepared to enter the transformer block. The embodiment of the transformer block in Fig. 5a consists of two necessary steps: multi-head attention 5030 and a linear transformation with a non-linear activation function 5032 applied separately and identically to each position. Two summing and normalization blocks 5031 and 5033 combine the outputs of the attention layer 5030 and the MLP 5032, respectively, with the residual connections 5034 and 5035. The embodiment of the transformer block in Fig. 5b also consists of two necessary steps: attention 5051 and a linear transformation with a non-linear activation function 5053 applied separately and identically to each position. The embodiment in Fig. 5b shows a different arrangement of normalization blocks 5050 and 5052 and residual connections 5054 and 5055. The role of the attention block here is similar to that of the regression cell, but with fewer computational requirements. The transformer block does not necessarily need to use a multi-head attention layer or a multi-head attention layer L times. The multi-head attention layer in these examples may be replaced by any other type of attention mechanism.
[0153] In the self-attention module, all three vectors are taken from the same sequence and represent vectors with embedded positional encoding.
[0154] A typical attention mechanism consisting of a query Q 620, a key K 621, and a value V 622 is exemplarily shown in Fig. 6. The origin of such a name comes from search engines, where a user's query is matched against keys in an internal engine and the results are represented by some values.
[0155] The embedding vector is expressed as position encoding p e After combining with S, three different representations, i.e., queues Q, keys K, and values V, are obtained by the feedforward neural network layer. The queues, keys, and values are S×d q , S × d k and S × dv Usually, the cue, the key and the value may have the same dimension d. To compute self-attention, we first calculate the scaled dot product between the cue and the key (QK T / d k ) can be calculated and a softmax function can be applied to obtain attention scores. These scores are then multiplied by a value to achieve self-attention. The self-attention mechanism is:
number
[0156] The computed attention is then added to the embedding vector by forming a form of residual connection and normalized by a normalization layer. Finally, a multi-layer feedforward neural network (aka multi-layer perceptron) containing the residual connections is applied and the final output is normalized. All the above steps (after the generation of the embedding tensor) describe one layer of a transformer that can be repeated L times to generate a transformer network containing L layers.
[0157] In other words, the attention layer obtains multiple representations of the input sequence, e.g., keys, cues, and values. To obtain a representation from the multiple representations, the input sequence is processed by a respective set of weights, which may be obtained in a training phase. These sets of weights may be jointly learned with the rest of the neural network, including such an attention layer. During inference, the output is calculated as a weighted sum of the processed input sequences.
[0158] One extension to the above attention mechanism is multi-head attention. In this version, the final dimensions of the query, key and value are split into h sub-representations and for each sub-representation, attention is computed separately. The final attention is computed by concatenating each sub-attention and feeding it into a feed-forward neural network (FFN). The formulation of multi-head attention is given as follows:
number
[0159] Multi-head attention allows for parallelization and for each embedding tensor to have multiple representations.
[0160] A single attention function is depicted in Fig. 6a, and its parallel application in multi-head attention is shown in Fig. 6b. By performing more projection and attention computations, the model is able to take different perspectives on the same input sequence. It jointly deals with information from different angles, which are mathematically represented via different linear subspaces.
[0161] The exemplary single attention function of Fig. 6a performs an alignment 620 between keys 610 and queries 611, as described above, and obtains an output 640 by applying a weighted sum 630 to the attention scores and values 612. The exemplary multi-head attention function of Fig. 6b performs an alignment 660 for each pair of keys 650 and queries 651, which may belong to different linear subspaces. For each obtained attention score and respective value 652, a weighted sum 670 is calculated. The results are concatenated 680 to obtain an output 690.
[0162] The next step after multi-head attention in the transformer block is a simple positionally fully connected feedforward network. There are residual connections around each block, followed by layer normalization. The residual connections help the network keep track of the data it is observing. The layer normalization serves to reduce the variance of the features.
[0163] There are several different architectures of the Transformer in the literature, the order and type of its components may vary. However, the basic logic is similar: some kind of attention mechanism followed by another neural network encapsulates the layers of the Transformer layer, and the layers of this architecture form the Transformer network. As explained above, two examples are given in Figures 5a and 5b. The present invention is not limited to the above-mentioned exemplary implementations of the attention mechanism.
[0164] Attention-Based Context Modeling The process of obtaining a context model by applying a neural network including an attention layer is exemplarily shown in Figures 7a and 7b.
[0165] Image data to be compressed can be represented as a three-dimensional tensor 311 with size H×W×C, where H and W are the height and width of the image, and C is the number of color channels. An input image can be processed by an autoencoder convolutional neural network 310, as described above with reference to FIG. 3a. Such an autoencoder 310 downsamples the input image by applying a number of convolutions and nonlinear regressions to generate a latent tensor y. The latent tensor can be expressed as (H / D e )×(W / D e )×C ewhere De is the downsampling factor of the encoder 310 and Ce is the number of channels. The obtained latent tensor can be encoded into a bitstream 371 using the probability model generated by the attention-based context modeling.
[0166] The latent tensor y may be quantized. The quantization may be performed by a quantization block 320.
[0167] The context model for entropy coding of the latent tensor can be determined by applying an attention layer 732. The latent spatial feature tensor contains one or more elements and is divided 700 into multiple segments 820 in the spatial dimension as shown in Figures 7a and 8. Each segment contains at least one latent tensor element. A segment has a dimension (p H ×p W ×C e ), C e is the number of elements in the channel dimension of the latent tensor, and the spatial dimension of the latent tensor is divided into patches, each of which is (p H ×p W ) elements. The separation 700 is illustratively shown in FIG. e The dimensional latent tensor 810 is split into 16 elements 820 in the spatial dimension, with each segment having dimensions (1×1×C e ).
[0168] The latent tensors to be entropy encoded may be generated from image data processed by an autoencoding neural network as described above, although the invention is not limited to image data from an autoencoder. The latent tensors to be entropy encoded may also be generated while processing any other type of input data, such as multidimensional point clouds, audio data, video data, etc.
[0169] The arrangement 830 of the multiple segments is processed by one or more layers of a neural network. Such an arrangement can be predefined, i.e., the scan order in the spatial and / or channel directions can be specified. The arrangement in the first embodiment can include reshaping the latent tensor into a sequential form 830.
number
number
[0170] The neural network includes at least one attention layer. The attention mechanism was described above in the section "Attention Mechanism in Deep Learning" with reference to Figs. 5 and 6. The attention layer may be a multi-head attention layer as exemplarily described with reference to Fig. 6b. The attention layer may be included in a transformer sub-network as exemplarily described with reference to Figs. 5a and 5b. The attention layer to be included in the transformer sub-network may be any type of attention layer or a multi-head attention layer.
[0171] A probability model for entropy coding of the current element of the latent tensor is obtained based on the processed segments. The current element may be entropy coded into a first bitstream, e.g., the y bitstream 371 in FIG. 3, using the obtained probability model for entropy coding. A specific implementation of the entropy coding may be, for example, arithmetic coding as discussed in the "Variational Image Compression" section. The present invention is not limited to such an exemplary arithmetic coding. Any entropy coding that can code based on an estimated entropy per element can use the probabilities obtained by the present invention.
[0172] Separation of the latent tensor may include separating the latent tensor into two or more segments in the channel dimension 701, as shown, for example, in FIG. CS Such separation of channel segments is
number
[0173] Maximum number of channel segments N CS teeth,
number
[0174] In a second embodiment, the segments may be arranged in a predefined order, where segments 931, 932, and 933 with the same spatial coordinates are grouped together. CS Segments in a first spatial coordinate 930 having different channel segment indices within [[(x,y)-1]] may be grouped together. Segments in a second spatial coordinate 931 having different channel indices may be grouped together. The arrangement 930 may be
number
[0175] In the third embodiment, segments 941, 942 and 943 having different spatial coordinates may be arranged 701 consecutively in a predefined order. In other words, the segments corresponding to a first channel segment index 940 may be grouped together. Subsequently, the segments corresponding to a second channel segment index 941 may be grouped together. The arrangement 940 may be:
number
[0176] For simplicity's sake,
number
number
[0177] The beginning of the arrangement of multiple segments of any of the above exemplary embodiments may be padded 710, 711 with a zero segment 1000 prior to processing by the neural network. The zero segment may have the same dimensions as each segment in the multiple segments. Each element in the zero segment may be zero. FIG. 10a illustrates such padding 710 for a first example, while FIGS. 10b and 10c illustrate padding 711 for second and third examples corresponding to different arrangements of the latent tensor. FIG. 10a illustratively illustrates a segment of the latent tensor for the first example, which does not perform separation in the channel dimension. C in the channel dimension e The zero segment 1000 containing elements is padded at the beginning of the constellation to obtain a padded constellation 1030. Figure 10b shows the padding of the constellation of the second embodiment with a coding order that codes segments with the same spatial coordinates first. The zero segment 1001 in this example is zero, C e / N CSSimilarly, FIG. 10c shows an exemplary padding arrangement of the third embodiment with a coding order that codes segments of the same channel segment index first. The zero segment 1002 in this example is C e / N CS elements. The padding ensures that the causality of the coding sequence is not disturbed, i.e. a decoder can decode the data from the bitstream without any additional a priori knowledge.
[0178] The multiple segments of the latent tensor may be processed by a first neural sub-network 720. Such a first neural sub-network may extract features from the multiple segments. The features may be independent deep features (also called embeddings). Thus, said first neural sub-network 720 is a so-called embedding layer that extracts context embeddings in a high-dimensional real-valued vector space. The first neural sub-network 720 may be a fully connected neural network such as a multi-layer perceptron as described above. For example, a convolutional neural network (CNN) or a recurrent neural network (RNN) may be used. The output of the first neural sub-network 720, the so-called context embeddings, may be fed as input to a subsequent layer of the neural network.
[0179] Positional information 721 of multiple segments may be provided as input to the attention layer. Such positional information 721 may be combined with the output of the first neural sub-network 720, e.g., by concatenation, addition, etc. Context embeddings may be combined with the positional information 721 and normalized 731. Positional encodings include positional information, e.g., coordinates in a linear space. Positional encodings allow the attention layer to understand the sequential order of the input sequence. For example, these encodings can be learned, or predefined tensors representing the order of the sequence can be used.
[0180] In the processing by the attention layer 732, a mask may be applied, which masks subsequent elements in the attention tensor that follow the current element in the processing order of the latent tensor. The mask prevents the subsequent elements from being used in the calculation of the attention tensor. In other words, the attention mechanism may be adapted to autoregressive tasks to ensure causality at the decoder side. Such a masked attention mechanism is an attention mechanism that is masked so as not to process any data that is not at a position prior to the current position in the attention layer input order. Masking is exemplarily shown in Fig. 13a-c, which shows the processing order of segments for the current segment. The segments that are still to be coded are shown.
[0181] The attention mechanism is applied by default to the whole sequence S. It consists of the attention i applies attention to itself and all other elements. This behavior is undesirable for autoregressive tasks, since the network cannot use any elements that have not yet been processed. To combat this issue, the attention mechanism can be restricted by masking the scaled dot products within the attention mechanism. The mask can be written as an S×S matrix whose lower triangle (including the diagonal) contains ones and whose upper triangular part (excluding the diagonal) consists of minus infinity (softmax(-∞)=0). Masked attention can be formulated as follows:
number
[0182] The masking of the present invention is not limited to the application of this exemplary matrix M. Any other masking technique may be applied.
[0183] The output of the attention layer 732 may be processed by a second neural sub-network 735, which may be a multi-layer perceptron. The output of the attention layer 732 may be normalized 734 before processing by the second neural sub-network 735. The output of the attention layer 732 may be combined with a context embedding or with a combined representation of the context embedding and the location information 721 by residual connections 737.
[0184] The output of the attention-based context model is denoted by φ.
[0185] The probability model 770 of the entropy coding may be selected depending on the computational complexity and / or characteristics of the first bitstream 731. The characteristics of the first bitstream 731 may include a predefined target rate or frame size. The rules may predefine the option to be used. In this case, the rules may be known by the decoder, so no additional signaling is required.
[0186] The selection may include selecting whether the separation of the latent tensors is performed in the channel dimension. The selection may include selecting between various ways how the alignment is performed, e.g., in the first spatial dimension or in the first channel dimension.
[0187] For example, if separation in the channel dimension is not performed, the performance of the context model may be limited since cross-channel correlation is not taken into account for entropy modeling, but this may result in faster encoding and decoding since fewer autocorrelation steps are required.
[0188] For example, N CSIf N is >1, cross-channel correlation is taken into account, which may improve the performance of the context model. CS but
number
[0189] In a first step of obtaining any hyper-prior model, a hyper-encoder 320 shown in FIG. 3a is applied to the latent tensor to obtain a hyper-latent tensor. The hyper-latent tensor may be encoded into a second bitstream, e.g., z-stream 341. The second bitstream may be entropy decoded, and the hyper-decoder output is obtained by hyper-decoding the hyper-latent tensor. The hyper-prior model may be obtained as described in the "Variational Image Compression" section. However, the present disclosure is not limited to this exemplary implementation.
[0190] Similar to the latent tensor, the output ψ of any hyperdecoder may be split into multiple hyperdecoder output segments 740. Each hyperdecoder output segment may include one or more hyperdecoder output elements. For each segment in the multiple segments, the segment and the set of hyperdecoder output segments in the multiple hyperdecoder output segments may be concatenated before the probability model 770 is obtained. In other words, the tensors φ and ψ may be concatenated in the channel dimension (the last dimension), resulting in a concatenated two-dimensional tensor.
[0191] The hyperdecoder output segments may be arranged in a manner that corresponds to the arrangement of the multiple segments. The output of the hyperdecoder, ψ, may be
number
[0192] An example of a set of hyperencoder output segments is shown in FIG. 11. The arrangement of the segments of the latent tensor may be performed according to the second or third embodiment. In a fourth embodiment, the set of hyperdecoder output segments to be concatenated with each segment 1100 may include a hyperdecoder output segment 1110 corresponding to each segment. The hyperdecoder output segment 1110 may have the same spatial coordinates and the same channel segment index as each segment 1100. That is, the hyperdecoder output segment 1110 may be co-located with each segment 1100. Using co-located hyperdecoder output segments 1110 in the concatenation may reduce computational complexity and therefore result in faster processing.
[0193] In the fifth embodiment, the set of hyperdecoder output segments to be concatenated with each segment 1100 may include multiple hyperdecoder output segments corresponding to the same channel as the respective segment. In other words, the multiple hyperdecoder output segments may include hyperdecoder output segments having the same spatial coordinates as each segment, i.e., belonging to the same co-located channel. In the example of FIG. 11, there are three co-located hyperdecoder output segments 1120, 1121, and 1122, where the first hyperdecoder output segment 1120 has the same channel segment index and spatial coordinates as each exemplary segment of the latent tensor y. The remaining two hyperdecoder output segments 1121 and 1122 may have the same spatial coordinates as each exemplary segment 1100. The multiple hyperdecoder output segments 1120, 1121, and 1122 may belong to the same co-located channel of each segment 1100. This set of hyperdecoder output segments may improve the performance of the probability estimation, since more cross-channel correlation of the hyperdecoder output is taken into account.
[0194] In a sixth embodiment, the set of hyperdecoder output segments to be concatenated with each segment 1100 may include multiple hyperdecoder output segments 1130 that are spatially proximate to each segment 1100. The multiple hyperdecoder output segments 1130 that are spatially proximate to each segment 1100 may have the same channel segment index as each segment 1100, as exemplarily shown in FIG. 11. The multiple hyperdecoder output segments 1130 may belong to the same spatial neighborhood of each segment 1100. This set of hyperdecoder output segments may improve the performance of the probability estimation, since more spatial correlation of the hyperdecoder output is taken into account.
[0195] In the seventh embodiment, the set of hyperdecoder output segments to be concatenated with each segment may include a plurality of hyperdecoder output segments including adjacent segment 1140 spatially adjacent to each segment, and segments 1141 and 1142 corresponding to the same channel as adjacent segment 1140. In other words, the set of hyperdecoder output segments may include hyperdecoder output segments 1140 spatially adjacent to each segment 1100 and may have the same channel segment index as each segment 1100, as exemplarily shown in FIG. 11. Furthermore, the set of hyperdecoder output segments may include hyperdecoder output segments 1141 and 1142 that may have the same spatial coordinates as the spatially adjacent hyperdecoder output segment 1140 and a channel segment index different from the channel segment index of the spatially adjacent hyperdecoder output segment 1140. The hyperdecoder output segments to be concatenated may belong to the same local neighborhood of each segment 1100. This set of hyper-decoder output segments may improve the performance of the probability estimation since more spatial and cross-channel correlation of the hyper-decoder output is taken into account.
[0196] The set of hyperdecoder output segments to be concatenated with each segment is not limited to the above examples. Any other set of hyperdecoder output segments may be concatenated with each segment of the latent tensor. For example, any combination of the fourth to seventh embodiments above may be used. Any of the fourth to seventh embodiments above and any combination thereof may be combined with any of the arrangements of the second or third embodiments.
[0197] FIG. 12 shows an example of concatenation 750 when no separation into segments in the channel dimension is performed. The arrangement of the segments of the latent tensor may be performed according to the first embodiment. For example, the set of hyperdecoder output segments to be concatenated with each segment 1200 may include a hyperdecoder output segment 1210 corresponding to each segment. The hyperdecoder output segment 1210 may have the same spatial coordinates and the same channel segment index as each segment 1200. For example, the set of hyperdecoder output segments to be concatenated with each segment 1200 may include multiple hyperdecoder output segments 1230 that are spatially adjacent to each segment 1200. The multiple hyperdecoder output segments 1230 that are spatially adjacent to each segment 1100 are exemplarily shown in FIG. 12.
[0198] The concatenated tensor is S×(C φ +C ψ’ ) and C φ and C ψ’ are the number of channels in the tensor φ and the number of channels from the tensor ψ, respectively. The result of the concatenation may be processed by an aggregation process 760. For example, the aggregation may be performed by a set of fully connected neural networks and nonlinear transformations for the last dimension. For example, the aggregation may be implemented by one or more layers of convolutions and nonlinear transformations with kernel size 1×1. The entropy model 770 is
number
number
[0199] Similar to the selection of a probability model for entropy coding, the set of hyperdecoder output segments may be adaptively selected depending on the computational complexity and / or characteristics of the first bitstream. The characteristics of the first bitstream may include a predefined target rate or frame size. A set of rules may be predefined which option to use. In this case, the rules may be known by the decoder, so no additional signaling is required.
[0200] During encoding, all elements of the latent tensor are available, so processing by the neural network and / or entropy coding of the current element can be performed in parallel for each segment in the multiple segments.
[0201] Processing the arrangement by the neural network may include selecting a subset of segments. Such a subset of segments is selected from the plurality of segments. The subset may be fed to a subsequent layer of the neural network. For example, the subset may be selected before applying the first neural sub-network. Such a subset of segments may include segments in a local neighborhood in the spatial dimension. This is exemplarily shown in Fig. 14a-c. In the example of Fig. 14a-c, segments spatially close to the current segment are represented that may be used by context modeling. Fig. 14a shows a case where separation in the channel dimension may not be performed. Fig. 14b represents an exemplary case where a segment of a first channel is processed before a segment of a second channel. Fig. 14c represents an exemplary case where a segment of a first channel segment index is processed before a segment with a second channel segment index. The size of the attention mechanism in the context model may be determined by:
number
number
[0202] For decoding the latent space feature tensor from the first bitstream, the latent tensor is initialized with zeros since the decoder is agnostic to the latent tensor and its statistical properties. The latent space feature tensor contains one or more elements and is divided 700 into multiple segments 820 in the spatial dimension as shown in Fig. 7a and Fig. 8. Each segment contains at least one latent tensor element. As with the encoding side, the arrangement of the multiple segments is handled by one or more layers of a neural network. The arrangement corresponding to the first embodiment of the encoding side may include reshaping the latent tensor into a sequential form 830.
number
number
[0203] The neural network includes at least one attention layer. The attention mechanism is described above in the section "Attention Mechanism in Deep Learning" with reference to Figures 5 and 6. Corresponding to the encoding, the attention layer may be a multi-head attention layer as exemplarily described with reference to Figure 6b. The attention layer may be included in a transformer sub-network, which is exemplarily described with reference to Figures 5a and 5b.
[0204] A probability model for entropy decoding of the current element of the latent tensor is obtained based on the processed segments. The current element can be decoded from a first bitstream, e.g., y bitstream 371 in FIG. 3, using the obtained probability model for entropy decoding. A specific implementation for entropy decoding can be, for example, arithmetic decoding as discussed in the "Variational Image Compression" section. The present invention is not limited to such an exemplary arithmetic decoding. Any entropy decoding can base its decoding on an estimated entropy per element and can use the probability obtained by the present invention.
[0205] The separation of the latent tensor may include separating the latent tensor into two or more segments in the channel dimension 701, as shown, for example, in Figure 9. Such separation is described in detail on the encoding side.
[0206] The segments may be arranged in a predefined order, with segments 931, 932 and 933 having the same spatial coordinates being grouped together. This arrangement 930 corresponds to the second embodiment described above in detail for encoding.
[0207] The segments with different spatial coordinates 941, 942 and 943 may be consecutively arranged in a predefined order 940. Such an arrangement 940 is similar to the third embodiment described above in detail for encoding.
[0208] The beginning of the multiple segment arrangement of any of the above embodiments may be padded 710, 711 with a zero segment 1000 prior to processing by the neural network. The zero segment may have the same dimensions as each segment in the multiple segments, which is exemplarily shown in Figures 10a-c. Padding is described in detail above with reference to Figures 10a-c.
[0209] According to the encoding side, the multiple segments of the latent tensor may be processed by a first neural sub-network 720. Such a first neural sub-network may extract features from the multiple segments. The features may be independent deep features. The first neural sub-network 720 may be a multi-layer perceptron. Position information 721 of the multiple segments may be provided as input to an attention layer. Such position information 721 may be combined with the output of the first neural sub-network 720, for example by concatenation, addition, etc.
[0210] The output of the attention layer 732 can be processed by a second neural sub-network 735, which can be a multi-layer perceptron, similar to the encoding side. The output of the attention layer 732 can be combined with the context embedding or with a combined representation of the context embedding and the location information 721 by the residual connection 737.
[0211] As with the encoding, the probability model 770 for the entropy coding may be selected depending on the computational complexity and / or characteristics of the first bitstream 731. The characteristics of the first bitstream 731 may include a predefined target rate or frame size. A set of rules may be predefined which options to use. In this case, the rules may be known by the decoder.
[0212] The hyper-latent tensors may be entropy decoded from the second bitstream 341. The obtained hyper-latent tensors may be hyper-decoded into a hyper-decoder output ψ.
[0213] Similar to the latent tensor, the output of any hyperdecoder ψ may be split into multiple hyperdecoder output segments 740. Each hyperdecoder output segment may include one or more hyperdecoder output elements. For each segment in the multiple segments, the segment and a set of hyperdecoder output segments in the multiple hyperdecoder output segments may be concatenated 750 before a probabilistic model 770 is obtained.
[0214] Examples of sets of hyperencoder output segments are shown in Fig. 11 and are described in detail on the encoding side in the fourth, fifth, sixth and seventh embodiments. The set of hyperencoder output segments may include one or more of the following: a hyperdecoder output segment corresponding to each of the segments, or a plurality of hyperdecoder output segments corresponding to the same channel as each of the segments, or a plurality of hyperdecoder output segments spatially adjacent to each of the segments, or a plurality of hyperdecoder output segments including adjacent segments spatially adjacent to each of the segments and segments corresponding to the same channel as the adjacent segments. Any of the above fourth to seventh embodiments and any combination thereof may be combined with any of the arrangements of the second or third embodiments.
[0215] Similar to the selection of a probability model for entropy coding, the set of hyperdecoder output segments may be adaptively selected depending on the computational complexity and / or characteristics of the first bitstream, including, for example, a predefined target rate or frame size. A set of rules may predefine the options to be used. In this case, the rules may be known by the decoder.
[0216] Processing of the arrangement by the neural network may include selecting a subset of the segments. Such a subset of segments may be selected from the plurality of segments. The subset may be fed to a subsequent layer of the neural network. Examples are described above with reference to Figures 14a-c.
[0217] A probabilistic model using attention layers may be applied to entropy decoding of latent tensors, which may be processed by a self-decoding convolutional neural network to obtain the image data as discussed above.
[0218] Implementation in picture coding The encoder 20 may be configured to receive a picture 17 (or picture data 17), e.g. a picture in a sequence of pictures forming a video or a video sequence. The received picture or picture data may be a preprocessed picture 19 (or preprocessed picture data 19). For simplicity, the following description refers to the picture 17. The picture 17 may also be called the current picture or the picture to be coded (particularly in video coding, in order to distinguish the current picture from other pictures, e.g. pictures that have been previously coded and / or decoded in the same video sequence, i.e. the video sequence that also contains the current picture).
[0219] A (digital) picture is or can be viewed as a two-dimensional array or matrix of samples with intensity values. The samples in the array may also be called pixels (short for picture element) or pels. The number of samples in the horizontal and vertical directions (or axes) of the array or picture defines the size and / or resolution of the picture. For color representation, three color components are used; that is, a picture is represented by or may contain three sample arrays. In an RGB format or color space, a picture has corresponding red, green and blue sample arrays. However, in video coding, each pixel is typically represented in a luminance and chrominance format or color space, e.g. YCbCr, which includes a luminance component denoted by Y (sometimes L is also used instead) and two chrominance components denoted by Cb and Cr. The luminance (or luma for short) component Y represents brightness or gray level intensity (e.g., similar to a grayscale picture), while the two chrominance (or chroma for short) components Cb and Cr represent chromaticity or color information components. Thus, a picture in YCbCr format includes a luminance sample array of luminance sample values (Y) and two chrominance sample arrays of chrominance values (Cb and Cr). A picture in RGB format may be converted or translated to YCbCr format and vice versa, a process also known as color conversion or translation. If the picture is monochrome, the picture may only have a luminance sample array. Thus, a picture may be, for example, an array of luma samples in monochrome format, or an array of luma samples and two corresponding arrays of chroma samples in 4:2:0, 4:2:2, and 4:4:4 color formats.
[0220] Hardware and software implementation Some further implementations in hardware and software are described below.
[0221] Any of the encoding devices described with reference to Figures 15-18 may provide means for performing entropy encoding of a latent tensor. Processing circuitry in any of these example devices is configured to: partition the latent tensor into a plurality of segments in a spatial dimension, each segment including at least one latent tensor element, process an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer, and obtain a probabilistic model for entropy encoding of a current element of the latent tensor based on the processed plurality of segments.
[0222] 15-18 may include a processing circuit configured to perform a decoding method, the method including initializing a latent tensor with zeros, dividing the latent tensor into a plurality of segments in a spatial dimension, each segment including at least one latent tensor element, processing an arrangement of the plurality of segments by one or more layers of a neural network including at least one attention layer, and obtaining a probabilistic model for entropy decoding of a current element of the latent tensor based on the processed plurality of segments.
[0223] In summary, a method and apparatus is described for entropy encoding and decoding of a latent tensor, including dividing the latent tensor into segments in a spatial dimension, each segment including at least one latent tensor element. The arrangement of the segments is processed by a neural network, the neural network including at least one attention layer. Based on the processed segments, a probabilistic model is obtained for entropy encoding or decoding of the latent tensor elements.
[0224] In the following embodiment of the video coding system 10, the video encoder 20 and the video decoder 30 are described based on FIGS.
[0225] 15 is a schematic block diagram of an example coding system 10, e.g., video coding system 10 (or coding system 10 for short), that may employ techniques of the present application. Video encoder 20 (or encoder 20 for short) and video decoder 30 (or decoder 30 for short) of video coding system 10 represent examples of devices that may be configured to perform techniques in accordance with various examples described herein.
[0226] As shown in FIG. 16, coding system 10 includes a source device 12 configured to provide encoded picture data 21, for example encoded picture data 13, to a destination device 14 for decoding.
[0227] The source device 12 comprises an encoder 20 , and may further, that is, optionally comprise a picture source 16 , a pre-processor (or pre-processing unit) 18 , for example a picture pre-processor 18 , and a communication interface or unit 22 .
[0228] Picture source 16 may comprise or be any kind of picture capture device, e.g., a camera that captures pictures of the real world, and / or any kind of picture generation device, e.g., a computer graphics processor that generates computer animated pictures, or any kind of other device that obtains and / or provides real-world pictures, computer-generated pictures (e.g., screen content, virtual reality (VR) pictures), and / or any combination thereof (e.g., augmented reality (AR) pictures). Picture source may also be any kind of memory or storage that stores any of the above pictures.
[0229] In distinction to the processing performed by the preprocessor 18 or preprocessing unit 18 , the pictures or picture data 17 are sometimes also referred to as raw pictures or raw picture data 17 .
[0230] The pre-processor 18 is configured to receive the (raw) picture data 17 and perform pre-processing on the picture data 17 to obtain a pre-processed picture 19 or pre-processed picture data 19. The pre-processing performed by the pre-processor 18 may include, for example, cropping, color format conversion (e.g., from RGB to YCbCr), color correction, or noise removal. It may be understood that the pre-processing unit 18 may be any component.
[0231] Video encoder 20 is configured to receive pre-processed picture data 19 and to provide encoded picture data 21 .
[0232] The communications interface 22 of the source device 12 may be configured to receive the encoded picture data 21 and to transmit the encoded picture data 21 (or any further processed version thereof) via the communications channel 13 to another device, such as the destination device 14 or any other device, for storage or direct reconstruction.
[0233] The destination device 14 comprises a decoder 30 (eg a video decoder 30 ), and may further, i.e. optionally, comprise a communications interface or unit 28 , a post-processor 32 (or post-processing unit 32 ), and a display device 34 .
[0234] The communications interface 28 of the destination device 14 is configured to receive the encoded picture data 21 (or any further processed version thereof), for example directly from the source device 12 or from any other source, for example a storage device, for example a coded picture data storage device, and to provide the encoded picture data 21 to a decoder 30.
[0235] The communications interface 22 and the communications interface 28 may be configured to transmit or receive encoded picture data 21 or encoded data 13 via a direct communications link between the source device 12 and the destination device 14, e.g., a direct wired or wireless connection, or via any type of network, e.g., a wired or wireless network or any combination thereof, or any type of private and public network, or any type of combination thereof.
[0236] The communications interface 22 may be configured, for example, to package the encoded picture data 21 in a suitable format, e.g. into packets, and / or to process the encoded picture data using any type of transmission coding or processing for transmission over a communications link or network.
[0237] The communications interface 28 forms the counterpart to the communications interface 22 and may be configured, for example, to receive transmitted data and process the transmitted data using any type of corresponding transmission decoding or processing and / or unpackaging to obtain the encoded picture data 21.
[0238] Both communication interface 22 and communication interface 28 may be configured as unidirectional communication interfaces, as indicated by the arrow for communication channel 13 in FIG. 15 pointing from source device 12 to destination device 14, or as bidirectional communication interfaces, and may be configured, for example, to send and receive messages, for example to set up connections, and to confirm and exchange communication links and / or any other information related to data transmission, for example encoded picture data transmission.
[0239] The decoder 30 is arranged to receive the encoded picture data 21 and to provide decoded picture data 31 or decoded pictures 31 .
[0240] The post-processor 32 of the destination device 14 is configured to post-process the decoded picture data 31 (also called reconstructed picture data), e.g. the decoded picture 31, to obtain post-processed picture data 33, e.g. the post-processed picture 33. The post-processing performed by the post-processing unit 32 may include, e.g., color format conversion (e.g., from YCbCr to RGB), color correction, cropping or resampling, or any other processing, e.g. to prepare the decoded picture data 31 for display, e.g. by a display device 34.
[0241] A display device 34 of the destination device 14 is configured to receive the post-processed picture data 33 for displaying the picture, e.g., to a user or viewer. The display device 34 may be or include any type of display for presenting the reconstructed picture, e.g., an internal or external display or monitor. The display may include, e.g., a liquid crystal display (LCD), an organic light emitting diode (OLED) display, a plasma display, a projector, a micro LED display, a Liquid Crystal on Silicon (LCoS), a digital light processor (DLP), or any other type of display.
[0242] Coding system 10 further includes a training engine 25. Training engine 25 is configured to train encoder 20 (or a module within encoder 20) or decoder 30 (or a module within decoder 30) to process input pictures or generate probability models for entropy encoding, as discussed above.
[0243] 15 depicts source device 12 and destination device 14 as separate devices, an embodiment of the device may have both or both functions, i.e., source device 12 or corresponding functions and destination device 14 or corresponding functions. In such an embodiment, source device 12 or corresponding functions and destination device 14 or corresponding functions may be implemented using the same hardware and / or software or by separate hardware and / or software, or any combination thereof.
[0244] As will be clear to a person skilled in the art based on the description, the presence and (exact) separation of different units or functions in the source device 12 and / or destination device 14 shown in FIG. 15 may vary depending on the actual device and application.
[0245] The encoder 20 (e.g., video encoder 20) or the decoder 30 (e.g., video decoder 30), or both the encoder 20 and the decoder 30, may be implemented by processing circuitry as shown in FIG. 16, such as one or more microprocessors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), discrete logic, hardware, dedicated to video coding, or any combination thereof. The encoder 20 may be implemented by processing circuitry 46 to embody the various modules discussed with respect to the encoder of FIG. 3b and / or any other encoder system or subsystem described herein. The decoder 30 may be implemented by processing circuitry 46 to embody the various modules discussed with respect to the decoder of FIG. 3c and / or any other decoder system or subsystem described herein. The processing circuitry may be configured to perform various operations discussed below. As shown in FIG. 18, in the case where the techniques are implemented in part in software, the device may store instructions for the software on a suitable non-transitory computer-readable storage medium and may execute instructions in hardware using one or more processors to perform the techniques of this disclosure. Either video encoder 20 and video decoder 30 may be incorporated as part of a combined encoder / decoder (CODEC) in a single device, for example as shown in FIG.
[0246] Source device 12 and destination device 14 may comprise any of a wide range of devices, including any type of handheld or stationary device, such as a notebook or laptop computer, a mobile phone, a smart phone, a tablet or tablet computer, a video game console, a video streaming device (e.g., a content service server or a content delivery server), a broadcast receiver device, a broadcast transmitter device, etc., and may use no operating system or any type of operating system. In some cases, source device 12 and destination device 14 may be equipped for wireless communication. Thus, source device 12 and destination device 14 may be wireless communication devices.
[0247] In some cases, the video coding system 10 depicted in FIG. 15 is only one example, and the techniques of the present application may be applied to video coding settings (e.g., video encoding or video decoding) that do not necessarily include any data communication between the encoding device and the decoding device. In other examples, data may be received from local memory, streamed over a network, etc. A video encoding device may encode data and store it in memory, and / or a video decoding device may retrieve data from memory and decode it. In some examples, encoding and decoding are performed by devices that do not communicate with each other, but simply encode data into memory and / or read data from memory and decode it.
[0248] For ease of description, embodiments of the present invention are described herein with reference to reference software, for example, High-Efficiency Video Coding (HEVC) or Versatile Video Coding (VVC), a next-generation video coding standard developed by the Joint Collaboration Team on Video Coding (JCT-VC) of the ITU-T Video Coding Experts Group (VCEG) and the ISO / IEC Motion Picture Experts Group (MPEG). Those skilled in the art will appreciate that embodiments of the present invention are not limited to HEVC or VVC.
[0249] 17 is a schematic diagram of a video coding device 400 according to an embodiment of the present disclosure. The schematic diagram of the video coding device 400 is suitable for implementing the disclosed embodiments described herein. In an embodiment, the video coding device 400 may be a decoder, such as the video decoder 30 of FIG. 15, or an encoder, such as the video encoder 20 of FIG. 15.
[0250] Video coding device 400 has an ingress port 410 (or input port 410) and a receiver unit (Rx) 420 for receiving data, a processor, logic unit, or central processing unit (CPU) 430 for processing data, a transmitter unit (Tx) 440 and an egress port 450 (or output port 450) for transmitting data, and a memory 460 for storing data. Video coding device 400 may also have optical-electrical (OE) and electrical-optical (EO) components coupled to the ingress port 410, receiver unit 420, transmitter unit 440, and egress port 450 for entering and leaving optical or electrical signals.
[0251] The processor 430 is implemented by hardware and software. The processor 430 may be implemented as one or more CPU chips, cores (e.g., as a multi-core processor), FPGA, ASIC, and DSP. The processor 430 communicates with the ingress port 410, the receiver unit 420, the transmitter unit 440, the egress port 450, and the memory 460. The processor 430 includes a coding module 470. The coding module 470 implements the disclosed embodiments described above. For example, the coding module 470 implements, processes, prepares, or provides various coding operations. Thus, the inclusion of the coding module 470 provides a significant increase in the functionality of the video coding device 400 and achieves the transition of the video coding device 400 to different states. Alternatively, the coding module 470 is implemented as instructions stored in the memory 460 and executed by the processor 430.
[0252] Memory 460 may include one or more disks, tape drives, and solid state drives, and may be used as an overflow data storage device for storing programs when such programs are selected for execution, and for storing instructions and data read during program execution. Memory 460 may be, for example, volatile and / or non-volatile, and may be read-only memory (ROM), random access memory (RAM), ternary content addressable memory (TCAM), and / or static random access memory (SRAM).
[0253] FIG. 18 is a schematic block diagram of an apparatus 500 that may be used as either or both of the source device 12 and destination device 14 of FIG. 15, according to an example embodiment.
[0254] The processor 502 of the device 500 can be a central processing unit. Alternatively, the processor 502 can be any type of device, or multiple devices, now existing or later developed, that can manipulate or process information. Although the disclosed implementations can be implemented with a single processor, such as processor 502, as shown, advantages in speed and efficiency can be achieved using more than one processor.
[0255] The memory 504 of the apparatus 500 can be a read-only memory (ROM) device or a random access memory (RAM) device in implementation. Any other suitable type of storage device can be used as the memory 504. The memory 504 can include code and data 506 that is accessed by the processor 502 using a bus 512. The memory 504 can further include an operating system 508 and application programs 510, which include at least one program that enables the processor 502 to perform the methods described herein. For example, the application programs 510 can include applications 1-N, which further include a video coding application that performs the methods described herein, including encoding and decoding using a neural network that includes a subset of partially updatable layers.
[0256] The apparatus 500 may also include one or more output devices, such as a display 518. The display 518, in one example, may be a touch-sensitive display that combines a display with a touch-sensitive element operative to detect touch input. The display 518 may be coupled to the processor 502 via the bus 512.
[0257] Although depicted here as a single bus, bus 512 of device 500 may be comprised of multiple buses. Additionally, secondary storage 514 may be directly coupled to the other components of device 500 or may be accessed over a network, and may comprise a single integrated unit such as a memory card or multiple units such as multiple memory cards. Device 500 may thus be implemented in a wide variety of configurations.
[0258] Although embodiments of the present invention have been described primarily in terms of video coding, it should be noted that embodiments of coding system 10, encoder 20 and decoder (and correspondingly system 10), as well as other components described herein, may also be configured for still picture processing or coding, i.e., processing or coding of an individual picture independent of any preceding or successive pictures as found in video coding. In general, only inter prediction units 244 (encoder) and 344 (decoder) may not be available when picture processing coding is limited to a single picture 17. All other functionality (also called tools or techniques) of the video encoder 20 and the video decoder 30, such as residual calculation 204 / 304, transform 206, quantization 208, inverse quantization 210 / 310, (inverse) transform 212 / 312, partitioning 262 / 362, intra prediction 254 / 354, and / or loop filtering 220, 320, as well as entropy encoding 270 and entropy decoding 304, may be used for still picture processing as well.
[0259] For example, the embodiments of the encoder 20 and the decoder 30 and the functions described herein with reference to the encoder 20 and the decoder 30 may be implemented in hardware, software, firmware, or any combination thereof. If implemented in software, the functions may be stored on a computer-readable medium or transmitted over a communication medium as one or more instructions or codes and executed by a hardware-based processing unit. A computer-readable medium may include a computer-readable storage medium corresponding to a tangible medium, such as a data storage medium, or a communication medium including any medium that facilitates the transfer of a computer program from one place to another, for example according to a communication protocol. In this manner, a computer-readable medium may generally correspond to (1) a tangible computer-readable storage medium that is non-transitory, or (2) a communication medium such as a signal or carrier wave. A data storage medium may be any available medium that can be accessed by one or more computers or one or more processors to read instructions, code, and / or data structures for implementing the techniques described in this disclosure. A computer program product may include a computer-readable medium.
[0260] By way of example, and not limitation, such computer-readable storage media may comprise RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage or other magnetic storage devices, flash memory, or any other medium that can be used to store desired program code in the form of data or data structures and that can be accessed by a computer. Also, any connection is properly referred to as a computer-readable medium. For example, if instructions are transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio waves, and microwaves, the coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio waves, and microwaves are included in the definition of media. However, it should be understood that computer-readable storage media and data storage media do not include connections, carrier waves, signals, or other transitory media, but instead cover non-transitory tangible storage media. As used herein, disk and disc include compact discs (CDs), laser discs, optical discs, digital versatile discs (DVDs), floppy disks and Blu-ray discs, where a disk typically reproduces data magnetically, while a disc reproduces data optically with a laser. Combinations of the above should also be included within the scope of computer readable media.
[0261] The instructions may be executed by one or more processors, such as one or more digital signal processors (DSPs), general-purpose microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other equivalent integrated or discrete logic circuitry. Thus, the term "processor" as used herein may refer to any of the above structures or any other structure suitable for implementing the techniques described herein. Furthermore, in some aspects, the functionality described herein may be provided in dedicated hardware and / or software modules configured for encoding and decoding, or incorporated into a composite codec. Additionally, the techniques may be implemented entirely in one or more circuit or logic elements.
[0262] The techniques of this disclosure may be implemented in a wide variety of devices or apparatuses, including a wireless handset, an integrated circuit (IC) or a set of ICs (e.g., a chipset). Various components, modules, or units are described in this disclosure to highlight functional aspects of devices configured to perform the disclosed techniques, but do not necessarily require realization by different hardware units. Rather, as described above, the various units may be combined with appropriate software and / or firmware into a codec hardware unit or may be provided by a collection of interoperable hardware units including one or more processors as described above.
Claims
1. A method for entropy coding of a latent tensor (4020), comprising: dividing (700) the latent tensor (4020) into a plurality of segments (820, 920) in a spatial dimension, each segment including at least one latent tensor element; processing the arrangement (830, 930, 940) of the plurality of segments through one or more layers of a neural network including at least one attention layer (732); obtaining a probabilistic model (770) for entropy coding of the current element of the latent tensor (4020) based on the processed segments (820, 920); The method according to claim 1,
2. Splitting the latent tensor includes splitting the latent tensor into two or more segments in a channel dimension (701). The method of claim 1.
3. Processing the arrangement includes arranging the plurality of segments in a predefined order (930), where segments having the same spatial coordinates are grouped together. The method of claim 2.
4. processing the arrangement includes arranging the plurality of segments such that segments having different spatial coordinates are consecutively arranged in a predefined order (940). The method of claim 2.
5. processing with the neural network includes applying a first neural sub-network (720) to extract features of the plurality of segments (820, 920) and providing an output of the first neural sub-network (720) as an input to a subsequent layer in the neural network. A method according to any one of claims 1 to 4.
6. The processing by the neural network includes: providing position information (721) of the plurality of segments (820, 920) as an input to the at least one attention layer (732); A method according to any one of claims 1 to 5.
7. Processing the arrangement of the plurality of segments (830, 930, 940) includes selecting a subset of segments from the plurality of segments, the subset being provided as an input to a subsequent layer in the neural network. A method according to any one of claims 1 to 6.
8. The processing by the at least one attention layer (732) in the neural network includes: applying a mask to mask elements in an attention layer that follow the current element in a processing order of the latent tensor (4020); A method according to any one of claims 1 to 7.
9. the neural network includes a second neural sub-network (735), the second neural sub-network (735) processing the output of the attention layer (732); A method according to any one of claims 1 to 8.
10. At least one of the first neural sub-network (720) and the second neural sub-network (735) is a multi-layer perceptron.
10. The method of claim 5 or 9.
11. the at least one attention layer (732) in the neural network is a multi-head attention layer; A method according to any one of claims 1 to 10.
12. The at least one attention layer (732) in the neural network is included in a transformer sub-network.
12. A method according to any one of claims 1 to 11.
13. padding (710, 711) the beginning of the arrangement of the plurality of segments with a zero segment prior to processing by the neural network. A method according to any one of claims 1 to 12.
14. and entropy encoding the current element into a first bitstream (371) using the obtained probability model (770). A method according to any one of claims 1 to 13.
15. quantizing (320) the latent tensor (4020) before dividing it into segments.
15. A method according to any preceding claim.
16. computational complexity, and / or Characteristics of the first bitstream (371) selecting the probability model (770) for the entropy encoding according to 16. A method according to any preceding claim.
17. hyper-encoding the latent tensor (4020) to obtain a hyper-latent tensor; entropy encoding the hyper-latent tensors into a second bitstream (341); entropy decoding the second bitstream (341); obtaining a hyper-decoder output by hyper-decoding the hyper-latent tensor; 17. The method of any preceding claim, further comprising:
18. dividing said hyperdecoder output into a plurality of hyperdecoder output segments (740, 741), each hyperdecoder output including one or more hyperdecoder output elements; for each segment in said plurality of segments (820, 920), before obtaining said probability model (770), concatenating said segment with a set of hyperdecoder output segments in said plurality of hyperdecoder output segments; The method of claim 17 further comprising:
19. The set of hyperdecoder output segments associated with each segment (1100) is a hyperdecoder output segment (1110) corresponding to each of said segments (1100); or a plurality of hyperdecoder output segments (1120, 1121, 1122) corresponding to the same channel as each of said segments (1100); or a plurality of hyperdecoder output segments (1130) that are spatially adjacent to each of said segments (1100); or a plurality of hyperdecoder output segments (1140, 1141, 1141) including neighboring segments spatially adjacent to each of said segments (1100) and segments corresponding to the same channel as said neighboring segments; including one or more of:
20. The method of claim 18.
20. computational complexity, and / or Characteristics of the first bitstream (371) and adaptively selecting the set of hyperdecoder output segments according to 20. A method according to any one of claims 17 to 19.
21. one or more of the steps of processing with the neural network and entropy encoding the current element are performed in parallel for each segment in the plurality of segments.
21. A method according to any preceding claim.
22. 1. A method of encoding image data, comprising the steps of: obtaining a latent tensor (4020) by processing the image data with a self-encoding convolutional neural network; entropy coding the latent tensor (4020) into a bitstream (371) using a probabilistic model (770) generated according to claims 1 to 21; The method according to claim 1,
23. A method for entropy decoding of a latent tensor (4020), comprising: initializing said latent tensor (4020) with zero; dividing (700) the latent tensor (4020) into a plurality of segments (820, 920) in a spatial dimension, each segment including at least one latent tensor element; processing the arrangement (830, 930, 940) of the plurality of segments through one or more layers of a neural network including at least one attention layer (732); obtaining a probability model (770) for entropy decoding of the current element of the latent tensor (4020) based on the processed segments (820, 920); The method according to claim 1,
24. Splitting the latent tensor includes splitting the latent tensor into two or more segments in a channel dimension (701).
24. The method of claim 23.
25. Processing the arrangement includes arranging the plurality of segments in a predefined order (930), where segments having the same spatial coordinates are grouped together.
25. The method of claim 24.
26. processing the arrangement includes arranging the plurality of segments such that segments having different spatial coordinates are consecutively arranged in a predefined order (940).
25. The method of claim 24.
27. processing with the neural network includes applying a first neural sub-network (720) to extract features of the plurality of segments (820, 920) and providing an output of the first neural sub-network (720) as an input to a subsequent layer in the neural network.
27. A method according to any one of claims 23 to 26.
28. The processing by the neural network includes: providing position information (721) of the plurality of segments (820, 920) as an input to the at least one attention layer (732); 28. A method according to any one of claims 23 to 27.
29. Processing the arrangement of the plurality of segments (830, 930, 940) includes selecting a subset of segments from the plurality of segments, the subset being provided as an input to a subsequent layer in the neural network.
29. A method according to any one of claims 23 to 28.
30. the neural network includes a second neural sub-network (735), the second neural sub-network (735) processing the output of the attention layer (732); 30. A method according to any one of claims 23 to 29.
31. At least one of the first neural sub-network (720) and the second neural sub-network (735) is a multi-layer perceptron.
31. The method of claim 27 or 30.
32. the at least one attention layer (732) in the neural network is a multi-head attention layer; 32. A method according to any one of claims 23 to 31.
33. The at least one attention layer (732) in the neural network is included in a transformer sub-network.
33. A method according to any one of claims 23 to 32.
34. padding (710, 711) the beginning of the arrangement of the plurality of segments with a zero segment prior to processing by the neural network.
34. The method of claim 33.
35. and entropy decoding the current element into a first bitstream (371) using the obtained probability model (770).
35. A method according to any one of claims 23 to 34.
36. selecting the probability model (770) for the entropy coding according to a computational complexity and / or characteristics of the first bitstream (371).
36. A method according to any one of claims 23 to 35.
37. entropy decoding the hyper-latent tensors from the second bitstream (341); and obtaining a hyper-decoder output by hyper-decoding the hyper-latent tensor; 37. The method of any of claims 23 to 36, further comprising:
38. dividing said hyperdecoder output into a plurality of hyperdecoder output segments (740, 741), each hyperdecoder output including one or more hyperdecoder output elements; for each segment in said plurality of segments (820, 920), before obtaining said probability model (770), concatenating said segment with a set of hyperdecoder output segments in said plurality of hyperdecoder output segments; 38. The method of claim 37, further comprising:
39. The set of hyperdecoder output segments associated with each segment (1100) is a hyperdecoder output segment (1110) corresponding to each of said segments (1100); or a plurality of hyperdecoder output segments (1120, 1121, 1122) corresponding to the same channel as each of said segments (1100); or a plurality of hyperdecoder output segments (1130) that are spatially adjacent to each of said segments (1100); or a plurality of hyperdecoder output segments (1140, 1141, 1141) including neighboring segments spatially adjacent to each of said segments (1100) and segments corresponding to the same channel as said neighboring segments; including one or more of:
39. The method of claim 38.
40. computational complexity, and / or Characteristics of the first bitstream (371) and adaptively selecting the set of hyperdecoder output segments according to 40. A method according to any one of claims 37 to 39.
41. 1. A method for decoding image data, comprising: entropy decoding a latent tensor (4020) from the bitstream (371) according to claims 23 to 40; obtaining the image data by processing the latent tensor (4020) with a self-encoding convolutional neural network; The method according to claim 1,
42. stored on a non-transitory medium and including code instructions; The code instructions, when executed by one or more processors, cause the one or more processors to perform the steps of the method of any of claims 1 to 41. Computer program.
43. 1. An apparatus for entropy coding of a latent tensor, comprising: dividing (700) the latent tensor (4020) into a plurality of segments (820, 920) in a spatial dimension, each segment including at least one latent tensor element; processing the arrangement (830, 930, 940) of the plurality of segments through one or more layers of a neural network including at least one attention layer (732); Obtaining a probabilistic model (770) for entropy coding of the current element of the latent tensor (4020) based on the processed segments (820, 920). An apparatus having a processing circuit configured to:
44. 1. An apparatus for entropy decoding of a latent tensor, comprising: Initialize the latent tensor (4020) with zero; dividing (700) the latent tensor (4020) into a plurality of segments (820, 920) in a spatial dimension, each segment including at least one latent tensor element; processing the arrangement (830, 930, 940) of the plurality of segments through one or more layers of a neural network including at least one attention layer (732); Obtaining a probability model (770) for entropy decoding of the current element of the latent tensor (4020) based on the processed segments (820, 920). An apparatus having a processing circuit configured to:
Citation Information
Patent Citations
Coarse-grained context entropy coding method
CN113347422A
Cited By
Machine-learning for 3D object detection
JP2022095591A
Machine Learning for 3D Object Detection
JP7807907B2
Machine-learning for 3D object detection
US12462438B2
