A deep learning image coding network distillation training method and system
By using a distillation training method to lightweight deep learning image encoding and decoding networks, the problem of high computational cost is solved, enabling efficient encoding and decoding in actual production and suitable for both central and edge devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SHUANGSHEN INFORMATION TECH CO LTD
- Filing Date
- 2022-09-08
- Publication Date
- 2026-05-29
Smart Images

Figure CN116320458B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image encoding and decoding technology, and in particular to a distillation training method and system for deep learning image encoding and decoding networks. Background Technology
[0002] Currently, deep learning-based image encoding and decoding networks in academia have surpassed the performance of traditional H.266, H.265, WEBP, and JPEG in terms of compression performance based on PSNR (Peak Signal-to-Noise Ratio), MS-SSIM (Multi-level Structural Similarity), and human subjective perception.
[0003] However, existing deep learning-based image encoding and decoding networks involve enormous computational demands for encoding and decoding, making them difficult to apply in real-world production. Summary of the Invention
[0004] The purpose of this invention is to provide a distillation training method and system for deep learning image encoding and decoding networks, which greatly reduces the memory usage and computational load of the encoding and decoding process while ensuring that the compression performance is not significantly reduced.
[0005] The objective of this invention is achieved through the following technical solution:
[0006] A distillation training method for a deep learning image encoding / decoding network includes:
[0007] Phase 1: Construct an image codec network containing a teacher codec model, which includes a teacher encoding model, a super-prior probability model, and a teacher decoding model. The teacher encoding model and the teacher decoding model constitute the teacher codec model. Input the original image into the image codec network containing the teacher codec model, calculate the rate-distortion loss of the first phase, and train the image codec network based on the teacher codec model.
[0008] The second stage involves adding a student encoding / decoding model to the image encoding / decoding network containing the teacher encoding / decoding model. The student encoding / decoding model comprises a student encoding model and a student decoding model, with the student model positioned at the same location as the teacher encoding / decoding model. The student encoding / decoding model is obtained by lightweighting the residual modules in the teacher encoding / decoding model. The original image is input to both the teacher and student encoding models. The outputs of both models are processed by the prior probability model before being fed into the corresponding teacher and student decoding models. The knowledge distillation loss is calculated using the outputs of both models, the outputs at the same positions in the teacher and student encoding models, and the outputs at the same positions in the teacher and student decoding models. This second-stage rate-distortion loss, calculated by combining the outputs of the student decoding model and the prior probability model, is then used to train the student encoding / decoding model and update its parameters. After training for a specified number of iterations, the teacher encoding / decoding model is removed, the original image is input, the second-stage rate-distortion loss is calculated, and the parameters of the student encoding / decoding model and the prior probability model are fine-tuned.
[0009] A distillation training system for a deep learning image encoding / decoding network includes:
[0010] The first training unit is applied to the first stage, which includes: constructing an image codec network containing a teacher codec model, wherein the teacher codec model includes a teacher encoding model, a super-prior probability model, and a teacher decoding model, and the teacher encoding model and the teacher decoding model constitute the teacher codec model; inputting the original image into the image codec network containing the teacher codec model, calculating the rate-distortion loss of the first stage, and training the image codec network based on the teacher codec model;
[0011] The second training unit, applied to the second stage, includes: adding a student encoding / decoding model to the image encoding / decoding network based on the teacher encoding / decoding model, including a student encoding model and a student decoding model, the student encoding / decoding model being positioned at the same location as the teacher encoding / decoding model; the student encoding / decoding model being obtained by lightweighting the residual module in the teacher encoding / decoding model; inputting the original image to the teacher encoding model and the student encoding model, the outputs of both the teacher encoding model and the student encoding model being processed by the prior probability model and then correspondingly input to the teacher decoding model and the student decoding model; calculating the knowledge distillation loss using the outputs of the teacher encoding model and the student encoding model, the outputs at the same position between the teacher encoding model and the student encoding model, and the outputs at the same position between the teacher decoding model and the student decoding model, and training the student encoding / decoding model by combining the second-stage rate-distortion loss calculated by combining the outputs of the student decoding model and the prior probability model, and updating the parameters of the student encoding / decoding model; after training reaches a specified number of times, removing the teacher encoding / decoding model, inputting the original image, calculating the second-stage rate-distortion loss, and fine-tuning the parameters of the student encoding / decoding model and the prior probability model.
[0012] A processing device includes: one or more processors; and a memory for storing one or more programs;
[0013] When the one or more programs are executed by the one or more processors, the one or more processors implement the aforementioned method.
[0014] A readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned method.
[0015] As can be seen from the technical solution provided by the present invention, performing a lightweight distillation operation on the deep learning image encoding and decoding network ensures that the number of network parameters is effectively reduced by 70% without significantly reducing the compression performance. In actual production applications, the student network that has undergone distillation learning occupies less device memory and has a faster encoding and decoding inference speed, enabling it to encode and decode high-definition images on central and edge devices. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating a distillation training method for a deep learning image encoding / decoding network provided in an embodiment of the present invention;
[0018] Figure 2 A schematic diagram of the first stage of training provided for an embodiment of the present invention;
[0019] Figure 3 A schematic diagram of the second stage of training provided in an embodiment of the present invention;
[0020] Figure 4 A schematic diagram of the residual module provided in an embodiment of the present invention;
[0021] Figure 5 A schematic diagram of a lightweight residual module provided in an embodiment of the present invention;
[0022] Figure 6 This is a schematic diagram of a distillation training system for a deep learning image encoding / decoding network provided in an embodiment of the present invention;
[0023] Figure 7 This is a schematic diagram of a processing device provided in an embodiment of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0025] First, the following explanations are provided for the terms that may be used in this article:
[0026] The terms “including,” “comprising,” “containing,” “having,” or other similar semantic descriptions should be interpreted as non-exclusive inclusion. For example, “including a technical feature element (such as raw material, component, ingredient, carrier, dosage form, material, size, part, component, mechanism, device, step, process, method, reaction conditions, processing conditions, parameter, algorithm, signal, data, product or article of manufacture, etc.)” should be interpreted as including not only the expressly listed technical feature element, but also other technical feature elements that are not expressly listed and are well-known in the art.
[0027] The following is a detailed description of the distillation training method and system for deep learning image encoding and decoding networks provided by this invention. Contents not described in detail in the embodiments of this invention are prior art known to those skilled in the art. Where specific conditions are not specified in the embodiments of this invention, they are performed according to conventional conditions in the art or conditions recommended by the manufacturer. Reagents or instruments used in the embodiments of this invention, unless otherwise specified, are all commercially available conventional products.
[0028] Example 1
[0029] This invention provides a distillation training method for deep learning image encoding / decoding networks, such as... Figure 1 As shown, it mainly includes:
[0030] Phase 1: Construct an image codec network containing a teacher codec model, which includes a teacher encoding model, a super-prior probability model, and a teacher decoding model; input the original image into the image codec network containing the teacher codec model, calculate the rate-distortion loss of the first phase, and train the image codec network based on the teacher codec model.
[0031] The rate-distortion loss in the first stage involved in this part can be calculated in a conventional way. The main structures of the teacher encoding model, the super-prior probability model and the teacher decoding model can also be implemented by existing models. During training, a training number will be set, and the learning rate will be gradually reduced until the training converges. The training process involved can refer to conventional techniques, and will not be elaborated in this invention.
[0032] Figure 2 The training process in the first phase is illustrated, which provides exemplary structures for the teacher-encoder model, the super-prior probability model, and the teacher-decoder model. The main steps in this phase include:
[0033] (1) Input the original image (dimensions: H, W, 3), enter the teacher coding model, extract the primary features of the image, the dimensions of the primary features are: H / 16, W / 16, C, C is the number of feature channels, H and W are the height and width of the original image respectively, and 16 represents the downsampling factor of the teacher coding model. The value can be set by the user according to the actual situation.
[0034] (2) The primary image features output by the teacher coding model are fed into the hyper-prior probabilistic model, which contains two branches. Each branch performs its own bitrate estimation, and the rate loss (R-LOSS) is calculated using the bitrate estimation results (bitstream) from the two branches. In the hyper-prior probabilistic model: hyperanalysis represents the hyper-prior encoder, hypersynthesis represents the hyper-prior decoder, ROUND represents the quantization operation, AE and AD represent the entropy encoder and entropy decoder (used to perform lossless entropy encoding and lossless entropy decoding), and LMM represents the Laplace mixture model. The main principles and workflow of the hyper-prior probabilistic model can be referred to conventional techniques, and will not be elaborated here.
[0035] (3) Since the super-prior probability model performs lossless entropy encoding and decoding, the output of the left branch AD is the primary image feature input to the super-prior probability model. It enters the teacher decoding model and undergoes nonlinear transformation through the deconvolution network to generate the decoded and reconstructed image (dimensions: H, W, 3).
[0036] (4) Calculate the distortion loss D-LOSS between the decoded and reconstructed image and the original image, such as MSE (mean squared error), MAE (mean absolute error), LPIPS (learned perceptual patch similarity), GAN loss (generative adversarial network loss), etc., and combine it with the rate loss R-LOSS to obtain the rate-distortion loss RD-LOSS1 of the first stage. The main calculation formula is expressed as follows:
[0037] R-LOSS=-E(log2p(Q(y j )))-Elog2p(Q(z k )))
[0038]
[0039] RD-LOSS1=λ1*D-LOSS+R-LOSS
[0040] Where E represents expectation, y represents primary image features, z represents the output of the hyper-prior encoder (hyperanalysis), Q represents the quantization function, p represents the probability function, and the subscripts j and k represent the information sequence numbers in the bit rate estimation results; x i and Let represent the pixel value of the i-th pixel in the original image and the reconstructed image, respectively, and λ1 be a hyperparameter controlling the distortion loss and rate loss.
[0041] (5) Backpropagation is performed using the calculated rate-distortion loss to update the model parameters, including the parameters of the teacher encoding / decoding model and the parameters of the prior probability model. This step can be implemented using conventional techniques, and will not be elaborated upon in this invention.
[0042] The second stage involves adding a student encoding / decoding model to the image encoding / decoding network containing the teacher encoding / decoding model. The student encoding / decoding model comprises a student encoding model and a student decoding model, with the student model positioned at the same location as the teacher encoding / decoding model. The student encoding / decoding model is obtained by lightweighting the residual modules in the teacher encoding / decoding model. The original image is input to both the teacher and student encoding models. The outputs of both models are processed by the prior probability model before being fed into the corresponding teacher and student decoding models. The knowledge distillation loss is calculated using the outputs of both models, the outputs at the same positions in the teacher and student encoding models, and the outputs at the same positions in the teacher and student decoding models. This second-stage rate-distortion loss, calculated by combining the outputs of the student decoding model and the prior probability model, is then used to train the student encoding / decoding model and update its parameters. After training for a specified number of iterations, the teacher encoding / decoding model is removed, the original image is input, the second-stage rate-distortion loss is calculated, and the parameters of the student encoding / decoding model and the prior probability model are fine-tuned.
[0043] In this stage, the parameters of the teacher encoding / decoding model and the prior probability model are fixed first, and only the parameters of the student encoding / decoding model are updated. Then, the teacher encoding / decoding model is removed, and the parameters of the prior probability model and the student encoding / decoding model are fine-tuned. Figure 3 The main process of the second stage is shown, which provides an example of the structure of the student encoding and decoding model. The main structure of the student model is similar to that of the teacher encoding and decoding model. The main difference is that the residual module in the teacher encoding and decoding model has been lightweighted, and the number of channels in the convolutional and deconvolutional layers has been reduced, thereby reducing the memory usage and computational load of the encoding and decoding process.
[0044] In this stage, the calculation principle of the second-stage rate-distortion loss RD-LOSS2 is the same as that of the first-stage rate-distortion loss RD-LOSS1. The main difference is that the distortion loss part is calculated using the output of the student decoding model.
[0045] like Figures 2-3 As shown, the teacher encoding model includes: multiple convolutional layers (Conv) arranged sequentially, with residual modules (Resblock) at the middle and end of the multiple convolutional layers; the teacher decoding model includes: multiple deconvolutional layers (Deconv) arranged sequentially, with residual modules at the top and middle of the deconvolutional layers.
[0046] like Figure 3As shown, the student encoding model includes: multiple convolutional layers arranged sequentially, with lightweight residual modules (Lite Resblock) located in the middle and at the ends of the multiple convolutional layers; the student decoding model includes: multiple deconvolutional layers arranged sequentially, with lightweight residual modules located at the top and middle of the deconvolutional layers; the lightweight residual modules are obtained by lightweighting the residual modules in the teacher encoding / decoding model.
[0047] like Figure 4 As shown, the residual module includes N identical convolutional layers arranged sequentially. The input of the residual module is connected to the output of the last convolutional layer via a residual connection, which serves as the output of the residual module. The input and output of the residual module have the same dimension, and N is a positive integer. Figure 4 A structure example with N=2 is provided.
[0048] like Figure 5 As shown, the lightweight residual module includes M sequentially arranged convolutional layers, with the input of the lightweight residual module connected to the output of the last convolutional layer via a residual connection to serve as the output of the lightweight residual module; wherein the input and output dimensions of the lightweight residual module are different, and M is a positive integer. Figure 5 A structure example with M=3 is provided.
[0049] Figures 2-5 In the diagram, Resblock3*3 represents a residual block of size 3*3; Conv represents convolution, Deconv represents deconvolution, and the information following it represents the relevant parameters of convolution or deconvolution. Structurally, it is represented as: x*x, y, Sz, activation; where: (1) x*x (e.g., 5*5) represents the kernel size; (2) y (e.g., 192) represents the number of output channels; (3) Sz (e.g., S1) can be understood as downsampling the input features. The number z in Sz (e.g., 1) represents the kernel sliding step size. If Sz is omitted, it means that the length and width are consistent with the input; (4) activation represents the specific activation function used. GDN (Generalized Divisor Normalization) and leaky-relu in the figure represent two types of activation functions.
[0050] In the second phase of training, both the teacher's encoding / decoding model and the student's encoding / decoding model process the input data independently. The constructed knowledge distillation loss consists of three parts, such as... Figure 3As shown, the first part is the loss between the outputs at the same position in the teacher's encoding model and the student's encoding model (KD-LOSS1); the second part is the loss between the outputs of the teacher's encoding model and the student's encoding model (i.e., the outputs at the end positions of the two encoding models) (KD-LOSS2); and the third part is the loss between the outputs at the same position in the teacher's decoding model and the student's decoding model (KD-LOSS3). All three losses are calculated using the mean squared error (MSE). If the output dimensions at the same position in the teacher's encoding model and the student's encoding model do not match, and / or the output dimensions at the same position in the teacher's decoding model and the student's decoding model do not match, then a convolutional layer is added to match the dimensions. Figure 3 As shown, when dimensionality mismatch exists, the corresponding output of the student encoding / decoding model can be increased in dimensionality by adding a 1*1 convolution to match the corresponding output of the teacher encoding / decoding model. The knowledge distillation loss in this part primarily supervises the student encoding / decoding model through the output of the teacher encoding / decoding model. For the overall supervision during the training of the student encoding / decoding model, both knowledge distillation loss and the second-stage rate-distortion loss RD-LOSS2 are used. Therefore, the loss function for the second stage is expressed as:
[0051] Total-LOSS=λ2*RD-LOSS2+KD-LOSS
[0052] Wherein, λ2 represents the hyperparameter of control rate distortion loss and knowledge distillation loss, and for example, λ1 = 0.01 can be set; KD-LOSS represents knowledge distillation loss.
[0053] The student codec model is trained using the Total-LOSS method described above, and its parameters are updated. After a specified number of training iterations, the teacher codec model is removed, and the parameters of both the student codec model and the super-prior probability model are fine-tuned using rate-distortion loss. The rate-distortion loss calculation process here is the same as in the first stage, the main difference being that the first stage used the teacher codec model, while this stage uses the student codec model; the fine-tuning here is a technical term referring to updating the parameters based on the previous training.
[0054] The above-mentioned solution provided by the embodiments of the present invention performs a lightweight distillation operation on the deep learning image encoding and decoding network, which effectively reduces the number of network parameters by 70% without significantly reducing the compression performance. In actual production applications, the student network learned through distillation occupies less device memory and has a faster encoding and decoding inference speed, enabling the encoding and decoding of high-definition images on central and edge devices.
[0055] Example 2
[0056] This invention also provides a distillation training system for deep learning image encoding / decoding networks, which is mainly based on the method provided in the foregoing embodiments, such as... Figure 6 As shown, the system mainly includes:
[0057] The first training unit is applied to the first stage, which includes: constructing an image codec network containing a teacher codec model, wherein the teacher codec model includes a teacher encoding model, a super-prior probability model, and a teacher decoding model, and the teacher encoding model and the teacher decoding model constitute the teacher codec model; inputting the original image into the image codec network containing the teacher codec model, calculating the rate-distortion loss of the first stage, and training the image codec network based on the teacher codec model;
[0058] The second training unit, applied to the second stage, includes: adding a student encoding / decoding model to the image encoding / decoding network containing the teacher encoding / decoding model. The student encoding / decoding model includes a student encoding model and a student decoding model, and the student encoding / decoding model is positioned at the same location as the teacher encoding / decoding model. The student encoding / decoding model is obtained by lightweighting the residual module in the teacher encoding / decoding model. The original image is input to the teacher encoding model and the student encoding model. The outputs of the teacher encoding model and the student encoding model are processed by the prior probability model and then correspondingly input into the teacher decoding model and the student decoding model. The knowledge distillation loss is calculated using the outputs of the teacher encoding model and the student encoding model, the outputs at the same position between the teacher encoding model and the student encoding model, and the outputs at the same position between the teacher decoding model and the student decoding model. The second-stage rate-distortion loss is calculated by combining the outputs of the student decoding model and the prior probability model to train the student encoding / decoding model and update its parameters. After training reaches a specified number of times, the teacher encoding / decoding model is removed, the original image is input, the second-stage rate-distortion loss is calculated, and the parameters of the student encoding / decoding model and the prior probability model are fine-tuned.
[0059] Those skilled in the art will understand that, for the sake of convenience and brevity, the above-described division of functional modules is used as an example. In practical applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the system can be divided into different functional modules to complete all or part of the functions described above.
[0060] Example 3
[0061] The present invention also provides a processing device, such as Figure 7As shown, it mainly includes: one or more processors; a memory for storing one or more programs; wherein, when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided in the foregoing embodiments.
[0062] Furthermore, the processing device also includes at least one input device and at least one output device; in the processing device, the processor, memory, input device, and output device are connected via a bus.
[0063] In this embodiment of the invention, the specific types of the memory, input device, and output device are not limited; for example:
[0064] Input devices can be touchscreens, image acquisition devices, physical buttons, or mice, etc.
[0065] The output device can be a display terminal;
[0066] The memory can be random access memory (RAM) or non-volatile memory, such as disk storage.
[0067] Example 4
[0068] The present invention also provides a readable storage medium storing a computer program that, when executed by a processor, implements the method provided in the foregoing embodiments.
[0069] In this embodiment of the invention, the readable storage medium is a computer-readable storage medium and can be disposed in the aforementioned processing device, for example, as a memory in the processing device. Furthermore, the readable storage medium can also be any medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.
[0070] The above description is merely a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A distillation training method for a deep learning image encoding / decoding network, characterized in that, include: Phase 1: Construct an image codec network containing a teacher codec model, which includes a teacher encoding model, a super-prior probability model, and a teacher decoding model. The teacher encoding model and the teacher decoding model constitute the teacher codec model. Input the original image into the image codec network containing the teacher codec model, calculate the rate-distortion loss of the first phase, and train the image codec network containing the teacher codec model. The second stage involves adding a student encoding / decoding model to the image encoding / decoding network containing the teacher encoding / decoding model. The student encoding / decoding model comprises a student encoding model and a student decoding model, with the student model positioned at the same location as the teacher encoding / decoding model. The student encoding / decoding model is obtained by lightweighting the residual modules in the teacher encoding / decoding model. The original image is input to both the teacher and student encoding models. The outputs of both models are processed by the prior probability model before being fed into the corresponding teacher and student decoding models. The knowledge distillation loss is calculated using the outputs of both models, the outputs at the same positions in the teacher and student encoding models, and the outputs at the same positions in the teacher and student decoding models. This second-stage rate-distortion loss, calculated by combining the outputs of the student decoding model and the prior probability model, is then used to train the student encoding / decoding model and update its parameters. After training for a specified number of iterations, the teacher encoding / decoding model is removed, the original image is input, the second-stage rate-distortion loss is calculated, and the parameters of the student encoding / decoding model and the prior probability model are fine-tuned.
2. The distillation training method for a deep learning image encoding / decoding network according to claim 1, characterized in that, The teacher encoding model includes: multiple convolutional layers arranged sequentially, with residual modules located at the middle and ends of the multiple convolutional layers; the teacher decoding model includes: multiple deconvolutional layers arranged sequentially, with residual modules located at the top and middle of the deconvolutional layers.
3. The distillation training method for a deep learning image encoding / decoding network according to claim 2, characterized in that, The residual module includes N identical convolutional layers arranged sequentially, with the input of the residual module connected to the output of the last convolutional layer via a residual connection to serve as the output of the residual module; wherein the input and output of the residual module have the same dimension, and N is a positive integer.
4. The distillation training method for a deep learning image encoding / decoding network according to claim 1, characterized in that, The student encoding model includes: multiple convolutional layers arranged sequentially, with lightweight residual modules located at the middle and ends of the convolutional layers; the student decoding model includes: multiple deconvolutional layers arranged sequentially, with lightweight residual modules located at the top and middle of the deconvolutional layers; the lightweight residual modules are obtained by lightweighting the residual modules in the teacher encoding / decoding model.
5. The distillation training method for a deep learning image encoding / decoding network according to claim 4, characterized in that, The lightweight residual module includes M convolutional layers arranged sequentially, and the input of the lightweight residual module is connected to the output of the last convolutional layer through a residual connection to serve as the output of the lightweight residual module; wherein, the input and output of the lightweight residual module have different dimensions, and M is a positive integer.
6. The distillation training method for a deep learning image encoding / decoding network according to claim 1, characterized in that, When calculating the knowledge distillation loss, if the output dimensions at the same position between the teacher's encoding model and the student's encoding model do not match, and / or the output dimensions at the same position between the teacher's decoding model and the student's decoding model do not match, then a convolutional layer is added to match the dimensions.
7. The distillation training method for a deep learning image encoding / decoding network according to claim 1, characterized in that, The calculation of knowledge distillation loss using the outputs of the teacher's coding model and the student's coding model, the outputs at the same positions in the teacher's coding model and the student's coding model, and the outputs at the same positions in the teacher's decoding model and the student's decoding model includes: The knowledge distillation loss is calculated using the mean square error (MSE) based on the outputs of the teacher coding model and the student coding model, the outputs at the same positions in the teacher coding model and the student coding model, and the outputs at the same positions in the teacher decoding model and the student decoding model.
8. A distillation training system for a deep learning image encoding / decoding network, characterized in that, Based on the method described in any one of claims 1 to 7, the system comprises: The first training unit is applied to the first stage, which includes: constructing an image codec network containing a teacher codec model, wherein the teacher codec model includes a teacher encoding model, a super-prior probability model, and a teacher decoding model, and the teacher encoding model and the teacher decoding model constitute the teacher codec model; inputting the original image into the image codec network containing the teacher codec model, calculating the rate-distortion loss of the first stage, and training the image codec network containing the teacher codec model; The second training unit, applied to the second stage, includes: adding a student encoding / decoding model to the image encoding / decoding network containing the teacher encoding / decoding model, including a student encoding model and a student decoding model, the student encoding / decoding model being positioned at the same location as the teacher encoding / decoding model; the student encoding / decoding model being obtained by lightweighting the residual module in the teacher encoding / decoding model; inputting the original image to the teacher encoding model and the student encoding model, the outputs of both the teacher encoding model and the student encoding model being processed by the prior probability model and then correspondingly input to the teacher decoding model and the student decoding model; calculating the knowledge distillation loss using the outputs of the teacher encoding model and the student encoding model, the outputs at the same position between the teacher encoding model and the student encoding model, and the outputs at the same position between the teacher decoding model and the student decoding model, and training the student encoding / decoding model by combining the second-stage rate-distortion loss calculated with the outputs of the student decoding model and the prior probability model, updating the parameters of the student encoding / decoding model; after training reaches a specified number of times, removing the teacher encoding / decoding model, inputting the original image, calculating the second-stage rate-distortion loss, and fine-tuning the parameters of the student encoding / decoding model and the prior probability model.
9. A processing device, characterized in that, include: One or more processors; Memory, used to store one or more programs; Wherein, when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the method as described in any one of claims 1 to 7.
10. A readable storage medium storing a computer program, characterized in that, When a computer program is executed by a processor, it implements the method as described in any one of claims 1 to 7.