WO2022147745A1 - 编码方法、解码方法和编码装置、解码装置 - Google Patents

编码方法、解码方法和编码装置、解码装置 Download PDF

Info

Publication number
WO2022147745A1
WO2022147745A1 PCT/CN2021/070791 CN2021070791W WO2022147745A1 WO 2022147745 A1 WO2022147745 A1 WO 2022147745A1 CN 2021070791 W CN2021070791 W CN 2021070791W WO 2022147745 A1 WO2022147745 A1 WO 2022147745A1
Authority
WO
WIPO (PCT)
Prior art keywords
model
neural network
network model
parameter set
parameter
Prior art date
Application number
PCT/CN2021/070791
Other languages
English (en)
French (fr)
Inventor
周焰
郑萧桢
Original Assignee
深圳市大疆创新科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to PCT/CN2021/070791 priority Critical patent/WO2022147745A1/zh
Priority to CN202180080110.1A priority patent/CN116530079A/zh
Publication of WO2022147745A1 publication Critical patent/WO2022147745A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N19/00Methods or arrangements for coding, decoding, compressing or decompressing digital video signals

Definitions

  • the present application relates to the field of image processing, and more particularly, to an encoding method, a decoding method, an encoding device, and a decoding device.
  • one way is to fix the model parameters of the neural network model in a common library file available to both the encoder and the decoder.
  • the encoder and decoder can obtain the model parameters of the neural network model from the common library file when encoding or decoding, but this method will reduce the effect once some encoding tools of the encoder are changed.
  • Another way is to send the model parameters of the neural network model to the decoder through the code stream, so that the model parameters can be flexibly adjusted according to the needs of the encoder.
  • the amount is generally relatively large, and if it is directly written into the code stream for transmission, the transmission bandwidth will be increased.
  • the present application provides an encoding method, a decoding method, an encoding device, and a decoding device, which can save transmission bandwidth.
  • a first aspect provides an encoding method, comprising: encoding an image to be encoded by using a neural network-based encoding technology to obtain first encoded data; using a differential prediction method to encode a neural network included in the neural network-based encoding technology
  • the model parameter set of the model is compressed and encoded to obtain second encoded data; the first encoded data and the second encoded data are transmitted.
  • a decoding method including: receiving first encoded data and second encoded data; decoding the second encoded data to obtain model parameters in a model parameter set of a neural network model; using the neural network The model parameters in the model parameter set of the model decode the first encoded data to obtain a decoded image.
  • an encoding device comprising: a processor for encoding an image to be encoded by using a neural network-based encoding technology to obtain first encoded data; and using a differential prediction method to encode the neural network-based encoding technology
  • the model parameter set of the included neural network model is compressed and encoded to obtain second encoded data; the first encoded data and the second encoded data are transmitted.
  • a decoding device comprising: a processor for receiving first encoded data and second encoded data; decoding the second encoded data to obtain model parameters in a model parameter set of a neural network model; The first encoded data is decoded by using the model parameters in the model parameter set of the neural network model to obtain a decoded image.
  • an encoding apparatus including a processor and a memory.
  • the memory is used for storing a computer program
  • the processor is used for calling and running the computer program stored in the memory to execute the method in the above-mentioned first aspect or each implementation manner thereof.
  • a decoding apparatus including a processor and a memory.
  • the memory is used to store a computer program, and the processor is used to call and run the computer program stored in the memory to execute the method in the second aspect or each of its implementations.
  • a chip is provided for implementing the method in the above-mentioned first aspect or each of its implementation manners.
  • the chip includes: a processor for invoking and running a computer program from a memory, so that a device installed with the chip executes the method in the first aspect or each of its implementations.
  • a chip is provided for implementing the method in the second aspect or each of its implementation manners.
  • the chip includes: a processor for invoking and running a computer program from a memory, so that a device on which the chip is installed executes the method in the second aspect or each of its implementations.
  • a computer-readable storage medium for storing a computer program, the computer program comprising instructions for performing the method in the first aspect or any possible implementation manner of the first aspect.
  • a computer-readable storage medium for storing a computer program, the computer program comprising instructions for performing the method of the second aspect or any possible implementation of the second aspect.
  • a computer program product comprising computer program instructions, the computer program instructions causing a computer to execute the method in the first aspect or each implementation manner of the first aspect.
  • a twelfth aspect provides a computer program product, comprising computer program instructions, the computer program instructions causing a computer to execute the method in the second aspect or each implementation manner of the second aspect.
  • the encoding end performs compression encoding on the model parameter set of the neural network model by means of differential prediction, and transmits the second encoded data obtained after the compression encoding, which can save transmission bandwidth.
  • Fig. 1 is the architecture diagram of applying the technical solution of the embodiment of the present application.
  • FIG. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application.
  • FIG. 3 is a schematic flowchart of an encoding method provided by an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a decoding method provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of a coding framework 2 provided by an embodiment of the present application.
  • Fig. 6 is the schematic diagram of the image transmission transmission of the intelligent coding technology provided by the embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a training neural network model provided by an embodiment of the present application.
  • FIG. 8a is a schematic flowchart of a video encoder applying an intelligent encoding technology provided by an embodiment of the present application
  • 8b is a schematic flowchart of a video decoder applying an intelligent coding technology provided by an embodiment of the present application
  • FIG. 9 is a schematic diagram of an encoding device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a decoding apparatus provided by an embodiment of the present application.
  • FIG. 11 is a schematic diagram of an encoding apparatus provided by another embodiment of the present application.
  • FIG. 12 is a schematic diagram of a decoding apparatus provided by another embodiment of the present application.
  • FIG. 13 is a schematic structural diagram of a chip provided by an embodiment of the present application.
  • FIG. 1 is an architectural diagram of applying the technical solution of the embodiment of the present application.
  • the system 100 may receive data 102 to be processed, process the data 102 to be processed, and generate processed data 108 .
  • system 100 may receive data to be encoded and encode the data to be encoded to generate encoded data, or system 100 may receive data to be decoded and decode the data to be decoded to generate decoded data.
  • components in system 100 may be implemented by one or more processors, which may be processors in computing devices or processors in mobile devices (eg, drones).
  • the processor may be any type of processor, which is not limited in this embodiment of the present invention.
  • the processor may include an encoder, a decoder, or a codec, among others.
  • One or more memories may also be included in system 100 .
  • the memory may be used to store instructions and data, for example, computer-executable instructions, data to be processed 102 , processed data 108 , etc. that implement the technical solutions of the embodiments of the present invention.
  • the memory may be any type of memory, which is also not limited in this embodiment of the present invention.
  • the data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded.
  • the data to be encoded may include sensory data from sensors, which may be visual sensors (eg, cameras, infrared sensors), microphones, near-field sensors (eg, ultrasonic sensors, radar), position sensors, temperature sensor, touch sensor, etc.
  • the data to be encoded may include information from the user, eg, biometric information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA sampling, and the like.
  • FIG. 2 is a schematic diagram of a video coding framework 2 according to an embodiment of the present application.
  • each frame of the video to be encoded is encoded in sequence.
  • the current coded frame mainly undergoes: prediction (Prediction), transformation (Transform), quantization (Quantization) and entropy coding (Entropy Coding), etc., and finally outputs the code stream of the current coded frame.
  • the decoding process usually decodes the received code stream according to the inverse process of the above process, so as to recover the video frame information before decoding.
  • the video coding framework 2 includes a coding control module 201 for performing decision control actions and parameter selection in the coding process.
  • the encoding control module 201 controls parameters used in transformation, quantization, inverse quantization, and inverse transformation, controls selection of intra-frame mode or inter-frame mode, and parameter control of motion estimation and filtering, And the control parameters of the encoding control module 201 will also be input into the entropy encoding module to be encoded to form a part of the encoded code stream.
  • the coded frame is divided 202, and specifically, the coded frame is divided into slices first, and then divided into blocks.
  • the coding frame is divided into a plurality of non-overlapping largest coding tree units (Coding Tree Units, CTUs), and each CTU can also be in the form of a quad tree, or a binary tree, or a ternary tree, respectively.
  • CTUs Coding Tree Units
  • a CU may also include a prediction unit (Prediction Unit, PU) and a transform unit (Transform Unit, TU) associated with it, where PU is the basic unit of prediction, and TU is the basic unit of transform and quantization.
  • Prediction Unit PU
  • Transform Unit TU
  • PUs and TUs are obtained by dividing into one or more blocks on the basis of CUs, wherein one PU includes multiple prediction blocks (Prediction Blocks, PBs) and related syntax elements.
  • the PU and the TU may be the same, or may be obtained by the CU through different partitioning methods.
  • At least two of the CUs, PUs, and TUs are the same, eg, CUs, PUs, and TUs are not distinguished, and all are predicted, quantized, and transformed in units of CUs.
  • the CTU, CU or other formed data units are referred to as coding blocks.
  • a data unit targeted for video coding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or a group of any of the above.
  • the size of the data unit may vary.
  • a prediction process is performed to remove redundant information in the spatial and temporal domains of the current coded frame.
  • the commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction only uses the reconstructed information in this frame to predict the current coding block, while inter-frame prediction uses the information in other frames (also called reference frames) that have been reconstructed before to predict the current coding block. Make predictions.
  • the encoding control module 201 is configured to decide whether to select intra-frame prediction or inter-frame prediction.
  • the process of intra-frame prediction 203 includes obtaining the reconstructed block of the coded adjacent blocks around the current coding block as a reference block, and using the prediction mode method to calculate the prediction value based on the pixel value of the reference block to generate the prediction block. , the corresponding pixel values of the current coding block and the prediction block are subtracted to obtain the residual of the current coding block.
  • the residual of the current coding block is transformed 204 , quantized 205 and entropy encoded 210 to form the code stream of the current coding block. Further, after all the coded blocks of the current coded frame are subjected to the above coding process, a part of the coded code stream of the coded frame is formed.
  • the control and reference data generated in the intra prediction 203 are also encoded by entropy encoding 210 to form part of the encoded code stream.
  • the transform 204 is used to de-correlate the residuals of image blocks in order to improve coding efficiency.
  • two-dimensional discrete cosine transform Discrete Cosine Transform, DCT
  • two-dimensional discrete sine transform Discrete Sine Transform, DST
  • quantization 205 is used to further improve the compression efficiency.
  • the transform coefficients can be quantized to obtain quantized coefficients, and then the quantized coefficients are entropy encoded 210 to obtain the residual code stream of the current encoding block.
  • the entropy encoding method includes: But not limited to content adaptive binary arithmetic coding (Context Adaptive Binary Arithmetic Coding, CABAC) entropy coding.
  • CABAC Context Adaptive Binary Arithmetic Coding
  • the bit stream obtained by entropy encoding and the encoded encoding mode information are stored or sent to the decoding end.
  • inverse quantization 206 is also performed on the quantized result, and inverse transformation 207 is performed on the inverse quantization result.
  • the reconstructed pixels are obtained using the inverse transformation result and the motion compensation result. Afterwards, the reconstructed pixels are filtered (ie loop filtered) 211. After 211, the filtered reconstructed image (belonging to the reconstructed video frame) is output. Subsequently, the reconstructed image can be used as a reference frame image of other frame images for inter-frame prediction. In this embodiment of the present application, the reconstructed image may also be referred to as a reconstructed image or a reconstructed image.
  • the coded adjacent blocks in the process of intra-frame prediction 203 are: adjacent blocks that have been coded before the current coded block is coded, and the residuals generated in the coding process of the adjacent blocks are transformed 204, quantized 205, After inverse quantization 206 and inverse transform 207, the reconstructed block is obtained by adding the prediction block of the adjacent block.
  • inverse quantization 206 and inverse transform 207 are inverse processes of quantization 206 and transform 204, and are used to restore residual data before quantization and transform.
  • the inter prediction process when the inter prediction mode is selected, the inter prediction process includes motion estimation (Motion Estimation, ME) 208 and motion compensation (Motion Compensation, MC) 209 .
  • the encoder can perform motion estimation 208 according to the reference frame image in the reconstructed video frame, and search for the image block most similar to the current encoding block in one or more reference frame images as the prediction block according to certain matching criteria,
  • the relative displacement between the prediction block and the current coding block is the motion vector (Motion Vector, MV) of the current coding block.
  • the original value of the pixel of the coding block is subtracted from the pixel value of the corresponding prediction block to obtain the residual of the coding block.
  • the residual of the current coded block is transformed 204, quantized 205 and entropy coded 210 to form a part of the coded code stream of the coded frame.
  • motion compensation 209 may be performed based on the motion vector and prediction block determined above to obtain the current coding block.
  • the reconstructed video frame is a video frame obtained after filtering 211 .
  • the reconstructed video frame includes one or more reconstructed images.
  • Filtering 211 is used to reduce compression distortions such as blocking and ringing effects during the encoding process.
  • the reconstructed video frame is used to provide reference frames for inter-frame prediction during the encoding process.
  • the reconstructed video frame is post-processed and output. for the final decoded video.
  • the inter prediction mode may include an advanced motion vector prediction (Advanced Motion Vector Prediction, AMVP) mode, a merge (Merge) mode, or a skip (skip) mode.
  • AMVP Advanced Motion Vector Prediction
  • merge Merge
  • skip skip
  • the motion vector prediction can be determined first. After the MVP is obtained, the starting point of the motion estimation can be determined according to the MVP, and a motion search can be performed near the starting point. After the search is completed, the optimal MV, the position of the reference block in the reference image is determined by the MV, the reference block is subtracted from the current block to obtain the residual block, the MV is subtracted from the MVP to obtain the Motion Vector Difference (MVD), and the difference between the MVD and the MVP is obtained.
  • the index is transmitted to the decoder through the code stream.
  • the MVP can be determined first, and the MVP can be directly determined as the MV of the current block.
  • a MVP candidate list (merge candidate list) can be constructed first.
  • the MVP candidate list at least one candidate MVP can be included, and each candidate MVP can have an index corresponding to the MVP candidate list.
  • the MVP index can be written into the code stream, and the decoder can find the MVP corresponding to the index from the MVP candidate list according to the index, so as to decode the image block.
  • Skip mode is a special case of Merge mode. After the MV is obtained according to the Merge mode, if the encoder determines that the current block is basically the same as the reference block, it does not need to transmit the residual data, only the index of the MVP needs to be passed, and further a flag can be passed, which can indicate that the current block can be directly Obtained from the reference block.
  • the decoding end perform operations corresponding to the encoding end.
  • the residual information is obtained by entropy decoding, inverse quantization and inverse transformation, and according to the decoded code stream, it is determined whether the current image block uses intra-frame prediction or inter-frame prediction. If it is intra-frame prediction, use the reconstructed image blocks in the current frame to construct prediction information according to the intra-frame prediction method; if it is inter-frame prediction, you need to parse out the motion information, and use the parsed motion information in the reconstructed image. Then, the prediction information and the residual information are superimposed, and the reconstruction information can be obtained through the filtering operation.
  • This application mainly relates to the encoding and decoding of images or videos based on neural network encoding and decoding technology (also referred to as “intelligent encoding and decoding technology”). Therefore, the following briefly introduces the relevant content of neural networks.
  • Neural network also known as “artificial” neural network (Artificial Neural Network, ANN)
  • NN also known as "artificial” neural network
  • ANN Artificial Neural Network
  • Neural network systems consist of many simple and highly interconnected processing components that process information through dynamic state responses to external inputs.
  • the processing components can be thought of as neurons in the human brain, where each perceptron accepts multiple inputs and computes a weighted sum of the inputs.
  • perceptrons are considered mathematical models of biological neurons.
  • these interconnected processing components are typically organized in layers.
  • the external input can correspond to a pattern presented to the network that communicates with one or more intermediate layers, also known as “hidden layers", where the actual processing is done through a system of weighted "connections".
  • ANNs can use different architectures to specify which variables are involved in the network and their topological relationships.
  • the variables involved in a neural network might be the weights of connections between neurons, and the activity of neurons.
  • Most artificial neural networks contain some form of "learning rule" that modifies the weights of connections based on the input patterns presented. In a sense, artificial neural networks learn by example just like their biological counterparts.
  • Deep Neural Networks or deep multilayer neural networks correspond to neural networks with multiple levels of interconnected nodes, which allow them to compactly represent highly nonlinear and highly varying functions.
  • the computational complexity of DNNs grows rapidly with the number of nodes associated with a large number of layers.
  • one way is to fix the model parameters of the neural network model in a common library file available to both the encoder and the decoder.
  • the encoder and decoder can obtain the model parameters of the neural network model from the common library file when encoding or decoding, but this method will reduce the effect once some encoding tools of the encoder are changed.
  • Another way is to send the model parameters of the neural network model to the decoder through the code stream, so that the model parameters can be flexibly adjusted according to the needs of the encoder.
  • the amount is generally relatively large, and if it is directly written into the code stream for transmission, the transmission bandwidth will be increased.
  • the present application provides an encoding method, a decoding method, an encoding device, and a decoding device, which can save transmission bandwidth.
  • the encoding method 300 provided by this embodiment of the present application will be described in detail below with reference to FIG. 3 .
  • FIG. 3 is a schematic diagram of an encoding method 300 provided by an embodiment of the present application, and the method 300 may include steps 310-330.
  • using a neural network-based encoding technology to encode an image to be encoded can be understood as: using a neural network model-based encoding module to replace or supplement part of the encoding and decoding framework
  • the encoding module encodes the to-be-encoded image, or replaces the original encoding frame with a neural network model-based encoding frame to encode the to-be-encoded image.
  • the neural network-based coding technology mainly includes three aspects: hybrid neural network video coding (that is, the neural network coding module is embedded in the traditional video coding framework instead of the traditional coding module), neural network rate-distortion optimization coding and end-to-end neural network coding.
  • Network video encoding that is, the neural network coding module is embedded in the traditional video coding framework instead of the traditional coding module.
  • a coding module based on a neural network model can be used to replace part of the coding module in the coding framework to be coded. image to encode.
  • a filtering module based on a neural network model may also be added to the existing filtering module to filter the reconstructed image.
  • the intra-frame prediction method based on neural network is compared with the original intra-frame prediction method to determine the optimal intra-frame prediction method for prediction;
  • the image super-resolution technology based on neural network can be used for prediction, which can improve the performance of motion estimation, thereby improving the efficiency of inter prediction.
  • a context probability estimation method based on neural network technology can be used to replace the traditional rule-based context probability prediction model, and applied to the entropy coding process of coefficient coding or some other syntax elements.
  • a Neural Network Filter (NNF) technology can be added after deblocking filtering.
  • End-to-end neural network video coding is to completely abandon the traditional hybrid video coding framework, directly input video images and related information, and use neural network-based prediction methods for prediction and compression coding.
  • the neural network model in this embodiment of the present application may include a neural network model trained offline or a neural network model trained online, which is not limited.
  • the neural network model in the embodiment of the present application may include a DNN, a convolutional neural network (Convolutional Neural Network, CNN), a recurrent neural network (Recurrent Neural Network, RNN), or other neural network variants, etc., which is not specifically limited in this application. .
  • a convolutional neural network Convolutional Neural Network, CNN
  • a recurrent neural network Recurrent Neural Network, RNN
  • other neural network variants etc.
  • the model parameters of the neural network model in the embodiments of the present application include, but are not limited to, the number of layers of the neural network, the number of neurons, the weight of connections between neurons, and the like.
  • FIG. 4 is a schematic diagram of a decoding method 400 provided by an embodiment of the present application, and the method 400 may include steps 410-430.
  • a decoding module based on a neural network model can be used to replace part of the decoding in the decoding framework.
  • the module decodes the image to be decoded.
  • a filtering module based on a neural network model may also be added to the existing filtering module to filter the predicted reconstructed image.
  • the encoding end performs compression encoding on the model parameter set of the neural network model by means of differential prediction, and transmits the second encoded data obtained after the compression encoding, which can save transmission bandwidth.
  • the bit width of the model parameters included in the model parameter set of the neural network model is less than or equal to the first threshold.
  • the bit width of the model parameter in the embodiment of the present application can be understood as the bits occupied by the model parameter after being converted into a binary format.
  • the encoder can encode it as "1010", then the bits occupied after the value is converted to binary format are 4 bits, that is, the value of the value is 4 bits.
  • the bit width is 4 bits; assuming that the model parameters in the model parameter set of the neural network model include the value 5, the encoder can encode it as "101", then the bits occupied by the value converted into binary format are 3 bits, that is, the The bit width of the value is 3 bits.
  • the maximum value of the model parameters in the model parameter set of the trained neural network model may be 15; if the first threshold is 8, the encoding end is in the In the process of training the neural network model, the maximum value of the model parameters in the model parameter set of the trained neural network model may be 255.
  • the first threshold in the embodiment of the present application may be a predetermined value of the protocol, or may be a preset value of the encoding end; the first threshold in the embodiment of the present application may be a fixed value or a transformed value; it is not limited.
  • the bit width of the model parameters included in the model parameter set of the neural network model is less than or equal to the first threshold, which facilitates the compression coding of the model parameter set of the neural network model by means of differential prediction.
  • neural network models include offline training neural network models or online training neural network models.
  • the following two neural network models are used as examples to introduce the use of differential prediction methods for neural network-based coding techniques.
  • the model parameter set of the neural network model is compressed and encoded.
  • Case 1 Use differential prediction to compress and encode the model parameter set of the online-trained neural network model included in the neural network-based encoding technology
  • the neural network model includes an online training neural network model
  • the model parameter set of the neural network model included in the neural network-based coding technique is performed by means of differential prediction.
  • Compression encoding including:
  • n is a positive integer greater than 1
  • m is a positive integer greater than or equal to 1.
  • m ⁇ n that is, when encoding the model parameter set of the nth neural network model, the model parameter set of the nth neural network model and the model parameter set of the mth neural network model before it can be encoded
  • the parameter difference of the corresponding parameter is sufficient.
  • the parameter difference value of the corresponding parameter in the model parameter set of the third neural network model and the model parameter set of the second neural network model can be encoded, and the parameter The difference value is transmitted to the decoding end; or, for the model parameter set of the third neural network model, the parameter difference between the model parameter set of the third neural network model and the model parameter set of the first neural network model can also be encoded. value, and transmit the difference value of this parameter to the decoding end; it is not limited.
  • the encoded data of the model parameter set of the first neural network model can be received, and the parameters of the corresponding parameters of the model parameter set of the nth neural network model and the model parameter set of the mth neural network model can be received.
  • the encoded data of the difference and decode the received encoded data to obtain the model parameters in the model parameter set of the 1st neural network model, and, the model parameter set of the nth neural network model and the mth neural network
  • the parameter difference value of the corresponding parameter in the model parameter set of the model is obtained, and the model parameter of the model parameter set of the nth neural network model is obtained by using the parameter difference value obtained after decoding and the model parameter in the model parameter set of the mth neural network model.
  • the model parameter set of the first neural network model when the encoding end encodes the model parameter set of the first neural network model, the model parameter set of the first neural network model can be encoded separately and transmitted to the decoding end; The parameter difference between the model parameters in the model parameter set of a neural network model and the preset value, and the parameter difference is transmitted to the decoding end; no limitation.
  • the encoding end in the process of encoding the image to be encoded by the encoding end using the neural network model trained online, not only encodes the model parameter set of the first neural network model, but also encodes the model parameters of the nth neural network model. It can encode the parameter difference between the model parameter set of the n-th neural network model and the corresponding parameter in the model parameter set of the m-th neural network model, and transmit the encoded data corresponding to the parameter difference to the decoding end. Save transmission bandwidth.
  • the encoding parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model includes:
  • the first parameter difference is the parameter difference between the model parameter set of the nth neural network model and the parameter set of the mth neural network model corresponding to the parameters.
  • the neural network model includes an online training neural network model
  • the model parameter set of the neural network model included in the neural network-based coding technique is performed by means of differential prediction.
  • Compression encoding including:
  • the first parameter difference is the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model
  • the second parameter difference is the The parameter difference between the parameters in the nth model parameter set other than the model parameter corresponding to the first parameter difference and the preset value.
  • the encoding end can use the number of model parameters included in the model parameter set of the nth neural network model and the mth parameter in the encoding process according to the The number of model parameters included in the model parameter set of the neural network model determines the encoded parameter difference.
  • the number of model parameters included in the model parameter set of the nth neural network model is less than or equal to the number of model parameters included in the model parameter set of the mth neural network model, encode the first parameter difference;
  • the number of model parameters included in the model parameter set of each neural network model is greater than the number of model parameters included in the model parameter set of the mth neural network model, encoding the first parameter difference and the second parameter difference.
  • the encoding end can encode the 100 model parameters.
  • the parameter difference value of the corresponding parameter in the model parameters that is, the parameter difference value of the corresponding parameter among the 100 model parameters included in the model parameter set of the nth neural network model and the model parameter set of the mth neural network model.
  • the encoding end encodes the number of model parameters of the nth neural network model.
  • the parameter difference between the 80 model parameters included in the model parameter set and the corresponding 80 model parameters included in the model parameter set of the mth neural network model may be sufficient.
  • the encoder can encode the nth neural network model The parameter difference between the model parameter set of the nth neural network model and the corresponding parameters of the 80 model parameters included in the model parameter set of the mth neural network model.
  • the coding end The parameter differences between these 20 model parameters and preset values can be encoded.
  • the preset value can be 2 a-1 , and the encoding end can encode these 20 model parameters and 2 a-1 when encoding the remaining 20 model parameters. parameter difference.
  • the above-mentioned preset value may also be other values, such as 2 a-2 , etc., which are not limited.
  • the decoding end decodes the encoded data of the parameter difference between the received model parameter set of the n-th neural network model and the model parameter set of the m-th neural network model, and may obtain The first parameter difference, it is also possible to obtain the first parameter difference and the second parameter difference.
  • the decoding end correspondingly sums the first parameter difference and the model parameters in the model parameter set of the mth neural network model to obtain the model parameter set of the nth neural network model;
  • the parameter difference value and the second parameter difference value, the decoding end correspondingly sums the first parameter difference value and the model parameters in the model parameter set of the mth neural network model, and sums the second parameter difference value and the preset value to obtain The set of model parameters for the nth neural network model.
  • the model parameter set of the first neural network model can be encoded, and the model parameter set of the nth neural network model and the model parameter set of the mth neural network model correspond to parameters in the model parameter set.
  • the encoding the model parameter set of the first neural network model includes: encoding the model parameter set of the first neural network model in a first encoding manner
  • the encoding of the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model includes: encoding the model parameters of the nth neural network model by a second encoding method The parameter difference between the set and the corresponding parameters in the model parameter set of the mth neural network model.
  • the model parameter set of the first neural network model, and the model parameter set of the nth neural network model and the model parameter set of the mth neural network model can be encoded in different ways.
  • the parameter difference is encoded.
  • the model parameter set of the first neural network model can be encoded by the first encoding method; for the model parameter set of the nth neural network model and the parameters of the corresponding parameters in the model parameter set of the mth neural network model
  • the difference value can be encoded by the second encoding.
  • the encoded data of the model parameter set of the first neural network model is decoded by the first decoding method, and the model parameter set of the nth neural network model and the mth neural network model are decoded by the second decoding method.
  • the encoded data of the parameter difference values of the corresponding parameters in the model parameter set of the neural network model is decoded, and the decoded data is summed, thereby obtaining the model parameter set of the neural network model.
  • the encoding end can pass the second encoding.
  • the method encodes the parameter difference between the model parameter set of the nth neural network model and the corresponding parameter in the model parameter set of the mth neural network model, and encodes the model parameter corresponding to the difference value of the first parameter in the nth model parameter set except the first parameter difference.
  • the decoding end can decode the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model by the second decoding method, and decode the parameter difference of the nth model parameter set.
  • the model parameter set of the first neural network model, and the parameters of the corresponding parameters in the model parameter set of the nth neural network model and the model parameter set of the mth neural network model are encoded in different ways
  • the difference is encoded, or the model parameter set of the first neural network model is encoded by different encoding methods, and the model parameter set of the nth neural network model and the model parameter set of the mth neural network model
  • the corresponding parameters of the model parameter set are The parameter difference value and the parameter difference value of the preset value in the nth model parameter set other than the model parameter corresponding to the first parameter difference value are encoded, which can improve the flexibility of encoding.
  • the first encoding mode is a fixed-length code encoding mode
  • the second encoding mode is a variable-length code encoding mode
  • the fixed-length code encoding method in the embodiments of the present application can be understood as an encoding method performed with a fixed bit width; the variable-length code encoding method can be understood as an encoding method performed with a changed bit width.
  • the bit width of the model parameters of the neural network model is 4 bits
  • it when encoding the model parameters of the model parameter set of the first neural network model, it can be encoded with a bit width of 4 bits.
  • the encoder can encode it as "1010"; if the model parameter of the model parameter set of the first neural network model also includes a numerical value 2, the encoder can encode it as "0010". In other words, regardless of the value of the model parameter of the model parameter set of the first neural network model, the encoding end encodes it with a bit width of 4 bits.
  • the encoding end encodes the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model. If the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model includes the value 2, the encoder can encode it as "10", that is, the parameter difference 2 occupies The bit width is 2 bits; if the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model includes the value 5, the encoder can encode it as "101" , that is, the bit width occupied by the parameter difference value 5 is 3 bits. In other words, for the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model, for different parameter differences, the encoder uses different bit widths according to the size of the value. encode it.
  • the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model can be encoded based on the above variable length. code encoding method to encode it.
  • the model parameters in the model parameter set of the first neural network model are encoded by the fixed-length code encoding method
  • the model parameter set of the n-th neural network model and the m-th neural network model are encoded by the variable-length code encoding method.
  • the parameter difference values of corresponding parameters in the model parameter set of the neural network model are encoded, which can further save bandwidth.
  • the m is a parameter that is fixed or preset at the encoding end before encoding, or the m is determined by the encoding end based on a preset rule.
  • the m is a parameter fixed or preset at the decoding end, or the m is determined based on a preset rule.
  • m may be a parameter fixed or preset at the encoding end or the decoding end.
  • the decoder receives the encoded data of the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the first neural network model.
  • the model parameters of the model parameter set of the nth neural network model can be obtained by summing the parameter difference and the corresponding parameters in the model parameter set of the first neural network model.
  • the encoding end can compare the model parameter set of the nth neural network model with the n-1th neural network model parameter set.
  • the terminal After receiving the encoded data of the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the n-1th neural network model, the terminal can add the parameter difference to the n-1th parameter
  • the model parameters of the model parameter set of the nth neural network model can be obtained by summing the corresponding parameters in the model parameter set of the neural network model.
  • the bits consumed by the encoding end for transmitting m can be reduced, thereby further saving bandwidth.
  • the m is determined by the encoding end based on a preset rule, and the first encoded data further includes first indication information, where the first indication information is used to indicate the m value .
  • the encoding end may also determine m based on a preset rule, and at the same time, the value of m may be transmitted to the decoding end through the first encoded data, so as to facilitate correct decoding by the decoding end.
  • the parameter difference of the corresponding parameters in the model parameter set of the third neural network model and the model parameter set of the first neural network model can be encoded.
  • the encoding end determines m based on a preset rule, and uses the first indication information to indicate the value of m, and the first indication information is transmitted to the decoding end through the first encoded data, which can improve the flexibility of encoding, and also The correctness of the codec can be guaranteed.
  • the preset rules include:
  • a neural network model parameter set with the smallest number of bits encoding the parameter difference of the model parameter set of the nth neural network model is selected from the plurality of neural network models.
  • the minimum number of bits in this embodiment of the present application can be understood as the minimum number of bits occupied.
  • the parameter difference of the corresponding parameters in the model parameter set of the third neural network model and the model parameter set of the first neural network model can be encoded;
  • the encoding end can make a decision according to the minimum number of bits encoding the parameter difference of the model parameter set of the nth neural network model.
  • model parameters in the model parameter set of the third neural network model include 10. If the model parameter set of the first neural network model is used to encode the model parameter 10 of the third neural network model, it is assumed that the first neural network model The corresponding model parameter included in the model parameter set is 5, and the encoded parameter difference is 5, that is, the encoding end encodes the parameter difference 5 as "101"; if the model parameter of the second neural network model is used The set encodes the model parameter 10 of the third neural network model.
  • the difference between the encoded parameters is 2, that is, the encoding end will
  • the parameter difference value 2 is encoded as "10"; the encoding end can choose to use the model parameter set of the second neural network model to encode the model parameter 10 of the third neural network model, that is, to encode the third neural network model.
  • the encoding end can select from multiple neural network models the neural network model parameter set that encodes the parameter difference of the model parameter set of the nth neural network model with the smallest number of bits to the neural network model parameter set of the nth neural network model.
  • the model parameter set is encoded, which can further save bandwidth.
  • Case 2 The model parameter set of the offline-trained neural network model included in the neural network-based encoding technology is compressed and encoded by means of differential prediction
  • the neural network model includes a plurality of offline trained neural network models, and the model parameters of the neural network model included in the neural network-based coding technique are determined by means of differential prediction. set for compression encoding, including:
  • the encoding end can first encode the model parameter set of the neural network model 1.
  • the model parameter sets of the remaining other neural network models including neural network model 2, neural network model 3, and neural network model 4
  • the model parameter sets of the three neural network models and the model parameters of neural network model 1 can be encoded respectively. Sets the parameter difference of the corresponding parameter.
  • the encoder can obtain different neural network models by offline training for different quantization parameters (Quantization Parameter, QP). For example, 4 different neural network models (respectively neural network model 1, neural network model 2, neural network model 3 and neural network model 4) are obtained by training for quantization parameters of 27, 32, 37, and 45. In the process of encoding the image, a corresponding neural network model can be selected for encoding according to the quantization parameter of the image to be encoded.
  • QP quantization Parameter
  • the encoded data of the model parameter set of the first neural network model can be received; at the same time, the parameter difference value of the corresponding parameter in the model parameter set of the second neural network model and the model parameter set of the first neural network model can be received. coded data. Decoding and processing the received encoded data (summing the decoded parameter difference and the corresponding parameters of the model parameters in the model parameter set of the first neural network model), thereby obtaining the model parameters of the first neural network model set and the model parameter set of the second neural network model.
  • the encoding end in the process of encoding the image to be encoded by using the offline trained neural network model, can not only encode the model parameter set of the first neural network model, but also other offline trained neural network models. Encoding the parameter difference of the corresponding parameter between the model parameter set of the second neural network model and the model parameter set of the first neural network model, and transmitting the encoded data corresponding to the parameter difference, can save transmission bandwidth.
  • the parameter difference values of the corresponding parameters in the model parameter set of the encoded second neural network model and the model parameter set of the first neural network model include:
  • a third parameter difference is encoded, and the third parameter difference is encoded.
  • the parameter difference value is the parameter difference value of the corresponding parameter in the model parameter set of the second neural network model and the model parameter set of the first neural network model.
  • the neural network model includes a plurality of offline trained neural network models, and the model parameters of the neural network model included in the neural network-based coding technique are determined by means of differential prediction. set for compression encoding, including:
  • the third parameter difference is the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model
  • the fourth parameter difference is the second The parameter difference between the parameters other than the model parameter corresponding to the third parameter difference and the preset value in the model parameter set of the neural network model.
  • the encoding end may, during the encoding process, use the number of model parameters included in the model parameter set of the second neural network model and the first neural network The number of model parameters included in the model parameter set of the model determines the encoded parameter difference.
  • the number of model parameters included in the model parameter set of the second neural network model is less than or equal to the number of model parameters included in the model parameter set of the first neural network model, encode the first parameter difference;
  • the number of model parameters included in the model parameter set of the model is greater than the number of model parameters included in the model parameter set of the first neural network model, and the first parameter difference and the second parameter difference are encoded.
  • the encoding end can encode these 100 models.
  • the parameter difference value of the corresponding parameter in the parameters that is, the parameter difference value of the corresponding parameter among the 100 model parameters included in the model parameter set of the encoded second neural network model and the model parameter set of the first neural network model.
  • the encoding end encodes the model parameter set of the second neural network model
  • the difference between the included 80 model parameters and the corresponding 80 model parameters included in the model parameter set of the first neural network model is sufficient.
  • the encoding end can encode the model parameters of the second neural network model The parameter difference between the set and the corresponding parameters of the 80 model parameters included in the model parameter set of the first neural network model.
  • the encoder can encode these 20 parameters. Parameter difference between model parameters and preset values.
  • the preset value can be 2 a-1 , and the encoding end can encode these 20 model parameters and 2 a-1 when encoding the remaining 20 model parameters. parameter difference.
  • the above-mentioned preset value may also be other values, such as 2 a-2 , etc., which are not limited.
  • the encoded data of the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model is decoded, and the third parameter difference may be obtained, or it may be obtained.
  • the model parameter set of the first neural network model can be encoded, and the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model can be encoded. value.
  • the encoding methods are different. For details, please refer to the following.
  • the encoding of the model parameter set of the first neural network model in the plurality of offline trained neural network models includes:
  • the model parameter set of the first neural network model is encoded by the first encoding method
  • the parameter difference value of the corresponding parameter in the model parameter set of the described coding described second neural network model and the model parameter set of the first neural network model including:
  • the parameter difference values of the corresponding parameters in the model parameter set of the second neural network model and the model parameter set of the first neural network model are encoded in a second encoding manner.
  • the model parameter set of the first neural network model, and the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model can be encoded in different ways. That is: the model parameter set of the first neural network model can be encoded by the first encoding method; the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model can be Encoding by the second encoding.
  • the encoded data of the model parameter set of the first neural network model is decoded by the first decoding method; and the model parameter set of the second neural network model and the model of the first neural network model are decoded by the second decoding method.
  • the decoded data is summed to obtain the model parameter set of the neural network model.
  • the encoder can encode the second The parameter difference between the model parameter set of the neural network model and the parameter corresponding to the model parameter set of the first neural network model, and the parameters and presets in the encoded second model parameter set other than the model parameters corresponding to the third parameter difference The parameter difference of values.
  • the decoding end can decode the parameter difference between the model parameter set of the second neural network model and the parameter corresponding to the model parameter set of the first neural network model by the second decoding method, and decode the parameter set of the second model except the third model parameter set.
  • the parameter difference corresponds to the parameter difference between the parameters other than the model parameters and the preset value.
  • the model parameter set of the first neural network model and the parameter difference of the corresponding parameters in the model parameter set of the second neural network model and the model parameter set of the first neural network model are processed by different coding methods. Coding, or, by different coding methods, the model parameter set of the first neural network model, and, the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model corresponding to the parameters and the second
  • the parameters other than the model parameters corresponding to the third parameter difference in the model parameter set are encoded with the parameter difference of the preset value, which can improve the flexibility of encoding.
  • the first encoding mode is a fixed-length code encoding mode
  • the second encoding mode is a variable-length code encoding mode
  • the encoder can encode it as "1010"; if the model parameter set of the first neural network model The model parameter also includes the value 2, then the encoder can encode it as "0010". In other words, regardless of the magnitude of the value of the model parameter of the model parameter set of the first neural network model, the encoding end encodes it with a bit width of 4 bits.
  • the encoding end encodes the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model. It is assumed that the second neural network model includes three neural network models (eg, the above-mentioned neural network model 2, neural network model 3, and neural network model 4).
  • the encoder can encode it as "10", that is, the parameter difference
  • the bit width occupied by the value 2 is 2 bits; if the parameter difference between the model parameter set of the neural network model 2 and the model parameter set of the first neural network model also includes the value 5, the encoding end can encode it as "101" ”, that is, the bit width occupied by the parameter difference value 5 is 3 bits.
  • the encoding end performs different bit widths according to the size of the value.
  • Encoding that is, the encoding end can encode in a variable-length code encoding method according to the size of the value.
  • the neural network model 3 and the neural network model 4 can be encoded based on the variable-length code encoding method similar to the above-mentioned neural network model 2 .
  • the model parameters in the model parameter set of the first neural network model are encoded in a fixed-length code encoding method
  • the model parameter set of the second neural network model and the first neural network model are encoded in a variable-length code encoding method.
  • the parameter difference value of the corresponding parameter in the model parameter set of is encoded, which can further save the bandwidth.
  • the number of model parameters included in the model parameter set of the first neural network model is the smallest number of model parameters included in the model parameter set of the plurality of offline trained neural network models.
  • Neural network model is the smallest number of model parameters included in the model parameter set of the plurality of offline trained neural network models.
  • the offline training neural network model includes four neural network models, namely, neural network model 1, neural network model 2, neural network model 3, and neural network model 4. If the number of model parameters included in the model parameter set of neural network model 1 is 100, the number of model parameters included in the model parameter set of neural network model 2 is 80, and the number of model parameters included in the model parameter set of neural network model 3 The number is 120, and the number of model parameters included in the model parameter set of the neural network model 4 is 95, so the first neural network model in this application may be the neural network model 2 .
  • the number of model parameters included in the model parameter set of the first neural network model is a neural network model with the smallest number of model parameters included in the model parameter sets of multiple offline trained neural network models, which can further save bandwidth .
  • the first neural network model may also be a neural network model whose number of model parameters included in its model parameter set is the largest number of model parameters included in the model parameter sets of multiple offline-trained neural network models , or, the first neural network model may also be any neural network model among multiple offline-trained neural network models, which is not limited.
  • the first encoded data further includes second indication information, where the second indication information is used to indicate the model of the neural network model used when encoding the p-th target image.
  • the identifier of the parameter, the target image is an image obtained by dividing the image to be encoded according to any one of the video sequence level, the image group level, and the image level, and the p is an integer greater than 0.
  • the first encoded data may further include a model parameter used to indicate the neural network model used when encoding the p-th target image
  • the second indication information of the identifier is convenient for the correct decoding of the decoding end.
  • the target image in this embodiment of the present application may be an image after the image to be encoded is divided according to any one of a video sequence level, a Group of Picture (GOP) level, and a picture level (or frame level).
  • the length of the GOP can be defined independently.
  • the image from the current I frame to the next I frame in the video sequence can be used as a GOP.
  • GOP includes a group of continuous pictures, consisting of one I frame and several B frames and/or P frames, and is the basic unit accessed by video image encoders and decoders.
  • the I frame (also known as the key frame) is the intra-coded image frame, which can be understood as the complete preservation of this frame;
  • the B frame is the bidirectional reference frame or the bidirectional difference frame, which can be understood as the B frame records the current frame and the The difference between the before and after frames, the previous cached image and the decoded image are obtained when decoding, and the final image is obtained by superimposing the data of the previous and previous images and the data of the current frame;
  • P frame is the forward reference frame or forward prediction frame, it can be understood For the difference between this frame and the previous frame, when decoding, it is necessary to superimpose the difference defined in this frame with the previously cached image to generate the final image.
  • the offline training neural network model includes four neural network models, namely, neural network model 1, neural network model 2, neural network model 3, and neural network model 4.
  • the encoder uses neural network model 1 to encode it, and the encoder can transmit the identifier of the model parameters of the neural network model 1 used to encode the first GOP to the decoding.
  • the second indication information indicates the identification of the model parameters of the neural network model 1 used when encoding the first GOP; it is assumed that for the second GOP, the encoding end uses the neural network model 3 to encode it, and the encoding end
  • the identification of the model parameters of the neural network model 3 adopted when the second GOP is encoded can be transmitted to the decoding end, that is, the second indication information indicates the model of the neural network model 3 adopted when the second GOP is encoded.
  • the identifier of the parameter ... and so on.
  • the neural network model can be retrained based on different application scenarios.
  • the encoding end can choose to use the retrained neural network model or the existing basic neural network model for offline training for encoding. Whether to use the syntax element of the retrained neural network model for encoding is written into the first encoded data.
  • the model parameters of the retrained neural network model can be encoded by differential prediction, and the encoded data obtained after encoding is transmitted to the decoding end.
  • the grammatical elements of the retrained neural network model are encoded and written into the first encoded data; when the encoding end selects an existing offline trained basic neural network model for encoding, it is not necessary to encode the retrained neural network model.
  • the model parameters are transmitted to the decoding end, and further, the syntax elements of the retrained neural network model may also be encoded and written into the first encoded data.
  • the decoding end decodes the identifier of whether to use the retrained neural network model from the received first encoded data, that is, uses the model parameter set of the existing offline trained basic neural network model for decoding or uses the transmitted data.
  • the model parameter set of the retrained neural network model is decoded.
  • the second indication information in the implementation of the present application may be transmitted to the decoding end through the first encoded data, so as to facilitate decoding by the decoding end.
  • the encoding end may also not need to transmit the second indication information, and may determine the neural network model to be used according to the quantization parameter.
  • the encoding end is trained to obtain 4 different neural network models for quantization parameters of 27, 32, 37, and 45, respectively, neural network model 1, neural network model 2, neural network model 3, and neural network model 4. .
  • the encoding end can establish the mapping relationship between the quantization parameters and the four neural network models.
  • the neural network model 1 can be used for encoding
  • the neural network model 2 can be used.
  • the neural network model 3 can be used for coding
  • QP>40 the neural network model 4 can be used for coding.
  • mapping relationship is only an exemplary illustration, and the encoding end may also establish different mapping relationships, which are not limited.
  • the encoder can select neural network model 1 to encode it to obtain the first encoded data.
  • the decoding end receives the first encoded data and obtains its quantization parameters by decoding, it can determine the neural network model required for decoding the encoded data according to the mapping relationship between the quantization parameters and the neural network model as neural network model 1, and use the neural network model 1.
  • the neural network model 1 decodes the encoded data corresponding to the first GOP.
  • the encoder can select neural network model 4 to encode it to obtain the first encoded data.
  • the decoding end receives the first encoded data and obtains its quantization parameter by decoding, it can determine that the neural network model required for decoding the encoded data is the neural network model 4 according to the mapping relationship between the quantization parameter and the neural network model, and use the neural network model 4.
  • the neural network model 4 decodes the encoded data corresponding to the second GOP.
  • mapping relationship between the quantization parameter and the neural network model can be preset on the encoding end and the decoding end; or, the mapping relationship between the quantization parameter and the neural network model can also be transmitted to the decoding end during the encoding process, and the The mapping relationship is written into the first encoded data and transmitted to the decoding end along with the first encoded data.
  • the mapping relationship can also be written into the second encoded data and transmitted to the decoding end along with the second encoded data; no limitation .
  • the first encoded data transmitted by the encoding end includes second indication information for indicating the identification of the model parameters of the neural network model used when encoding the p-th target image, which is beneficial to the correctness of the decoding end. decoding.
  • the encoding end and the decoding end can use the neural network-based encoding technology to filter the to-be-encoded image, and the content of the neural network-based encoding technology to filter the to-be-encoded image is described below with reference to FIG. 5 .
  • FIG. 5 it is a schematic diagram of a coding framework 2 provided in an embodiment of the present application.
  • the encoding end may perform filtering 211 on the reconstructed pixel.
  • the reconstructed pixels can be deblocking filter (Deblocking Filter, DF), NNF, sample adaptive offset (Sample adaptive offset, SAO) or adaptive loop filter (Adaptive Loop Fitler, ALF) Any one or more of them, and output the filtered reconstructed image.
  • the image of the first GOP is used as the training set, and the filtering technology based on neural network is performed. model training process.
  • the entire training process can refer to the following process:
  • the current image to be encoded can be sent to the frame shown in Figure 5 for encoding training.
  • the first GOP is inverse quantized and inverse transformed to obtain a reconstructed image.
  • the reconstructed image is subjected to DF, NNF, SAO and ALF.
  • the encoded code stream of all images in the first GOP and the neural network model obtained by training the neural network framework based on all the images in the first GOP are obtained.
  • the neural network model trained by the first GOP is used to perform the filtering technology based on the neural network.
  • the specific filtering process can refer to the following process: when encoding the image in the second GOP, the second GOP is inversely quantized and inversely transformed to obtain a reconstructed image, and then the reconstructed image is sent to the first
  • the filtering module of the neural network model obtained by GOP training obtains the filtered reconstructed image, wherein the filtering module here includes the DF module, the NNF module, the SAO module and the ALF module, and the NNF module includes the first GOP training to obtain the image. neural network model.
  • the neural network model trained by the p-t-th GOP is used to perform the filtering technology based on the neural network.
  • the specific filtering process can refer to the following process: when encoding the image in the p-th GOP, the p-th GOP is inverse-quantized and inverse-transformed to obtain a reconstructed image, and then the reconstructed image is sent to the p-t-th GOP that deploys the reconstructed image.
  • the filtering module of the neural network model obtained by GOP training obtains the filtered reconstructed image.
  • the filtering module here includes the DF module, the NNF module, the SAO module and the ALF module, and the NNF module includes training with the p-t th GOP The resulting neural network model.
  • filtering order shown in FIG. 5 is only an example, and other orders, such as DF, SAO, NNF, and ALF, are also possible, which should not be limited to the present application.
  • the method further includes: dividing the model parameter set of the neural network model to obtain multiple model parameter subsets of the model parameter set of the neural network model;
  • the method of using differential prediction to compress and encode the model parameter set of the neural network model included in the neural network-based encoding technology includes: encoding the model parameter set of the neural network model by using the differential prediction method. Multiple subsets of model parameters.
  • the encoding end may divide the model parameter set of the neural network model into multiple model parameter subsets, and encode the multiple model parameter subsets by means of differential prediction.
  • the encoding end can divide the model parameter set of the neural network model according to the layers, and the parameters generated by each layer in the neural network model structure can be divided into a model parameter subset, and use the differential prediction method to encode multiple model parameter subsets. set.
  • the received second encoded data is decoded to obtain multiple model parameter subsets of the model parameter set of the neural network model.
  • the solution provided by the present application can improve the parallelism of the neural network model parameter prediction coding by dividing the model parameter set of the neural network model and transmitting the multiple model parameter subsets obtained after the division by means of differential prediction.
  • the correlation between the model parameters in multiple model parameter subsets after dividing the model parameter sets of different neural network models is higher, and using the differential prediction method to transmit the multiple model parameter subsets obtained after division can further Save bandwidth.
  • the neural network model includes a plurality of neural network models, and the use of the differential prediction method to encode a plurality of model parameter subsets of the model parameter set of the neural network model, including :
  • the first model parameter subset in the qth neural network model is encoded by using the model parameter subset in the third neural network model;
  • the second subset of model parameters in the qth neural network model is encoded using the subset of model parameters in the fourth neural network model, the third neural network model and the The fourth neural network model is a different model among the plurality of neural network models, and the q is an integer greater than 0.
  • the encoding end has pre-trained four different neural network models, namely, neural network model 1, neural network model 2, neural network model 3, and neural network model 4.
  • the encoder can use the neural network model 1 to encode the first GOP.
  • the encoding end may use the model parameter subsets included in different neural network models to encode it.
  • encoding the model parameter subsets included in different neural network models can be understood as using the model parameter subsets included in different neural network models to encode the model parameter subsets included in the neural network model 1 set to encode.
  • the model parameter set of the neural network model 1 is divided into two model parameter subsets, which are the first model parameter subset and the second model parameter subset, respectively.
  • the model parameter subsets of different neural network models can be used to encode it.
  • the model parameter subset of neural network model 2 is used to encode the first model parameter subset
  • the model parameter subset of neural network model 3 The parameter subset encodes a second subset of model parameters.
  • the encoding end may encode the first GOP based on the neural network model 1, and encode the second GOP based on the neural network model 2.
  • the encoder can use the model parameter set of the neural network model 2 to encode the second GOP.
  • the model parameter subset of the neural network model 2 can be encoded using the model parameter subsets included in different neural network models.
  • the model parameter set of the neural network model 2 is divided into two model parameter subsets, which are the first model parameter subset and the second model parameter subset, respectively.
  • the model parameter subsets of different neural network models can be used to encode it.
  • the model parameter subset of neural network model 3 is used to encode the first model parameter subset
  • the model parameter subset of neural network model 4 The parameter subset encodes a second subset of model parameters.
  • model parameter set of the neural network model may also be divided into multiple model parameter subsets (for example, it is divided into 3 model parameter subsets or 4 model parameter subsets, etc.), when the encoding end encodes these multiple model parameter subsets, it can use the model parameters of different neural network models to encode them respectively.
  • the model parameter set of the neural network model is divided into 3 model parameter subsets
  • the third neural network model can be used to encode 2 of the model parameter subsets
  • the fourth neural network model can be used to encode the other 1.
  • a subset of model parameters can be used for encoding; the third neural network model, the fourth neural network model and the fifth neural network model can also be used (the third neural network model, the fourth neural network model and the fifth neural network model can be multiple The network model in the neural network model) encodes these 3 subsets of model parameters respectively; it is not limited.
  • the decoding end after receiving the second encoded data, decodes it to obtain the residual data of the first model parameter subset and the residual data of the second model parameter subset.
  • the model parameter subset and residual data and the third neural network model parameter subset obtain the first model parameter subset and use the residual data of the second model parameter subset and the model parameter subset in the fourth neural network model to obtain the first model parameter subset.
  • Two subsets of model parameters The first encoded data is then decoded by using the model parameters in the first model parameter subset and the model parameters in the second model parameter subset.
  • the prediction of the parameters of the neural network model can be improved.
  • the degree of parallelism of the encoding is higher, and the first model parameter subset is transmitted by means of differential prediction and a second subset of model parameters can further save bandwidth.
  • the first encoded data is transmitted over a first communication link
  • the second encoded data is transmitted over a second communication link
  • the first encoded data and the second encoded data are transmitted through the first communication link, and the second encoded data is written in the first encoded data in the form of encoding header information.
  • the first encoded data and the second encoded data may be transmitted through different communication links; the first encoded data and the second encoded data may also be transmitted through the same communication link, and the second encoded data is encoded
  • the header information is written into the first encoded data.
  • the first encoded data may further include indication information for indicating the neural network model currently used in the encoded image.
  • the decoding end may determine, according to the indication information in the first encoded data, the neural network model used when decoding the current encoded data.
  • the solution provided by this application if the first coded data and the second coded data are transmitted through different communication links, can well solve the problem of management and transmission of model parameters of the neural network model; Link transmission can alleviate bit consumption; in addition, it can also reduce the challenge of low-latency transmission due to management of model parameters and transmission requirements. If the first encoded data and the second encoded data are transmitted through the same communication link, the risk of errors in the transmission process can be reduced, and the second encoded data is written into the first encoded data, which facilitates the management of model parameters of the neural network model and transmission.
  • the first communication link and the second communication link have different physical characteristics.
  • the physical characteristics in the embodiments of the present application may be determined by specific application requirements, and may include, for example, transmission delay and/or transmission bandwidth. However, it should be understood that the physical properties may also be other properties, which should not be particularly limited to the present application.
  • the transmission delay of the first communication link is lower than that of the second communication link, and/or the transmission bandwidth of the second communication link is higher than that of the second communication link.
  • the first communication link has a lower transmission delay, or, the transmission bandwidth is lower, or, the transmission delay and the transmission bandwidth are both lower; in other words, The transmission delay and/or transmission bandwidth of the second communication link is higher than that of the first communication link.
  • the encoding end may transmit the first encoded data in real time, so that the decoding end can decode it in time. Therefore, it may be considered that the first communication link with lower delay transmits the first encoded data.
  • the model parameters of the neural network model can be transmitted through the second communication link.
  • the model parameters are more complicated, therefore, it can be considered to transmit by using a second communication link with a higher bandwidth.
  • the first coded data is transmitted through the first communication link with low transmission delay
  • the second coded data is transmitted through the second communication link with higher transmission bandwidth, which can well solve the problem of the neural network model.
  • the management and transmission of model parameters can further reduce the challenge of low-latency transmission due to the management and transmission requirements of model parameters of the neural network model.
  • the first communication link includes a link with a delay less than or equal to a second threshold
  • the second communication link includes a link with a bandwidth greater than or equal to a third threshold
  • the second threshold and/or the third threshold in this embodiment of the present application may be specified by a protocol or configured by a server; the second threshold and/or the third threshold may be a fixed value, or a continuously adjusted and changed value; No restrictions.
  • the first communication link includes a link based on a proprietary image transmission protocol or a wireless local area network protocol
  • the second communication link includes a link based on a mobile communication protocol
  • the private image transmission protocol includes a software radio (Software Defination Radio, SDR) protocol
  • the wireless local area network protocol includes a wireless fidelity (Wireless Fidelity, WiFi) protocol
  • the mobile communication protocol Including 4G or 5G protocols.
  • the private image transmission protocol shows the SDR protocol
  • the private image transmission protocol may also include other protocols, such as the Open Network Video Interface Forum (ONVIF) protocol, etc., No restrictions.
  • OVIF Open Network Video Interface Forum
  • the wireless local area network protocol in the embodiment of the present application may also include other protocols, such as Bluetooth (Bluetooth), ZigBee (ZigBee), etc., which are not limited.
  • Bluetooth Bluetooth
  • ZigBee ZigBee
  • the mobile communication protocol in the embodiment of the present application may also include other protocols, such as the future 6G protocol.
  • the first communication link may also be a link based on the SDR protocol
  • the second communication link may be a link based on the WiFi protocol
  • the first communication link includes a private image transmission link
  • the second communication link includes a public network transmission link
  • FIG. 6 it is a schematic diagram of the image transmission transmission of the intelligent coding technology provided by the embodiment of the present application.
  • the acquisition end (which can also be understood as the encoding end) collects the video
  • the first encoded data and the corresponding second encoded data are obtained after compression and encoding by the encoder and the neural network computing platform, and then the first encoded data is transmitted through the wireless image transmission system.
  • the data and the second encoded data are transmitted to the display side.
  • the display end also referred to as the decoding end
  • the above wireless image transmission system may be a wireless video transmission system, and may include a private image transmission link and a public network transmission link for respectively transmitting the first encoded data and the second encoded data.
  • the private image transmission link in the embodiment of the present application may include a link based on the SDR protocol, a link based on the WiFi protocol, or a link based on the ONVIF protocol;
  • the public network transmission link in the embodiment of the present application may include a link based on 4G or 5G or 6G protocol link.
  • the solution provided by the present application transmits the first encoded data through a private image transmission link, and transmits the second encoded data through a public network transmission link, which can well solve the management and transmission problems of model parameters of the neural network model.
  • the first communication link and/or the second communication link is selected from one or more of the following links:
  • the encoding end when the encoding end transmits the first encoded data and the second encoded data, it can also flexibly select from one or more links, thereby improving flexibility.
  • the first encoded data is transmitted through the first communication link
  • the second encoded data is transmitted through the second communication link
  • the first encoded data further Including third indication information
  • the third indication information is used to indicate the identification of the model parameters of the neural network model used when encoding the s-th target image
  • the target image is the image to be encoded according to the video sequence.
  • the image is divided by any one of the level, the picture group level, and the picture level, and the s is an integer greater than 0.
  • the first encoded data may further include a neural network used to indicate the encoding of the s th target image.
  • Third indication information of the identification of the model parameters of the model After receiving the first encoded data, the decoding end can determine the model parameters of the neural network model used for decoding the first encoded data according to the third indication information in the first encoded data, so as to facilitate correct decoding by the decoding end.
  • the method further includes:
  • the method of using differential prediction to compress and encode the model parameter set of the neural network model included in the neural network-based encoding technology includes:
  • the target format is compressed and encoded by means of the differential prediction.
  • decoding the second encoded data in the above step 420 to obtain model parameters in the model parameter set of the neural network model includes: decoding the second encoded data to obtain the target format.
  • Decoding the first encoded data by using the model parameters in the model parameter set of the neural network model in the above step 430 includes: converting the target format; using the model parameters in the converted format to decode the first encoded data Encoded data is decoded.
  • the encoding end may perform format conversion on the model parameters of the neural network model to obtain the target format, and compress and encode the target format by means of differential prediction , and transmit the compressed and encoded target format to the decoding end.
  • the decoding end receives the second encoded data, it decodes it to obtain the target format, and then converts the target format to obtain the model parameters of the corresponding neural network model, and uses the model parameters of the converted format for the first encoding. Encoded data is decoded.
  • the target format includes Neural Network Exchange Format (NNEF) or Open Neural Network Exchange (Open Neural Network Exchange) ONNX format.
  • NEF Neural Network Exchange Format
  • Open Neural Network Exchange Open Neural Network Exchange
  • the NNEF and ONNX formats in the embodiments of this application are two similar open formats used to represent and exchange neural networks between deep learning frameworks and inference engines. At their core, both formats are based on a set of common operations from which networks can be built.
  • NNEF reduces the fragmentation of machine learning deployments by enabling applications on multiple devices and platforms to use a rich combination of neural network training tools and inference engines, with the main goal of being able to export networks from deep learning frameworks and import them into in the hardware vendor's inference engine.
  • ONNX defines a common set of operators - building blocks for machine learning and deep learning models and a common file format to enable artificial intelligence (AI) developers to integrate models with various frameworks, tools, run When used with encoders and decoders.
  • AI artificial intelligence
  • Both formats can store neural network models generated by commonly used deep learning frameworks.
  • the purpose is to realize the interaction and commonality of neural network models between different deep learning frameworks.
  • the training of the neural network model may be performed in the following manner.
  • FIG. 7 it is a schematic flowchart of training a neural network model according to an embodiment of the present application.
  • a neural network model is obtained by compressing and encoding the image to be encoded by the encoder and the neural network computing platform.
  • the model parameters in NNEF or ONNX format are compressed to obtain encoded data after differential prediction.
  • the encoding may be performed based on the process shown in FIG. 8a.
  • FIG. 8a it is a schematic flowchart of applying an intelligent coding technology to a video encoder according to an embodiment of the present application.
  • the encoded data before differential prediction can be obtained through differential prediction decompression, and the encoded data before differential prediction is subjected to format inverse conversion in NNEF or ONNX format to obtain the neural network model. model parameters, and deploy the model parameters of the obtained neural network model on the neural network computing platform.
  • the encoder encodes the image or video, it can be encoded in combination with the neural network computing platform where the model parameters of the neural network model are deployed. , to generate the first encoded data.
  • the coding based on the neural network coding technology can be realized by modifying the traditional encoder.
  • the coding of the intelligent coding-related syntax element can be added to the existing header information syntax parameter set, for example, the sequence parameter set (Sequence Parameter Set, SPS), image parameter set ( Picture Parameter Set (PPS), Slice Header (Slice Header) adds a syntax element to identify the switch that controls the opening or closing of the neural network-based coding technology.
  • This syntax element can be directly added to the above syntax element parameter set, or you can Select to add this syntax element to the User Extension Data of the above syntax element parameter set.
  • decoding can be performed based on the process shown in Figure 8b.
  • FIG. 8b it is a schematic flowchart of applying an intelligent coding technology to a video decoder according to an embodiment of the present application.
  • the encoded data before differential prediction can be obtained through differential prediction decompression, and the encoded data before differential prediction is subjected to format inverse conversion in NNEF or ONNX format to obtain a neural network model. and deploy the obtained model parameters of the neural network model on the neural network computing platform.
  • the decoder decodes the code stream of the image or video to be decoded, it can combine the neural network with the model parameters of the neural network model.
  • the computing platform decodes it to obtain the image or video to be decoded.
  • the first encoded data includes fourth indication information, where the fourth indication information is used to indicate whether encoding using a neural network encoding technique is enabled.
  • the first encoded data may further include fourth indication information, indicating whether the encoding end enables encoding by using the neural network encoding technology during encoding.
  • the decoding end may determine whether to use the decoding technology of the neural network to perform decoding according to the fourth indication information in the first encoded data.
  • the decoding end uses the neural network decoding technology to decode; if the fourth indication information indicates that the neural network encoding technology encoding is not enabled, the decoding end does not Use the decoding technology of neural network to decode.
  • the fourth indication information is added to the first encoded data to indicate whether encoding using the neural network encoding technology is enabled. After receiving the first encoded data, the decoding end will The fourth indication information in determines whether to use the decoding technology of the neural network for decoding, which can further improve the accuracy of decoding.
  • performing compression coding on the model parameter set of the neural network model included in the neural network-based coding technology by means of differential prediction includes:
  • Part or all of the model parameters in the model parameter set of the neural network model are compressed and encoded by means of the differential prediction.
  • the second encoded data is decoded in the above step 430 to obtain model parameters in the model parameter set of the neural network model, including:
  • the encoding end when the encoding end compresses and encodes the model parameter set of the neural network model, it may encode some or all of the model parameters in the model parameter set of the neural network model.
  • the part of the model parameters may include but not limited to the number of layers of the neural network, the number of neurons, and other model parameters (including but not limited to the weight of connections between neurons, etc.) can be preset at the encoding end and the decoding end .
  • the decoding end can obtain some model parameters of the model parameters of the neural network model by decoding the second encoded data, and can decode the first encoded data in combination with other model parameters preset at the decoding end; or, by decoding the second encoded data Decoding can be performed to obtain all model parameters of the model parameter set of the neural network model, and the first encoded data is decoded by using all the model parameters obtained by decoding.
  • the encoding end when the encoding end compresses and encodes the model parameter set of the neural network model, it can encode some model parameters in the model parameter set of the neural network model, and other model parameters are preset on the encoding end and the decoding end, which can save Transmission bandwidth, the decoding end can ensure the accuracy of decoding when decoding the first encoded data; when the encoding end compresses and encodes the model parameter set of the neural network model, it can encode all model parameters in the model parameter set of the neural network model , the decoding end can ensure the accuracy of decoding when decoding the first encoded data.
  • FIG. 9 is an encoding apparatus 900 provided by an embodiment of the present application.
  • the encoding apparatus 900 may include a processor 910 .
  • a processor 910 configured to encode the image to be encoded by using a neural network-based encoding technology to obtain first encoded data
  • the model parameter set of the neural network model included in the neural network-based encoding technology is compressed and encoded by means of differential prediction to obtain second encoded data;
  • the first encoded data and the second encoded data are transmitted.
  • the bit width of the model parameters included in the model parameter set of the neural network model is less than or equal to the first threshold.
  • the neural network model includes an offline trained neural network model or an online trained neural network model.
  • the neural network model includes an online training neural network model
  • the processor 910 is further configured to:
  • n is a positive integer greater than 1
  • m is a positive integer greater than or equal to 1.
  • the processor 910 is further configured to:
  • the first parameter difference is the parameter difference between the model parameter set of the nth neural network model and the parameter set of the mth neural network model corresponding to the parameters.
  • the processor 910 is further configured to:
  • the first parameter difference is the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model
  • the second parameter difference is the The parameter difference between the parameters in the nth model parameter set other than the model parameter corresponding to the first parameter difference and the preset value.
  • the processor 910 is further configured to:
  • the model parameter set of the first neural network model is encoded by the first encoding method
  • the parameter difference between the model parameter set of the n th neural network model and the corresponding parameter in the model parameter set of the m th neural network model is encoded by the second coding manner.
  • the m is a parameter that is fixed or preset at the encoding end before encoding, or the m is determined by the encoding end based on a preset rule.
  • the m is determined by the encoding end based on a preset rule, and the first encoded data further includes first indication information, where the first indication information is used to indicate the m value .
  • the preset rules include:
  • a neural network model parameter set with the smallest number of bits encoding the parameter difference of the model parameter set of the nth neural network model is selected from the plurality of neural network models.
  • the neural network model includes a plurality of offline trained neural network models
  • the processor 910 is further configured to:
  • the processor 910 is further configured to:
  • a third parameter difference is encoded, and the third parameter difference is encoded.
  • the parameter difference value is the parameter difference value of the corresponding parameter in the model parameter set of the second neural network model and the model parameter set of the first neural network model.
  • the processor 910 is further configured to:
  • the neural network model includes a plurality of offline training neural network models, and the processor is further configured to:
  • the third parameter difference is the parameter difference between the model parameter set of the second neural network model and the corresponding parameter in the model parameter set of the first neural network model
  • the fourth parameter difference is the second The parameter difference between the parameters other than the model parameter corresponding to the third parameter difference and the preset value in the model parameter set of the neural network model.
  • the processor 910 is further configured to:
  • the model parameter set of the first neural network model is encoded by the first encoding method
  • the parameter difference values of the corresponding parameters in the model parameter set of the second neural network model and the model parameter set of the first neural network model are encoded in a second encoding manner.
  • the number of model parameters included in the model parameter set of the first neural network model is the smallest number of model parameters included in the model parameter set of the plurality of offline trained neural network models. neural network model.
  • the first encoded data further includes second indication information, where the second indication information is used to indicate the model of the neural network model used when encoding the p-th target image.
  • the identifier of the parameter, the target image is an image obtained by dividing the image to be encoded according to any one of the video sequence level, the image group level, and the image level, and the p is an integer greater than 0.
  • the first encoding mode is a fixed-length code encoding mode
  • the second encoding mode is a variable-length code encoding mode
  • the processor 910 is further configured to:
  • a plurality of model parameter subsets of the model parameter set of the neural network model are encoded by means of the differential prediction.
  • the neural network model includes multiple neural network models
  • the processor 910 is further configured to:
  • the first model parameter subset in the qth neural network model is encoded by using the model parameter subset in the third neural network model;
  • the second subset of model parameters in the qth neural network model is encoded using the subset of model parameters in the fourth neural network model, the third neural network model and the The fourth neural network model is a different model among the plurality of neural network models, and the q is an integer greater than 0.
  • the first encoded data is transmitted over a first communication link
  • the second encoded data is transmitted over a second communication link
  • the first encoded data and the second encoded data are transmitted through the first communication link, and the second encoded data is written in the first encoded data in the form of encoding header information.
  • the first encoded data is transmitted through the first communication link
  • the second encoded data is transmitted through the second communication link
  • the first encoded data further Including third indication information
  • the third indication information is used to indicate the identification of the model parameters of the neural network model used when encoding the s-th target image
  • the target image is the image to be encoded according to the video sequence.
  • the image is divided by any one of the level, the picture group level, and the picture level, and the s is an integer greater than 0.
  • the processor 910 is further configured to:
  • the target format is compressed and encoded by means of the differential prediction.
  • the target format includes a neural network transformation format NNEF or an open neural network transformation ONNX format.
  • the processor 910 is further configured to:
  • At least one of prediction, transformation, quantization, entropy encoding or filtering is performed on the to-be-encoded image using the neural network-based encoding technology.
  • the first encoded data includes fourth indication information, where the fourth indication information is used to indicate whether encoding using a neural network encoding technique is enabled.
  • the processor 910 is further configured to:
  • Part or all of the model parameters in the model parameter set of the neural network model are compressed and encoded by means of the differential prediction.
  • FIG. 10 is a decoding apparatus 1000 provided by an embodiment of the present application.
  • the decoding apparatus 1000 may include a processor 1010 .
  • a processor 1010 configured to receive the first encoded data and the second encoded data
  • the first encoded data is decoded by using the model parameters in the model parameter set of the neural network model to obtain a decoded image.
  • the bit width of the model parameters included in the model parameter set of the neural network model is less than or equal to the first threshold.
  • the neural network model includes an offline trained neural network model or an online trained neural network model.
  • the neural network model includes an online training neural network model
  • the processor 1010 is further configured to:
  • the model parameters of the model parameter set of the nth neural network model are obtained by using the parameter difference and the model parameters in the model parameter set of the mth neural network model.
  • the processor 1010 is further configured to:
  • the first parameter Decoding the encoded data of the parameter difference between the model parameter set of the n-th neural network model and the model parameter set of the m-th neural network model and the parameter difference value of the corresponding parameter to obtain a first parameter difference value, the first parameter The difference is the parameter difference between the model parameter set of the nth neural network model and the corresponding parameter in the model parameter set of the mth neural network model.
  • the neural network model includes an online training neural network model
  • the processor 1010 is further configured to:
  • the first parameter difference is the parameter difference between the model parameter set of the nth neural network model and the model parameter set of the mth neural network model
  • the second parameter difference is the The parameter difference between the model parameter set of the n neural network models or the model parameter set of the mth neural network model except the model parameter corresponding to the first parameter difference and the preset value
  • the processor 1010 is further configured to:
  • the encoded data of the parameter difference between the model parameter set of the n-th neural network model and the model parameter set of the m-th neural network model is decoded by using the second decoding method.
  • the m is a parameter fixed or preset at the decoding end, or the m is determined based on a preset rule.
  • the m is determined based on a preset rule, and the first encoded data further includes first indication information, where the first indication information is used to indicate the m value.
  • the neural network model includes a plurality of offline trained neural network models
  • the processor 1010 is further configured to:
  • the model parameter set of the second neural network model is obtained by using the parameter difference and the model parameters in the model parameter set of the first neural network model.
  • the processor 1010 is further configured to:
  • the third parameter difference value is the parameter difference of the corresponding parameter between the model parameter set of the second neural network model and the model parameter set of the first neural network model.
  • the neural network model includes a plurality of offline trained neural network models
  • the processor 1010 is further configured to:
  • the third parameter difference value is the parameter difference value of the corresponding parameter between the model parameter set of the second neural network model and the model parameter set of the first neural network model
  • the fourth parameter difference value is the second neural network model parameter difference value.
  • the processor 1010 is further configured to:
  • the encoded data of the parameter difference between the model parameter set of the second neural network model and the model parameter set of the first neural network model of the corresponding parameter is decoded by the second decoding method.
  • the number of model parameters included in the model parameter set of the first neural network model is the smallest number of model parameters included in the model parameter set of the plurality of offline trained neural network models.
  • Neural network model is the smallest number of model parameters included in the model parameter set of the plurality of offline trained neural network models.
  • the first encoded data further includes second indication information, where the second indication information is used to indicate the model of the neural network model used when encoding the p-th target image.
  • the identifier of the parameter, the target image is an image obtained by dividing the to-be-encoded image according to any one of the video sequence level, the picture group level, and the picture level, and the p is an integer greater than or equal to 0.
  • the first decoding mode is a fixed-length code decoding mode
  • the second decoding mode is a variable-length code decoding mode
  • the processor 1010 is further configured to:
  • the neural network model includes multiple neural network models
  • the processor 1010 is further configured to:
  • Decoding the second encoded data obtaining a first model parameter subset and a second model parameter subset, and obtaining residual data of the first model parameter subset and residual data of the second model parameter subset;
  • the second subset of model parameters is obtained using the residual data of the second subset of model parameters and the subset of model parameters in the fourth neural network model model, the third neural network model and the fourth neural network
  • the model is a different model in the plurality of neural network models
  • the first encoded data is decoded using model parameters in the first subset of model parameters and model parameters in the second subset of model parameters.
  • the first encoded data is transmitted over a first communication link
  • the second encoded data is transmitted over a second communication link
  • the first encoded data and the second encoded data are transmitted through the first communication link, and the second encoded data is written into the first encoded data in the form of encoded header information.
  • the first encoded data is transmitted through the first communication link
  • the second encoded data is transmitted through the second communication link
  • the first encoded data further Including third indication information
  • the third indication information is used to indicate the identification of the model parameters of the neural network model used when encoding the s-th target image
  • the target image is the image to be encoded according to the video sequence.
  • the image is divided by any one of the level, the picture group level, and the picture level, and the s is an integer greater than 0.
  • the processor 1010 is further configured to:
  • the first encoded data is decoded using the model parameters in the converted format.
  • the target format includes a neural network transformation format NNEF or an open neural network transformation ONNX format.
  • the processor 1010 is further configured to:
  • At least one of entropy decoding, inverse quantization, inverse transformation, predictive reconstruction, or filtering is performed on the first encoded data using the model parameters in the model parameter set of the neural network.
  • the first encoded data includes fourth indication information, where the fourth indication information is used to indicate whether encoding using a neural network encoding technique is enabled.
  • the processor 1010 is further configured to:
  • FIG. 11 is a schematic structural diagram of an encoding apparatus provided by still another embodiment of the present application.
  • the encoding apparatus 1100 shown in FIG. 11 includes a processor 1110, and the processor 1110 can call and run a computer program from a memory to implement the encoding method described in the embodiments of the present application.
  • the encoding apparatus 1100 may further include a memory 1120 .
  • the processor 1110 may call and run a computer program from the memory 1120 to implement the encoding method in the embodiments of the present application.
  • the memory 1120 may be a separate device independent of the processor 1110, or may be integrated in the processor 1110.
  • the encoding device 1100 may further include a transceiver 1130, and the processor 1110 may control the transceiver 1130 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by the device.
  • the processor 1110 may control the transceiver 1130 to communicate with other devices, specifically, may send information or data to other devices, or receive other devices Information or data sent by the device.
  • the encoding device can be, for example, an encoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the encoding device can implement the corresponding processes in the encoding methods of the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
  • FIG. 12 is a schematic structural diagram of a decoding apparatus provided by still another embodiment of the present application.
  • the decoding apparatus 1200 shown in FIG. 12 includes a processor 1210, and the processor 1210 can call and run a computer program from a memory to implement the decoding method described in the embodiments of the present application.
  • the decoding apparatus 1200 may further include a memory 1220 .
  • the processor 1210 may call and run a computer program from the memory 1220 to implement the decoding method in the embodiment of the present application.
  • the memory 1220 may be a separate device independent of the processor 1210, or may be integrated in the processor 1210.
  • the decoding apparatus 1200 may further include a transceiver 1230, and the processor 1210 may control the transceiver 1230 to communicate with other apparatuses, specifically, may send information or data to other apparatuses, or receive other apparatuses Information or data sent by the device.
  • the processor 1210 may control the transceiver 1230 to communicate with other apparatuses, specifically, may send information or data to other apparatuses, or receive other apparatuses Information or data sent by the device.
  • the decoding device can be, for example, a decoder, a terminal (including but not limited to a mobile phone, a camera, an unmanned aerial vehicle, etc.), and the decoding device can implement the corresponding processes in the decoding methods in the embodiments of the present application, for the sake of brevity. , and will not be repeated here.
  • FIG. 13 is a schematic structural diagram of a chip according to an embodiment of the present application.
  • the chip 1300 shown in FIG. 13 includes a processor 1310, and the processor 1310 can call and run a computer program from a memory to implement the encoding method or the decoding method in the embodiments of the present application.
  • the chip 1300 may further include a memory 1320 .
  • the processor 1310 may call and run a computer program from the memory 1320 to implement the encoding method or the decoding method in the embodiments of the present application.
  • the memory 1320 may be a separate device independent of the processor 1310, or may be integrated in the processor 1310.
  • the chip 1300 may further include an input interface 1330 .
  • the processor 1310 can control the input interface 1330 to communicate with other devices or chips, and specifically, can obtain information or data sent by other devices or chips.
  • the chip 1300 may further include an output interface 1340 .
  • the processor 1310 can control the output interface 1340 to communicate with other devices or chips, and specifically, can output information or data to other devices or chips.
  • the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-chip, or a system-on-a-chip, or the like.
  • the processor in this embodiment of the present application may be an integrated circuit image processing system, which has signal processing capability.
  • each step of the above method embodiments may be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the above-mentioned processor can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), an off-the-shelf programmable gate array (Field Programmable Gate Array, FPGA) or other available Programming logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • DSP Digital Signal Processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor reads the information in the memory, and completes the steps of the above method in combination with its hardware.
  • the memory in this embodiment of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory may be a read-only memory (Read-Only Memory, ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically programmable read-only memory (Erasable PROM, EPROM). Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be Random Access Memory (RAM), which acts as an external cache.
  • RAM Static RAM
  • DRAM Dynamic RAM
  • SDRAM Synchronous DRAM
  • SDRAM double data rate synchronous dynamic random access memory
  • Double Data Rate SDRAM DDR SDRAM
  • enhanced SDRAM ESDRAM
  • synchronous link dynamic random access memory Synchlink DRAM, SLDRAM
  • Direct Rambus RAM Direct Rambus RAM
  • the memory in the embodiments of the present application may provide instructions and data to the processor.
  • a portion of the memory may also include non-volatile random access memory.
  • the memory may also store device type information.
  • the processor may be configured to execute the instruction stored in the memory, and when the processor executes the instruction, the processor may execute each step corresponding to the terminal device in the foregoing method embodiments.
  • each step of the above-mentioned method can be completed by a hardware integrated logic circuit in a processor or an instruction in the form of software.
  • the steps of the methods disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware processor, or executed by a combination of hardware and software modules in the processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory, and the processor executes the instructions in the memory, and completes the steps of the above method in combination with its hardware. To avoid repetition, detailed description is omitted here.
  • the pixels in the image may be located in different rows and/or columns, wherein the length of A may correspond to the number of pixels located in the same row included in A, and the height of A may be Corresponds to the number of pixels in the same column included in A.
  • the length and height of A may also be referred to as the width and depth of A, respectively, which are not limited in this embodiment of the present application.
  • distributed at the boundary of A may refer to at least one pixel point away from the boundary of A, and may also be referred to as "not adjacent to the boundary of A” or “not located at the boundary of A”.
  • Embodiments of the present application further provide a computer-readable storage medium for storing a computer program.
  • the computer-readable storage medium can be applied to the encoding device or the decoding device in the embodiments of the present application, and the computer program enables the computer to execute the corresponding processes implemented by the encoding device or the decoding device in each method of the embodiments of the present application. , and are not repeated here for brevity.
  • Embodiments of the present application also provide a computer program product, including computer program instructions.
  • the computer program product can be applied to the encoding device or the decoding device in the embodiments of the present application, and the computer program instructions cause the computer to execute the corresponding processes implemented by the encoding device or the decoding device in each method of the embodiments of the present application, For brevity, details are not repeated here.
  • the embodiments of the present application also provide a computer program.
  • the computer program can be applied to the encoding device or the decoding device in the embodiments of the present application.
  • the encoding device or the decoding device implements each method in the computer to perform the embodiments of the present application. The corresponding process, for the sake of brevity, will not be repeated here.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may also be electrical, mechanical or other forms of connection.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solutions of the embodiments of the present application.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as an independent product, may be stored in a computer-readable storage medium.
  • the technical solutions of the present application are essentially or part of contributions to the prior art, or all or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in a storage medium , including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a ROM, a RAM, a magnetic disk, or an optical disk and other mediums that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

本申请提供一种编码方法、解码方法和编码装置、解码装置,包括:利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;传输所述第一编码数据和所述第二编码数据。本申请提供的方案,可以节省传输带宽。

Description

编码方法、解码方法和编码装置、解码装置
版权申明
本专利文件披露的内容包含受版权保护的材料。该版权为版权所有人所有。版权所有人不反对任何人复制专利与商标局的官方记录和档案中所存在的该专利文件或者该专利披露。
技术领域
本申请涉及图像处理领域,并且更为具体地,涉及一种编码方法、解码方法和编码装置、解码装置。
背景技术
目前,对于基于神经网络的编码技术包含的神经网络模型的模型参数的管理和传输,一种方式是将神经网络模型的模型参数固定于编码器和解码器都可得的一个公共库文件中,编码器和解码器在进行编码或解码时可以从该公共库文件中获取神经网络模型的模型参数,但是这种方式一旦编码器的某些编码工具发生变化,其效果会降低。
另一种方式是将神经网络模型的模型参数通过码流传送到解码端,这样可以根据编码器的需求对模型参数进行灵活的调整,但是对于层度教深的深度学习神经网络模型来说参数量一般比较大,如果直接写入到码流中进行传输增加了传输带宽。
发明内容
本申请提供一种编码方法、解码方法和编码装置、解码装置,可以节省传输带宽。
第一方面,提供一种编码方法,包括:利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;传输所述第一编码数据和所述第二编码数据。
第二方面,提供一种解码方法,包括:接收第一编码数据和第二编码数据;对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数;利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
第三方面,提供一种编码装置,包括:处理器,用于利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;传输所述第一编码数据和所述第二编码数据。
第四方面,提供一种解码装置,包括:处理器,用于接收第一编码数据和第二编码数据;对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数;利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
第五方面,提供了一种编码装置,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,执行上述第一方面或其各实现方式中的方法。
第六方面,提供一种解码装置,包括处理器和存储器。该存储器用于存储计算机程序,该处理器用于调用并运行该存储器中存储的计算机程序,执行上述第二方面或其各实现方式中的方法。
第七方面,提供一种芯片,用于实现上述第一方面或其各实现方式中的方法。
具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第一方面或其各实现方式中的方法。
第八方面,提供一种芯片,用于实现上述第二方面或其各实现方式中的方法。
具体地,该芯片包括:处理器,用于从存储器中调用并运行计算机程序,使得安装有该芯片的设备执行如上述第二方面或其各实现方式中的方法。
第九方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于执行第一方面或第一方面的任意可能的实现方式中的方法的指令。
第十方面,提供了一种计算机可读存储介质,用于存储计算机程序,该计算机程序包括用于执行第二方面或第二方面的任意可能的实现方式中的方法的指令。
第十一方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第一方面或第一方面的各实现方式中的方法。
第十二方面,提供了一种计算机程序产品,包括计算机程序指令,该计算机程序指令使得计算机执行上述第二方面或第二方面的各实现方式中的方法。
本申请提供的方案,编码端通过差分预测的方式对神经网络模型的模型参数集进行压缩编码,并传输压缩编码后获得的第二编码数据,可以节省传输带宽。
附图说明
图1是应用本申请实施例的技术方案的架构图;
图2是根据本申请实施例的视频编码框架2示意图;
图3是本申请一实施例提供的编码方法的示意性流程图;
图4是本申请一实施例提供的解码方法的示意性流程图;
图5是本申请实施例提供的一种编码框架2的示意图;
图6是本申请实施例提供的智能编码技术的图传传输的示意图;
图7是本申请实施例提供的一种训练神经网络模型的流程示意图;
图8a是本申请实施例提供的一种视频编码器应用智能编码技术的流程示意图;
图8b是本申请实施例提供的一种视频解码器应用智能编码技术的流程示意图;
图9是本申请一实施例提供的编码装置的示意性图;
图10是本申请一实施例提供的解码装置的示意性图;
图11是本申请另一实施例提供的编码装置的示意性图;
图12是本申请另一实施例提供的解码装置的示意性图;
图13是本申请实施例提供的芯片的示意性结构图。
具体实施方式
下面对本申请实施例中的技术方案进行描述。
除非另有说明,本申请实施例所使用的所有技术和科学术语与本申请的技术领域的技术人员通常理解的含义相同。本申请中所使用的术语只是为了描述具体的实施例的目 的,不是旨在限制本申请的范围。
图1是应用本申请实施例的技术方案的架构图。
如图1所示,系统100可以接收待处理数据102,对待处理数据102进行处理,产生处理后的数据108。例如,系统100可以接收待编码数据,对待编码数据进行编码以产生编码后的数据,或者,系统100可以接收待解码数据,对待解码数据进行解码以产生解码后的数据。在一些实施例中,系统100中的部件可以由一个或多个处理器实现,该处理器可以是计算设备中的处理器,也可以是移动设备(例如无人机)中的处理器。该处理器可以为任意种类的处理器,本发明实施例对此不做限定。在一些可能的设计中,该处理器可以包括编码器、解码器或编解码器等。系统100中还可以包括一个或多个存储器。该存储器可用于存储指令和数据,例如,实现本发明实施例的技术方案的计算机可执行指令、待处理数据102、处理后的数据108等。该存储器可以为任意种类的存储器,本发明实施例对此也不做限定。
待编码数据可以包括文本、图像、图形对象、动画序列、音频、视频、或者任何需要编码的其他数据。在一些情况下,待编码数据可以包括来自传感器的传感数据,该传感器可以为视觉传感器(例如,相机、红外传感器),麦克风、近场传感器(例如,超声波传感器、雷达)、位置传感器、温度传感器、触摸传感器等。在一些情况下,待编码数据可以包括来自用户的信息,例如,生物信息,该生物信息可以包括面部特征、指纹扫描、视网膜扫描、嗓音记录、DNA采样等。
图2是根据本申请实施例的视频编码框架2示意图。如图2所示,在接收待编码视频后,从待编码视频的第一帧开始,依次对待编码视频中的每一帧进行编码。其中,当前编码帧主要经过:预测(Prediction)、变换(Transform)、量化(Quantization)和熵编码(Entropy Coding)等处理,最终输出当前编码帧的码流。对应的,解码过程通常是按照上述过程的逆过程对接收到的码流进行解码,以恢复出解码前的视频帧信息。
具体地,如图2所示,所述视频编码框架2中包括一个编码控制模块201,用于进行编码过程中的决策控制动作,以及参数的选择。例如,如图2所示,编码控制模块201控制变换、量化、反量化、反变换的中用到的参数,控制进行帧内模式或者帧间模式的选择,以及运动估计和滤波的参数控制,且编码控制模块201的控制参数也将输入至熵编码模块中,进行编码形成编码码流中的一部分。
对当前编码帧开始编码时,对编码帧进行划分202处理,具体地,首先对其进行条带(slice)划分,再进行块划分。可选地,在一个示例中,编码帧划分为多个互不重叠的最大的编码树单元(Coding Tree Unit,CTU),各CTU还可以分别按四叉树、或二叉树、或三叉树的方式迭代划分为一系列更小的编码单元(Coding Unit,CU),一些示例中,CU还可以包含与之相关联的预测单元(Prediction Unit,PU)和变换单元(Transform Unit,TU),其中PU为预测的基本单元,TU为变换和量化的基本单元。一些示例中,PU和TU分别是在CU的基础上划分成一个或多个块得到的,其中一个PU包含多个预测块(Prediction Block,PB)以及相关语法元素。一些示例中,PU和TU可以是相同的,或者,是由CU通过不同的划分方法得到的。一些示例中,CU、PU和TU中的至少两种是相同的,例如,不区分CU、PU和TU,全部是以CU为单位进行预测、量化和变换。为方便描述,下文中将CTU、CU或者其它形成的数据单元均称为编码块。
应理解,在本申请实施例中,视频编码针对的数据单元可以为帧,条带,编码树单 元,编码单元,编码块或以上任一种的组。在不同的实施例中,数据单元的大小可以变化。
具体地,如图2所示,编码帧划分为多个编码块后,进行预测过程,用于去除当前编码帧的空域和时域冗余信息。当前比较常用的预测编码方法包括帧内预测和帧间预测两种方法。帧内预测仅利用本帧图像中己重建的信息对当前编码块进行预测,而帧间预测会利用到之前已经重建过的其它帧图像(也被称作参考帧)中的信息对当前编码块进行预测。具体地,在本申请实施例中,编码控制模块201用于决策选择帧内预测或者帧间预测。
当选择帧内预测模式时,帧内预测203的过程包括获取当前编码块周围已编码相邻块的重建块作为参考块,基于该参考块的像素值,采用预测模式方法计算预测值生成预测块,将当前编码块与预测块的相应像素值相减得到当前编码块的残差,当前编码块的残差经过变换204、量化205以及熵编码210后形成当前编码块的码流。进一步的,当前编码帧的全部编码块经过上述编码过程后,形成编码帧的编码码流中的一部分。此外,帧内预测203中产生的控制和参考数据也经过熵编码210编码,形成编码码流中的一部分。
具体地,变换204用于去除图像块的残差的相关性,以便提高编码效率。对于当前编码块残差数据的变换通常采用二维离散余弦变换(Discrete Cosine Transform,DCT)变换和二维离散正弦变换(Discrete Sine Transform,DST)变换,例如在编码端将编码块的残差信息分别与一个N×M的变换矩阵及其转置矩阵相乘,相乘之后得到当前编码块的变换系数。
在产生变换系数之后用量化205进一步提高压缩效率,变换系数经量化可以得到量化后的系数,然后将量化后的系数进行熵编码210得到当前编码块的残差码流,其中,熵编码方法包括但不限于内容自适应二进制算术编码(Context Adaptive Binary Arithmetic Coding,CABAC)熵编码。最后将熵编码得到的比特流及进行编码后的编码模式信息进行存储或发送到解码端。在编码端,还会对量化的结果进行反量化206,对反量化结果进行反变换207。在反变换207之后,利用反变换结果以及运动补偿结果,得到重建像素。之后,对重建像素进行滤波(即环路滤波)211。在211之后,输出滤波后的重建图像(属于重建视频帧)。后续,重建图像可以作为其他帧图像的参考帧图像进行帧间预测。本申请实施例中,重建图像又可称为重建后的图像或重构图像。
具体地,帧内预测203过程中的已编码相邻块为:当前编码块编码之前,已进行编码的相邻块,该相邻块的编码过程中产生的残差经过变换204、量化205、反量化206、和反变换207后,与该相邻块的预测块相加得到的重建块。对应的,反量化206和反变换207为量化206和变换204的逆过程,用于恢复量化和变换前的残差数据。
如图2所示,当选择帧间预测模式时,帧间预测过程包括运动估计(Motion Estimation,ME)208和运动补偿(Motion Compensation,MC)209。具体地,编码端可以根据重建视频帧中的参考帧图像进行运动估计208,在一张或多张参考帧图像中根据一定的匹配准则搜索到与当前编码块最相似的图像块作为预测块,该预测块与当前编码块的相对位移即为当前编码块的运动矢量(Motion Vector,MV)。并将该编码块像素的原始值与对应的预测块像素值相减得到编码块的残差。当前编码块的残差经过变换204、量化205以及熵编码210后形成编码帧的编码码流中的一部分。对于解码端来说,可以基 于上述确定的运动矢量和预测块进行运动补偿209,获得当前编码块。
其中,如图2所示,重建视频帧为经过滤波211之后得到视频帧。重建视频帧包括一个或多个重建后的图像。滤波211用于减少编码过程中产生的块效应和振铃效应等压缩失真,重建视频帧在编码过程中用于为帧间预测提供参考帧,在解码过程中,重建视频帧经过后处理后输出为最终的解码视频。
具体地,帧间预测模式可以包括高级运动矢量预测(Advanced Motion Vector Prediction,AMVP)模式、合并(Merge)模式或跳过(skip)模式。
对于AMVP模式而言,可以先确定运动矢量预测(Motion Vector Prediction,MVP),在得到MVP之后,可以根据MVP确定运动估计的起始点,在起始点附近,进行运动搜索,搜索完毕之后得到最优的MV,由MV确定参考块在参考图像中的位置,参考块减去当前块得到残差块,MV减去MVP得到运动矢量差值(Motion Vector Difference,MVD),并将该MVD和MVP的索引通过码流传输给解码端。
对于Merge模式而言,可以先确定MVP,并直接将MVP确定为当前块的MV。其中,为了得到MVP,可以先构建一个MVP候选列表(merge candidate list),在MVP候选列表中,可以包括至少一个候选MVP,每个候选MVP可以对应有一个索引,编码端在从MVP候选列表中选择MVP之后,可以将该MVP索引写入到码流中,则解码端可以按照该索引从MVP候选列表中找到该索引对应的MVP,以实现对图像块的解码。
应理解,以上过程只是Merge模式的一种具体实现方式。Merge模式还可以具有其他的实现方式。
例如,Skip模式是Merge模式的一种特例。按照Merge模式得到MV之后,如果编码端确定当前块和参考块基本一样,那么不需要传输残差数据,只需要传递MVP的索引,以及进一步地可以传递一个标志,该标志可以表明当前块可以直接从参考块得到。
也就是说,Merge模式特点为:MV=MVP(MVD=0);而Skip模式还多一个特点,即:重构值rec=预测值pred(残差值resi=0)。
对于解码端,则进行与编码端相对应的操作。首先利用熵解码以及反量化和反变换得到残差信息,并根据解码码流确定当前图像块使用帧内预测还是帧间预测。如果是帧内预测,则利用当前帧中已重建图像块按照帧内预测方法构建预测信息;如果是帧间预测,则需要解析出运动信息,并使用所解析出的运动信息在已重建的图像中确定参考块,得到预测信息;接下来,再将预测信息与残差信息进行叠加,并经过滤波操作便可以得到重建信息。
本申请主要涉及基于神经网络的编解码技术对图像或视频进行编解码(也可以称为“智能编解码技术”),因此,下文先对神经网络的相关内容进行简单介绍。
神经网络(Neural Network,NN),也称为“人工”神经网络(Artificial Neural Network,ANN),具有与生物神经网络共同的某些性能特征的信息处理系统。神经网络系统由许多简单且高度互连的处理组件组成,通过对外部输入的动态状态响应来处理信息。处理组件可以被认为是人脑中的神经元,其中每个感知器接受多个输入并计算输入的加权和。在神经网络领域,感知器被认为是生物神经元的数学模型。此外,这些互连的处理组件通常以层的形式组织。对于识别应用,外部输入可以对应于呈现给网络的模式,该模式与一个或多个中间层通信,也称为“隐藏层”,其中实际处理是通过加权“连接”系统完成的。
ANN可以使用不同的架构来指定网络中涉及哪些变量及其拓扑关系。例如,神经网络中涉及的变量可能是神经元之间连接的权重,以及神经元的活动。大多数人工神经网络都包含某种形式的“学习规则”,它根据所呈现的输入模式修改连接的权重。从某种意义上说,人工神经网络就像他们的生物学对像一样通过实例来学习。
深度神经网络(Deep Neural Network,DNN)或深度多层神经网络对应于具有多级互连节点的神经网络,其允许它们紧凑地表示高度非线性和高度变化的函数。然而,DNN的计算复杂度随着与大量层相关联的节点数量的增加而迅速增长。
目前,对于基于神经网络的编码技术包含的神经网络模型的模型参数的管理和传输,一种方式是将神经网络模型的模型参数固定于编码器和解码器都可得的一个公共库文件中,编码器和解码器在进行编码或解码时可以从该公共库文件中获取神经网络模型的模型参数,但是这种方式一旦编码器的某些编码工具发生变化,其效果会降低。
另一种方式是将神经网络模型的模型参数通过码流传送到解码端,这样可以根据编码器的需求对模型参数进行灵活的调整,但是对于层度教深的深度学习神经网络模型来说参数量一般比较大,如果直接写入到码流中进行传输增加了传输带宽。
本申请提供一种编码方法、解码方法和编码装置、解码装置,可以节省传输带宽。
下面将结合图3详细描述本申请实施例提供的编码方法300。
如图3所示为本申请一实施例提供的编码方法300的示意图,该方法300可以包括步骤310-330。
310,利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据。
本申请实施例中,利用基于神经网络的编码技术(也可以称为“智能编码技术”)对待编码图像进行编码可以理解为:利用基于神经网络模型的编码模块替换或补充编解码框架中的部分编码模块对待编码图像进行编码,或者,利用基于神经网络模型的编码框架替换原始的编码框架对待编码图像进行编码。
基于神经网络的编码技术主要包括三个方面:混合式神经网络视频编码(即将神经网络的编码模块代替传统编码模块嵌入到传统的视频编码框架中)、神经网络率失真优化编码以及端到端的神经网络视频编码。
可选地,在一些实施例中,对于编码过程中的预测、变换、量化、熵编码、滤波中的至少一种,可以利用基于神经网络模型的编码模块替换编码框架中的部分编码模块对待编码图像进行编码。
需要特别说明的是,对于编码过程中的滤波,也可以在现有的滤波模块中增加一个基于神经网络模型的滤波模块对重建图像进行滤波。
示例性地,对于编码过程中的帧内预测,采用基于神经网络的帧内预测方法与原有的帧内预测方法进行比较决策出最优的帧内预测方法进行预测;对于编码过程中的帧间预测,可以采用基于神经网络的图像超分辨率技术进行预测,可以提升运动估计性能,进而提高帧间预测的效率。
对于编码过程中的熵编码,可以采用基于神经网络技术的上下文概率估计方法替换传统的基于规则的上下文概率预测模型,应用于系数编码或者其它一些语法元素的熵编码过程中。对于编码过程中的滤波,可以在去方块滤波之后,增加基于神经网络的滤波(Neural Network Filter,NNF)技术。
端到端的神经网络视频编码则是完全抛开传统的混合视频编码框架的方式,直接输 入视频图像以及相关信息,采用基于神经网络的预测方式进行预测和压缩编码。
320,利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据。
330,传输所述第一编码数据和所述第二编码数据。
可选地,本申请实施例中的神经网络模型可以包括离线训练的神经网络模型或在线训练的神经网络模型,不予限制。
本申请实施例中的神经网络模型可以包括DNN、卷积神经网络(Convolutional Neural Network,CNN)、递归神经网络(Recurrent Neural Network,RNN)或其他神经网络变体等,本申请对此不作具体限制。
本申请实施例中的神经网络模型的模型参数包括但不限于神经网络的层数、神经元的个数、神经元之间连接的权重等。
相应地,对于解码端,可以基于接收到的神经网络模型的模型参数对码流进行解码。如图4所示为本申请一实施例提供的解码方法400的示意图,该方法400可以包括步骤410-430。
410,接收第一编码数据和第二编码数据。
420,对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数。
430,利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
可选地,在一些实施例中,对于解码过程中的熵解码、反量化、反变换、预测重建或滤波中的至少一种,可以利用基于神经网络模型的解码模块替换解码框架中的部分解码模块对待解码图像进行解码。
需要特别说明的是,对于解码过程中的滤波,也可以在现有的滤波模块中增加一个基于神经网络模型的滤波模块对预测重建图像进行滤波。
本申请提供的方案,编码端通过差分预测的方式对神经网络模型的模型参数集进行压缩编码,并传输压缩编码后获得的第二编码数据,可以节省传输带宽。
可选地,在一些实施例中,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
本申请实施例中的模型参数的位宽可以理解为该模型参数转换为二进制格式后所占用的比特。
示例性地,假设神经网络模型的模型参数集中的模型参数包括数值10,编码端可以将其编码为“1010”,则该数值转换为二进制格式后所占用的比特为4比特,即该数值的位宽为4比特;假设神经网络模型的模型参数集中的模型参数包括数值5,编码端可以将其编码为“101”,则该数值转换为二进制格式后所占用的比特为3比特,即该数值的位宽为3比特。
若第一阈值为4,则编码端在训练神经网络模型的过程中,其训练的神经网络模型的模型参数集中的模型参数的最大值可以为15;若第一阈值为8,则编码端在训练神经网络模型的过程中,其训练的神经网络模型的模型参数集中的模型参数的最大值可以为255。
本申请实施例中的第一阈值可以为协议预定值,也可以为编码端预设值;本申请实施例中的第一阈值可以为固定值,也可以为变换值;不予限制。
本申请提供的方案,神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值,有利于利用差分预测的方式对神经网络模型的模型参数集进行的压缩编码。
上文指出,神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型,下文将以这两种神经网络模型为例,分别介绍利用差分预测的方式对基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码的相关内容。
情况一:利用差分预测的方式对基于神经网络的编码技术所包含的在线训练的神经网络模型的模型参数集进行压缩编码
可选地,在一些实施例中,所述神经网络模型包括在线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
编码第1个神经网络模型的模型参数集;
对于第n个神经网络模型的模型参数集,编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述n为大于1的正整数,所述m为大于或等于1的正整数。
本申请实施例中,m<n,即在编码第n个神经网络模型的模型参数集时,可以编码第n个神经网络模型的模型参数集与其之前的第m个神经网络模型的模型参数集中对应参数的参数差值即可。
示例性地,对于第3个神经网络模型的模型参数集,可以编码第3个神经网络模型的模型参数集与第2个神经网络模型的模型参数集中对应参数的参数差值,并将该参数差值传输至解码端;或者,对于第3个神经网络模型的模型参数集,也可以编码第3个神经网络模型的模型参数集与第1个神经网络模型的模型参数集中对应参数的参数差值,并将该参数差值传输至解码端;不予限制。
相应地,对于解码端,可以接收第1个神经网络模型的模型参数集的编码数据,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,并对接收到的编码数据进行解码,以获得第1个神经网络模型的模型参数集中的模型参数,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,并利用解码后获得的参数差值和第m个神经网络模型的模型参数集中的模型参数获得第n个神经网络模型的模型参数集的模型参数。
需要说明的是,本申请实施例中,编码端编码第1个神经网络模型的模型参数集时,可以对第1个神经网络模型的模型参数集单独编码并传输至解码端;也可以编码第1个神经网络模型的模型参数集中的模型参数与预设值的参数差值,并将参数差值传输至解码端;不予限制。
本申请提供的方案,编码端利用在线训练的神经网络模型对待编码图像进行编码的过程中,编码端除了编码第1个神经网络模型的模型参数集外,对于第n个神经网络模型的模型参数集的编码,可以编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,并将该参数差值对应的编码数据传输至解码端,可以节省传输带宽。
可选地,在一些实施例中,所述编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,包括:
若所述第n个神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述神经网络模型包括在线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
编码第1个神经网络模型的模型参数集;
若所述第n个神经网络模型的模型参数集包括的模型参数的数量大于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。
本申请实施例中,对于第n个神经网络模型的模型参数集中的模型参数,编码端在编码的过程中可以根据第n个神经网络模型的模型参数集中包括的模型参数的数量和第m个神经网络模型的模型参数集包括的模型参数的数量,确定编码的参数差值。
具体地,若第n个神经网络模型的模型参数集包括的模型参数的数量小于或等于第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值;若第n个神经网络模型的模型参数集包括的模型参数的数量大于第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值。
示例性地,假设第n个神经网络模型的模型参数集包括的模型参数的数量为100,第m个神经网络模型的模型参数集包括的模型参数的数量为100,则编码端可以编码这100个模型参数中对应参数的参数差值,即编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集包括的这100个模型参数中对应参数的参数差值。
假设第n个神经网络模型的模型参数集包括的模型参数的数量为80,第m个神经网络模型的模型参数集包括的模型参数的数量为100,则编码端编码第n个神经网络模型的模型参数集包括的这80个模型参数与第m个神经网络模型的模型参数集包括的对应80个模型参数的参数差值即可。
假设第n个神经网络模型的模型参数集包括的模型参数的数量为100,第m个神经网络模型的模型参数集包括的模型参数的数量为80,则编码端可以编码第n个神经网络模型的模型参数集中与第m个神经网络模型的模型参数集包括的80个模型参数中对应参数的参数差值,对于第n个神经网络模型的模型参数集包括的其余20个模型参数,编码端可以编码这20个模型参数和预设值的参数差值。
若上述神经网络模型的模型参数的位宽为a,该预设值可以为2 a-1,编码端在编码上述其余20个模型参数时,可以编码这20个模型参数和2 a-1的参数差值。
需要说明的是,上述预设值也可以为其它值,如2 a-2等,不予限制。
相应地,对于解码端,解码端对接收到的第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,可能获得第一参数差值,也可能获得第一参数差值和第二参数差值。若获得第一参数差值,解码端对该第一参数差值和第m个神经网络模型的模型参数集中的模型参数对应求和获得 第n个神经网络模型的模型参数集;若获得第一参数差值和第二参数差值,解码端对第一参数差值和第m个神经网络模型的模型参数集中的模型参数对应求和,以及对第二参数差值和预设值求和获得第n个神经网络模型的模型参数集。
上文指出,对于在线训练的神经网络模型,可以编码第1个神经网络模型的模型参数集,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,对于不同的神经网络模型的模型参数集中的模型参数,其编码方式不同,具体请参见下文。
可选地,在一些实施例中,所述编码第1个神经网络模型的模型参数集,包括:通过第一编码方式编码所述第1个神经网络模型的模型参数集;
所述编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,包括:通过第二编码方式编码所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值。
本申请实施例中,可以通过不同的编码方式对第1个神经网络模型的模型参数集,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值进行编码。具体地,对于第1个神经网络模型的模型参数集,可以通过第一编码方式进行编码;对于第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,可以通过第二编码进行编码。
相应地,对于解码端,通过第一解码方式对第1个神经网络模型的模型参数集的编码数据进行解码,以及通过第二解码方式对第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,并对解码后的数据进行求和处理,从而可以获得神经网络模型的模型参数集。
需要特别说明的是,若第n个神经网络模型的模型参数集包括的模型参数的数量大于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码端可以通过第二编码方式编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,以及编码第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。相应地,解码端可以通过第二解码方式解码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,以及解码第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。
本申请提供的方案,通过不同的编码方式对第1个神经网络模型的模型参数集,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值进行编码,或者,通过不同的编码方式对第1个神经网络模型的模型参数集,和,第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值以及第n个模型参数集中除第一参数差值对应的模型参数之外的参数和预设值的参数差值进行编码,可以提高编码的灵活性。
可选地,在一些实施例中,所述第一编码方式为定长码编码方式,所述第二编码方式为变长码编码方式。
本申请实施例中的定长码编码方式可以理解为以固定位宽进行的编码方式;变长码编码方式可以理解为以变换位宽进行的编码方式。
示例性地,假设神经网络模型的模型参数的位宽为4比特,则编码第1个神经网络 模型的模型参数集的模型参数时,可以以4比特的位宽对其进行编码。
具体地,若第1个神经网络模型的模型参数集的模型参数包括数值10,则编码端可以将其编码为“1010”;若第1个神经网络模型的模型参数集的模型参数还包括数值2,则编码端可以将其编码为“0010”。换句话说,不管第1个神经网络模型的模型参数集的模型参数的数值的大小,编码端均以4比特的位宽对其进行编码。
对于第2个神经网络模型的模型参数集,编码端编码的是第2个神经网络模型的模型参数集和第1个神经网络模型的模型参数集中对应参数的参数差值。若第2个神经网络模型的模型参数集和第1个神经网络模型的模型参数集中对应参数的参数差值包括数值2,则编码端可以将其编码为“10”,即参数差值2占用的位宽为2比特;若第2个神经网络模型的模型参数集和第1个神经网络模型的模型参数集中对应参数的参数差值包括数值5,则编码端可以将其编码为“101”,即参数差值5占用的位宽为3比特。换句话说,对于第2个神经网络模型的模型参数集和第1个神经网络模型的模型参数集中对应参数的参数差值,针对不同的参数差值,编码端根据数值的大小以不同位宽对其进行编码。
以此类推,对于第n个神经网络模型的模型参数集,编码第n个神经网络模型的模型参数集和第m个神经网络模型的模型参数集中对应参数的参数差值,可以基于上述变长码编码方式对其进行编码。
应理解,上述数值仅为举例说明,还可以为其它数值,不应对本申请造成特别限定。
本申请提供的方案,通过定长码编码方式对第1个神经网络模型的模型参数集中的模型参数进行编码,通过变长码编码方式对第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值进行编码,可以进一步节省带宽。
可选地,在一些实施例中,所述m为编码前固化到或预设在编码端的参数,或,所述m为编码端基于预设规则确定的。
对于解码端,所述m为固化到或预设在解码端的参数,或,所述m为基于预设规则确定的。
可选地,在一些实施例中,所述m=1,或,所述m=n-1。
本申请实施例中的m可以为固化到或预设在编码端或解码端的参数,例如,编码端可以固化或预设m=1,则对于第n个神经网络模型的模型参数集,编码端可以对第n个神经网络模型的模型参数集与第1个神经网络模型的模型参数集中对应参数的参数差值进行编码,且由于该m=1同样也固化到或预设在解码端,因此,编码端可以不用将m的数值传输至解码端,解码端在接收到第n个神经网络模型的模型参数集与第1个神经网络模型的模型参数集中对应参数的参数差值的编码数据后,可以将该参数差值和第1个神经网络模型的模型参数集中对应参数求和即可获得第n个神经网络模型的模型参数集的模型参数。
类似地,若编码端固化或预设m=n-1,则对于第n个神经网络模型的模型参数集,编码端可以对第n个神经网络模型的模型参数集与第n-1个神经网络模型的模型参数集中对应参数的参数差值进行编码,且由于该m=n-1同样也固化到或预设在解码端,因此,编码端可以不用将m的数值传输至解码端,解码端在接收到第n个神经网络模型的模型参数集与第n-1个神经网络模型的模型参数集中对应参数的参数差值的编码数据后,可以将该参数差值和第n-1个神经网络模型的模型参数集中对应参数求和即可获得第n个神经网络模型的模型参数集的模型参数。
本申请提供的方案,通过固化或预设m在编码端和解码端,可以减少编码端由于传输m所需要消耗的比特,从而可以进一步节省带宽。
可选地,在一些实施例中,所述m为编码端基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
本申请实施例中,编码端也可以基于预设规则确定m,同时,可以将该m值通过第一编码数据传输至解码端,以便于解码端的正确解码。
示例性地,对于第3个神经网络模型的模型参数集,可以编码第3个神经网络模型的模型参数集与第1个神经网络模型的模型参数集中对应参数的参数差值,同时将利用的神经网络模型是第1个神经网络模型传输至解码端,即将m=1传输至解码端,便于解码端的正确解码;对于第3个神经网络模型的模型参数集,也可以编码第3个神经网络模型的模型参数集与第2个神经网络模型的模型参数集中对应参数的参数差值,同时将利用的神经网络模型是第2个神经网络模型传输至解码端,即将m=2传输至解码端,便于解码端的正确解码。
本申请提供的方案,编码端基于预设规则确定m,并利用第一指示信息指示该m值,该第一指示信息通过第一编码数据传输至解码端,可以提高编码的灵活性,同时也可以保证编解码的正确性。
可选地,在一些实施例中,所述预设规则包括:
对于所述第n个神经网络模型的模型参数集,从多个神经网络模型中选择编码所述第n个神经网络模型的模型参数集的参数差值的比特数最小的神经网络模型参数集。
本申请实施例中的比特数最小可以理解为所占用的比特数最少。
示例性地,对于第3个神经网络模型的模型参数集,可以编码第3个神经网络模型的模型参数集与第1个神经网络模型的模型参数集中对应参数的参数差值;也可以编码第3个神经网络模型的模型参数集与第2个神经网络模型的模型参数集中对应参数的参数差值。编码端可以根据编码第n个神经网络模型的模型参数集的参数差值的比特数最小进行决策。
假设第3个神经网络模型的模型参数集中的模型参数包括10,若利用第1个神经网络模型的模型参数集对第3个神经网络模型的模型参数10进行编码,假设第1个神经网络模型的模型参数集中包括的与之对应的模型参数为5,则编码的参数差值为5,即编码端将该参数差值5编码为“101”;若利用第2个神经网络模型的模型参数集对第3个神经网络模型的模型参数10进行编码,假设第2个神经网络模型的模型参数集中包括的与之对应的模型参数为8,则编码的参数差值为2,即编码端将该参数差值2编码为“10”;则编码端可以选择利用第2个神经网络模型的模型参数集对第3个神经网络模型的模型参数10进行编码,即编码第3个神经网络模型的模型参数集与第2个神经网络模型的模型参数集中对应参数的参数差值2。
应理解,上述数值仅为举例说明,还可以为其它数值,不应对本申请造成特别限定。
本申请提供的方案,编码端可以从多个神经网络模型中选择编码第n个神经网络模型的模型参数集的参数差值的比特数最小的神经网络模型参数集对第n个神经网络模型的模型参数集进行编码,可以进一步节省带宽。
情况二:利用差分预测的方式对基于神经网络的编码技术所包含的离线训练的神经网络模型的模型参数集进行压缩编码
可选地,在一些实施例中,所述神经网络模型包括多个离线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型。
本申请实施例中,假设通过离线训练获得4个神经网络模型,分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4,假设第一神经网络模型为神经网络模型1,则编码端可以先编码该神经网络模型1的模型参数集。对于剩余的其它神经网络模型(包括神经网络模型2、神经网络模型3以及神经网络模型4)的模型参数集,可以分别编码这3个神经网络模型的模型参数集与神经网络模型1的模型参数集中对应参数的参数差值。
具体地,编码端可以针对不同的量化参数(Quantization Parameter,QP)分别离线训练得到不同的神经网络模型。例如,针对量化参数为27、32、37、45分别训练得到4个不同的神经网络模型(分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4),在对待编码图像进行编码的过程中,可以根据待编码图像的量化参数选择相应地神经网络模型进行编码。
相应地,对于解码端,可以接收第一神经网络模型的模型参数集的编码数据;同时可以接收第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值的编码数据。并对接收到的编码数据进行解码以及处理(将解码后的参数差值与第一神经网络模型的模型参数集中的模型参数的对应参数求和),从而可以获得第一神经网络模型的模型参数集和第二神经网络模型的模型参数集。
本申请提供的方案,编码端利用离线训练的神经网络模型对待编码图像进行编码的过程中,编码端除了编码第一神经网络模型的模型参数集外,对于离线训练好的其它神经网络模型,可以编码第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值,并传输该参数差值对应的编码数据,可以节省传输带宽。
可选地,在一些实施例中,所述编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,包括:
若所述第二神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述神经网络模型包括多个离线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
若所述第二神经网络模型的模型参数集包括的模型参数的数量大于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参 数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。
本申请实施例中,对于第二神经网络模型的模型参数集包括的模型参数,编码端在编码的过程中可以根据第二神经网络模型的模型参数集中包括的模型参数的数量和第一神经网络模型的模型参数集包括的模型参数的数量,确定编码的参数差值。
具体地,若第二神经网络模型的模型参数集包括的模型参数的数量小于或等于第一神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值;若第二神经网络模型的模型参数集包括的模型参数的数量大于第一神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值。
示例性地,假设第二神经网络模型的模型参数集包括的模型参数的数量为100,第一神经网络模型的模型参数集包括的模型参数的数量为100,则编码端可以编码这100个模型参数中对应参数的参数差值,即编码第二神经网络模型的模型参数集与第一神经网络模型的模型参数集包括的这100个模型参数中对应参数的参数差值。
假设第二神经网络模型的模型参数集包括的模型参数的数量为80,第一神经网络模型的模型参数集包括的模型参数的数量为100,则编码端编码第二神经网络模型的模型参数集包括的这80个模型参数与第一神经网络模型的模型参数集包括的对应80个模型参数的参数差值即可。
假设第二神经网络模型的模型参数集包括的模型参数的数量为100,第一神经网络模型的模型参数集包括的模型参数的数量为80,则编码端可以编码第二神经网络模型的模型参数集中与第一神经网络模型的模型参数集包括的80个模型参数中对应参数的参数差值,对于第二神经网络模型的模型参数集包括的其余20个模型参数,编码端可以编码这20个模型参数和预设值的参数差值。
若上述神经网络模型的模型参数的位宽为a,该预设值可以为2 a-1,编码端在编码上述其余20个模型参数时,可以编码这20个模型参数和2 a-1的参数差值。
需要说明的是,上述预设值也可以为其它值,如2 a-2等,不予限制。
相应地,对于解码端,对第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,可能获得第三参数差值,也可能获得第三参数差值和第四参数差值。若获得第三参数差值,解码端对该第三参数差值和第一神经网络模型的模型参数集中的模型参数对应求和获得第二神经网络模型的模型参数集;若获得第三参数差值和第四参数差值,解码端对该第三参数差值和第一神经网络模型的模型参数集中的模型参数对应求和,以及对第四参数差值和预设值求和获得第二神经网络模型的模型参数集。
上文指出,对于离线训练的神经网络模型,可以编码第一神经网络模型的模型参数集,和,第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值,对于不同的神经网络模型的模型参数集中的模型参数,其编码方式不同,具体请参见下文。
可选地,在一些实施例中,所述编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集,包括:
通过第一编码方式编码所述第一神经网络模型的模型参数集;
所述编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数 集中对应参数的参数差值,包括:
通过第二编码方式编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
本申请实施例中,可以通过不同的编码方式对第一神经网络模型的模型参数集,和,第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值进行编码。即:对于第一神经网络模型的模型参数集,可以通过第一编码方式进行编码;对于第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值,可以通过第二编码进行编码。
相应地,对于解码端,通过第一解码方式解码第一神经网络模型的模型参数集的编码数据;以及通过第二解码方式解码第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值的编码数据。并对解码后的数据进行求和处理,从而可以获得神经网络模型的模型参数集。
需要特别说明的是,若第二神经网络模型的模型参数集包括的模型参数的数量大于第一神经网络模型的模型参数集包括的模型参数的数量,编码端可以通过第二编码方式编码第二神经网络模型的模型参数集与第一神经网络模型的模型参数集对应参数的参数差值,以及编码第二模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。相应地,解码端可以通过第二解码方式解码第二神经网络模型的模型参数集与第一神经网络模型的模型参数集对应参数的参数差值,以及解码第二模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。
本申请提供的方案,通过不同的编码方式对第一神经网络模型的模型参数集,和,第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值进行编码,或者,通过不同的编码方式对第一神经网络模型的模型参数集,和,第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值以及第二模型参数集中除第三参数差值对应的模型参数之外的参数和预设值的参数差值进行编码,可以提高编码的灵活性。
可选地,在一些实施例中,所述第一编码方式为定长码编码方式,所述第二编码方式为变长码编码方式。
具体地,若第一神经网络模型(如上述神经网络模型1)的模型参数集的模型参数包括数值10,则编码端可以将其编码为“1010”;若第一神经网络模型的模型参数集的模型参数还包括数值2,则编码端可以将其编码为“0010”。换句话说,不管第一神经网络模型的模型参数集的模型参数的数值的大小,编码端均以4比特的位宽对其进行编码。
对于第二神经网络模型的模型参数集,编码端编码的是第二神经网络模型的模型参数集和第一神经网络模型的模型参数集中对应参数的参数差值。假设第二神经网络模型包括3个神经网络模型(如上述神经网络模型2、神经网络模型3以及神经网络模型4)。
对于神经网络模型2,若神经网络模型2的模型参数集和第一神经网络模型的模型参数集中对应参数的参数差值包括数值2,则编码端可以将其编码为“10”,即参数差值2占用的位宽为2比特;若神经网络模型2的模型参数集和第一神经网络模型的模型参数集中对应参数的参数差值还包括数值5,则编码端可以将其编码为“101”,即参数差值5占用的位宽为3比特。换句话说,对于神经网络模型2的模型参数集和第一神经网络模型的模型参数集中对应参数的参数差值,针对不同的参数差值,编码端根据数值的大小以 不同位宽对其进行编码,即编码端可以根据数值的大小以变长码编码方式进行编码。
以此类推,对于神经网络模型3、神经网络模型4,可以基于与上述神经网络模型2类似的变长码编码方式进行编码。
本申请提供的方案,通过定长码编码方式对第一神经网络模型的模型参数集中的模型参数进行编码,通过变长码编码方式对第二神经网络模型的模型参数集与第一神经网络模型的模型参数集中对应参数的参数差值进行编码,可以进一步节省带宽。
可选地,在一些实施例中,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
本申请实施例中,仍然假设离线训练的神经网络模型包括4个神经网络模型,分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4。若神经网络模型1的模型参数集中包括的模型参数的数量为100个,神经网络模型2的模型参数集中包括的模型参数的数量为80个,神经网络模型3的模型参数集中包括的模型参数的数量为120个,神经网络模型4的模型参数集中包括的模型参数的数量为95个,则本申请中的第一神经网络模型可以为神经网络模型2。
本申请提供的方案,第一神经网络模型的模型参数集包括的模型参数的数量为多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型,可以进一步节省带宽。
当然,在一些实施例中,第一神经网络模型也可以为其模型参数集包括的模型参数的数量为多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最多的神经网络模型,或者,第一神经网络模型也可以为多个离线训练的神经网络模型中的任一神经网络模型,不予限制。
可选地,在一些实施例中,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于0的整数。
本申请实施例中,对于利用离线训练的神经网络模型对目标图像进行的编码,第一编码数据中还可以包括用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识的第二指示信息,便于解码端的正确解码。
本申请实施例中的目标图像可以为对待编码图像按照视频序列级、图像组(Group of Picture,GOP)级、图像级(或称帧级)中的任意一种进行划分后的图像。其中,GOP的长度可以自主定义,一般可以将视频序列中从当前I帧到下一个I帧之前的图像作为一个GOP。
为了便于理解本申请的方案,先对GOP进行简单介绍。GOP包括一组连续的画面,由一张I帧和数张B帧和/或P帧组成,是视频图像编码器和解码器存取的基本单位。I帧(也可以称为关键帧)即帧内编码图像帧,可以理解为这一帧画面的完整保留;B帧即双向参考帧或双向差别帧,可以理解为B帧记录的是本帧与前后帧的差别,解码时要取得之前的缓存图像和解码之后的图像,通过前后图像的数据与本帧数据的叠加取得最终的图像;P帧即前向参考帧或前向预测帧,可以理解为本帧跟前一帧的差别,解码时需要用之前缓存的图像叠加上本帧定义的差别,生成最终图像。
假设离线训练的神经网络模型包括4个神经网络模型,分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4。以GOP为例,假设对于第1个GOP,编码端利用神经网络模型1对其进行编码,编码端可以将对第1个GOP进行编码时采用的神经网络模型1的模型参数的标识传输至解码端,即第二指示信息指示在对第1个GOP进行编码时采用的神经网络模型1的模型参数的标识;假设对于第2个GOP,编码端利用神经网络模型3对其进行编码,编码端可以将在对第2个GOP进行编码时采用的神经网络模型3的模型参数的标识传输至解码端,即第二指示信息指示在对第2个GOP进行编码时采用的神经网络模型3的模型参数的标识,……以此类推。
在实际应用过程中,可以基于不同应用场景重新训练神经网络模型,编码端在编码的过程中,可以选择使用重新训练的神经网络模型或已有的离线训练的基本的神经网络模型进行编码,并将是否使用重新训练的神经网络模型的语法元素进行编码写入到第一编码数据中。
当编码端选择重新训练的神经网络模型进行编码时,则可以利用差分预测的方式对重新训练的神经网络模型的模型参数进行编码,并将编码后获得的编码数据传输至解码端,同时将使用重新训练的神经网络模型的语法元素进行编码写入到第一编码数据中;当编码端选择已有的离线训练的基本的神经网络模型进行编码时,则不需将重新训练的神经网络模型的模型参数传输至解码端,进一步地,也可以将没有使用重新训练的神经网络模型的语法元素进行编码写入到第一编码数据中。
解码端则从接收到的第一编码数据中解码出是否使用重新训练的神经网络模型的标识,即采用已有的离线训练的基本的神经网络模型的模型参数集进行解码或采用通过传输过来的重新训练的神经网络模型的模型参数集进行解码。
本申请实施中的第二指示信息可以通过第一编码数据传输至解码端,便于解码端的解码。
在一些实施例中,编码端也可以不用传输第二指示信息,可以根据量化参数确定所进行采用的神经网络模型。示例性地,假设编码端针对量化参数为27、32、37、45分别训练得到4个不同的神经网络模型,分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4。
编码端可以建立量化参数和这4个神经网络模型的映射关系,示例性地,若QP≤30,则可以利用神经网络模型1进行编码,若30<QP≤35,则可以利用神经网络模型2进行编码,若35<QP≤40,则可以利用神经网络模型3进行编码,若QP>40,则可以利用神经网络模型4进行编码。
应理解,上述映射关系仅为示例性说明,编码端也可以建立不同的映射关系,不予限制。
对于第1个GOP,若其量化参数为25,则编码端可以选择神经网络模型1对其进行编码,获得第一编码数据。解码端接收到该第一编码数据后,并解码获得其量化参数后,可以根据量化参数与神经网络模型的映射关系确定解码该编码数据所需要的神经网络模型为神经网络模型1,并利用该神经网络模型1对该第1个GOP对应的编码数据进行解码。
对于第2个GOP,若其量化参数为41,则编码端可以选择神经网络模型4对其进行编码,获得第一编码数据。解码端接收到该第一编码数据后,并解码获得其量化参数后, 可以根据量化参数与神经网络模型的映射关系确定解码该编码数据所需要的神经网络模型为神经网络模型4,并利用该神经网络模型4对该第2个GOP对应的编码数据进行解码。
需要说明的是,量化参数与神经网络模型的映射关系可以预设在编码端和解码端;或,量化参数与神经网络模型的映射关系也可以在编码的过程中传输至解码端,可以将该映射关系写入第一编码数据中,并随着第一编码数据传输至解码端,也可以将该映射关系写入第二编码数据中,随着第二编码数据传输至解码端;不予限制。
本申请提供的方案,编码端传输的第一编码数据中包括用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识的第二指示信息,有利于解码端的正确解码。
如上所述,编码端和解码端可以利用基于神经网络的编码技术对待编码图像进行滤波,下文结合图5描述基于神经网络的编码技术对待编码图像进行滤波的内容。
如图5所示,为本申请实施例提供的一种编码框架2的示意图。
其中,编码端在利用反量化206和反变换207得到重建像素后,可以对该重建像素进行滤波211。在进行滤波的过程中,可以通过对重建像素进行去方块滤波(Deblocking Filter,DF)、NNF、样点自适应补偿(Sample adaptive offset,SAO)或自适应环路滤波(Adaptive Loop Fitler,ALF)中的任意一种或多种,输出滤波后的重建图像。
编码端对目标图像进行编码的过程中,以目标图像为GOP为例,在编码当前待编码图像的第1个GOP时,将第1个GOP的图像作为训练集,进行基于神经网络的滤波技术的模型训练过程。整个训练过程可以参考如下过程:在编码过程中可以将当前待编码图像送入到图5所示的框架中进行编码训练,例如,第1个GOP经过反量化和反变换后得到重建图像,对该重建图像进行DF、NNF、SAO以及ALF。待第1个GOP内所有图像编码完成后,则得到第1个GOP内所有图像编码后的码流以及基于第1个GOP内有所有图像经过神经网络框架训练得到的神经网络模型。
在编码当前待编码图像的第2个GOP时,用第1个GOP训练得到的神经网络模型进行基于神经网络的滤波技术。具体的滤波过程可以参考如下过程:在编码第2个GOP内的图像时,该第2个GOP经过反量化和反变换后得到重建图像,然后将该重建图像送入到部署了用第1个GOP训练得到的神经网络模型的滤波模块得到滤波后的重建图像,其中,此处的滤波模块包括DF模块、NNF模块、SAO模块以及ALF模块,且该NNF模块中包括用第1个GOP训练得到的神经网络模型。
以此类推,对于第p个GOP,在编码第p个GOP时,用第p-t个GOP训练得到的神经网络模型进行基于神经网络的滤波技术。具体的滤波过程可以参考如下过程:在编码第p个GOP内的图像时,该第p个GOP经过反量化和反变换后得到重建图像,然后将该重建图像送入到部署了用第p-t个GOP训练得到的神经网络模型的滤波模块得到滤波后的重建图像,类似地,此处的滤波模块包括DF模块、NNF模块、SAO模块以及ALF模块,且该NNF模块中包括用第p-t个GOP训练得到的神经网络模型。
可以理解的是,图5中所示的滤波顺序仅为示例说明,还可以为其它顺序,例如,DF、SAO、NNF以及ALF,不应对本申请造成特别限定。
可选地,在一些实施例中,所述方法还包括:对所述神经网络模型的模型参数集进行划分,以获得所述神经网络模型的模型参数集的多个模型参数子集;
所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集。
本申请实施例中,编码端可以将神经网络模型的模型参数集划分为多个模型参数子集,并利用差分预测的方式对该多个模型参数子集进行编码。
示例性地,编码端可以根据层划分神经网络模型的模型参数集,对于神经网络模型结构中每一层生成的参数可以划分为一个模型参数子集,利用差分预测的方式编码多个模型参数子集。
相应地,对于解码端,对接收到的第二编码数据进行解码,获得所述神经网络模型的模型参数集的多个模型参数子集。
本申请提供的方案,通过对神经网络模型的模型参数集进行划分,并利用差分预测的方式传输划分后获得的多个模型参数子集,可以提高神经网络模型参数预测编码的并行度。此外,对不同神经网络模型的模型参数集进行划分后的多个模型参数子集中模型参数之间的相关性更高,并利用差分预测的方式传输划分后获得的多个模型参数子集可以进一步节省带宽。
可选地,在一些实施例中,所述神经网络模型包括多个神经网络模型,所述利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集,包括:
对于第q个神经网络模型中的第一模型参数子集,利用第三神经网络模型中的模型参数子集对所述第一模型参数子集进行编码;
对于第q个神经网络模型中的第二模型参数子集,利用第四神经网络模型中的模型参数子集对所述第二模型参数子集进行编码,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型,所述q为大于0的整数。
示例性地,假设编码端预先训练了4个不同的神经网络模型,分别为神经网络模型1、神经网络模型2、神经网络模型3以及神经网络模型4。对于第1个GOP,编码端可以利用神经网络模型1对第1个GOP进行编码。在编码该神经网络模型1的模型参数子集时,编码端可以利用不同的神经网络模型包括的模型参数子集对其进行编码。
本申请实施例中,利用不同的神经网络模型包括的模型参数子集对其进行编码,可以理解为利用不同的神经网络模型包括的模型参数子集对神经网络模型1的所包括的模型参数子集进行编码。示例性地,假设神经网络模型1的模型参数集被划分为2个模型参数子集,分别为第一模型参数子集和第二模型参数子集,则编码端在对这2个模型参数子集编码时,可以利用不同的神经网络模型的模型参数子集对其进行编码,例如,利用神经网络模型2的模型参数子集对第一模型参数子集进行编码,利用神经网络模型3的模型参数子集对第二模型参数子集进行编码。
需要说明的是,虽然在编码第1个神经网络模型的模型参数子集时,利用不同神经网络模型的模型参数子集分别对其进行编码,但是在利用神经网络模型对待编码图像进行编码时,仍然以神经网络模型为单位对待编码图像进行编码。示例性地,编码端可以基于神经网络模型1对第1个GOP进行编码,基于神经网络模型2对第2个GOP进行编码。
类似地,对于第2个GOP,编码端可以利用神经网络模型2的模型参数集对第2个GOP进行编码。在编码该神经网络模型2的模型参数子集时,可以利用不同的神经网络 模型包括的模型参数子集对其进行编码。示例性地,假设神经网络模型2的模型参数集被划分为2个模型参数子集,分别为第一模型参数子集和第二模型参数子集,则编码端在对这2个模型参数子集编码时,可以利用不同的神经网络模型的模型参数子集对其进行编码,例如,利用神经网络模型3的模型参数子集对第一模型参数子集进行编码,利用神经网络模型4的模型参数子集对第二模型参数子集进行编码。
应理解,上述神经网络模型的模型参数集被划分的模型参数子集的数量仅为举例说明,在一些实施例中,神经网络模型的模型参数集还可以被划分为多个模型参数子集(如划分为3个模型参数子集或4个模型参数子集等),编码端在编码这多个模型参数子集时,可以利用不同的神经网络模型的模型参数分别对其进行编码。
还应理解,若神经网络模型的模型参数集被划分为3个模型参数子集,可以利用第三神经网络模型对其中2个模型参数子集进行编码,且利用第四神经网络模型对另外1个模型参数子集进行编码;也可以利用第三神经网络模型、第四神经网络模型以及第五神经网络模型(第三神经网络模型、第四神经网络模型以及第五神经网络模型可以为多个神经网络模型中的网络模型)分别对这3个模型参数子集进行编码;不予限制。
相应地,对于解码端,解码端在接收到第二编码数据后,对其进行解码,可以获得第一模型参数子集的残差数据和第二模型参数子集的残差数据,利用第一模型参数子集和残差数据和第三神经网络模型参数子集获得第一模型参数子集以及利用第二模型参数子集的残差数据和第四神经网络模型中的模型参数子集获得第二模型参数子集。再利用第一模型参数子集中的模型参数和第二模型参数子集中的模型参数对第一编码数据进行解码。
本申请提供的方案,通过对神经网络模型的模型参数集进行划分,并利用差分预测的方式传输划分后获得的第一模型参数子集和第二模型参数子集,可以提高神经网络模型参数预测编码的并行度。此外,对神经网络模型的模型参数集进行划分后的第一模型参数子集和第二模型参数子集中模型参数之间的相关性更高,并利用差分预测的方式传输第一模型参数子集和第二模型参数子集可以进一步节省带宽。
可选地,在一些实施例中,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中的。
本申请实施例中,可以通过不同的通信链路传输第一编码数据和第二编码数据;也可以通过同一通信链路传输第一编码数据和第二编码数据,且第二编码数据是以编码头信息的方式写入第一编码数据中的。
需要说明的是,若通过不同的通信链路传输第一编码数据和第二编码数据,第一编码数据中还可以包括指示信息,用于指示当前编码图像所采用的神经网络模型。解码端接收到该第一编码数据后,可以根据第一编码数据中的指示信息确定解码当前编码数据时所采用的神经网络模型。
本申请提供的方案,若通过不同的通信链路传输第一编码数据和第二编码数据,可以很好地解决神经网络模型的模型参数的管理和传输问题;由于第二编码数据通过第二通信链路传输,可以缓解比特消耗;此外,还可以降低由于有模型参数的管理和传输需求对低时延传输的挑战。若通过同一通信链路传输第一编码数据和第二编码数据,可以 减少传输过程中的差错风险,并且将第二编码数据写入到第一编码数据中,便于神经网络模型的模型参数的管理和传输。
可选地,在一些实施例中,所述第一通信链路和所述第二通信链路具有不同的物理特性。
本申请实施例中的物理特性可以由具体的应用需求决定,示例性地,可以包括传输时延和/或传输带宽。但应理解,该物理特性还可以为其它特性,不应对本申请造成特别限定。
可选地,在一些实施例中,所述第一通信链路的传输时延低于所述第二通信链路,和/或,所述第二通信链路的传输带宽高于所述第一通信链路。
本申请实施例中,第一通信链路与第二通信链路相比,其传输时延较低,或,传输带宽较低,或,传输时延和传输带宽均较低;换句话说,第二通信连路的传输时延和/或传输带宽高于第一通信链路。
需要说明的是,编码端在对待编码图像进行编码的过程中,可能会实时传输第一编码数据,以便于解码端可以及时对其进行解码。因此,可以考虑时延较低的第一通信链路传输第一编码数据。
还需要说明的是,编码端利用神经网络模型对待编码图像进行编码的过程中,可以通过第二通信链路传输神经网络模型的模型参数,即第二编码数据,由于神经网络模型的模型参数较多,特别是对于层数较多的神经网络模型的模型参数更复杂,因此,可以考虑利用带宽较高的第二通信链路传输。
本申请提供的方案,通过传输时延较低的第一通信链路传输第一编码数据,通过传输带宽较高的第二通信链路传输第二编码数据,可以很好地解决神经网络模型的模型参数的管理和传输问题,同时可以进一步减少由于有神经网络模型的模型参数的管理和传输需求对于低时延传输的挑战。
可选地,在一些实施例中,所述第一通信链路包括时延小于或等于第二阈值的链路,所述第二通信链路包括带宽大于或等于第三阈值的链路。
本申请实施例中的第二阈值和/或第三阈值可以通过协议规定,也可以通过服务器配置;第二阈值和/或第三阈值可以是固定值,也可以是不断调整的变化的值;不予限制。
可选地,在一些实施例中,所述第一通信链路包括基于私有图传协议或无线局域网协议的链路,所述第二通信链路包括基于移动通信协议的链路。
可选地,在一些实施例中,所述私有图传协议包括软件无线电(Software Defination Radio,SDR)协议,所述无线局域网协议包括无线保真(Wireless Fidelity,WiFi)协议,所述移动通信协议包括4G或5G协议。
需要说明的是,本申请实施例中,私有图传协议示出了SDR协议,私有图传协议还可以包括其它协议,如开放式网络视频接口论坛(Open Network Video Interface Forum,ONVIF)协议等,不予限制。
本申请实施例中的无线局域网协议除了上述所示出的WiFi协议外,还可以包括其它协议,如蓝牙(Bluetooth)、紫蜂(ZigBee)等,不予限制。
此外,本申请实施例中的移动通信协议除了上述所示出的4G或5G协议之外,还可以包括其它协议,如未来的6G协议等。
当然,在一些实施例中,第一通信链路也可以为基于SDR协议的链路,第二通信链 路为基于WiFi协议的链路。
可选地,在一些实施例中,所述第一通信链路包括私有图传链路,所述第二通信链路包括公网传输链路。
如图6所示,为本申请实施例提供的智能编码技术的图传传输的示意图。采集端(也可以理解为编码端)采集到视频后,经过编码器和神经网络计算平台的压缩编码后得到第一编码数据和对应的第二编码数据,然后经过无线图传系统将第一编码数据和第二编码数据传输到显示端。显示端(也可以理解为解码端)在接收到第一编码数据和第二编码数据后,通过显示端的解码器和神经网络计算平台进行解码得到重建视频,并通过显示端的显示器显示该重建视频。
其中,上述无线图传系统可以是无线视频传输系统,可以包括私有图传链路和公网传输链路,用于分别传输第一编码数据和第二编码数据。
本申请实施例中的私有图传链路可以包括基于SDR协议的链路或基于WiFi协议的链路或基于ONVIF协议的链路;本申请实施例中的公网传输链路可以包括基于4G或5G或6G协议的链路。
本申请提供的方案,通过私有图传链路传输第一编码数据,通过公网传输链路传输第二编码数据,可以很好地解决神经网络模型的模型参数的管理和传输问题。
可选地,在一些实施例中,所述第一通信链路和/或所述第二通信链路是从以下一种或多种链路中选择的:
基于无线局域网协议的链路、基于移动通信协议的链路、基于以太网协议的链路。
本申请实施例中,编码端传输第一编码数据和第二编码数据时,也可以从一种或多种链路中灵活选择,从而可以提高灵活性。
可选地,在一些实施例中,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
本申请实施例中,若通过不同的通信链路传输第一编码数据和第二编码数据,则第一编码数据中还可以包括用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识的第三指示信息。解码端接收到第一编码数据后,可以根据第一编码数据中的第三指示信息确定对第一编码数据进行解码时采用的神经网络模型的模型参数,便于解码端的正确解码。
可选地,在一些实施例中,所述方法还包括:
将所述神经网络模型的模型参数集包括的模型参数转换为目标格式;
所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
利用所述差分预测的方式对所述目标格式进行压缩编码。
相应地,对于解码端,上述步骤420中对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:对所述第二编码数据进行解码,获得目标格式。
上述步骤430中利用所述神经网络模型的模型参数集中的模型参数对所述第一编码 数据进行解码,包括:对所述目标格式进行转换;利用转换后的格式的模型参数对所述第一编码数据进行解码。
本申请实施例中,编码端在利用神经网络模型对待编码图像进行编码后,可以对该神经网络模型的模型参数进行格式转换,以获得目标格式,并利用差分预测的方式对目标格式进行压缩编码,并将压缩编码后的目标格式传输至解码端。解码端在接收到第二编码数据后,对其进行解码可以获得目标格式,再对该目标格式进行转换,得到对应的神经网络模型的模型参数,并利用转换后的格式的模型参数对第一编码数据进行解码。
可选地,在一些实施例中,所述目标格式包括神经网络变换格式(Neural Network Exchange Format,NNEF)或开放神经网络变换(Open Neural Network Exchange)ONNX格式。
本申请实施例中的NNEF和ONNX格式是两种相近的开放格式,用于表示和交换深度学习框架和推理引擎之间的神经网络。两种格式的核心都是基于一组常用操作,可以从这些操作中构建网络。
NNEF通过支持多种设备和平台上的应用程序使用丰富的神经网络训练工具和推理引擎的组合,减少了机器学习部署的分散性,主要目标是能够从深度学习框架中导出网络并将其导入到硬件供应商的推理引擎中。
ONNX定义了一组通用的运算符-机器学习和深度学习模型的构建块以及一种通用的文件格式,以使人工智能(Artificial Intelligence,AI)开发人员可以将模型与各种框架、工具,运行时和编码器以及译码器一起使用。
这两种格式均可以存储常用的深度学习框架生成的神经网络模型,其目的是可以实现神经网络模型在不同深度学习框架之间的交互和通用。
本申请提供的方案,通过将神经网络模型的模型参数转换为目标格式,可以实现神经网络模型在不同深度学习框架之间的交互和通用;此外,利用差分预测的方式对转换后得到的目标格式进行编码并传输编码后的第二编码数据,可以进一步节省带宽。
本申请实施例中,对于神经网络模型的训练可以通过以下方式进行训练。
如图7所示,为本申请实施例提供的一种训练神经网络模型的流程示意图。参考图7,通过编码器和神经网络计算平台对待编码图像进行压缩编码得到神经网络模型,该神经网络模型的模型参数经过NNEF或ONNX格式的格式转换后,通过差分预测的压缩方法对转换后获得的NNEF或ONNX格式的模型参数进行压缩,以获得差分预测后的编码数据。
编码端利用基于神经网络的编码技术对待编码图像进行编码时,可以基于图8a所示的过程进行编码。
如图8a所示,为本申请实施例提供的一种视频编码器应用智能编码技术的流程示意图。参考图8a,在获得差分预测后的编码数据后,可以通过差分预测解压缩获得差分预测前的编码数据,该差分预测前的编码数据经过NNEF或ONNX格式的格式逆转换后得到神经网络模型的模型参数,并将得到的神经网络模型的模型参数部署于神经网络计算平台,编码器在对图像或视频进行编码时,可以结合部署了神经网络模型的模型参数的神经网络计算平台对其进行编码,生成第一编码数据。
在具体实现中,可以通过对传统的编码器进行修改实现基于神经网络的编码技术进行的编码。示例性地,可以在编码头信息语法元素时在目前已有的头信息语法参数集中 添加智能编码相关语法元素的编码,例如,可以在序列参数集(Sequence Parameter Set,SPS)、图像参数集(Picture Parameter Set,PPS)、条带头(Slice Header)中增加一个语法元素用来标识控制基于神经网络的编码技术打开或者关闭的开关,可以直接将该语法元素添加到上述语法元素参数集中,也可以选择将该语法元素添加到上述语法元素参数集的用户扩展数据(User Extension Data)中。
对于解码端,可以基于图8b所示的过程进行解码。
如图8b所示,为本申请实施例提供的一种视频解码器应用智能编码技术的流程示意图。参考图8b,在接收到差分预测后的编码数据后,可以通过差分预测解压缩获得差分预测前的编码数据,该差分预测前的编码数据经过NNEF或ONNX格式的格式逆转换后得到神经网络模型的模型参数,并将得到的神经网络模型的模型参数部署于神经网络计算平台,解码器在对待解码的图像或视频的码流进行解码时,可以结合部署了神经网络模型的模型参数的神经网络计算平台对其进行解码,获得待解码的图像或视频。
可选地,在一些实施例中,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
本申请实施例中,第一编码数据中还可以包括第四指示信息,指示编码端在编码时是否开启了利用神经网络的编码技术进行编码。解码端在接收到第一编码数据后,可以根据该第一编码数据中的第四指示信息确定是否利用神经网络的解码技术进行解码。
若该第四指示信息指示开启了利用神经网络的编码技术编码,则解码端利用神经网络的解码技术进行解码;若该第四指示信息指示未开启利用神经网络的编码技术编码,则解码端不利用神经网络的解码技术进行解码。
示例性地,假设分别以“1”和“0”表示利用神经网络的编码技术进行编码的开启和关闭,若第一编码数据中的第四指示信息指示“1”,则解码端根据该指示信息确定利用神经网络的解码技术进行解码;若第一编码数据中的第四指示信息指示“0”,则解码端根据该指示信息确定不利用神经网络的解码技术进行解码。
应理解,上述以“1”和“0”表示利用神经网络的编码技术进行编码的开启和关闭仅为示例性说明,还可以用其他标识(如“a”、“b”等)表示利用神经网络的编码技术进行编码的开启和关闭,不应对本申请造成特别限定。
本申请提供的方案,通过在第一编码数据中增加第四指示信息,指示是否开启了利用神经网络的编码技术进行编码,解码端在接收到该第一编码数据后,根据该第一编码数据中的第四指示信息确定是否利用神经网络的解码技术进行解码,可以进一步提高解码的准确率。
可选地,在一些实施例中,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
利用所述差分预测的方式对所述神经网络模型的模型参数集中的部分模型参数或全部模型参数进行压缩编码。
相应地,对于解码端,上述步骤430中对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集中的部分模型参数或全部模型参数。
本申请实施例中,编码端对神经网络模型的模型参数集进行压缩编码时,可以编码 该神经网络模型的模型参数集中的部分模型参数或全部模型参数。其中该部分模型参数可以包括但不限于该神经网络的层数、神经元的个数,其它模型参数(包括但不限制于神经元之间连接的权重等)可以预设在编码端和解码端。
解码端通过对第二编码数据进行解码,可以获得神经网络模型的模型参数的部分模型参数,可以结合预设在解码端的其它模型参数对第一编码数据进行解码;或者,通过对第二编码数据进行解码可以获得神经网络模型的模型参数集的全部模型参数,并利用解码获得的全部模型参数对第一编码数据进行解码。
本申请提供的方案,编码端对神经网络模型的模型参数集进行压缩编码时,可以编码该神经网络模型的模型参数集中的部分模型参数,其它模型参数预设在编码端和解码端,可以节省传输带宽,解码端在对第一编码数据进行解码时可以保证解码的准确性;编码端对神经网络模型的模型参数集进行压缩编码时,可以编码该神经网络模型的模型参数集中的全部模型参数,解码端在对第一编码数据进行解码时可以保证解码的准确性。
上文结合图1-图8b,详细描述了本申请的方法实施例,下面结合图9-图13,描述本申请的装置实施例,装置实施例与方法实施例相互对应,因此未详细描述的部分可参见前面各部分方法实施例。
图9为本申请一实施例提供的一种编码装置900,该编码装置900可以包括处理器910。
处理器910,用于利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;
利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;
传输所述第一编码数据和所述第二编码数据。
可选地,在一些实施例中,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
可选地,在一些实施例中,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
可选地,在一些实施例中,所述神经网络模型包括在线训练的神经网络模型,所述处理器910进一步用于:
编码第1个神经网络模型的模型参数集;
对于第n个神经网络模型的模型参数集,编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述n为大于1的正整数,所述m为大于或等于1的正整数。
可选地,在一些实施例中,所述处理器910进一步用于:
若所述第n个神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述处理器910进一步用于:
编码第1个神经网络模型的模型参数集;
若所述第n个神经网络模型的模型参数集包括的模型参数的数量大于所述第m个神 经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。
可选地,在一些实施例中,所述处理器910进一步用于:
通过第一编码方式编码所述第1个神经网络模型的模型参数集;
通过第二编码方式编码所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述m为编码前固化到或预设在编码端的参数,或,所述m为编码端基于预设规则确定的。
可选地,在一些实施例中,所述m=1,或,所述m=n-1。
可选地,在一些实施例中,所述m为编码端基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
可选地,在一些实施例中,所述预设规则包括:
对于所述第n个神经网络模型的模型参数集,从多个神经网络模型中选择编码所述第n个神经网络模型的模型参数集的参数差值的比特数最小的神经网络模型参数集。
可选地,在一些实施例中,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器910进一步用于:
编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型。
可选地,在一些实施例中,所述处理器910进一步用于:
若所述第二神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述处理器910进一步用于:
所述神经网络模型包括多个离线训练的神经网络模型,所述处理器进一步用于:
编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
若所述第二神经网络模型的模型参数集包括的模型参数的数量大于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。
可选地,在一些实施例中,所述处理器910进一步用于:
通过第一编码方式编码所述第一神经网络模型的模型参数集;
通过第二编码方式编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述第一神经网络模型的模型参数集包括的模型参数的 数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
可选地,在一些实施例中,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于0的整数。
可选地,在一些实施例中,所述第一编码方式为定长码编码方式,所述第二编码方式为变长码编码方式。
可选地,在一些实施例中,所述处理器910进一步用于:
对所述神经网络模型的模型参数集进行划分,以获得所述神经网络模型的模型参数集的多个模型参数子集;
利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集。
可选地,在一些实施例中,所述神经网络模型包括多个神经网络模型,所述处理器910进一步用于:
对于第q个神经网络模型中的第一模型参数子集,利用第三神经网络模型中的模型参数子集对所述第一模型参数子集进行编码;
对于第q个神经网络模型中的第二模型参数子集,利用第四神经网络模型中的模型参数子集对所述第二模型参数子集进行编码,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型,所述q为大于0的整数。
可选地,在一些实施例中,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中的。
可选地,在一些实施例中,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
可选地,在一些实施例中,所述处理器910进一步用于:
将所述神经网络模型的模型参数集包括的模型参数转换为目标格式;
利用所述差分预测的方式对所述目标格式进行压缩编码。
可选地,在一些实施例中,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
可选地,在一些实施例中,所述处理器910进一步用于:
利用所述基于神经网络的编码技术对所述待编码图像进行预测、变换、量化、熵编码或滤波中的至少一种。
可选地,在一些实施例中,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
可选地,在一些实施例中,所述处理器910进一步用于:
利用所述差分预测的方式对所述神经网络模型的模型参数集中的部分模型参数或全部模型参数进行压缩编码。
图10为本申请一实施例提供的一种解码装置1000,该解码装置1000可以包括处理器1010。
处理器1010,用于接收第一编码数据和第二编码数据;
对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数;
利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
可选地,在一些实施例中,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
可选地,在一些实施例中,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
可选地,在一些实施例中,所述神经网络模型包括在线训练的神经网络模型,所述处理器1010进一步用于:
接收第1个神经网络模型的模型参数集的编码数据;
接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值;
利用所述参数差值和所述第m个神经网络模型的模型参数集中的模型参数获得所述第n个神经网络模型的模型参数集的模型参数。
可选地,在一些实施例中,所述处理器1010进一步用于:
对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述神经网络模型包括在线训练的神经网络模型,所述处理器1010进一步用于:
接收第1个神经网络模型的模型参数集的编码数据;
接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值和第二参数差值,所述 第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个神经网络模型的模型参数集或所述第m个神经网络模型的模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值;
利用所述第一参数差值和所述第m个神经网络模型的模型参数集中的模型参数,以及利用所述第二参数差值和所述预设值获得所述第n个神经网络模型的模型参数集的模型参数。
可选地,在一些实施例中,所述处理器1010进一步用于:
通过第一解码方式对所述第1个神经网络模型的模型参数集的编码数据进行解码;
通过第二解码方式对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码。
可选地,在一些实施例中,所述m为固化到或预设在解码端的参数,或,所述m为基于预设规则确定的。
可选地,在一些实施例中,所述m=1,或,所述m=n-1。
可选地,在一些实施例中,所述m为基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
可选地,在一些实施例中,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器1010进一步用于:
接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值;
利用所述参数差值与所述第一神经网络模型的模型参数集中的模型参数获得所述第二神经网络模型的模型参数集。
可选地,在一些实施例中,所述处理器1010进一步用于:
对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
可选地,在一些实施例中,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器1010进一步用于:
接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应 参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集或所述第一神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值;
利用所述第三参数差值与所述第一神经网络模型的模型参数集中的模型参数,以及利用所述第四参数差值和所述预设值获得所述第二神经网络模型的模型参数集。
可选地,在一些实施例中,所述处理器1010进一步用于:
通过第一解码方式解码所述第一神经网络模型的模型参数集的编码数据;
通过第二解码方式解码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据。
可选地,在一些实施例中,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
可选地,在一些实施例中,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于或等于0的整数。
可选地,在一些实施例中,所述第一解码方式为定长码解码方式,所述第二解码方式为变长码解码方式。
可选地,在一些实施例中,所述处理器1010进一步用于:
对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集的多个模型参数子集。
可选地,在一些实施例中,所述神经网络模型包括多个神经网络模型,所述处理器1010进一步用于:
对所述第二编码数据进行解码,获得第一模型参数子集和第二模型参数子集,获得第一模型参数子集的残差数据和第二模型参数子集的残差数据;
利用所述第一模型参数子集的残差数据和第三神经网络模型模型中的模型参数子集获得所述第一模型参数子集;
利用所述第二模型参数子集的残差数据和第四神经网络模型模型中的模型参数子集获得所述第二模型参数子集,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型;
利用所述第一模型参数子集中的模型参数和第二模型参数子集中的模型参数对所述第一编码数据进行解码。
可选地,在一些实施例中,所述第一编码数据通过第一通信链路传输,所述第二编 码数据通过第二通信链路传输;或,
所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中。
可选地,在一些实施例中,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
可选地,在一些实施例中,所述处理器1010进一步用于:
对所述第二编码数据进行解码,获得目标格式;
对所述目标格式进行转换;
利用转换后的格式的模型参数对所述第一编码数据进行解码。
可选地,在一些实施例中,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
可选地,在一些实施例中,所述处理器1010进一步用于:
利用所述神经网络的模型参数集中的模型参数对所述第一编码数据进行熵解码、反量化、反变换、预测重建或滤波中的至少一种。
可选地,在一些实施例中,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
可选地,在一些实施例中,所述处理器1010进一步用于:
对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集中的部分模型参数或全部模型参数。
图11是本申请再一实施例提供的编码装置的示意性结构图。图11所示的编码装置1100包括处理器1110,处理器1110可以从存储器中调用并运行计算机程序,以实现本申请实施例中所述的编码方法。
可选地,如图11所示,编码装置1100还可以包括存储器1120。其中,处理器1110可以从存储器1120中调用并运行计算机程序,以实现本申请实施例中的编码方法。
其中,存储器1120可以是独立于处理器1110的一个单独的器件,也可以集成在处理器1110中。
可选地,如图11所示,编码装置1100还可以包括收发器1130,处理器1110可以控制该收发器1130与其他装置进行通信,具体地,可以向其他装置发送信息或数据,或接收其他装置发送的信息或数据。
可选地,该编码装置例如可以是编码器、终端(包括但不限于手机、相机、无人机等),并且该编码装置可以实现本申请实施例的各个编码方法中的相应流程,为了简洁,在此不再赘述。
图12是本申请再一实施例提供的解码装置的示意性结构图。图12所示的解码装置1200包括处理器1210,处理器1210可以从存储器中调用并运行计算机程序,以实现本申请实施例中所述的解码方法。
可选地,如图12所示,解码装置1200还可以包括存储器1220。其中,处理器1210可以从存储器1220中调用并运行计算机程序,以实现本申请实施例中的解码方法。
其中,存储器1220可以是独立于处理器1210的一个单独的器件,也可以集成在处理器1210中。
可选地,如图12所示,解码装置1200还可以包括收发器1230,处理器1210可以控制该收发器1230与其他装置进行通信,具体地,可以向其他装置发送信息或数据,或接收其他装置发送的信息或数据。
可选地,该解码装置例如可以是解码器、终端(包括但不限于手机、相机、无人机等),并且该解码装置可以实现本申请实施例的各个解码方法中的相应流程,为了简洁,在此不再赘述。
图13是本申请实施例的芯片的示意性结构图。图13所示的芯片1300包括处理器1310,处理器1310可以从存储器中调用并运行计算机程序,以实现本申请实施例中的编码方法或解码方法。
可选地,如图13所示,芯片1300还可以包括存储器1320。其中,处理器1310可以从存储器1320中调用并运行计算机程序,以实现本申请实施例中的编码方法或解码方法。
其中,存储器1320可以是独立于处理器1310的一个单独的器件,也可以集成在处理器1310中。
可选地,该芯片1300还可以包括输入接口1330。其中,处理器1310可以控制该输入接口1330与其他装置或芯片进行通信,具体地,可以获取其他装置或芯片发送的信息或数据。
可选地,该芯片1300还可以包括输出接口1340。其中,处理器1310可以控制该输出接口1340与其他装置或芯片进行通信,具体地,可以向其他装置或芯片输出信息或数据。
应理解,本申请实施例提到的芯片还可以称为系统级芯片,系统芯片,芯片系统或片上系统芯片等。
应理解,本申请实施例的处理器可能是一种集成电路图像处理系统,具有信号的处理能力。在实现过程中,上述方法实施例的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成上述方法的步骤。
可以理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically  EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data Rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DR RAM)。应注意,本文描述的系统和方法的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
本申请实施例中的存储器可以向处理器提供指令和数据。存储器的一部分还可以包括非易失性随机存取存储器。例如,存储器还可以存储设备类型的信息。该处理器可以用于执行存储器中存储的指令,并且该处理器执行该指令时,该处理器可以执行上述方法实施例中与终端设备对应的各个步骤。
在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器,处理器执行存储器中的指令,结合其硬件完成上述方法的步骤。为避免重复,这里不再详细描述。
还应理解,在本申请实施例中,图像中的像素点可以位于不同的行和/或列,其中,A的长度可以对应于A包括的位于同一行的像素点个数,A的高度可以对应于A包括的位于同一列的像素点个数。此外,A的长度和高度也可以分别称为A的宽度和深度,本申请实施例对此不做限定。
还应理解,在本申请实施例中,“与A的边界间隔分布”可以指与A的边界间隔至少一个像素点,也可以称为“不与A的边界相邻”或者“不位于A的边界”,本申请实施例对此不做限定,其中,A可以是图像、矩形区域或子图像,等等。
还应理解,上文对本申请实施例的描述着重于强调各个实施例之间的不同之处,未提到的相同或相似之处可以互相参考,为了简洁,这里不再赘述。
本申请实施例还提供了一种计算机可读存储介质,用于存储计算机程序。
可选的,该计算机可读存储介质可应用于本申请实施例中的编码装置或解码装置,并且该计算机程序使得计算机执行本申请实施例的各个方法中由编码装置或解码装置实现的相应流程,为了简洁,在此不再赘述。
本申请实施例还提供了一种计算机程序产品,包括计算机程序指令。
可选的,该计算机程序产品可应用于本申请实施例中的编码装置或解码装置,并且该计算机程序指令使得计算机执行本申请实施例的各个方法中由编码装置或解码装置实现的相应流程,为了简洁,在此不再赘述。
本申请实施例还提供了一种计算机程序。
可选的,该计算机程序可应用于本申请实施例中的编码装置或解码装置,当该计算机程序在计算机上运行时,使得计算机执行本申请实施例的各个方法中由编码装置或解码装置实现的相应流程,为了简洁,在此不再赘述。
应理解,在本申请实施例中,术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系。例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口、装置或单元的间接耦合或通信连接,也可以是电的,机械的或其它的形式连接。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (110)

  1. 一种编码方法,其特征在于,包括:
    利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;
    利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;
    传输所述第一编码数据和所述第二编码数据。
  2. 根据权利要求1所述的方法,其特征在于,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
  3. 根据权利要求1或2所述的方法,其特征在于,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
  4. 根据权利要求1或3所述的方法,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    编码第1个神经网络模型的模型参数集;
    对于第n个神经网络模型的模型参数集,编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述n为大于1的正整数,所述m为大于或等于1的正整数。
  5. 根据权利要求4所述的方法,其特征在于,所述编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,包括:
    若所述第n个神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
  6. 根据权利要求1或3所述的方法,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    编码第1个神经网络模型的模型参数集;
    若所述第n个神经网络模型的模型参数集包括的模型参数的数量大于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。
  7. 根据权利要求4至6中任一项所述的方法,其特征在于,所述编码第1个神经网络模型的模型参数集,包括:
    通过第一编码方式编码所述第1个神经网络模型的模型参数集;
    所述编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,包括:
    通过第二编码方式编码所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值。
  8. 根据权利要求4至7中任一项所述的方法,其特征在于,所述m为编码前固化到或预设在编码端的参数,或,所述m为编码端基于预设规则确定的。
  9. 根据权利要求4至8中任一项所述的方法,其特征在于,所述m=1,或,所述m=n-1。
  10. 根据权利要求8所述的方法,其特征在于,所述m为编码端基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
  11. 根据权利要求10所述的方法,其特征在于,所述预设规则包括:
    对于所述第n个神经网络模型的模型参数集,从多个神经网络模型中选择编码所述第n个神经网络模型的模型参数集的参数差值的比特数最小的神经网络模型参数集。
  12. 根据权利要求1或3所述的方法,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
    编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型。
  13. 根据权利要求12所述的方法,其特征在于,所述编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,包括:
    若所述第二神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  14. 根据权利要求1或3所述的方法,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
    若所述第二神经网络模型的模型参数集包括的模型参数的数量大于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。
  15. 根据权利要求12至14中任一项所述的方法,其特征在于,所述编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集,包括:
    通过第一编码方式编码所述第一神经网络模型的模型参数集;
    所述编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,包括:
    通过第二编码方式编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  16. 根据权利要求12至15中任一项所述的方法,其特征在于,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参 数集中包括的模型参数的数量最少的神经网络模型。
  17. 根据权利要求12至16中任一项所述的方法,其特征在于,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于0的整数。
  18. 根据权利要求7或15所述的方法,其特征在于,所述第一编码方式为定长码编码方式,所述第二编码方式为变长码编码方式。
  19. 根据权利要求1至18中任一项所述的方法,其特征在于,所述方法还包括:
    对所述神经网络模型的模型参数集进行划分,以获得所述神经网络模型的模型参数集的多个模型参数子集;
    所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集。
  20. 根据权利要求19所述的方法,其特征在于,所述神经网络模型包括多个神经网络模型,所述利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集,包括:
    对于第q个神经网络模型中的第一模型参数子集,利用第三神经网络模型中的模型参数子集对所述第一模型参数子集进行编码;
    对于第q个神经网络模型中的第二模型参数子集,利用第四神经网络模型中的模型参数子集对所述第二模型参数子集进行编码,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型,所述q为大于0的整数。
  21. 根据权利要求1至20中任一项所述的方法,其特征在于,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
    所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中的。
  22. 根据权利要求21所述的方法,其特征在于,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
  23. 根据权利要求1至22中任一项所述的方法,其特征在于,所述方法还包括:
    将所述神经网络模型的模型参数集包括的模型参数转换为目标格式;
    所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    利用所述差分预测的方式对所述目标格式进行压缩编码。
  24. 根据权利要求23所述的方法,其特征在于,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
  25. 根据权利要求1至24中任一项所述的方法,其特征在于,所述利用基于神经网络的编码技术对待编码图像进行编码,包括:
    利用所述基于神经网络的编码技术对所述待编码图像进行预测、变换、量化、熵编码或滤波中的至少一种。
  26. 根据权利要求1至25中任一项所述的方法,其特征在于,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
  27. 根据权利要求1至26中任一项所述的方法,其特征在于,所述利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,包括:
    利用所述差分预测的方式对所述神经网络模型的模型参数集中的部分模型参数或全部模型参数进行压缩编码。
  28. 一种解码方法,其特征在于,包括:
    接收第一编码数据和第二编码数据;
    对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数;
    利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
  29. 根据权利要求28所述的方法,其特征在于,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
  30. 根据权利要求28或29所述的方法,其特征在于,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
  31. 根据权利要求28或30所述的方法,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述接收第二编码数据,包括:
    接收第1个神经网络模型的模型参数集的编码数据;
    接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
    所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值;
    利用所述参数差值和所述第m个神经网络模型的模型参数集中的模型参数获得所述第n个神经网络模型的模型参数集的模型参数。
  32. 根据权利要求31所述的方法,其特征在于,所述对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值,包括:
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值,所述第一参数差值为 所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
  33. 根据权利要求28或30所述的方法,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述接收第二编码数据,包括:
    接收第1个神经网络模型的模型参数集的编码数据;
    接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
    所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个神经网络模型的模型参数集除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值;
    利用所述第一参数差值和所述第m个神经网络模型的模型参数集中的模型参数,以及利用所述第二参数差值和所述预设值获得所述第n个神经网络模型的模型参数集的模型参数。
  34. 根据权利要求31至33中任一项所述的方法,其特征在于,所述对所述第1个神经网络模型的模型参数集的编码数据进行解码,包括:
    通过第一解码方式对所述第1个神经网络模型的模型参数集的编码数据进行解码;
    所述对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,包括:
    通过第二解码方式对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码。
  35. 根据权利要求31至34中任一项所述的方法,其特征在于,所述m为固化到或预设在解码端的参数,或,所述m为基于预设规则确定的。
  36. 根据权利要求31至35中任一项所述的方法,其特征在于,所述m=1,或,所述m=n-1。
  37. 根据权利要求36所述的方法,其特征在于,所述m为基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
  38. 根据权利要求28或30所述的方法,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述接收第二编码数据,包括:
    接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
    接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
    所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值;
    利用所述参数差值与所述第一神经网络模型的模型参数集中的模型参数获得所述第二神经网络模型的模型参数集。
  39. 根据权利要求38所述的方法,其特征在于,所述对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,包括:
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  40. 根据权利要求28或30所述的方法,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述接收第二编码数据,包括:
    接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
    接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
    所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值;
    利用所述第三参数差值与所述第一神经网络模型的模型参数集中的模型参数,以及利用所述第四参数差值和所述预设值获得所述第二神经网络模型的模型参数集。
  41. 根据权利要求38至40中任一项所述的方法,其特征在于,所述对所述第一神经网络模型的模型参数集的编码数据进行解码,包括:
    通过第一解码方式解码所述第一神经网络模型的模型参数集的编码数据;
    所述对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,包括:
    通过第二解码方式解码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据。
  42. 根据权利要求38至41中任一项所述的方法,其特征在于,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
  43. 根据权利要求38至42中任一项所述的方法,其特征在于,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于或等于0的整数。
  44. 根据权利要求34或41所述的方法,其特征在于,所述第一解码方式为定长码解码方式,所述第二解码方式为变长码解码方式。
  45. 根据权利要求28至44中任一项所述的方法,其特征在于,所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集的多个模型参数子集。
  46. 根据权利要求45所述的方法,其特征在于,所述神经网络模型包括多个神经网络模型,所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第二编码数据进行解码,获得第一模型参数子集的残差数据和第二模型参数子集的残差数据;
    利用所述第一模型参数子集的残差数据和第三神经网络模型中的模型参数子集获得所述第一模型参数子集;
    利用所述第二模型参数子集的残差数据和第四神经网络模型中的模型参数子集获得所述第二模型参数子集,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型;
    所述利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,包括:
    利用所述第一模型参数子集中的模型参数和第二模型参数子集中的模型参数对所述第一编码数据进行解码。
  47. 根据权利要求28至46中任一项所述的方法,其特征在于,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
    所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中。
  48. 根据权利要求47所述的方法,其特征在于,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
  49. 根据权利要求28至48中任一项所述的方法,其特征在于,所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第二编码数据进行解码,获得目标格式;
    所述利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,包括:
    对所述目标格式进行转换;
    利用转换后的格式的模型参数对所述第一编码数据进行解码。
  50. 根据权利要求49所述的方法,其特征在于,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
  51. 根据权利要求28至50中任一项所述的方法,其特征在于,所述利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,包括:
    利用所述神经网络的模型参数集中的模型参数对所述第一编码数据进行熵解码、反量化、反变换、预测重建或滤波中的至少一种。
  52. 根据权利要求28至51中任一项所述的方法,其特征在于,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
  53. 根据权利要求28至52中任一项所述的方法,其特征在于,所述对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数,包括:
    对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集中的部分模型参数或全部模型参数。
  54. 一种编码装置,其特征在于,包括:
    处理器,用于利用基于神经网络的编码技术对待编码图像进行编码,获得第一编码数据;
    利用差分预测的方式对所述基于神经网络的编码技术所包含的神经网络模型的模型参数集进行压缩编码,得到第二编码数据;
    传输所述第一编码数据和所述第二编码数据。
  55. 根据权利要求54所述的装置,其特征在于,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
  56. 根据权利要求54或55所述的装置,其特征在于,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
  57. 根据权利要求54或56所述的装置,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述处理器进一步用于:
    编码第1个神经网络模型的模型参数集;
    对于第n个神经网络模型的模型参数集,编码第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述n为大于1的正整数,所述m为大于或等于1的正整数。
  58. 根据权利要求57所述的装置,其特征在于,所述处理器进一步用于:
    若所述第n个神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
  59. 根据权利要求54或56所述的装置,其特征在于,所述神经网络模型包括在线 训练的神经网络模型,所述处理器进一步用于:
    编码第1个神经网络模型的模型参数集;
    若所述第n个神经网络模型的模型参数集包括的模型参数的数量大于所述第m个神经网络模型的模型参数集包括的模型参数的数量,编码第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值。
  60. 根据权利要求57至59中任一项所述的装置,其特征在于,所述处理器进一步用于:
    通过第一编码方式编码所述第1个神经网络模型的模型参数集;
    通过第二编码方式编码所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值。
  61. 根据权利要求57至60中任一项所述的装置,其特征在于,所述m为编码前固化到或预设在编码端的参数,或,所述m为编码端基于预设规则确定的。
  62. 根据权利要求57至61中任一项所述的装置,其特征在于,所述m=1,或,所述m=n-1。
  63. 根据权利要求62所述的装置,其特征在于,所述m为编码端基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
  64. 根据权利要求63所述的装置,其特征在于,所述预设规则包括:
    对于所述第n个神经网络模型的模型参数集,从多个神经网络模型中选择编码所述第n个神经网络模型的模型参数集的参数差值的比特数最小的神经网络模型参数集。
  65. 根据权利要求54或56所述的装置,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器进一步用于:
    编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
    编码第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型。
  66. 根据权利要求65所述的装置,其特征在于,所述处理器进一步用于:
    若所述第二神经网络模型的模型参数集包括的模型参数的数量小于或等于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  67. 根据权利要求54或56所述的装置,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器进一步用于:
    编码所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集;
    若所述第二神经网络模型的模型参数集包括的模型参数的数量大于所述第一神经网络模型的模型参数集包括的模型参数的数量,编码第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值。
  68. 根据权利要求65至67中任一项所述的装置,其特征在于,所述处理器进一步用于:
    通过第一编码方式编码所述第一神经网络模型的模型参数集;
    通过第二编码方式编码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  69. 根据权利要求65至68中任一项所述的装置,其特征在于,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
  70. 根据权利要求65至69中任一项所述的装置,其特征在于,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于0的整数。
  71. 根据权利要求60或68所述的装置,其特征在于,所述第一编码方式为定长码编码方式,所述第二编码方式为变长码编码方式。
  72. 根据权利要求54至71中任一项所述的装置,其特征在于,所述处理器进一步用于:
    对所述神经网络模型的模型参数集进行划分,以获得所述神经网络模型的模型参数集的多个模型参数子集;
    利用所述差分预测的方式编码所述神经网络模型的模型参数集的多个模型参数子集。
  73. 根据权利要求72所述的装置,其特征在于,所述神经网络模型包括多个神经网络模型,所述处理器进一步用于:
    对于第q个神经网络模型中的第一模型参数子集,利用第三神经网络模型中的模型参数子集对所述第一模型参数子集进行编码;
    对于第q个神经网络模型中的第二模型参数子集,利用第四神经网络模型中的模型参数子集对所述第二模型参数子集进行编码,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型,所述q为大于0的整数。
  74. 根据权利要求54至73中任一项所述的装置,其特征在于,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
    所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中的。
  75. 根据权利要求74所述的装置,其特征在于,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
  76. 根据权利要求54至75中任一项所述的装置,其特征在于,所述处理器进一步用于:
    将所述神经网络模型的模型参数集包括的模型参数转换为目标格式;
    利用所述差分预测的方式对所述目标格式进行压缩编码。
  77. 根据权利要求76所述的装置,其特征在于,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
  78. 根据权利要求54至77中任一项所述的装置,其特征在于,所述处理器进一步用于:
    利用所述基于神经网络的编码技术对所述待编码图像进行预测、变换、量化、熵编码或滤波中的至少一种。
  79. 根据权利要求54至78中任一项所述的装置,其特征在于,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
  80. 根据权利要求54至79中任一项所述的装置,其特征在于,所述处理器进一步用于:
    利用所述差分预测的方式对所述神经网络模型的模型参数集中的部分模型参数或全部模型参数进行压缩编码。
  81. 一种解码装置,其特征在于,包括:
    处理器,用于接收第一编码数据和第二编码数据;
    对所述第二编码数据进行解码,获得神经网络模型的模型参数集中的模型参数;
    利用所述神经网络模型的模型参数集中的模型参数对所述第一编码数据进行解码,获得解码后的图像。
  82. 根据权利要求81所述的装置,其特征在于,所述神经网络模型的模型参数集中所包括的模型参数的位宽小于或等于第一阈值。
  83. 根据权利要求81或82所述的装置,其特征在于,所述神经网络模型包括离线训练的神经网络模型或在线训练的神经网络模型。
  84. 根据权利要求81或83所述的装置,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述处理器进一步用于:
    接收第1个神经网络模型的模型参数集的编码数据;
    接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
    对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值;
    利用所述参数差值和所述第m个神经网络模型的模型参数集中的模型参数获得所述第n个神经网络模型的模型参数集的模型参数。
  85. 根据权利要求84所述的装置,其特征在于,所述处理器进一步用于:
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值。
  86. 根据权利要求81或83所述的装置,其特征在于,所述神经网络模型包括在线训练的神经网络模型,所述处理器进一步用于:
    接收第1个神经网络模型的模型参数集的编码数据;
    接收第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述n为大于1的正整数,所述m为大于或等于1的正整数;
    对所述第1个神经网络模型的模型参数集的编码数据进行解码,获得所述第1个神经网络模型的模型参数集中的模型参数;
    对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第一参数差值和第二参数差值,所述第一参数差值为所述第n个神经网络模型的模型参数集与第m个神经网络模型的模型参数集中对应参数的参数差值,所述第二参数差值为所述第n个神经网络模型的模型参数集中除所述第一参数差值对应的模型参数之外的参数和预设值的参数差值;
    利用所述第一参数差值和所述第m个神经网络模型的模型参数集中的模型参数,以及利用所述第二参数差值和所述预设值获得所述第n个神经网络模型的模型参数集的模型参数。
  87. 根据权利要求84至86中任一项所述的装置,其特征在于,所述处理器进一步用于:
    通过第一解码方式对所述第1个神经网络模型的模型参数集的编码数据进行解码;
    通过第二解码方式对所述第n个神经网络模型的模型参数集与所述第m个神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码。
  88. 根据权利要求84至87中任一项所述的装置,其特征在于,所述m为固化到或预设在解码端的参数,或,所述m为基于预设规则确定的。
  89. 根据权利要求84至88中任一项所述的装置,其特征在于,所述m=1,或,所述m=n-1。
  90. 根据权利要求88所述的装置,其特征在于,所述m为基于预设规则确定的,所述第一编码数据中还包括第一指示信息,所述第一指示信息用于指示所述m值。
  91. 根据权利要求81或83所述的装置,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器进一步用于:
    接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
    接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
    对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值;
    利用所述参数差值与所述第一神经网络模型的模型参数集中的模型参数获得所述第 二神经网络模型的模型参数集。
  92. 根据权利要求91所述的装置,其特征在于,所述处理器进一步用于:
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值。
  93. 根据权利要求81或83所述的装置,其特征在于,所述神经网络模型包括多个离线训练的神经网络模型,所述处理器进一步用于:
    接收所述多个离线训练的神经网络模型中的第一神经网络模型的模型参数集的编码数据;
    接收第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据,所述第二神经网络模型为所述多个离线训练的神经网络模型中除所述第一神经网络模型之外的神经网络模型;
    对所述第一神经网络模型的模型参数集的编码数据进行解码,获得所述第一神经网络模型的模型参数集中的模型参数;
    对所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据进行解码,获得第三参数差值和第四参数差值,所述第三参数差值为所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值,所述第四参数差值为所述第二神经网络模型的模型参数集中除所述第三参数差值对应的模型参数之外的参数和预设值的参数差值;
    利用所述第三参数差值与所述第一神经网络模型的模型参数集中的模型参数,以及利用所述第四参数差值和所述预设值获得所述第二神经网络模型的模型参数集。
  94. 根据权利要求91至93中任一项所述的装置,其特征在于,所述处理器进一步用于:
    通过第一解码方式解码所述第一神经网络模型的模型参数集的编码数据;
    通过第二解码方式解码所述第二神经网络模型的模型参数集与所述第一神经网络模型的模型参数集中对应参数的参数差值的编码数据。
  95. 根据权利要求91至94中任一项所述的装置,其特征在于,所述第一神经网络模型的模型参数集包括的模型参数的数量为所述多个离线训练的神经网络模型的模型参数集中包括的模型参数的数量最少的神经网络模型。
  96. 根据权利要求91至95中任一项所述的装置,其特征在于,所述第一编码数据中还包括第二指示信息,所述第二指示信息用于指示在对第p个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述p为大于或等于0的整数。
  97. 根据权利要求87或94所述的装置,其特征在于,所述第一解码方式为定长码解码方式,所述第二解码方式为变长码解码方式。
  98. 根据权利要求81至97中任一项所述的装置,其特征在于,所述处理器进一步用于:
    对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集的多个模型参数子集。
  99. 根据权利要求98所述的装置,其特征在于,所述神经网络模型包括多个神经网络模型,所述处理器进一步用于:
    对所述第二编码数据进行解码,获得第一模型参数子集的残差数据和第二模型参数子集的残差数据;
    利用所述第一模型参数子集的残差数据和第三神经网络模型中的模型参数子集获得所述第一模型参数子集;
    利用所述第二模型参数子集的残差数据和第四神经网络模型中的模型参数子集获得所述第二模型参数子集,所述第三神经网络模型和所述第四神经网络模型为所述多个神经网络模型中的不同模型;
    利用所述第一模型参数子集中的模型参数和第二模型参数子集中的模型参数对所述第一编码数据进行解码。
  100. 根据权利要求81至99中任一项所述的装置,其特征在于,所述第一编码数据通过第一通信链路传输,所述第二编码数据通过第二通信链路传输;或,
    所述第一编码数据和所述第二编码数据通过所述第一通信链路传输,所述第二编码数据是以编码头信息的方式写入所述第一编码数据中。
  101. 根据权利要求100所述的装置,其特征在于,所述第一编码数据通过所述第一通信链路传输,所述第二编码数据通过所述第二通信链路传输,所述第一编码数据中还包括第三指示信息,所述第三指示信息用于指示在对第s个目标图像进行编码时采用的神经网络模型的模型参数的标识,所述目标图像为对所述待编码图像按照视频序列级、图像组级、图像级中的任意一种进行划分后的图像,所述s为大于0的整数。
  102. 根据权利要求81至101中任一项所述的装置,其特征在于,所述处理器进一步用于:
    对所述第二编码数据进行解码,获得目标格式;
    对所述目标格式进行转换;
    利用转换后的格式的模型参数对所述第一编码数据进行解码。
  103. 根据权利要求102所述的装置,其特征在于,所述目标格式包括神经网络变换格式NNEF或开放神经网络变换ONNX格式。
  104. 根据权利要求81至103中任一项所述的装置,其特征在于,所述处理器进一步用于:
    利用所述神经网络的模型参数集中的模型参数对所述第一编码数据进行熵解码、反量化、反变换、预测重建或滤波中的至少一种。
  105. 根据权利要求81至104中任一项所述的装置,其特征在于,所述第一编码数据中包括第四指示信息,所述第四指示信息用于指示是否开启了利用神经网络的编码技术进行编码。
  106. 根据权利要求81至105中任一项所述的装置,其特征在于,所述处理器进一步用于:
    对所述第二编码数据进行解码,获得所述神经网络模型的模型参数集中的部分模型参数或全部模型参数。
  107. 一种编码装置,其特征在于,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求1 至27中任一项所述的方法。
  108. 一种解码装置,其特征在于,包括:处理器和存储器,该存储器用于存储计算机程序,所述处理器用于调用并运行所述存储器中存储的计算机程序,执行如权利要求28至53中任一项所述的方法。
  109. 一种计算机可读存储介质,其特征在于,包括用于执行权利要求1至27中任一项所述的编码方法的指令。
  110. 一种计算机可读存储介质,其特征在于,包括用于执行权利要求28至53中任一项所述的解码方法的指令。
PCT/CN2021/070791 2021-01-08 2021-01-08 编码方法、解码方法和编码装置、解码装置 WO2022147745A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2021/070791 WO2022147745A1 (zh) 2021-01-08 2021-01-08 编码方法、解码方法和编码装置、解码装置
CN202180080110.1A CN116530079A (zh) 2021-01-08 2021-01-08 编码方法、解码方法和编码装置、解码装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2021/070791 WO2022147745A1 (zh) 2021-01-08 2021-01-08 编码方法、解码方法和编码装置、解码装置

Publications (1)

Publication Number Publication Date
WO2022147745A1 true WO2022147745A1 (zh) 2022-07-14

Family

ID=82357584

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/070791 WO2022147745A1 (zh) 2021-01-08 2021-01-08 编码方法、解码方法和编码装置、解码装置

Country Status (2)

Country Link
CN (1) CN116530079A (zh)
WO (1) WO2022147745A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229644A (zh) * 2016-12-15 2018-06-29 上海寒武纪信息科技有限公司 压缩/解压缩神经网络模型的装置、设备和方法
CN108271026A (zh) * 2016-12-30 2018-07-10 上海寒武纪信息科技有限公司 压缩/解压缩的装置和系统、芯片、电子装置
CN109190759A (zh) * 2018-08-01 2019-01-11 西安电子科技大学 一种基于{-1,+1}编码的神经网络模型压缩与加速方法
CN111182220A (zh) * 2020-01-09 2020-05-19 西安万像电子科技有限公司 图像处理装置、远端设备及通信系统
US20200236349A1 (en) * 2019-01-22 2020-07-23 Apple Inc. Predictive coding with neural networks
CN112119593A (zh) * 2019-07-25 2020-12-22 深圳市大疆创新科技有限公司 一种数据的处理方法、系统、编码器及解码器

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108229644A (zh) * 2016-12-15 2018-06-29 上海寒武纪信息科技有限公司 压缩/解压缩神经网络模型的装置、设备和方法
CN108271026A (zh) * 2016-12-30 2018-07-10 上海寒武纪信息科技有限公司 压缩/解压缩的装置和系统、芯片、电子装置
CN109190759A (zh) * 2018-08-01 2019-01-11 西安电子科技大学 一种基于{-1,+1}编码的神经网络模型压缩与加速方法
US20200236349A1 (en) * 2019-01-22 2020-07-23 Apple Inc. Predictive coding with neural networks
CN112119593A (zh) * 2019-07-25 2020-12-22 深圳市大疆创新科技有限公司 一种数据的处理方法、系统、编码器及解码器
CN111182220A (zh) * 2020-01-09 2020-05-19 西安万像电子科技有限公司 图像处理装置、远端设备及通信系统

Also Published As

Publication number Publication date
CN116530079A (zh) 2023-08-01

Similar Documents

Publication Publication Date Title
Lombardo et al. Deep generative video compression
TWI830107B (zh) 通過指示特徵圖資料進行編碼
WO2022068716A1 (zh) 熵编/解码方法及装置
WO2022116207A1 (zh) 编码方法、解码方法和编码装置、解码装置
WO2022155974A1 (zh) 视频编解码以及模型训练方法与装置
KR20200109904A (ko) Dnn 기반 이미지 또는 비디오 코딩을 위한 시스템 및 방법
JP2023548507A (ja) セグメンテーション情報のシグナリングを用いた復号化
WO2022063265A1 (zh) 帧间预测方法及装置
KR20200005403A (ko) 코덱 단위의 dnn 기반 이미지 또는 비디오 코딩을 위한 시스템 및 방법
US20240064318A1 (en) Apparatus and method for coding pictures using a convolutional neural network
CN116235496A (zh) 编码方法、解码方法、编码器、解码器以及编码系统
Han et al. Deep generative video compression
CN113767626B (zh) 视频增强的方法及装置
WO2022147745A1 (zh) 编码方法、解码方法和编码装置、解码装置
TWI826160B (zh) 圖像編解碼方法和裝置
WO2023193629A1 (zh) 区域增强层的编解码方法和装置
WO2022063267A1 (zh) 帧内预测方法及装置
TW202337211A (zh) 條件圖像壓縮
CN114979711B (zh) 音视频或图像分层压缩方法和装置
CN118020306A (zh) 视频编解码方法、编码器、解码器及存储介质
CN118120233A (zh) 基于注意力的图像和视频压缩上下文建模
CN117501696A (zh) 使用在分块之间共享的信息进行并行上下文建模
JP2024511587A (ja) ニューラルネットワークベースのピクチャ処理における補助情報の独立した配置
JP2024513693A (ja) ピクチャデータ処理ニューラルネットワークに入力される補助情報の構成可能な位置
CN114501031A (zh) 一种压缩编码、解压缩方法以及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21916801

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202180080110.1

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21916801

Country of ref document: EP

Kind code of ref document: A1