Image coding method, image decoding method and apparatus
By incorporating identification information into the code stream to indicate different decoding network structures, the problem that image encoding and decoding solutions in the existing technology cannot adapt to different application scenarios is solved, and computing power can be flexibly adjusted on different devices to balance delay and Effect of compression performance.
Patent Information
- Application Number
- PCT/CN2024/089342
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-07-28
- Filing Date
- 2024-04-23
- Publication Date
- 2024-10-31
AI Technical Summary
Existing neural network-based image encoding and decoding solutions have a fixed network structure and cannot meet the needs of different application scenarios. This results in reduced compression efficiency or inability to run on low-computing end-side devices, and cannot flexibly balance latency and compression performance. .
By incorporating identification information (grade information) into the code stream, the receiving end is instructed to adopt different decoding network structures, thereby dynamically adjusting the network computing power during the encoding and decoding process to achieve different decoding performance and support the needs of different application scenarios.
The flexibility of the decoding end is improved, allowing users to adjust the encoding and decoding network computing power according to the scenario, balance delay and compression performance, and adapt to low computing power and high computing power devices.
Smart Images

Figure CN2024089342_31102024_PF_FP_ABST
Abstract
Description
Image encoding and decoding method and device
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on April 24, 2023, with application number 202310476967.6 and application name “A method and device for image encoding and decoding”, the entire contents of which are incorporated by reference into this application; this application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on July 28, 2023, with application number 202310956879.6 and application name “A method and device for image encoding and decoding”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present application relates to the fields of image compression technology and artificial intelligence technology, and in particular to an image encoding and decoding method and device. Background Art
[0004] Many consumer applications (such as news, social networking, and shopping online applications) require image decoding on terminal devices with lower computing power (such as mobile phones, personal PCs, and TVs). In other industrial applications, image decoding can be completed on terminal devices with higher computing power (such as GPU workstations equipped with independent graphics cards), but higher requirements are also placed on image compression rates.
[0005] Current neural network-based image encoding and decoding solutions usually have a fixed network structure and cannot meet the needs of different application scenarios.
[0006] Summary of the Invention
[0007] The embodiments of the present application provide an image encoding and decoding method and apparatus to provide an encoding and decoding solution to meet the needs of different application scenarios.
[0008] In a first aspect, an embodiment of the present application provides an image encoding method, comprising:
[0009] Encoding identification information for indicating the adopted decoding network into the bitstream;
[0010] The identification information is a first value, which is used to indicate that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or
[0011] The identification information is a second value, used to indicate that the decoding network used to decode the image to be processed from the code stream is the second decoding network; the processing resources required by the first decoding network are higher than the processing resources required by the second decoding network;
[0012] Send the code stream.
[0013] Identification information can also be called profile information (Profile ID).
[0014] The embodiment of the present application uses the above-mentioned scheme to instruct the receiving end to adopt a network structure through the sending end. Different network structures can achieve different decoding performance, thereby improving the flexibility of the decoding end. Users can adjust their encoding and decoding network computing power according to their own scenarios to flexibly balance latency and compression performance.
[0015] In a possible implementation, the first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
[0016] If the second decoding network is a subnetwork of the first decoding network, it can be understood that when the identification information is the second value, some network layers in the first decoding network are skipped, that is, the decoding process using the second decoding network is implemented.
[0017] In a possible implementation, the method further includes:
[0018] obtaining the identification information;
[0019] When the identification information is a first value, encoding the residual information obtained by encoding the image to be processed using the first encoding network into the bitstream; or,
[0020] When the identification information is a second value, encoding the code stream using residual information obtained by encoding the image to be processed using a second coding network;
[0021] The processing resources required by the first encoding network are higher than the processing resources required by the second encoding network.
[0022] In the above solution, for the bitstreams generated by different AI encoding networks, the decoding end can select different decoding network structures according to the bitstream content to achieve decoding. This brings greater flexibility to the codec end. Users can adjust the computing power of their codec network according to their own scenarios to flexibly balance latency and compression performance.
[0023] In a possible implementation, the first coding network and the second coding network are two different coding networks; or, the first coding network and the second coding network share some subnetworks; or, the second coding network is a subnetwork of the first coding network.
[0024] In a possible implementation, the first encoding network includes a first feature extraction network, an autoregressive network, a side information extraction network, and a probability estimation network;
[0025] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0026] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0027] Extracting a three-dimensional feature map of the image to be processed by the first feature extraction network, where the three-dimensional feature map includes a plurality of feature elements;
[0028] extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network;
[0029] estimating a first probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network;
[0030] Inputting the encoded feature element and the first probability distribution mean into the autoregressive network to obtain a second probability distribution mean of the feature element to be encoded;
[0031] Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the second probability distribution mean of the feature element to be encoded.
[0032] In a possible implementation, the first encoding network includes a second feature extraction network, a side information extraction network, and a probability estimation network;
[0033] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0034] extracting a three-dimensional feature map of the image to be processed by the second feature extraction network, where the three-dimensional feature map includes a plurality of feature elements;
[0035] extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network;
[0036] estimating a probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network;
[0037] Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the probability distribution mean.
[0038] In a possible implementation, the second feature extraction network is a subnetwork of the first feature extraction network, or the second feature extraction network and the first feature extraction network are two completely different subnetworks.
[0039] In a possible implementation, the method further includes:
[0040] The side information is encoded into the codestream.
[0041] In a possible implementation manner, the identification information is located in the code stream header.
[0042] In a second aspect, an embodiment of the present application provides an image decoding method, comprising:
[0043] Receive code stream;
[0044] Decoding identification information indicating a decoding network to be used from the code stream;
[0045] When the identification information is a first value, a first decoding network is used to decode the image to be processed from the code stream; or
[0046] When the identification information is a second value, a second decoding network is used to decode the image to be processed from the code stream; and processing resources required by the first decoding network are higher than processing resources required by the second decoding network.
[0047] In a possible implementation, the first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
[0048] In a possible implementation, the first decoding network includes an entropy decoding network, a probability estimation network, an autoregressive network, and a first image restoration network;
[0049] Decoding the image to be processed from the code stream using the first decoding network includes:
[0050] Decoding the side information of the three-dimensional feature map of the image to be processed from the code stream through the entropy decoding network; the three-dimensional feature map includes a plurality of feature elements;
[0051] estimating a first probability distribution mean of a feature element to be decoded based on the side information through a probability estimation network;
[0052] Determining, by the autoregressive network, a second probability distribution mean of the feature element to be decoded according to the first probability distribution mean and the decoded feature element;
[0053] Decoding residual information of the feature element to be decoded from the bitstream according to the second probability distribution mean through the entropy decoding network, and obtaining the feature element to be decoded based on the residual information and the second probability distribution mean;
[0054] The image to be processed is restored by the first image restoration network according to the three-dimensional feature map obtained by decoding.
[0055] In a possible implementation, the second decoding network includes the entropy decoding network, the probability estimation network, and the second image restoration network;
[0056] Decoding the image to be processed from the code stream using the second decoding network includes:
[0057] Decoding the side information of the three-dimensional feature map of the image to be processed from the code stream through the entropy decoding network; the three-dimensional feature map includes a plurality of feature elements;
[0058] estimating a first probability distribution mean of a feature element to be decoded based on the side information through a probability estimation network;
[0059] Decoding residual information of the feature element to be decoded from the bitstream according to the first probability distribution mean through the entropy decoding network, and obtaining the feature element to be decoded based on the residual information and the first probability distribution mean;
[0060] The image to be processed is restored by the second image restoration network according to the three-dimensional feature map obtained by decoding.
[0061] In a possible implementation, the second image restoration network is a subnetwork of the first image restoration network, or the image restoration network and the first image restoration network share a common subnetwork, or the second image restoration network and the first image restoration network are two different networks.
[0062] In a third aspect, an embodiment of the present application provides an image encoding device, including a memory and a video encoder, wherein:
[0063] The memory is used to store video data, wherein the video data includes images to be processed;
[0064] The video encoder is configured to encode identification information indicating a decoding network to be used into a bitstream;
[0065] The identification information is a first value, indicating that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or
[0066] The identification information is a second value, indicating that the decoding network used to decode the image to be processed from the code stream is the second decoding network; and the processing resources required by the first decoding network are higher than the processing resources required by the second decoding network.
[0067] In a fourth aspect, an embodiment of the present application provides an image decoding device, comprising a memory and a video decoder, wherein
[0068] The memory is used to store video data in the form of code stream, wherein the video data includes an image to be processed;
[0069] The video decoder is used to decode identification information indicating a decoding network to be used from a bitstream;
[0070] When the identification information is a first value, a first decoding network is used to decode the image to be processed from the code stream; or
[0071] When the identification information is a second value, a second decoding network is used to decode the image to be processed from the code stream; and processing resources required by the first decoding network are higher than processing resources required by the second decoding network.
[0072] In a fifth aspect, an embodiment of the present application provides a video decoding device, comprising: a non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute the method described in any implementation manner of the second aspect.
[0073] In the sixth aspect, an embodiment of the present application provides a video encoding device, comprising: a non-volatile memory and a processor coupled to each other, wherein the processor calls the program code stored in the memory to execute the method described in any implementation of the first aspect or the seventeenth aspect.
[0074] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code, and when the computer program runs on a computer, the computer executes the method described in any implementation method of the second aspect.
[0075] In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a program code, and when the computer program runs on a computer, the computer executes the method described in any implementation of the first aspect or the seventeenth aspect.
[0076] In a ninth aspect, an embodiment of the present application provides a computer-readable storage medium, on which is stored a video stream decoded by the method described in any implementation of the second aspect executed by one or more processors.
[0077] In the tenth aspect, an embodiment of the present application provides a computer-readable storage medium, on which is stored a video stream encoded by the method described in any implementation of the first aspect or the seventeenth aspect executed by one or more processors.
[0078] In an eleventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a code stream, wherein the code stream includes identification information;
[0079] The identification information is a first value, indicating that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or
[0080] The identification information is a second value, indicating that the decoding network used to decode the image to be processed from the code stream is the second decoding network; and the processing resources required by the first decoding network are higher than the processing resources required by the second decoding network.
[0081] In a twelfth aspect, an embodiment of the present application provides a coded bit stream, wherein the coded bit stream includes a plurality of syntax elements, and the plurality of syntax elements include identification information for indicating a decoding network used to decode a to-be-processed image from the bit stream.
[0082] In a thirteenth aspect, an embodiment of the present application provides a video encoder for encoding an image to be processed. Exemplarily, the video encoder can implement the method described in the first aspect or the seventeenth aspect.
[0083] In a fourteenth aspect, an embodiment of the present application provides a video decoder for decoding a to-be-processed image from a bitstream. Exemplarily, the video encoder can implement the method described in the second aspect.
[0084] In a fifteenth aspect, an embodiment of the present application provides a coding network, including:
[0085] First feature extraction network, second feature extraction network, quantization network, autoregressive network, side information extraction network, probability estimation network;
[0086] When the identification information indicating the adopted encoding network is a first value, extracting a three-dimensional feature map of the image to be processed by the first feature extraction network; when the identification information is a second value, extracting a three-dimensional feature map of the image to be processed by the first feature extraction network;
[0087] Extracting side information of the image to be processed from the edge of the three-dimensional feature map through the side information extraction network;
[0088] estimating a first probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network;
[0089] When the identification information indicating the adopted coding network is a first value, inputting the encoded feature element and the first probability distribution mean into the autoregressive network to obtain a second probability distribution mean of the feature element to be encoded; and obtaining residual information of the feature element to be encoded based on the feature element to be encoded and the second probability distribution mean of the feature element to be encoded;
[0090] When the identification information indicating the adopted coding network is the second value, the residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the mean of the first probability distribution.
[0091] In a possible implementation, the second feature extraction network is a subnetwork of the first feature extraction network, or the second feature extraction network and the first feature extraction network are two completely different subnetworks.
[0092] In a sixteenth aspect, an embodiment of the present application provides a decoding network, including:
[0093] An entropy decoding network, a probability estimation network, an autoregressive network, a first image restoration network, and a second image restoration network;
[0094] The entropy decoding network decodes the edge information and identification information of the three-dimensional feature map of the image to be processed from the code stream; the three-dimensional feature map includes multiple feature elements;
[0095] The probability estimation network estimates a first probability distribution mean of a feature element to be decoded based on the side information;
[0096] When the identification information is a first value, the autoregressive network determines a second probability distribution mean of the feature element to be decoded based on the first probability distribution mean and the decoded feature element, the entropy decoding network decodes residual information of the feature element to be decoded from the bitstream based on the second probability distribution mean, and obtains the feature element to be decoded based on the residual information and the second probability distribution mean; the first image restoration network restores the image to be processed based on the three-dimensional feature map obtained by decoding; or
[0097] When the identification information is a second value, the entropy decoding network decodes the residual information of the feature element to be decoded from the code stream according to the first probability distribution mean, and obtains the feature element to be decoded based on the residual information and the first probability distribution mean; the second image restoration network restores the image to be processed according to the three-dimensional feature map obtained by decoding.
[0098] In a possible implementation, the second image restoration network is a subnetwork of the first image restoration network, or the second image restoration network and the first image restoration network share a common subnetwork, or the second image restoration network and the first image restoration network are two different networks.
[0099] In a seventeenth aspect, an embodiment of the present application provides an image encoding method, including:
[0100] obtaining the identification information;
[0101] When the identification information is a first value, encoding the residual information obtained by encoding the image to be processed based on (or using) a first encoding network into the bitstream; or
[0102] When the identification information is a second value, encoding the code stream based on (or using) residual information obtained by encoding the image to be processed through a second coding network;
[0103] The processing resources required by the first encoding network are higher than the processing resources required by the second encoding network.
[0104] In a possible implementation, the method further includes:
[0105] The identification information is encoded into a code stream.
[0106] In a possible implementation, the identification information is further used to indicate a decoding network used to decode the image to be processed from the bitstream;
[0107] The identification information is a first value, which is used to indicate that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or
[0108] The identification information is a second value, which is used to indicate that the decoding network used to decode the image to be processed from the code stream is the second decoding network; and the processing resources required by the first decoding network are higher than the processing resources required by the second decoding network.
[0109] Identification information can also be called profile information (Profile ID).
[0110] In a possible implementation, the first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
[0111] In a possible implementation, the first coding network and the second coding network are two different coding networks; or, the first coding network and the second coding network share some subnetworks; or, the second coding network is a subnetwork of the first coding network.
[0112] In a possible implementation, the first encoding network includes a first feature extraction network, an autoregressive network, a side information extraction network, and a probability estimation network;
[0113] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0114] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0115] Extracting a three-dimensional feature map of the image to be processed by the first feature extraction network, where the three-dimensional feature map includes a plurality of feature elements;
[0116] extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network;
[0117] estimating a first probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network;
[0118] Inputting the encoded feature element and the first probability distribution mean into the autoregressive network to obtain a second probability distribution mean of the feature element to be encoded;
[0119] Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the second probability distribution mean of the feature element to be encoded.
[0120] In a possible implementation, the first encoding network includes a second feature extraction network, a side information extraction network, and a probability estimation network;
[0121] The residual information obtained by encoding the image to be processed using the first encoding network includes:
[0122] extracting a three-dimensional feature map of the image to be processed by the second feature extraction network, where the three-dimensional feature map includes a plurality of feature elements;
[0123] extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network;
[0124] estimating a probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network;
[0125] Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the probability distribution mean.
[0126] In a possible implementation, the second feature extraction network is a subnetwork of the first feature extraction network, or the second feature extraction network and the first feature extraction network are two completely different subnetworks.
[0127] In a possible implementation, the method further includes:
[0128] The side information is encoded into the codestream.
[0129] Based on the implementations provided in the above aspects, this application can also be further combined to provide more implementations. BRIEF DESCRIPTION OF THE DRAWINGS
[0130] FIG1 is an exemplary block diagram of a decoding system provided in an embodiment of the present application;
[0131] FIG2 is a schematic diagram of the convolutional neural network structure provided in an embodiment of the present application;
[0132] FIG3 is a network diagram of a deep learning-based video encoding and decoding method provided by an embodiment of the present application;
[0133] FIG4 is a schematic diagram of a network structure of an end-to-end video encoding and decoding based on deep learning provided by an embodiment of the present application;
[0134] FIG5 is a schematic diagram of a flow chart of a coding and decoding method provided in an embodiment of the present application;
[0135] FIG6A is a schematic diagram of the network structure of a first coding network provided in an embodiment of the present application;
[0136] FIG6B is a schematic diagram of the network structure of a second coding network provided in an embodiment of the present application;
[0137] FIG7A is a schematic diagram of an encoding process provided in an embodiment of the present application;
[0138] FIG7B is a schematic diagram of another encoding process provided in an embodiment of the present application;
[0139] FIG8 is a schematic diagram of the structure of a decoding network provided in an embodiment of the present application;
[0140] FIG9A is a schematic diagram of a possible decoding process using a first decoding network provided in an embodiment of the present application;
[0141] FIG9B is a schematic diagram of a possible decoding process using a second decoding network provided in an embodiment of the present application;
[0142] FIG10A is a schematic diagram of a coding network execution flow provided in an embodiment of the present application;
[0143] FIG10B is a schematic diagram of a decoding network execution flow provided in an embodiment of the present application;
[0144] FIG11 is a schematic diagram of a coding network structure provided in an embodiment of the present application;
[0145] FIG12 is a schematic diagram of the network structure of ResAU 3×3 no tanh provided in an embodiment of the present application;
[0146] Figure 13 is a schematic diagram of the structure of RNAB provided in the examples of the present application;
[0147] FIG14 is a schematic diagram of the residual module layer structure provided in an embodiment of the present application;
[0148] FIG15 is a schematic diagram of the network structure of a super decoding network provided in an embodiment of the present application;
[0149] FIG16 is a schematic diagram of the network structure of a very large-scale decoding network provided in an embodiment of the present application;
[0150] FIG17 is a schematic diagram of an execution flow of a decoding network provided in an embodiment of the present application;
[0151] FIG18 is a schematic diagram of the network structure of a lightweight residual module (LightResBlock) provided in an embodiment of the present application;
[0152] FIG19 is a schematic diagram of a decoding network structure provided in Example 2 of an embodiment of the present application;
[0153] FIG20A is a schematic diagram of a coding network execution flow provided in Example 3 of an embodiment of the present application;
[0154] FIG20B is a schematic diagram of a codec network structure provided in Example 3 of an embodiment of the present application;
[0155] FIG21 is a schematic diagram of a coding network structure provided in Example 3 of an embodiment of the present application;
[0156] Figure 22 is a schematic diagram of the decoding network structure provided in Example 3 of an embodiment of the present application. DETAILED DESCRIPTION
[0157] The embodiments of the present application are described below in conjunction with the drawings in the embodiments of the present application. In the following description, reference is made to the drawings that form a part of this disclosure and illustrate specific aspects of the embodiments of the present application or specific aspects of the embodiments of the present application that can be used. It should be understood that the embodiments of the present application can be used in other aspects and may include structural or logical changes not depicted in the drawings. Therefore, the following detailed description should not be understood in a restrictive sense, and the scope of the present application is defined by the appended claims. For example, it should be understood that the disclosure in conjunction with the described method can also be applied to the corresponding device or system for performing the method, and vice versa. For example, if one or more specific method steps are described, the corresponding device may include one or more units such as functional units to perform the one or more method steps described (for example, one unit performs one or more steps, or multiple units, each of which performs one or more of the multiple steps), even if such one or more units are not explicitly described or illustrated in the drawings. On the other hand, for example, if a specific device is described based on one or more units such as functional units, the corresponding method may include a step to perform the functionality of the one or more units (e.g., a step to perform the functionality of the one or more units, or multiple steps, each of which performs the functionality of one or more of the multiple units), even if such one or more steps are not explicitly described or illustrated in the drawings. Further, it should be understood that unless otherwise explicitly stated, the features of the various exemplary embodiments and / or aspects described herein can be combined with each other.
[0158] The technical solutions involved in the embodiments of this application may not only be applied to existing video coding standards (such as H.264, HEVC, etc.), but may also be applied to future video coding standards (such as H.266). The terms used in the implementation methods of this application are only used to explain the specific embodiments of this application and are not intended to limit this application. The following is a brief introduction to some concepts that may be involved in the embodiments of this application.
[0159] The image decoding and encoding methods provided in the embodiments of the present application can be applied in the fields of video encoding and image encoding. Specifically, the decoding and encoding methods can be applied in scenarios of album management, human-computer interaction, video compression or transmission, and image compression or transmission.
[0160] Taking the application of encoding and decoding methods to an end-to-end video image encoding and decoding system as an example, this end-to-end video image encoding and decoding system includes two parts: image encoding and image decoding. Image encoding is determined at the source end and generally includes processing (e.g., compressing) the original video image to reduce the amount of data required to represent the video image (thus more efficiently storing and / or transmitting it). Image decoding is determined at the destination end and generally includes performing inverse processing relative to the encoder to reconstruct the image. Current neural network-based image encoding and decoding solutions generally have a fixed network structure, such as the encoding and decoding model in JPEG AI VM1.0. If this network structure is adapted to the capabilities of a low-computing power end, the compression efficiency of the encoding scheme will be reduced to a certain extent; if the network structure is adapted to the computing power of a high-computing power device, this network will not be able to run on a low-computing power device. In an end-to-end video image encoding and decoding system, the encoding and decoding methods provided in this application can determine the encoding and decoding network to be used based on the profile information. Profile information can also be referred to as identification information or network identification, and other terms can also be used. The embodiments of this application do not specifically limit this. Profile information is used to indicate the decoding network to be used. That is, the codec can select the corresponding grade information according to the capabilities of the decoding device to select or indicate different codec networks, so that it can have the ability to adapt to low-computing power terminals as well as the ability to adapt to terminals that require higher computing power.
[0161] Video coding generally refers to processing a sequence of images to form a video or video sequence. In the field of video coding, the terms "picture", "frame" or "image" can be used as synonyms.
[0162] FIG1 is an exemplary block diagram of a decoding system provided in an embodiment of the present application, such as a video decoding system 10 (or simply decoding system 10 ) that can utilize the techniques of the present application. The video encoder 20 (or simply encoder 20 ) and video decoder 30 (or simply decoder 30 ) in the video decoding system 10 represent devices that can be used to perform various techniques according to various examples described in this application.
[0163] As shown in FIG. 1 , a decoding system 10 includes a source device 12 for providing encoded image data 21 such as an encoded image to a destination device 14 for decoding the encoded image data 21 .
[0164] The source device 12 includes an encoder 20 , and optionally, may include an image source 16 , a preprocessor (or preprocessing unit) 18 such as an image preprocessor, and a communication interface (or communication unit) 22 .
[0165] The image source 16 may include or may be any type of image capture device for capturing real-world images, etc., and / or any type of image generation device, such as a computer graphics processor for generating computer-animated images, or any type of device for acquiring and / or providing real-world images, computer-generated images (e.g., screen content, virtual reality (VR) images, and / or any combination thereof (e.g., augmented reality (AR) images). The image source may be any type of memory or storage that stores any of the above images.
[0166] In order to distinguish the processing performed by the pre-processor (or pre-processing unit) 18 , the image (or image data) 17 may also be referred to as a raw image (or raw image data) 17 .
[0167] The preprocessor 18 is configured to receive raw image data 17 and preprocess the raw image data 17 to obtain a preprocessed image (or preprocessed image data) 19. For example, the preprocessing performed by the preprocessor 18 may include cropping, color format conversion (e.g., from RGB to YCbCr), color grading, or denoising. It will be appreciated that the preprocessor 18 may be an optional component.
[0168] The video encoder (or encoder) 20 is configured to receive the pre-processed image data 19 and provide encoded image data 21 .
[0169] The communication interface 22 in the source device 12 can be used to receive the encoded image data 21 and send the encoded image data 21 (or any other processed version) to another device such as the destination device 14 or any other device through the communication channel 13 for storage or direct reconstruction.
[0170] The source device 12 may further include a memory (not shown in FIG. 1 ), which may be used to store at least one of the following data: original image data 17 , pre-processed image (or pre-processed image data) 19 , and encoded image data 21 .
[0171] The destination device 14 includes a decoder 30 and, in addition or alternatively, may include a communication interface (or communication unit) 28 , a post-processor (or post-processing unit) 32 , and a display device 34 .
[0172] The communication interface 28 in the destination device 14 is used to receive the encoded image data 21 (or any other processed version) directly from the source device 12 or from any other source device such as a storage device, for example, the storage device is a encoded image data storage device, and provide the encoded image data 21 to the decoder 30.
[0173] The communication interface 22 and the communication interface 28 can be used to send or receive encoded image data (or encoded data) 21 through a direct communication link between the source device 12 and the destination device 14, such as a direct wired or wireless connection, or through any type of network, such as a wired network, a wireless network or any combination thereof, any type of private network and public network or any combination thereof.
[0174] For example, the communication interface 22 may be used to encapsulate the encoded image data 21 into a suitable format such as a message, and / or process the encoded image data using any type of transmission coding or processing for transmission over a communication link or network.
[0175] The communication interface 28 corresponds to the communication interface 22 , and can be used, for example, to receive transmission data and process the transmission data using any type of corresponding transmission decoding or processing and / or decapsulation to obtain the encoded image data 21 .
[0176] Both the communication interface 22 and the communication interface 28 can be configured as a unidirectional communication interface as indicated by the arrow pointing from the source device 12 to the corresponding communication channel 13 of the destination device 14 in Figure 1, or a bidirectional communication interface, and can be used to send and receive messages, etc. to establish a connection, confirm and exchange any other information related to the communication link and / or data transmission such as encoded image data transmission, etc.
[0177] The video decoder (or decoder) 30 is configured to receive the encoded image data 21 and provide decoded image data (or decoded image data) 31 .
[0178] The post-processor 32 is configured to post-process the decoded image data 31 (also referred to as reconstructed image data), such as the decoded image, to obtain post-processed image data 33, such as the post-processed image. The post-processing performed by the post-processing unit 32 may include, for example, color format conversion (e.g., from YCbCr to RGB), color grading, cropping, or resampling, or any other processing for generating the decoded image data 31 for display on a display device 34, etc.
[0179] The display device 34 is configured to receive the post-processed image data 33 and display the image to a user or viewer. The display device 34 may be or include any type of display for displaying the reconstructed image, such as an integrated or external display screen or monitor. For example, the display screen may include 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) display, a digital light processor (DLP), or any other type of display screen.
[0180] The destination device 14 may further include a memory (not shown in FIG. 1 ), which may be used to store at least one of the following data: the encoded image data 21 , the decoded image data 31 , and the post-processed image data 33 .
[0181] The decoding system 10 also includes a training engine 25, which is used to train the encoder 20 to process the input image or image region or image block, obtain a feature map of the input image or image region or image block, and obtain an estimated probability distribution of the feature map, and encode the feature map according to the estimated probability distribution.
[0182] The training engine 25 is further used to train the decoder 30 to obtain an estimated probability distribution of the code stream, decode the code stream according to the estimated probability distribution to obtain a feature map, and reconstruct the feature map to obtain a reconstructed image.
[0183] Although FIG1 shows source device 12 and destination device 14 as separate devices, device embodiments may also include both source device 12 and destination device 14 or the functions of both source device 12 and destination device 14, that is, both source device 12 or the corresponding functions and destination device 14 or the corresponding functions. In these embodiments, source device 12 or the corresponding functions and destination device 14 or the corresponding functions may be implemented using the same hardware and / or software or through separate hardware and / or software or any combination thereof.
[0184] According to the description, the existence and (accurate) division of different units or functions in the source device 12 and / or the destination device 14 shown in FIG. 1 may vary depending on actual devices and applications, which is obvious to those skilled in the art.
[0185] In recent years, the application of deep learning to the field of video coding and decoding has gradually become a trend. Deep learning refers to multiple levels of learning at different levels of abstraction through machine learning algorithms. Video coding and decoding based on deep learning can also be called AI video coding and decoding or neural network-based video coding and decoding. Since the embodiments of the present application involve the application of neural networks, for ease of understanding, some of the nouns or terms used in the embodiments of the present application are explained below, and the nouns or terms are also part of the content of the invention.
[0186] (1) Artificial neural network (ANN):
[0187] Artificial neural network, also known as neural network (NN), is a dynamic system established by humans with a directed graph as its topological structure. It processes information by responding to continuous or intermittent inputs as states. It is an information processing system designed to imitate the structure and function of the human brain. After decades of development, artificial neural networks have been widely used in many fields such as pattern recognition, automatic control, signal processing, decision support, artificial intelligence, scientific computing, and have achieved widespread success. Usually a network consists of an input layer, a hidden layer, and an output layer. The neural networks involved in this application can include various types, such as deep neural networks (DNN), convolutional neural networks (CNN), recurrent neural networks (RNN), residual networks, neural networks using transformer models, or other neural networks. Some neural networks are exemplarily introduced below.
[0188] (2) Convolutional Neural Networks:
[0189] Convolutional neural networks (CNNs) are deep neural networks with a convolutional structure and a deep learning architecture. Deep learning architectures use machine learning algorithms to perform multiple levels of learning at different levels of abstraction. As a deep learning architecture, CNNs are feed-forward artificial neural networks, in which individual neurons process input data.
[0190] As shown in FIG2 , a convolutional neural network (CNN) 100 may include an input layer 110, a convolutional layer / pooling layer 120, wherein the pooling layer is optional, and a neural network layer 130. As shown in FIG2 , the convolutional layer / pooling layer 120 may include layers 121-126, for example. In one implementation, layer 121 is a convolutional layer, layer 122 is a pooling layer, layer 123 is a convolutional layer, layer 124 is a pooling layer, layer 125 is a convolutional layer, and layer 126 is a pooling layer. In another implementation, layers 121 and 122 are convolutional layers, layer 123 is a pooling layer, layer 124 and layer 125 are convolutional layers, and layer 126 is a pooling layer. That is, the output of a convolutional layer can serve as the input of a subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation. Taking convolutional layer 121 as an example, convolutional layer 121 may include many convolution operators, which are also called convolution kernels. The convolution operator is essentially a weight matrix, which is usually predefined. For example, in image processing, different weight matrices extract different features from the image. For example, one weight matrix is used to extract image edge information, another weight matrix is used to extract specific colors, and yet another weight matrix is used to blur unwanted noise in the image.
[0191] The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can extract information from the input data, thereby helping the convolutional neural network 100 to make correct predictions.
[0192] When the convolutional neural network 100 has multiple convolutional layers, the initial convolutional layer (for example, 121) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 100 increases, the features extracted by the later convolutional layers (for example, 126) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0193] Pooling layer:
[0194] Because it's often desirable to reduce the number of training parameters, pooling layers are often periodically introduced after convolutional layers. For example, as shown in the example of 120 in Figure 2, layers 121-126 can be composed of one convolutional layer followed by one pooling layer, or multiple convolutional layers followed by one or more pooling layers. In image processing, the sole purpose of a pooling layer is to reduce the spatial size of an image. Pooling layers can include average pooling and / or max pooling operators, which are used to downsample the input image to produce a smaller image. The average pooling operator calculates the average value of pixel values within a specific range. The max pooling operator takes the pixel with the largest value within a specific range as the result of max pooling. Furthermore, just as the size of the weight matrix used in a convolutional layer should be related to the image size, the operators in a pooling layer should also be related to the image size. The output image size after processing by a pooling layer can be smaller than the size of the image input to the pooling layer. Each pixel in the output image of the pooling layer represents the average or maximum value of the corresponding subregion of the image input to the pooling layer.
[0195] After being processed by the convolution layer / pooling layer 120, the convolution neural network 100 is not sufficient to output the required output information. Because as mentioned above, the convolution layer / pooling layer 120 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other relevant information), the convolution neural network 100 needs to use the neural network layer 130 to generate one or a group of outputs of the required number of classes. Therefore, the neural network layer 130 may include multiple hidden layers (131, 132 to 13n as shown in Figure 2) and an output layer 140. The parameters contained in the multiple hidden layers can be pre-trained based on relevant training data of a specific task type. For example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc.
[0196] After the multiple hidden layers in the neural network layer 130, that is, the last layer of the entire convolutional neural network 100 is the output layer 140. The output layer 140 has a loss function similar to the classification cross entropy, which is specifically used to calculate the prediction error. Once the forward propagation of the entire convolutional neural network 100 (the propagation from 110 to 140 in Figure 2 is forward propagation) is completed, the back propagation (the propagation from 140 to 110 in Figure 2 is back propagation) will begin to update the weight values and biases of the aforementioned layers to reduce the loss of the convolutional neural network 100 and the error between the result output by the convolutional neural network 100 through the output layer and the ideal result.
[0197] It should be noted that the convolutional neural network 100 shown in Figure 2 is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models. For example, multiple convolutional layers / pooling layers are run in parallel, and the extracted features are input into the neural network layer 130 for processing.
[0198] (3) Loss function
[0199] During the training of a neural network, because we want the output of the neural network to be as close as possible to the desired value, we can compare the current network's predicted value with the desired target value, and then update the weight vector of each layer of the neural network based on the difference between the two. (Of course, there is usually an initialization process before the first update, which is to pre-configure the parameters for each layer in the neural network.) For example, if the network's predicted value is too high, the weight vector is adjusted to make it predict a lower value. This adjustment is continued until the neural network can predict the desired target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value." This is the loss function or objective function, which is an important equation used to measure the difference between the predicted value and the target value. Among them, taking the loss function as an example, the higher the output value (loss) of the loss function, the greater the difference, so the training of the neural network becomes a process of minimizing this loss as much as possible.
[0200] (4) Linear operation:
[0201] Linearity refers to the proportional, linear relationship between quantities. Mathematically, it can be understood as a function whose first-order derivative is a constant. Linear operations include, but are not limited to, addition, null operations, identity operations, convolution, layer normalization (LN), and pooling. Linear operations, also known as linear mappings, must meet two conditions: homogeneity and additivity. Failure of either condition constitutes nonlinearity.
[0202] Here, homogeneity means f(ax) = af(x); additivity means f(x + y) = f(x) + f(y); for example, f(x) = ax is linear. It should be noted that x, a, and f(x) here are not necessarily scalars, but can be vectors or matrices, forming a linear space of any dimension. If x and f(x) are n-dimensional vectors, when a is a constant, they are equivalent to satisfying homogeneity, and when a is a matrix, they are equivalent to satisfying additivity. Relatively speaking, a function graph that is a straight line does not necessarily conform to a linear mapping. For example, f(x) = ax + b neither satisfies homogeneity nor additivity, and therefore belongs to a nonlinear mapping.
[0203] In the embodiment of the present application, the combination of multiple linear operations may be referred to as a linear operation, and each linear operation included in a linear operation may also be referred to as a sub-linear operation.
[0204] (5)Attention model.
[0205] An attention model is a neural network that uses the attention mechanism. In deep learning, the attention mechanism can be broadly defined as a weight vector that describes the importance of an element: this weight vector is used to predict or infer an element. For example, for a pixel in an image or a word in a sentence, the attention vector can be used to quantitatively estimate the correlation between the target element and other elements, and the weighted sum of the attention vectors can be used as an approximation of the target value.
[0206] The attention mechanism in deep learning simulates the attention mechanism of the human brain. For example, when a person looks at a painting, although their eyes can see the entire painting, when they look closely, their eyes actually focus on only a small part of the pattern. At this time, the human brain focuses primarily on this small part. In other words, when a person observes an image carefully, the human brain's attention is not evenly distributed across the entire image; instead, it is weighted differently. This is the core idea of the attention mechanism.
[0207] Simply put, the human visual processing system tends to selectively focus on certain parts of an image while ignoring other irrelevant information, thereby facilitating human perception. Similarly, in deep learning's attention mechanism, in some problems involving language, speech, or vision, certain parts of the input may be more relevant than others. Therefore, through the attention mechanism in the attention model, the attention model can dynamically focus on only the parts of the input that help effectively perform the task at hand.
[0208] (6) Self-attention network.
[0209] A self-attention network is a neural network that implements the self-attention mechanism. The self-attention mechanism is an extension of the attention mechanism. It is essentially an attention mechanism that associates different positions in a single sequence to compute a representation of the same sequence. The self-attention mechanism can play a key role in machine reading, abstractive summarization, or image description generation. Taking the application of self-attention networks in natural language processing as an example, the self-attention network processes input data of arbitrary length and generates a new feature representation of the input data, which is then converted into a target word. The self-attention network layer in the self-attention network uses the attention mechanism to capture the relationships between all other words, thereby generating a new feature representation for each word. The advantage of the self-attention network is that the attention mechanism can directly capture the relationships between all words in a sentence, regardless of their position.
[0210] Figure 3 is a schematic diagram of a network (or system) for deep learning-based video encoding and decoding provided by an embodiment of the present application, and Figure 2 uses entropy encoding and decoding as an example. The network includes a feature extraction module, a feature quantization module, an entropy encoding module, an entropy decoding module, a feature dequantization module, and a feature decoding (or image reconstruction) module.
[0211] On the encoding side, the original image (or the image to be compressed) is input into the feature extraction module. This module outputs a 3D feature map of the original image by stacking multiple layers of convolution and combining a nonlinear mapping activation function. The feature quantization module quantizes the floating-point eigenvalues in the 3D feature map to produce a quantized feature map. This quantized 3D feature map undergoes entropy coding to produce a bitstream.
[0212] On the decoding end, the entropy decoding module parses the bitstream to generate a quantized 3D feature map. The feature dequantization module dequantizes the integer eigenvalues in the quantized feature map to generate a dequantized feature map. The dequantized feature map is then reconstructed by the feature decoding module to produce the reconstructed image.
[0213] Entropy coding is a process that uses the entropy principle to avoid losing any information during the encoding process. Entropy coding applies an entropy coding algorithm or scheme to quantized coefficients and other syntax elements, resulting in coded data that can be output via an output terminal in the form of a coded bitstream, etc., so that a decoder, etc. can receive and use parameters for decoding. The coded bitstream can be transmitted to a decoder or stored in a memory for later transmission or retrieval by the decoder. Examples of entropy coding algorithms or schemes include, but are not limited to, variable length coding (VLC), context adaptive VLC (CALC), arithmetic coding, binarization, context adaptive binary arithmetic coding (CABAC), syntax based context adaptive binary arithmetic coding (SBAC), probability interval partitioning entropy (PIPE) coding, or other entropy coding methods or techniques.
[0214] The network can also exclude the feature quantization module and the feature dequantization module. In this case, the network can directly perform a series of processing on the feature map whose feature map is a floating point number. Alternatively, the network can be integerized so that the feature values in the feature map output by the feature extraction module are all integers.
[0215] After the image to be processed (or the image to be compressed) passes through the feature extraction module and the feature quantization module, a three-dimensional feature quantization map is obtained. When processing each eigenvalue in the three-dimensional feature quantization map, the entropy coding module can use the processed eigenvalues in the neighborhood as context to estimate the probability distribution of the eigenvalue, obtain the probability distribution of the eigenvalue, and perform subsequent encoding based on the probability distribution to obtain the encoded bit stream.
[0216] FIG4 is a schematic diagram of the network structure of an end-to-end video codec based on deep learning provided by an embodiment of the present application, and FIG4 is illustrated using entropy coding and decoding as an example. The neural network includes a feature extraction module, a quantization module, a side information extraction module, an entropy coding module, an entropy decoding module, a probability estimation module, and a reconstruction module. Entropy coding can be performed by auto encoders (AE), and entropy decoding can be performed by auto decoders (AD).
[0217] At the encoding end, the original image x is input into the feature extraction module, which outputs the feature map y of the original image. This feature map y is then input into the quantization module, which outputs a quantized feature map. This quantized feature map is then input into the entropy coding module. Furthermore, feature map y is input into the side information extraction module, which outputs side information z. This side information z is then input into the quantization module, which outputs quantized side information. The quantized side information is passed through the entropy coding module to generate a side information bitstream, which is then passed through the entropy decoding module to obtain the decoded side information. The decoded side information is then input into the probability estimation module, which outputs the probability distribution of each feature element [x][y][i] in the quantized feature map. This probability distribution is then input into the entropy coding module. The entropy coding module entropy encodes each input feature element based on its probability distribution to produce a super-prior bitstream.
[0218] The side information z is a kind of feature information, which is represented as a three-dimensional feature map, and the number of feature elements it contains is less than the number of feature elements included in the feature map y.
[0219] On the decoding end, the entropy decoding module parses the side information bitstream to obtain side information and inputs this side information into the probability estimation module, which outputs the probability distribution of each feature element [x][y][i] in the symbol to be decoded. The probability distribution of each feature element [x][y][i] is input into the entropy decoding module. The entropy decoding module performs entropy decoding on each feature element based on its probability distribution to produce a decoded feature map. This decoded feature map is input into the reconstruction module, which outputs a reconstructed image.
[0220] In addition, the probability estimation module of some variational autoencoders (VAE) also utilizes the encoded or decoded feature elements around the current feature element to more accurately estimate the probability distribution of the current feature element.
[0221] It should be noted that the network structures shown in Figures 3 and 4 are only exemplary descriptions, and the embodiments of the present application do not limit the modules included in the network and the structure of the modules.
[0222] In some possible scenarios, in order to further improve the accuracy of the mean, an autoregressive module can be added. The autoregressive module can further obtain the probability distribution value for obtaining the residual based on the mean output by the probability distribution module and the quantized feature map.
[0223] The encoding and decoding method provided in an embodiment of the present application is described in detail below. Referring to Figure 5, a flow chart of an encoding and decoding method provided in an embodiment of the present application is shown. The method process can be performed by two electronic devices or by one electronic device. Exemplarily, when the method process is performed by two electronic devices, one of the electronic devices includes an encoder for indicating an encoding operation, and the other electronic device includes a decoder for performing a decoding operation. When the method process is performed by one electronic device, the electronic device may include an encoder and a decoder. The method can be executed by an electronic device by calling a neural network model. The method process is described as a series of operations, and it should be understood that the method process can be performed in various orders and / or occur simultaneously, and is not limited to the execution order shown in Figure 5.
[0224] 501. The encoder encodes identification information indicating the adopted decoding network into a bitstream.
[0225] The identification information is a first value, indicating that the decoding network used to decode the image to be processed from the code stream is the first decoding network; or the identification information is a second value, indicating that the decoding network used to decode the image to be processed from the code stream is the second decoding network. It can also be understood that if the identification information is the first value, the encoder uses the first encoding network corresponding to the first decoding network to perform the encoding operation on the image to be processed, or if the identification information is the second value, the encoder uses the second encoding network corresponding to the second decoding network to perform the encoding operation on the image to be processed. This identification information can also be called profile information (Profile ID), network information, network identification, or other terms, which are not limited in this embodiment of the present application. In other words, this identification information is used to indicate the processing that the decoder needs to support, such as the general_profile_idc syntax element in the H.265 standard. As an example, the first value can be 0 and the second value can be 1, or the first value can be 1 and the second value can be 0. The first and second values can also use other values. The processing resources (or computing power) required by the first decoding network are higher than the processing resources (computing power) required by the second decoding network. Processing resources (computing power) can include memory resources, processor resources, and other resources. In some embodiments, it can also be understood that the decoding rates (or decompression efficiencies) of the first decoding network and the second decoding network are different, for example, the decoding rate of the first decoding network is higher than the decoding rate of the second decoding network; or, the image quality restored by the first decoding network is different from the image quality restored by the second decoding network, for example, the image quality restored by the first decoding network is higher than the image quality restored by the second decoding network.
[0226] 502, the encoder sends a code stream.
[0227] 503. The decoder decodes identification information indicating the adopted decoding network from the received code stream.
[0228] 504. When the identification information is a first value, use a first decoding network to decode the image to be processed from the code stream; or when the identification information is a second value, use a second decoding network to decode the image to be processed from the code stream.
[0229] In a possible implementation, the first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
[0230] In some embodiments, the identification information may also include other values for indicating different decoding networks. It can be understood that multiple different decoding networks are indicated by multiple different values. For example, the identification information takes a third value, which is used to indicate that the decoding network used is the third decoding network. The decoding rate of the third decoding network is different from that of the first decoding network (or the second decoding network). In some embodiments, the decoding rate of the third decoding network is higher than the decoding rate of the second decoding network, and the decoding rate of the second decoding network is higher than the decoding rate of the first decoding network. In other embodiments, the decoding speed of the third decoding network is between the decoding rates of the first decoding network and the second decoding network. Here, only three decoding networks are taken as an example, and the embodiments of the present application do not specifically limit the number of decoding networks.
[0231] The higher the image decoding rate, the smaller the image decoding delay.
[0232] For another example, the image quality restored by the third decoding network is different from that restored by the first decoding network (or the second decoding network).
[0233] The image quality restored by the third decoding network is higher than the image quality restored by the second decoding network, and the image quality restored by the second decoding network is higher than the image quality restored by the first decoding network. In other embodiments, the image quality restored by the third decoding network is between the image quality restored by the first decoding network and the image quality restored by the second decoding network.
[0234] In some scenarios, when a third decoding network is included, the third decoding network is different from the first decoding network (and the second decoding network), for example, the third decoding network and the second decoding network and the first decoding network are three different decoding networks; or, the third decoding network and the second decoding network (or the first decoding network) share some subnetworks; or, the third decoding network is a subnetwork of the second decoding network (or the first decoding network).
[0235] The first decoding network and the second decoding network share some subnetworks, which can be understood as the first decoding network reusing some subnetworks of the second decoding network. For example, the first decoding network includes network A, network B, and network C, and the second decoding network includes network D, network B, and network C, and both decoding networks share network B. Thus, when using the first decoding network, after inputting data into network A, the output of network A is input into network B, and the output of network B is input into network C. When using the second decoding network, it can be understood as inputting data into network D, the output of network D is input into network B, and the output of network B is input into network C.
[0236] For another example, the first decoding network is a subnetwork of the second decoding network. For example, the first decoding network includes network A1, network A2, and network A3. The second decoding network includes network A1 and network A3. When using the first decoding network, data is input to network A1, the output of network A1 is input to network A2, and the output of network A2 is input to network A3. When using the second decoding network, it can be understood that when data is input to network A1, the output of network A1 is no longer input to network A2, but instead skips network A2 and is input to network A3.
[0237] In another possible implementation, the encoder may also use different encoding networks according to different values of the identification information when performing encoding. Alternatively, after the encoder uses the encoding network to encode the image to be processed into the codestream, the identification information of the decoding network corresponding to the encoding network used may be encoded into the codestream. It can be understood that the identification information indicates both the decoding network used and the encoding network used. When the identification information is a first value, the residual information obtained by encoding the image to be processed using the first encoding network is encoded into the codestream; or, when the identification information is a second value, the residual information obtained by encoding the image to be processed using the second encoding network is encoded into the codestream; the processing resources (or computing power) required by the first encoding network are higher than the processing resources (or computing power) required by the second encoding network. It should be noted that the first encoding network and the first decoding network can be a pair of networks, and after encoding using the first encoding network, the first decoding network is used for decoding; the second encoding network and the second decoding network are a pair of networks, and after encoding using the second encoding network, the second decoding network is used for decoding.
[0238] In some embodiments, the first coding network and the second coding network are two different coding networks; or, the first coding network and the second coding network share some subnetworks; or, the first coding network is a subnetwork of the second coding network.
[0239] The identification information may also have other values, and different values indicate that different coding networks are used. For example, if the identification information takes the third value, the coding network used is the third coding network, and the decoding network used is the third decoding network. It should be noted that the third coding network and the third decoding network are a pair of networks. After encoding using the third coding network, the third decoding network is used for decoding. The coding rate of the third coding network is different from that of the first coding network (or the second coding network). In some embodiments, the coding rate of the third coding network is higher than the coding rate of the second coding network, and the coding rate of the second coding network is higher than the coding rate of the first coding network. In other embodiments, the coding rate of the third coding network is between the coding rates of the first coding network and the second coding network.
[0240] The higher the image encoding rate, the smaller the image encoding delay.
[0241] For another example, the image quality restored by the third encoding network is different from that restored by the first encoding network (or the second encoding network).
[0242] The image quality restored by the third encoding network is higher than the image quality restored by the second encoding network, and the image quality restored by the second encoding network is higher than the image quality restored by the first encoding network. In other embodiments, the image quality restored by the third encoding network is between the image quality restored by the first encoding network and the image quality restored by the second encoding network.
[0243] In some scenarios, when a third coding network is included, the third coding network is different from the first coding network (and the second coding network), for example, the third coding network and the second coding network and the first coding network are three different coding networks; or, the third coding network and the second coding network (or the first coding network) share some subnetworks; or, the third coding network is a subnetwork of the second coding network (or the first coding network).
[0244] Exemplarily, the first coding network includes a feature extraction module, a quantization module, a side information extraction module, an entropy coding module, and a probability estimation module. The second coding network also includes a feature extraction module, a quantization module, a side information extraction module, an entropy coding module, and a probability estimation module. In one embodiment, at least one module in the first coding network and the second coding network uses a different network structure. For example, the network structure of the probability estimation module in the first coding network is different from that of the probability estimation module in the second coding network. For another example, the network structure of the feature extraction module in the first coding network and the feature extraction module in the second coding network is different.
[0245] For example, the feature extraction module in the first encoding network is referred to as the first feature extraction module, and the feature extraction module in the second encoding network is referred to as the second feature extraction module. It should be noted that for each module within a neural network, the term "module" can also be referred to as "network." For example, a feature extraction module can be referred to as a feature extraction network, and a quantization module can also be referred to as a quantization network. The feature extraction module in the first encoding network and the feature extraction module in the second encoding network have different network structures. This may mean that the second feature extraction network is a subnetwork of the first feature extraction network, or that the second feature extraction network and the first feature extraction network are completely different subnetworks. Alternatively, the second feature extraction network and the first feature extraction network share one or more subnetworks. The probability estimation network in the first encoding network and the probability estimation network in the second encoding network have different network structures. This may mean that the second feature extraction network is a subnetwork of the first feature extraction network, or that the second feature extraction network and the first feature extraction network are completely different subnetworks. Alternatively, the second feature extraction network and the first feature extraction network share one or more subnetworks.
[0246] As an example, referring to FIG6A , the network structure of the first encoding network is as follows: the first encoding network includes a first feature extraction network 610 , a quantization network 620 , an autoregressive network 630 , a side information extraction network 640 , and a probability estimation network 650 .
[0247] Furthermore, the residual information obtained by encoding the image to be processed using the first encoding network can be implemented in the following manner. FIG. 7A is a schematic diagram of a possible process of encoding the residual information.
[0248] 701a, extracting a three-dimensional feature map of the image to be processed through the first feature extraction network 610;
[0249] 702a, quantizing the three-dimensional image features through the quantization network 620 to obtain a quantized three-dimensional feature map;
[0250] 703a, extracting side information of the image to be processed from the edge of the three-dimensional feature map through the side information extraction network 640;
[0251] 704a, estimating a first probability distribution mean of the image to be processed based on the side information through the probability estimation network 650;
[0252] 705a, inputting the quantized three-dimensional feature map and the first probability distribution information into the autoregressive network 630 to obtain a second probability distribution mean;
[0253] 706a: Obtain the residual information according to the third-dimensional feature map of the image to be processed and the mean of the second probability distribution.
[0254] The first coding network may further include an entropy coding network 660. The entropy coding network 660 may encode residual information and side information into the bitstream.
[0255] In some scenarios, it can be understood that the side information is encoded into bitstream 1, the residual information is encoded into bitstream 2, and then bitstream 1 and the bitstream are combined into a single bitstream. In other scenarios, the side information and the residual information can be encoded into a single bitstream.
[0256] As another example, referring to FIG6B , the network structure of the second encoding network is as follows: the second encoding network includes a second feature extraction network 611 , a side information extraction network 640 , and a probability estimation network 650 .
[0257] Furthermore, the residual information obtained by encoding the image to be processed using the second encoding network can be implemented in the following manner. FIG. 7B is a schematic diagram of a possible process of encoding the residual information.
[0258] 701b, extracting the three-dimensional feature map of the image to be processed in 611 through the second feature extraction network.
[0259] 702b , extracting side information from the three-dimensional feature map through the side information extraction network 640 .
[0260] 703b: Estimate the probability distribution mean of the image to be processed based on the side information through the probability estimation network 650.
[0261] 704b: Obtain the residual information according to the three-dimensional feature map of the image to be processed and the mean of the probability distribution.
[0262] The second coding network may also include an entropy coding network 660. Entropy coding network 660 can encode residual information and side information into the bitstream. In some scenarios, this can be understood as encoding the side information into bitstream 1, the residual information into bitstream 2, and then merging bitstream 1 and the bitstream into a single bitstream. In other scenarios, both the side information and the residual information can be encoded into a single bitstream.
[0263] The identification information in the embodiments of the present application can be located in the code stream header. In some scenarios, the identification information can also be added to the suffix of the code stream file. For example, different identification information corresponds to different suffixes. For example, the header contains information such as image height and width, image format, and profile ID. This information should be stored in an agreed order, and the specific storage order is not specifically limited by this application.
[0264] For example, the bitstream header may include one or more of the following parameter information. The parameter information includes: profile information (profile ID), image height H, width W, position and size of tiles in the latent space, control flags for each tool, scale factors of the primary and secondary components, model index (model Idx) - learnable model index, and rate control parameter β v The rate control parameters include the rate control parameters β of the main components Y and the rate control parameter β of the secondary component UV etc.
[0265] Exemplarily, the parameters of the codestream header may be encoded using a fixed bit length.
[0266] The following is an explanation of each parameter information.
[0267] W represents the width of the input image. For example, W can range from 1 pixel to 8192 pixels.
[0268] H represents the height of the input image. For example, H can range from 1 pixel to 8192 pixels.
[0269] format indicates the data format of the input image, such as YUV420, YUV444, sRGB, etc.
[0270] bit_depth indicates the bit depth of the input image, such as 8 and 10.
[0271] β is a parameter used to represent the quality level of the variable rate. The main component and the secondary component may have different β, so the main component is represented by beta_luma(β Y ), the secondary component is denoted as beta_chroma(β UV ). β Y The value of is between 0 and 1 and can be represented as a 16-bit fixed-point number. Y represents brightness (Luminance or Luma). UV represents chroma. (Parameter indicating quality level for variable rate. Primary and secondary component might have different betas, so for primary (beta_luma) and secondary (beta_chroma) are signaled. The value β vlays between 0and 1,and signaled as a 16bit fixed point numbers).
[0272] Color conversion information (color_transform_info). By default, the signal is encoded as YUV Bt.709 (full range), but also custom color transform is supported. In that case, 12 coefficients (conversion matrix and offset) may be sent (conversion matrix and offset), encoded as a fixed point number with 8-bit resolution.
[0273] Tile information (tiles info), indicating the decoder tile size and overlap for luma, decoder tile size and overlap for chroma. Inter Channel Correlation Information filter (ICCI) tile size and overlap. Generally, tiles are square in shape. However, since the right or bottom picture boundary may be smaller, the shape of the tiles on the right or boundary may not be square. (decoder tile size and overlap for luma, decoder tile size and overlap for chroma. ICCI tiles size and overlap. Tiles have square shape except at right or bottom picture boundary, where they may be smaller and non-rectangular).
[0274] The Skip Mode enable flag (SkipMode_enable_flag) is used to indicate whether the image encoding adopts the Skip Mode (SkipMode). (Signaled per image, indicates if SkipMode is used).
[0275] The RVS enable flag (RVS_enable_flag) is used to indicate whether the residual and variance scaling (RVS) technology is used for encoding each image.
[0276] The LSBS enable flag (LSBS_enable_flag) is used to indicate whether the latent spatial scaling technology (Latent Scale Before Synthesis, LSBS) at the decoding end is used for each image encoding.
[0277] The ICIC enable flag (ICIC_enable_flag) is used to indicate whether to use an Inter Channel Correlation Information filter (ICCI) for each image encoding.
[0278] numThreads is a 16-bit unsigned integer that specifies the number of samples processed in parallel.
[0279] It should be noted that in some scenarios, different values of the identification information (grade information) may only indicate the use of different decoding networks. In other scenarios, different encoding networks are used only according to different values of the identification information. In still other scenarios, different values of the identification information indicate the use of different encoding networks and decoding networks.
[0280] In a possible example, as shown in Figure 8, the first decoding network (or the second decoding network) may include an entropy decoding network 810, a probability estimation network 820, and an image restoration network. The image restoration network may also be referred to as a reconstruction network, or other names may be used, which is not specifically limited in the embodiments of the present application. The entropy decoding network at the decoding end decodes the side information and the residual information of the image to be processed from the bitstream. The network structure of at least one of the first decoding network and the second decoding network is different, such as the network structure of the image restoration network is different, or the network structure of the probability estimation network is different. For example, the network structure of the image restoration network in the first decoding network and the second decoding network is different. For ease of distinction, the image restoration network in the first decoding network is referred to as the first image restoration network 831, and the image restoration network in the second decoding network is referred to as the second image restoration network 832. The first image restoration network 831 and the second image restoration network 832 are different. For example, the second image restoration network 832 may be a subnetwork of the first image restoration network 831, or the second image restoration network 832 and the first image restoration network 831 may share some subnetworks, or the second image restoration network 832 and the first image restoration network 831 may be two different networks. The first decoding network also includes an autoregressive network 840.
[0281] The decoding process is described with reference to the structural examples of the first decoding network and the second decoding network.
[0282] 9A , which is a schematic diagram of a possible decoding process using the first decoding network.
[0283] 901a, the entropy decoding network 810 decodes the side information of the three-dimensional feature map of the image to be processed from the code stream; the three-dimensional feature map includes multiple feature elements.
[0284] 902a , estimating a first probability distribution mean of the feature element to be decoded based on the side information through the probability estimation network 820 .
[0285] 903a, determining a second probability distribution mean of the feature element to be decoded according to the first probability distribution mean and the decoded feature element through the autoregressive network 840.
[0286] 904a, decoding residual information of the feature element to be decoded from the bitstream according to the second probability distribution mean through the entropy decoding network 810, and obtaining the feature element to be decoded based on the residual information and the second probability distribution mean.
[0287] 905a, restoring the image to be processed according to the decoded 3D feature map through the first image restoration network 831.
[0288] 9B , which is a schematic diagram of a possible decoding process using the second decoding network.
[0289] 901b, the entropy decoding network 810 decodes the side information of the three-dimensional feature map of the image to be processed from the code stream; the three-dimensional feature map includes multiple feature elements.
[0290] 902b: Estimate a first probability distribution mean of the feature element to be decoded based on the side information through the probability estimation network 820.
[0291] 903b, decoding the residual information of the feature element to be decoded from the bitstream according to the first probability distribution mean through the entropy decoding network 810, and obtaining the feature element to be decoded based on the residual information and the first probability distribution mean.
[0292] 904b, using the second image restoration network 832 to restore the image to be processed according to the decoded three-dimensional feature map.
[0293] In some possible implementations, the probability estimation network in the encoding network (including the first encoding network and the second encoding network) and the probability estimation network used in the decoding network may be the same.
[0294] The following describes the solution of the embodiment of the present application with reference to a specific example. The following example uses an end-to-end image encoding and decoding process as an example.
[0295] Example 1:
[0296] 10A and 10B , which are schematic diagrams of the codec network execution process provided in an embodiment of the present application. The codec network used is dynamically adjusted according to the Profile ID. The coding network is combined with the network structure of FIG6A and FIG6B above. The first feature extraction network (module) 610 includes coding network submodules 1-3. The coding network submodules 1-3 perform feature extraction on the processed image and gradually convert the image from the pixel domain to the feature domain to make it easier to compress. The second feature extraction module in the second coding network includes a coding network submodule 1 and a coding network submodule 3.
[0297] Correspondingly, the decoding network is combined with the network structure shown in Figure 8. The decoding network submodule 1→2→3 or 1→2→4 gradually restores the three-dimensional feature map into an image. The difference between the decoding network submodule 3 and the decoding network submodule 4 lies in their different structures. For example, one possible difference is that the decoding network submodule 3 is a lightweight module adapted to the small computing power device on the end side. Compared with the decoding network submodule 4, it has the characteristics of fast operation but slightly lower restored image quality, while the decoding network submodule 4 is a module adapted to the large computing power device. Compared with the decoding network submodule 3, it has the characteristics of slow operation but high restored image quality. In Figure 10B, the first image restoration network of the first decoding network includes the decoding network submodules 1-2 and 4 as an example, and the second image restoration network of the second decoding network includes the decoding network submodules 1-3 as an example.
[0298] See Figure 10A, which is a schematic diagram of the encoding process provided in Example 1. Specifically, the encoding end implements the process as follows:
[0299] The first step is to calculate the output image feature y through the feature extraction module. During the calculation process, whether certain network sub-modules are executed or skipped is selected according to the Profile ID. When the Profile ID is 0, the encoding network sub-module 2 is executed, that is, the first encoding network is used for encoding. When the Profile ID is 1, the encoding network sub-module 2 is skipped, that is, the second encoding network is used for encoding. In some scenarios, it is also possible to skip the encoding network sub-module 2 when the Profile ID is 1, and execute the encoding network sub-module 2 when the Profile ID is 0. Exemplarily, the image feature y can also be called a feature map y, or a three-dimensional feature map y. After the feature extraction module extracts the image to be encoded to obtain the image feature y, the image feature y can also be quantized, which can be understood as processing the eigenvalues of the floating-point number (such as rounding) to obtain the eigenvalues of the integer, thereby obtaining the quantized feature map
[0300] In the second step, the image feature y calculated in the first step is input into the side information extraction network (module) to extract the side information z. After quantizing z, we get Will Compression into bitstream 1. It should be noted that the side information extraction module is not essential. In some possible scenarios, the original image is directly quantized and compressed (or encoded) into a bitstream after feature extraction.
[0301] In some embodiments, the quantized feature map can also be Input to the side information extraction network and output quantized side information The side information extraction module can be implemented using a neural network. The specific neural network structure will be explained with examples later and will not be described here. It can be understood as the quantized feature map Feature map obtained by further feature extraction The number of feature elements contained is less than the feature map The number of feature elements included.
[0302] In some scenarios, the encoding network (the first encoding network and the second encoding network) may further include a quantization network for performing a quantization operation on the image feature y. In other scenarios, the side information extraction network may also have the function of performing a quantization operation, so that the side information extraction network performs a quantization operation on the image feature y.
[0303] The third step is to obtain the probability distribution of the image feature y from the side information. When the Profile ID is 1, the side information is input into the probability estimation network. The probability estimation network (also referred to as the probability estimation module) includes feature probability distribution modules A and B to predict the mean (mean) and variance information of the image feature y. Feature probability distribution modules A and B can also be referred to as feature graph probability distribution estimation modules A and B, or other names are used, which are not limited in the embodiments of the present application. When the Profile ID is 0, the side information is input into the feature probability distribution modules A and B. The feature probability distribution module B outputs the variance information of the image feature y, and the output of the feature probability distribution module A needs to be sent to the autoregressive module together with the quantized image feature y to generate the mean (mean) of the image feature y. In some scenarios, the feature probability distribution modules A and B can also be merged into one module, that is, the function is performed by one module.
[0304] For example, the probability estimation network may adopt a single Gaussian model (GSM), an asymmetric Gaussian model, a Gaussian mixture model (GMM), or a Laplace distribution model. The probability estimation network may also adopt a deep learning network, such as a recurrent neural network (RNN) and a convolutional neural network (CNN), etc., which are not limited here.
[0305] The fourth step is to combine the probability distribution information (mean and variance) of the image feature y obtained in the third step to calculate the residual information r = y-mean of the image feature y relative to the mean, and then quantize the residual information Perform entropy coding to obtain compressed code stream 2. The residual information r can also be called residual feature map r, so the quantized residual information It can also be called the quantized residual feature map It can also be referred to as the quantized residual feature
[0306] Step 5: Combine streams 1 and 2 into one stream, and write the Profile ID into the stream, for example, into the header of the stream.
[0307] It should be noted that the encoding steps of the second, fourth and fifth steps can be combined and processed, and the edge information is no longer executed in the second step. Execute encoding and write to the bitstream, but obtain the quantized residual information in the fourth step After that, the quantized residual information With side information Perform encoding (such as entropy encoding) at the same time and write it into the bitstream.
[0308] See Figure 10B, which is a schematic diagram of the decoding process provided in Example 1. Specifically, the decoding end implements the process as follows:
[0309] The first step is to parse the bitstream through the entropy decoding network (module) to obtain the Profile ID information. For example, obtain the Profile ID from the bitstream header. Profile ID is the profile information in the bitstream, which is used to indicate the processing that the decoder needs to support, such as the general_profile_idc syntax element in the H.265 standard. Profile ID can be an integer (of course, it can also not be an integer, and this application does not make specific restrictions on this). The profile information is used to indicate the processing that the decoder needs to support, and it can also be understood that the profile information is used to indicate the different networks that the decoder needs to use.
[0310] The second step is to obtain the side information from the bitstream (such as bitstream 1) through the entropy decoding network. For example, the quantized side information can be obtained by decoding the bitstream 1 through the asymmetric numeral system (ANS) / arithmetic decoding.
[0311] The third step is to use the probability estimation network (module) to obtain the side information Get feature map When profile ID = 1, the side information The probability estimation module (or probability estimation network) is used to decode the feature map Each characteristic element in Perform probability estimation and obtain characteristic elements The probability distribution of . Assuming that the characteristic element Satisfy the Gaussian distribution with mean μ[x][y][i] and variance σ[x][y][i], where the mean μ[x][y][i] can be used as a feature element When profile ID = 0, the side information Input probability estimation module (or probability estimation network) to decode feature map Each characteristic element in Perform probability estimation and obtain characteristic elements Then, based on the autoregressive network, the information of the decoded feature elements and the mean of the probability estimation network output are used to obtain the predicted value of the feature element to be decoded.
[0312] Among them, the characteristic elements The parameters x, y, and i are all positive integers, and the coordinates (x, y, i) represent the position of the feature element to be decoded. Specifically, the coordinates (x, y, i) represent the position of the feature element to be decoded relative to the feature element at the upper left vertex in the current three-dimensional feature map. This step can be specifically implemented by a probability estimation module. The probability estimation method used by the decoding end can correspond to the probability estimation method used by the encoding end, that is, the structure of the probability estimation module at the decoding end can be the same as the structure of the probability estimation module at the encoding end, which will not be repeated here.
[0313] Codestream 2 can be thought of as a bitstream converted from multiple matrices y. Decoding is the process of recovering multiple matrices y from this bitstream. Restoring y is done element by element. For example, for a 10x10 matrix, the elements are recovered one by one, from left to right and from top to bottom. When the element in row 7 and column 8 is recovered, the preceding elements (i.e., all elements with abscissa < 7 and ordinate < 8) are considered the context of this element, and can be understood as the decoded context information.
[0314] The fourth step is to use the quantized feature map obtained in the third step The Gaussian distribution mean μ and variance σ of each feature element in the quantized residual feature map are obtained by continuing to parse the bit stream through the entropy decoding network. Furthermore, according to and μ to obtain the quantized feature map
[0315] As an example, the feature map is parsed from the code stream A possible implementation is as follows:
[0316] According to the probability distribution (for example, Gaussian distribution with mean 0 and variance σ), the feature elements to be decoded are obtained The probability P(k) of taking value k, according to P(k), the characteristic element is obtained from the ANS decoding / arithmetic decoding of the code stream Here, k can be any integer, such as 0, 1, 2, 3, etc.
[0317] The fifth step is to The image is restored through the image restoration network. During the image restoration network (or reconstruction network) process, after executing decoding network submodules 1 and 2, a selection is made between decoding network submodules 3 and 4 based on the Profile ID value. If the Profile ID is 1, decoding network submodule 3 is selected, i.e., the second decoding network is used; if the Profile ID is 0, decoding network submodule 4 is executed, i.e., the first decoding network is used.
[0318] The following examples illustrate the structures of the various sub-networks of the aforementioned coding network (including the first coding network and the second coding network). FIG11 is a schematic diagram of the execution flow of the coding network. It should be noted that FIG11 is merely an example and does not limit the specific structure of the coding network.
[0319] As shown in Figure 11, the encoding network submodule 1 includes multiple layers, namely padding layer (padding) 1_1, convolution layer (Conv) 1_11, residual activation function layer (ResAU) 1_21, padding 1_2, convolution layer 1_12, residual activation function layer 1_22, and padding 1_3. In this embodiment of the present application, the convolution size is KxK, the number of output channels is M, and the stride is N. It can be expressed as ConvMxKxK SN. In Figure 11, the convolution layer (Conv) 1_11 and the convolution layer 1_12 use Conv12 28x3x3 S2 as an example.
[0320] For example, the padding layer can use zeros padding (default 0 padding), reflect padding, replicated padding, and circular padding. For example, Padding1_1, Padding1_2, and Padding1_3 all use Replicate Padding. It is used to pad the length and width of the input tensor to an even number through Replicated Padding (filling with the nearest element). For example, if the length and width of the input tensor are 5 and 6 respectively, the padding layer will pad one element in the length direction to make the length an even number 6. However, the width of the input tensor is 6, which is an even number, so no padding operation is performed in the width direction.
[0321] The residual activation function layer 1_21 and the residual activation function layer 1_22 are mainly used as activation functions and can also provide an attention mechanism. As an example, the residual activation function layer 1_21 and the residual activation function layer 1_22 can adopt the ResAU 3×3 no tanh network. The ResAU 3×3 no tanh network can adopt the structure shown in Figure 12. The residual activation function layer 1_21 (and the residual activation function layer 1_22) includes: an activation function layer 2_1 and a convolution layer 2_1. In Figure 12, ⊙ and It is a per-element multiplication and per-element addition operation. For example, the convolution layer 2_1 uses a C×3×3 convolution kernel size of 3×3, and the number of output channels is C. In Figure 12, W represents the width of the input image block (or the number of rows in the vector matrix), H represents the height of the input image block (or the number of columns in the vector matrix), and N represents the stride. For example, the activation function layer 2_1 can use the Leaky ReLU function. The Leaky ReLU function is used to assign a non-zero slope to all negative values.
[0322] The encoding network submodule 2 can adopt a residual non-local attention block (RNAB) based on a residual structure to provide an attention mechanism, such as providing global or local attention information in space. For example, see Figure 13 for a possible schematic diagram of the RNAB structure. RNAB adopts a network structure including multiple residual block (RB) layers, multiple convolutional layers, deconvolution layers, and activation function layers (for example, using a sigmoid function). Global or local attention information in space is extracted through RNAB.
[0323] As an example, the residual module layer can adopt the network structure shown in Figure 14. The RB layer can include a convolution layer 4_1, an activation function layer 4_11, and a convolution layer 4_2. In some embodiments, the activation function layer 4_11 can use a Leaky ReLU function. The main line of the residual module layer in Figure 14 passes the input features through the 3×3 convolution layer 4_1 to obtain a feature matrix, then outputs it through the activation function, and then passes it through a 3×3 convolution layer 4_2 to add the result to the input features.
[0324] Referring to FIG. 11, the encoding network sub-module 3 includes a convolutional layer 5_1, a residual activation function layer 5_11, a padding layer 5_12, a convolutional layer 5_2, and a convolutional layer 5_3. In FIG. 11, the convolutional layer 5_1 and the convolutional layer 5_2 can adopt conv 128×3×3S2. The convolutional layer 5_3 adopts conv 128×1×1S1. The residual activation function layer 5_1 can adopt ResAU 3×3no Tanh, such as the network structure shown in FIG. 12.
[0325] The quantization network may include a Round layer 6_11 for performing a quantization operation, or it can also be referred to as a rounding operation. It returns the rounded value of a floating-point number. In some embodiments, referring to FIG. 11, the quantization network may further include a Gunit layer 6_1 and an invGunit layer 6_21. The Gunit layer 6_1 and the invGunit layer 6_21 are used to perform rate matching, enabling the encoding network to have the ability to adjust the code rate. As an example, the Gunit layer 6_1 and the invGunit layer 6_21 can adopt the structures of Gain and Inverse Gain in the paper "G-VAE: A CONTINUOUSLY VARIABLE RATE DEEP IMAGE COMPRESSION FRAMEWORK" by Ze Cui, Jing Wang, etc.
[0326] In FIG. 11, the side information extraction module may include a Hyper Encoder Net and a round layer. The Hyper Encoder Net can also be referred to as a hyper-encoding network. Its function is to extract side information z from the input quantized image feature y. In FIG. 11, the autoregressive network may include a Context Model Net and a Prediction Fusion Net. The Context Model Net is an autoregressive process. The Context Model Net predicts the expected value of the element to be encoded by using the information of the already encoded elements (i′≤i,j′<j - i - j′) and combining with the Prediction Fusion Net For example, in the implementation process, mask convolution (mask conv) can be used to achieve this. The Prediction Fusion Net is used to receive the information of the already encoded elements extracted by the Context Model Net and the side information extracted by the Hyper Decoder to predict the expected value (or the predicted value) of the element to be encoded. The expected value of the element to be encoded can be understood as the mean of the predicted probability distribution.
[0327] In some possible implementation scenarios, feature probability estimation module A can adopt a super decoding network (Hyper Dncoder Net). Feature probability estimation module B can adopt a super large-scale decoding network (Hyper Scale Dncoder Net). Of course, other network structures can also be adopted, and the network that can realize probability estimation of side information is applicable to this application. As an example, feature probability estimation module A can adopt the network structure of the super decoding network shown in Figure 15. Feature probability estimation module A includes convolutional layer 7_1, deconvolutional layer 7_11, cropping layer (Crop) layer 7_21, activation function layer 7_31, convolutional layer 7_2, deconvolutional layer 7_12, cropping layer (Crop) layer 7_22, activation function layer 7_32, convolutional layer 7_3, and activation function layer 7_33.
[0328] Crop layer 7_21 and Crop layer 7_22 are used to perform crop operations on the input tensor. The Crop operation can be expressed as Crop(H out ,W out ,d,s d ), where H out ,W out is the length and width of the image finally output by the decoding network (or it can also be understood as the size of the image input to the encoding network, which can be obtained from the code stream header), s d is the stride information of the deconvolution operation. As an example, s d =2. d represents the depth of the deconvolution layer. The input size of the Crop layer is [C,s d h d ,s d w d ] tensor, the output size is [C,h d-1 ,w d-1 ] tensor, where h d =ceil(h d-1 / s d );w d =ceil(w d-1 / s d ),h0=H out ,w0=W outAs an example, Figure 11 shows that activation function layers 7_31, 7_32, and 7_33 use the LeakyRelu function. In Figure 11, convolutional layer 7_1 uses conv 128×1×1S1, deconvolutional layer 7_11 uses DConv 128×4×4S2, convolutional layer 7_2 uses conv 128×3×3S1, deconvolutional layer 7_12 uses DConv 128×4×4S2, and convolutional layer 7_3 uses conv 128×3×3S1.
[0329] As another example, feature probability estimation module B can adopt the network structure of the ultra-large-scale decoding network shown in Figure 16. Feature probability estimation module B includes a deconvolution layer 7_13, a crop layer (Crop) layer 7_23, an activation function layer 7_34, a convolution layer 7_4, an activation function layer 7_34, a deconvolution layer 7_14, a crop layer (Crop) layer 7_24, an activation function layer 7_35, a convolution layer 7_5, and a Gunit layer 7_6. In Figure 11, the deconvolution layer 7_13 uses DConv 128×4×4S2, the activation function layer 7_34 uses the LeakyRelu function, the convolution layer 7_4 uses conv 128×3×3S1, the deconvolution layer 7_14 uses DConv 128×4×4S2, the activation function layer 7_35 uses the LeakyRelu function, and the convolution layer 7_5 uses conv 128×3×3S1 as an example.
[0330] In Figure 11, the entropy coding network uses a lossless encoder, whose function is to convert the features to be encoded into a bit stream.
[0331] The following is an example of the structure of each sub-network of the above-mentioned decoding network (including the first decoding network and the second decoding network) with reference to specific examples. As shown in Figure 17, it is a schematic diagram of the execution flow of the decoding network. It should be noted that Figure 17 is only an example and does not limit the specific structure of the decoding network. In Figure 17, the entropy decoding network adopts the Lossess decoder, whose function is to restore the bit stream to be decoded into features. The probability estimation network in the decoding network can adopt the same structure as the encoding network, as shown in Figure 11. The decoding network submodule 1 includes an invGunit layer, a lightweight residual module (LightResBlock), a deconvolution layer 8_1, a crop layer 8_11, and a residual activation function layer 8_21. The decoding network submodule 2 includes a deconvolution layer 8_2, a crop layer 8_12, and a residual activation function layer 8_22. The residual activation function layer 8_21 and the residual activation function layer 8_22 can adopt a ResAU structure. The deconvolution layer 8_1 may use Dconv 96×4×4S2, and the deconvolution layer 8_2 may use Dconv 64×4×4S2.
[0332] The decoding network submodule 3 may include a convolution layer 8_31, a residual activation function layer 8_23, a convolution layer 8_32, a PxlShuffleS4, and a cropping layer 8_13. The decoding network submodule 4 includes a deconvolution layer 8_3, an RNAB, a cropping layer 8_14, a residual activation function layer 8_24, a deconvolution layer 8_4, and a cropping layer 8_15. For example, RNAB may adopt the network structure shown in FIG13.
[0333] As an example, the network structure of the lightweight residual module (LightResBlock) can be seen in Figure 18. PxlShuffleS4: represents a pixel shuffle operation with 4x upsampling.
[0334] Example 2:
[0335] The encoding network used in Example 2 is the same as that used in Example 1, and the execution process is similar, so it will not be repeated here. The decoding network in Example 2 is different from the decoding network in Example 1. The second decoding network in the decoding network in Example 2 is a subnetwork of the first decoding network, or in other words, the second image restoration network of the second decoding network is a subnetwork of the structure of the first image restoration network in the first decoding network. As shown in Figure 19, the second image restoration network includes decoding network submodule 5 and decoding network submodule 7, and the first image restoration network includes decoding network submodules 5-7.
[0336] The difference from Example 1 is that in Example 2, at the decoding end, when the Profile ID is different, instead of selecting between decoding network sub-module 3 and decoding network sub-module 4, it is selected whether to skip a certain decoding network sub-module. When Profile ID = 1, decoding network sub-module 6 is skipped, and when Profile ID = 0, decoding network sub-module 6 is executed.
[0337] Example 3:
[0338] In Example 3, the feature extraction networks of the two encoding networks are two different networks, and the image restoration networks of the two decoding networks are two different networks. Referring to FIG20A , the encoding network includes a first feature extraction network, a second feature extraction network, a quantization network, an autoregressive network, a side information extraction network, a probability estimation network, and an entropy coding network. Correspondingly, referring to FIG20B , the decoding network includes an autoregressive network, a side information extraction network, a probability estimation network, a first image restoration network, a second image restoration network, and an entropy decoding network.
[0339] As shown in Figure 20A, the difference between the encoding implementation and Example 1 lies in the first step. During the calculation of the input image feature y, different feature extraction networks are selected based on the Profile ID. When Profile ID = 0, the first feature extraction network is selected, and when Profile ID = 1, the second feature extraction network is selected.
[0340] Similarly, the difference between the decoding implementation process and Example 1 lies in the fifth step, The image is restored through the image restoration network. During the decoding network operation, different image restoration networks are selected based on the Profile ID. When Profile ID = 0, the first image restoration network is selected, and when Profile ID = 1, the second image restoration network is selected.
[0341] The following is an example of the structure of each sub-network of the above-mentioned coding network (including the first coding network and the second coding network) with specific examples. Referring to Figure 21, it is a schematic diagram of the execution flow of the coding network. It should be noted that Figure 21 is only an example and does not limit the specific structure of the coding network. In Figure 21, the first feature extraction network includes a padding layer (padding) 1_1, a convolutional layer (Conv) 1_11, a residual activation function layer (ResAU) 1_21, padding 1_2, a convolutional layer 1_12, a residual activation function layer 1_22, padding 1_3, RNAB, a convolutional layer 5_1, a residual activation function layer 5_11, a padding layer 5_12, a convolutional layer 5_2, and a convolutional layer 5_3. The second feature extraction network includes a padding layer (padding) 1_1, a convolution layer (Conv) 1_11, a residual activation function layer (ResAU) 1_21, padding 1_2, a convolution layer 1_12, a residual activation function layer 1_22, padding 1_3, a convolution layer 5_1, a residual activation function layer 5_11, a padding layer 5_12, a convolution layer 5_2, and a convolution layer 5_3. For the description of the above layers, please refer to the relevant description of the embodiment corresponding to Figure 11, which will not be repeated here. The structures of the other networks in Figure 21 are described in Example 1 and will not be repeated here.
[0342] Referring to Figure 22, a schematic diagram of the execution flow of the decoding network is shown. It should be noted that Figure 22 is only an example and does not limit the specific structure of the encoding network. The first image restoration network includes an invGunit layer, a lightweight residual module (LightResBlock), a deconvolution layer 8_1, a crop layer 8_11, a residual activation function layer 8_21, a deconvolution layer 8_2, a crop layer 8_12, a residual activation function layer 8_22, a deconvolution layer 8_3, an RNAB, a crop layer 8_14, a residual activation function layer 8_24, a deconvolution layer 8_4, and a crop layer 8_15. The second image restoration network includes an invGunit layer, a lightweight residual module (LightResBlock), a deconvolution layer 8_1, a crop layer 8_11, a residual activation function layer 8_21, a deconvolution layer 8_2, a crop layer 8_12, a residual activation function layer 8_22, a convolution layer 8_31, a residual activation function layer 8_23, a convolution layer 8_32, PxlShuffleS4, and a crop layer 8_13. For the description of the above-mentioned layers, please refer to the relevant description of the corresponding embodiment of Figure 11, which will not be repeated here. The structures of the other networks in Figure 22 are described in Example 1 and will not be repeated here.
[0343] It should be noted that the above-mentioned network structures are only examples and do not limit the specific network structure. As long as the network structure can achieve the corresponding functions, it is applicable to this application.
[0344] It's also important to note that the aforementioned sub-module-level adjustments to the encoding and decoding network based on Profile IDs can be flexibly combined with overall network-level adjustments. For example, one possible scenario is that the encoding end uses a framework like PyTorch on the cloud side to execute a dynamic computation graph, adjusting the encoding network sub-modules based on the Profile ID, while the decoding end executes a static computation graph on the client side, switching the entire decoding network based on the Profile information.
[0345] The embodiment of the present application transmits network structure information through the encoding end, so that the decoding end can adjust the decoding network through the content of the code stream. This solution has the following advantages: 1. For code streams generated by different AI encoding networks, the decoding end can select different decoding network structures according to the content of the code stream to achieve decoding, which brings greater flexibility to the encoding and decoding end. Users can adjust their encoding and decoding network computing power according to their own scenarios to flexibly balance latency and compression performance. 2. Users can dynamically choose to adjust some modules of the decoding network according to the Profile ID according to their own usage scenarios, or switch between different decoding networks.
[0346] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working process of the communication system described above can refer to the corresponding process in the aforementioned method embodiment and will not be repeated here.
[0347] One embodiment of the present application provides a computer-readable medium for storing a computer program, wherein the computer program includes instructions for executing the method steps in the method embodiment corresponding to FIG. 5 .
[0348] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, optical storage, etc.) that contain computer-usable program code.
[0349] The present application is described with reference to the flow chart and / or block diagram of the method, device (system), and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0350] Obviously, those skilled in the art may make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include these modifications and variations.
Claims
1. An image coding method, characterized in that: include: Encoding identification information for indicating the adopted decoding network into the bitstream; The identification information is a first value, which is used to indicate that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or, The identification information is a second value, which is used to indicate that the decoding network used to decode the to-be-processed image from the code stream is a second decoding network; the processing resources required by the first decoding network are higher than the processing resources required by the second decoding network; The code stream is sent.
2. The method according to claim 1, characterized in that The first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
3. The method according to claim 1 or 2, characterized in that The method further comprises: Acquire the identification information; When the identification information is a first value, encoding the residual information obtained by encoding the image to be processed based on the first encoding network into the bitstream; or, When the identification information is a second value, encoding the bitstream based on residual information obtained by encoding the image to be processed based on a second encoding network; The processing resources required by the first encoding network are higher than the processing resources required by the second encoding network.
4. The method according to claim 3, characterized in that The first coding network and the second coding network are two different coding networks; or, the first coding network and the second coding network share some subnetworks; or, the second coding network is a subnetwork of the first coding network.
5. The method according to claim 4, characterized in that The first encoding network includes a first feature extraction network, an autoregressive network, a side information extraction network, and a probability estimation network; The residual information obtained by encoding the image to be processed using the first encoding network includes: Extracting a three-dimensional feature map of the image to be processed by the first feature extraction network, wherein the three-dimensional feature map includes a plurality of feature elements; Extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network; estimating a first probability distribution mean of the feature element to be encoded based on the side information by the probability estimation network; Inputting the encoded feature element and the first probability distribution mean into the autoregressive network to obtain a second probability distribution mean of the feature element to be encoded; Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the second probability distribution mean of the feature element to be encoded.
6. The method according to claim 5, characterized in that The second encoding network includes a second feature extraction network, a side information extraction network, and a probability estimation network; The residual information obtained by encoding the image to be processed using the second encoding network includes: Extracting a three-dimensional feature map of the image to be processed by the second feature extraction network, wherein the three-dimensional feature map includes a plurality of feature elements; Extracting side information of feature elements to be encoded from the three-dimensional feature map through the side information extraction network; estimating a probability distribution mean of the feature element to be encoded based on the side information through the probability estimation network; Residual information of the feature element to be encoded is obtained according to the feature element to be encoded and the probability distribution mean.
7. The method according to claim 6, characterized in that The second feature extraction network is a sub-network of the first feature extraction network, or the second feature extraction network and the first feature extraction network are two completely different sub-networks.
8. The method according to any one of claims 5 to 7, characterized in that: The method further comprises: The side information is encoded into the codestream.
9. The method according to any one of claims 1 to 8, characterized in that The identification information is located in the code stream header.
10. An image decoding method, characterized in that: include: Receive code stream; Decoding identification information for indicating a decoding network to be adopted from the code stream; When the identification information is a first value, a first decoding network is used to decode the image to be processed from the code stream; or, When the identification information is a second value, a second decoding network is used to decode the image to be processed from the code stream; and processing resources required by the first decoding network are higher than processing resources required by the second decoding network.
11. The method according to claim 10, characterized in that The first decoding network and the second decoding network are completely different decoding networks; or, the first decoding network and the second decoding network share some subnetworks; or, the second decoding network is a subnetwork of the first decoding network.
12. The method according to claim 10 or 11, characterized in that The first decoding network includes an entropy decoding network, a probability estimation network, an autoregressive network and a first image restoration network; Decoding the image to be processed from the bitstream using the first decoding network includes: Decoding the side information of the three-dimensional feature map of the image to be processed from the bitstream through the entropy decoding network; the three-dimensional feature map includes a plurality of feature elements; estimating a first probability distribution mean of a feature element to be decoded according to the side information through a probability estimation network; Determine, by the autoregressive network, a second probability distribution mean of the feature element to be decoded according to the first probability distribution mean and the decoded feature elements; Decoding residual information of the feature element to be decoded from the bitstream according to the second probability distribution mean through the entropy decoding network, and obtaining the feature element to be decoded based on the residual information and the second probability distribution mean; The image to be processed is restored through the first image restoration network according to the decoded three-dimensional feature map.
13. The method according to claim 12, characterized in that The second decoding network includes the entropy decoding network, the probability estimation network and the second image restoration network; Decoding the image to be processed from the bitstream using the second decoding network includes: Decoding the side information of the three-dimensional feature map of the image to be processed from the bitstream through the entropy decoding network; the three-dimensional feature map includes a plurality of feature elements; estimating a first probability distribution mean of a feature element to be decoded according to the side information through a probability estimation network; Decoding residual information of the feature element to be decoded from the bitstream according to the first probability distribution mean through the entropy decoding network, and obtaining the feature element to be decoded based on the residual information and the first probability distribution mean; The image to be processed is restored through the second image restoration network according to the decoded three-dimensional feature map.
14. The method according to claim 13, characterized in that The second image restoration network is a subnetwork of the first image restoration network, or the image restoration network and the first image restoration network share some subnetworks, or the second image restoration network and the first image restoration network are two different networks.
15. An image encoding device, characterized in that: comprising a memory and a video encoder, wherein: The memory is used to store video data, wherein the video data includes an image to be processed; The video encoder is used to encode identification information indicating the adopted decoding network into the bitstream; The identification information is a first value, indicating that the decoding network used to decode the image to be processed from the code stream is a first decoding network; or, The identification information is a second value, indicating that the decoding network used to decode the image to be processed from the code stream is a second decoding network; The processing resources required by the first decoding network are higher than the processing resources required by the second decoding network.
16. An image decoding device, characterized in that: including a memory and a video decoder, wherein The memory is used to store video data in the form of code stream, wherein the video data includes an image to be processed; The video decoder is used to decode identification information indicating a decoding network to be used from a bit stream; When the identification information is a first value, a first decoding network is used to decode the image to be processed from the code stream; or, When the identification information is a second value, a second decoding network is used to decode the image to be processed from the code stream; and processing resources required by the first decoding network are higher than processing resources required by the second decoding network.
17. A video decoding device, characterized in that: include: A non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute the method according to any one of claims 10 to 14.
18. A video encoding device, characterized in that: include: A non-volatile memory and a processor coupled to each other, wherein the processor calls a program code stored in the memory to execute the method according to any one of claims 1 to 14.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code, and when the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 10 to 14.
20. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program code, and when the computer program is executed on a computer, the computer is caused to execute the method according to any one of claims 1 to 9.
21. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a video code stream decoded by one or more processors executing the method according to any one of claims 10 to 14.
22. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a video code stream encoded by the method according to any one of claims 1 to 9 executed by one or more processors.
Citation Information
Patent Citations
Image coding and decoding method and device
CN104853209A
Encoding method and device, decoding method and device, electronic equipment and storage medium
CN111641832A
Method, apparatus and storage medium for image encoding / decoding using segmentation map
US20220166976A1
Video encoding / decoding method, device and system, and storage medium
WO2022257134A1
