Compression coding artifact removal method, terminal and computer readable medium

By introducing the quantization matrix and adaptive normalization module, combined with the encoder-decoder structure and feature extraction module, the problem of poor recovery effect of compressed images is solved, achieving stable recovery of different quality factors and retaining accurate pixel information. Improved model compatibility and practicality.

CN118864280APending Publication Date: 2024-10-29FUZHOU GAOTU INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410877915.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-02
Publication Date
2024-10-29

AI Technical Summary

Technical Problem

Existing compression artifact removal methods have poor recovery effects on compressed images with different quality factors, and networks based on strided convolution or pooling have losses when restoring accurate pixel information, which affects the artifact removal effect.

Method used

A compression coding artifact removal method is used to obtain the compressed image and quantization matrix by inputting a JPEG file, perform a convolution operation to obtain shallow features, and input them into the adaptive normalization module to generate embedded features, combined with the encoder-decoder The structure and triple feature extraction module uses Haar wavelet downsampling and modulation reconstruction modules to achieve stable recovery of different quality factors.

Benefits of technology

It achieves a stable and robust restoration effect on compressed images with different quality factors, retains the precise pixel-level information of the image, improves the compatibility and practicality of the model, and can flexibly restore images of different compression qualities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118864280A_ABST
    Figure CN118864280A_ABST
Patent Text Reader

Abstract

The invention discloses a compressed coding artifact removal method, a terminal and a computer readable medium. The method comprises the following steps: inputting a JEPG file and obtaining a compressed image and a quantization matrix of the JEPG file; performing convolution operation on the corresponding tensor of the compressed image and acquiring shallow layer features; inputting the shallow features and the quantization matrix into a partial adaptive normalization module and generating embedded features; and inputting the embedded features into a network model provided with an encoder-decoder structure, and outputting a recovered image file through the network model. By introducing quantization matrix information, a stable and robust recovery effect on compressed images with different quality factors is realized; a partial self-adaptive normalization module is set, stylized information for guiding the restoration of compressed images with different qualities is introduced, and accurate pixel-level information beneficial to image restoration is still reserved for most of feature maps by controlling a normalization proportion, so that the images with different compression qualities are flexibly restored in a single model, and the compatibility and practicability of the model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image artifact removal, and in particular to a compression coding artifact removal method, a terminal and a computer-readable medium. Background Art

[0002] With the development of computer vision technology, a large amount of image data is used for various advanced tasks, such as object detection, semantic segmentation, etc. However, in order to reduce storage space, images are usually lossily compressed. Directly using low-quality compressed images will lead to a decrease in the performance of visual tasks, so compression artifact removal becomes an important preprocessing method. Existing general compression artifact removal methods can often only restore compressed images of specific quality factors, and the restoration effect is often poor for untrained quality factors. Training a model for all quality factors will consume a lot of computing resources and is not suitable for actual application scenarios.

[0003] In addition, in order to reduce the parameters and computational complexity of the model, most networks with restoration flexibility now usually use downsampling operations based on strided convolution or pooling. However, this will cause the loss of precise pixel information required for compressed image restoration, thereby affecting the artifact removal effect of the model. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for removing compression coding artifacts, a terminal and a computer-readable medium to solve the problem of poor artifact removal effect of image data.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0006] A method for removing compression coding artifacts comprises the steps of:

[0007] S1, input JPEG file and obtain compressed image and quantization matrix of JPEG file;

[0008] S2. Perform a convolution operation on the corresponding tensor of the compressed image and obtain shallow features;

[0009] S3, inputting the shallow features and the quantization matrix into a partial adaptive normalization module to generate embedded features;

[0010] S4. Input the embedded features into a network model with an encoder-decoder structure and output the restored image file through the network model.

[0011] In order to solve the above technical problems, other technical solutions adopted by the present invention are:

[0012] A compression coding artifact removal terminal comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, steps in a compression coding artifact removal method are completed.

[0013] In order to solve the above technical problems, other technical solutions adopted by the present invention are:

[0014] A computer-readable storage medium stores a computer program, which implements the steps of a compression coding artifact removal method when executed by a processor.

[0015] The beneficial effects of the present invention include at least: providing a method for removing compression coding artifacts, a terminal and a computer-readable medium, which achieve a stable and robust restoration effect on compressed images of different quality factors by introducing quantization matrix information; at the same time, a partial adaptive normalization module is set to introduce stylized information to guide the restoration of compressed images of different qualities, and by controlling the normalization ratio, most feature maps still retain accurate pixel-level information that is beneficial to image restoration, thereby achieving flexible restoration of images of different compression qualities in a single model and improving the compatibility and practicality of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a method for removing compression coding artifacts in an embodiment of the present invention;

[0017] Figure 2 is a specific flow chart of a method for removing compression coding artifacts in an embodiment of the present invention;

[0018] Figure 3 It is a schematic diagram of the structure of some adaptive instance normalization modules in an embodiment of the present invention;

[0019] Figure 4 Schematic diagram of the overall structure of the triple feature extraction module in the embodiment of the present invention;

[0020] Figure 5 Schematic diagram of the structure of the overall feature extraction branch OFEB in an embodiment of the present invention;

[0021] Figure 6 It is a schematic diagram of the structure of a partial feature extraction branch PFEB in an embodiment of the present invention;

[0022] Figure 7 Schematic diagram of the detail feature extraction branch DFEB structure in an embodiment of the present invention;

[0023] Figure 8 Schematic diagram of the structure of a down-sampling module based on Haar wavelet in an embodiment of the present invention;

[0024] Fig. 9 Schematic diagram of the structure of a modulation reconstruction module in an embodiment of the present invention;

[0025] Fig.10 Schematic diagram of a compression coding artifact removal terminal in an embodiment of the present invention;

[0026] Description of labels:

[0027] 1. A compression coding artifact removal terminal; 2. A memory; 3. A processor. DETAILED DESCRIPTION

[0028] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0029] Please refer to Figure 1 , a compression coding artifact removal method, comprising the steps of:

[0030] S1, input JPEG file and obtain compressed image and quantization matrix of JPEG file;

[0031] S2. Perform a convolution operation on the corresponding tensor of the compressed image and obtain shallow features;

[0032] S3, inputting the shallow features and the quantization matrix into a partial adaptive normalization module to generate embedded features;

[0033] S4. Input the embedded features into a network model with an encoder-decoder structure and output the restored image file through the network model.

[0034] It can be understood that the quantization matrix (QM) in the image refers to the technology used to convert continuous pixel values ​​into discrete grayscale in digital image processing. Specifically, the quantization matrix is ​​a tool for quantizing the coefficients after DCT (discrete cosine transform). In the JPEG compression algorithm, the quantization matrix is ​​divided into a brightness quantization table and a chrominance quantization table, which are used to process brightness data and color difference data respectively. The quantization process is the process of converting the continuous brightness change interval corresponding to the sampling point into a single specific digital number. After quantization, the image is represented as an integer matrix, and each pixel has two attributes: position and grayscale. For example, in 8-bit quantization, the grayscale is generally 0 to 255. If the quantization level is 2, two grayscales will be used to represent the pixels of the original image; if the quantization level is 4, four grayscales will be used to represent the pixels of the original image.

[0035] From the above description, it can be seen that the beneficial effects of the present invention are: by introducing quantization matrix information, a stable and robust restoration effect of compressed images with different quality factors is achieved; at the same time, a partial adaptive normalization module is set to introduce stylized information to guide the restoration of compressed images of different qualities, and by controlling the normalization ratio, most feature maps still retain accurate pixel-level information that is conducive to image restoration, thereby achieving flexible restoration of images of different compression qualities in a single model, thereby improving the compatibility and practicality of the model.

[0036] Please refer to Figure 4 In an embodiment of the present invention, the step S4 specifically includes the steps of:

[0037] Inputting the embedded features into a network model having a four-stage symmetrical encoder-decoder structure; each stage of the encoder is provided with a triple feature extraction module, and the triple feature extraction module is used to perform feature extraction;

[0038] The restored image file is outputted through the network model.

[0039] Since natural images have multi-level structural features in the global, regional and local ranges, representing the features of objects of different scales, accurately and efficiently extracting features in these three different ranges helps to fully understand the image information. For compressed images, artifacts usually appear with objects, so artifacts also exist in multiple scales. In addition, different artifacts do not exist independently, but may be mixed and overlapped. How to effectively distinguish and extract features of different ranges and sizes in compressed images helps the network understand different types of artifacts and eliminate them, thereby restoring high-quality images; in order to solve the above problems, the present application introduces a triple feature extraction module; specifically, the feature extraction using the triple feature extraction module (Triple-hierarchy Feature Extraction Block, TFEB) specifically includes the following steps:

[0040] The triple feature extraction module is used to model the dependency of features at different levels in global, regional and local ranges in parallel, and to extract adaptive features of artifacts at different scales.

[0041] Among them, the triple feature extraction module includes layer normalization, triple-hierarchy attention block (TAB) and locality-enhanced feed-forward network (LeFF); wherein, the triple attention module is provided with efficient self-attention mechanism, random displacement window attention mechanism and lightweight convolutional neural network; in addition, the role of LeFF is to help restore local details.

[0042] Please refer to Figure 5 The efficient self-attention mechanism is the overall feature extraction branch in the triple feature extraction module. It mainly changes the way of calculating the mutual covariance, transforms it from the spatial dimension to the channel dimension, and generates an attention feature map with implicit representation of global context information, thereby reducing the entire self-attention calculation to a linear complexity.

[0043] Please refer to Figure 6 The random displacement window attention mechanism is a partial feature extraction branch in the triple feature extraction module. It uniformly samples a set of random shifts based on the Transformer method divided into non-overlapping windows. In the feature forward propagation, it can extract information in different regions of the image to the greatest extent, enhance the information interaction between different regions, and make the modeling of objects in the region more complete.

[0044] Please refer to Figure 7 The lightweight convolutional neural network is the detail feature extraction branch in the triple feature extraction module; the convolutional neural network is very effective in modeling detail features within a local range. At the same time, in order to reduce the complexity of the model, a deep separable convolution is used to replace the conventional convolution.

[0045] Preferably, the entire TFEB calculation process is as follows:

[0046] x' k =LN(TAB(x k-1 ))+x k-1 ;

[0047] x k =LN(LeFF(x' k ))+x' k ;

[0048] In the formula, x' k and x k They represent the intermediate results and final output of the kth TFEB respectively;

[0049] TAB represents the output of the triple attention module;

[0050] Leff represents the output of the local feedforward network.

[0051] Please refer to Figure 8 In an embodiment of the present invention, the step S4 further comprises the steps of:

[0052] After the encoder is used to extract features, the features are downsampled using a downsampling module based on Haar Wavelet Transform (HWT) to reduce the spatial resolution of the features and increase the number of channels of the features while retaining accurate pixel information as much as possible.

[0053] Specifically, the downsampling of features using a Haar wavelet-based downsampling block (WDB) specifically includes the following steps:

[0054] The image is decomposed into low-frequency components and high-frequency components using multi-level wavelet transform;

[0055] It is specifically implemented by the following formula:

[0056] F t =HWT(F x );

[0057] In the formula, F x represents the feature map of the input downsampling module; where F x ∈R H×W×C , R H×W×C Represents an image with a spatial dimension of H×W and a number of channels of C;

[0058] F t Represents the output result of wavelet transform based on Haar function, where F t ∈R H / 2×W / 2×4C , whose resolution is F x 1 / 4 of

[0059] From the above description, we can see that assuming F x ∈R H×W×C is the input feature map, H 0 and H 1 Indicates that the low-pass and high-pass filters are used to extract the low-frequency and high-frequency components of the image, respectively, and ↓2 indicates that the extracted components are downsampled. Combined with the wavelet transform multi-resolution analysis, it can be seen that the Haar wavelet transform will produce one low-frequency feature component and three high-frequency feature components in the horizontal, vertical and diagonal directions. The spatial size of each feature component is reduced to H / 2×W / 2, and the number of channels is increased by 4 times, transferring the spatial dimension information of the feature map to the channel dimension without losing any information.

[0060] Then the whole WDB process can be expressed as follows:

[0061]

[0062] In the formula, F d Represents the final output result of the downsampling module, where Fd ∈R H / 2×W / 2×2C ;

[0063] LFA stands for lossless feature aggregation module, which is used to learn the lossless features generated by wavelet transform based on Haar function and further obtain the low-dimensional representation of the features;

[0064] Conv 1 and Conv 2 Represents a 3×3 convolutional layer, Conv 3 Represents a 1×1 convolutional layer that reduces the number of channels to 1 / 2 of the original;

[0065] BN represents batch normalization, and σ represents the GELU activation function.

[0066] Please refer to Fig. 9 In an embodiment of the present invention, the step S4 further comprises the steps of:

[0067] Each layer of the decoder is equipped with a modulation reconstruction module, which is used to learn modulation parameters according to the quantization matrix and guide the features to perform adaptive affine transformation. The decoder uses the Pixel Shuffle operation for upsampling, and after the feature extraction module, it passes through a modulation reconstruction module (Modulation Reconstruction Block, MRB), which passes through a 4-layer MLP structure through the quantization matrix and outputs 3 channels of information corresponding to different resolution levels for guiding image reconstruction.

[0068] In an embodiment of the present invention, the modulation reconstruction module learns the modulation parameters according to the quantization matrix and guides the features to perform adaptive affine transformation, specifically comprising the steps of:

[0069] The quantization matrix is ​​used to generate two learnable modulation features, and the modulation reconstruction module is used to perform adaptive affine transformation of the modulation features; the modulation reconstruction module uses the compressed prior of the additional input to generate two learnable modulation features (γ, β), and uses these two features to perform affine transformation on the intermediate output features of the module, so as to achieve fine-grained spatial feature regulation and adaptively change the output features, and finally generate a high-quality restored image. Different from the use of the predicted QF as the prior information for generating modulation parameters in FBCNN, in this example, the quantization matrix of the JEPG file is directly used to obtain the modulation parameter pair through some nonlinear operations.

[0070] It is specifically implemented by the following formula:

[0071]

[0072] In the formula, F i Represents the feature map of the input modulation reconstruction module; where, The spatial dimension size is The number of channels is images;

[0073] F o represents the output feature map of the modulation reconstruction module;

[0074] Conv 1 and Conv 2 Respectively represent a 3×3 convolution, Conv 3 represents a 1×1 convolution, σ P and σ G Represent the PReLU and GELU activation functions, ⊙ and Respectively represent the multiplication and addition of corresponding elements;

[0075] γ and β represent the feature maps used for scaling and translation operations, respectively, which are performed as follows:

[0076] γ=σ S (Conv 1 (Broadcast(Q i )));

[0077] β=σ T (Conv 2 (Broadcast(Q i )));

[0078] In the formula, σ S and σ T Respectively represent the Sigmoid activation function and the Tanh activation function, Conv 1 and Conv 2 Respectively represent a 3×3 convolution;

[0079] Q i represents the prior information of the input modulation reconstruction module; where, It comes from a 4-layer MLP. The number of channels of the first 3 layers are {64, 128, 256} respectively, and the number of output channels of the last layer corresponds to the number of feature channels at different levels of the codec.

[0080] Broadcast represents the broadcast mechanism in matrix operations, which expands the variance and mean finally generated to the dimension with the same spatial size as the input features.

[0081] Please refer to Fig.10 A compression coding artifact removal terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor executes the computer program, the steps in a compression coding artifact removal method are completed.

[0082] A computer-readable storage medium stores a computer program, which implements the steps of a compression coding artifact removal method when executed by a processor.

[0083] The present invention provides a compression coding artifact removal method, a terminal and a computer-readable medium, which are mainly used to remove artifacts from compressed images, and are specifically described below in conjunction with embodiments.

[0084] Please refer to Figure 1 , Embodiment 1 of the present invention is:

[0085] A method for removing compression coding artifacts comprises the steps of:

[0086] S1, input JPEG file and obtain compressed image and quantization matrix of JPEG file;

[0087] S2, performing convolution operation on the corresponding tensor of the compressed image and obtaining shallow features;

[0088] S3, inputting the shallow features and the quantization matrix into the partial adaptive normalization module and generating embedded features;

[0089] S4. Input the embedded features into a network model with an encoder-decoder structure and output the restored image file through the network model.

[0090] That is, in this embodiment, by introducing quantization matrix information, a stable and robust restoration effect of compressed images with different quality factors is achieved; at the same time, a partial adaptive normalization module is set to introduce stylized information to guide the restoration of compressed images of different qualities, and by controlling the normalization ratio, most feature maps still retain precise pixel-level information that is conducive to image restoration, thereby achieving flexible restoration of images of different compression qualities in a single model, thereby improving the compatibility and practicality of the model.

[0091] Embodiment 2 of the present invention is:

[0092] Please refer to Figure 2 , a compression coding artifact removal method, comprising the steps of:

[0093] S1. Obtain the compressed image X∈R through the input JPEG file H×W×3 And quantization matrix QM (QuantizationMatrix);

[0094] S2: Pass the compressed image X through a 3×3 convolutional layer to obtain the shallow feature F 0 ∈R H×W×C ;

[0095] S3, shallow features F 0Together with QM, it is fed into the Partial Adaptive Instance Normalization (PAdaIN) module to embed the compressed quality information into F 0 In the above example, we get the embedded feature F e ∈R H×W×C .

[0096] For details, please refer to Figure 3 , assuming that the input feature of PAdaIN is X∈R H×W×C , H×W represents the spatial dimension size, and C represents the number of channels. X will be divided into X 1 ∈R H×W×γC and X 2 ∈R H×W×(1-γ)C , where X 1 represents the normalized feature, X 2 represents the unnormalized features, and γ represents the hyperparameter that controls the number of normalized channels. Then X 1 The instance normalized features of It can be expressed by the following formula:

[0097]

[0098] In the formula, μ represents the mean and σ represents the variance.

[0099] In order to flexibly remove compression artifacts, it is often necessary to add additional compression quality information as a priori input. This paper uses the quantization matrix stored in the JPEG file to generate the variance α∈R of the style to be embedded H×W×γC and mean β∈R H×W×γC The whole process can be expressed by the following two equations:

[0100] α=Broadcast(FC 1 (QM));

[0101] β=Broadcast(FC 2 (QM));

[0102] In the formula, QM represents the quantization matrix, which is 8×8 in size and is stored in the computer as a one-dimensional vector with a modulus length of 64. FC represents the fully connected layer, which allows QM to generate a preliminary representation of the variance and mean with a dimension of 1×1×γC. Broadcast represents the broadcast mechanism in the matrix operation, which allows the final generated variance and mean to be expanded to the dimension with the same spatial size as the input feature. Then the final output feature in PAdaIN is It can be expressed as the following formula:

[0103]

[0104] In the formula, ⊙ and Respectively expressed as the multiplication and addition of the elements at the corresponding positions, the output of the entire PAdaIN can be expressed as follows:

[0105]

[0106] In the formula, Concat represents the concatenation of feature maps in dimension.

[0107] S4. The embedded features are input into a network model with a four-level symmetric encoder-decoder structure; each level of the encoder is equipped with a triple feature extraction module, and the triple feature extraction module is used to model the dependency of features at different levels in parallel from the global, regional and local ranges, and to extract adaptive features of artifacts of different scales.

[0108] Please refer to Figure 4 The triple feature extraction module includes layer normalization, triple-hierarchy attention block (TAB) and locality-enhanced feed-forward network (LeFF); among them, the triple attention module is equipped with efficient self-attention mechanism, random displacement window attention mechanism and lightweight convolutional neural network; in addition, the role of LeFF is to help restore local details.

[0109] The entire TFEB calculation process is as follows:

[0110] x' k =LN(TAB(x k-1 ))+x k-1 ;

[0111] x k =LN(LeFF(x' k ))+x' k ;

[0112] In the formula, x' k and x k They represent the intermediate results and final output of the kth TFEB respectively;

[0113] TAB represents the output of the triple attention module;

[0114] Leff represents the output of the local feedforward network.

[0115] Also, please refer to Figure 8 , step S4 also includes step S41:

[0116] After feature extraction using the encoder, the features are downsampled using a downsampling module (WDB) based on Haar Wavelet Transform (HWT) to reduce the spatial resolution of the features and increase the number of feature channels while retaining accurate pixel information as much as possible.

[0117] Assumption F x ∈R H×W×C is the input feature map, H 0 and H 1 Indicates that the low-pass and high-pass filters are used to extract the low-frequency and high-frequency components of the image, respectively, and ↓2 indicates that the extracted components are downsampled. Combined with the wavelet transform multi-resolution analysis, it can be seen that the Haar wavelet transform will produce one low-frequency feature component and three high-frequency feature components in the horizontal, vertical and diagonal directions. The spatial size of each feature component is reduced to H / 2×W / 2, and the number of channels is increased by 4 times, transferring the spatial dimension information of the feature map to the channel dimension without losing any information.

[0118] The HWT process is performed as follows:

[0119] F t =HWT(F x );

[0120] In the formula, F x represents the feature map of the input downsampling module; where F x ∈R H×W×C , R H×W×C Represents an image with a spatial dimension of H×W and a number of channels of C;

[0121] F t Represents the output result of wavelet transform based on Haar function, where F t ∈R H / 2×W / 2×4C , whose resolution is F x 1 / 4 of

[0122] The entire WDB process can be expressed as follows:

[0123]

[0124] In the formula, F d Represents the final output result of the downsampling module, where F d ∈R H / 2×W / 2×2C ;

[0125] LFA stands for lossless feature aggregation module, which is used to learn the lossless features generated by wavelet transform based on Haar function and further obtain the low-dimensional representation of the features;

[0126] Conv 1 and Conv 2 Represents a 3×3 convolutional layer, Conv 3 Represents a 1×1 convolutional layer that reduces the number of channels to 1 / 2 of the original;

[0127] BN represents batch normalization, and σ represents the GELU activation function.

[0128] In addition, please refer to Fig. 9 , step S4 also includes step S42:

[0129] Each decoder layer sets up a modulation reconstruction module, which is used to learn modulation parameters according to the quantization matrix and guide the features to perform adaptive affine transformation. The decoder uses the Pixel Shuffle operation for upsampling, and after the feature extraction module, it passes through a modulation reconstruction block (MRB), which passes through a 4-layer MLP structure through the quantization matrix and outputs 3 channels of information corresponding to different resolution levels to guide image reconstruction.

[0130] In an embodiment of the present invention, the modulation reconstruction module learns the modulation parameters according to the quantization matrix and guides the features to perform adaptive affine transformation, specifically including the following steps:

[0131] The quantization matrix is ​​used to generate two learnable modulation features, and the modulation reconstruction module is used to perform adaptive affine transformation of the modulation features; the modulation reconstruction module uses the compressed prior of the additional input to generate two learnable modulation features (γ, β), and uses these two features to perform affine transformation on the intermediate output features of the module, so as to achieve fine-grained spatial feature regulation and adaptively change the output features, and finally generate a high-quality restored image. Different from the use of the predicted QF as the prior information for generating modulation parameters in FBCNN, in this example, the quantization matrix of the JEPG file is directly used through some nonlinear operations to obtain the modulation parameter pair.

[0132] Specifically, it is implemented by the following formula:

[0133]

[0134] In the formula, F i Represents the feature map of the input modulation reconstruction module; where, The spatial dimension size is The number of channels is images;

[0135] F o represents the output feature map of the modulation reconstruction module;

[0136] Conv1 and Conv 2 Respectively represent a 3×3 convolution, Conv 3 represents a 1×1 convolution, σ P and σ G Represent the PReLU and GELU activation functions, ⊙ and Respectively represent the multiplication and addition of corresponding elements;

[0137] γ and β represent the feature maps used for scaling and translation operations, respectively, which are performed as follows:

[0138] γ=σ S (Conv 1 (Broadcast(Q i )));

[0139] β=σ T (Conv 2 (Broadcast(Q i )));

[0140] In the formula, σ S and σ T Respectively represent the Sigmoid activation function and the Tanh activation function, Conv 1 and Conv 2 Respectively represent a 3×3 convolution;

[0141] Q i represents the prior information of the input modulation reconstruction module; where, It comes from a 4-layer MLP. The number of channels of the first 3 layers are {64, 128, 256} respectively, and the number of output channels of the last layer corresponds to the number of feature channels at different levels of the codec.

[0142] Finally, the restored image file is output through the network model; specifically, the network also uses multiple TFEBs to form a refinement module to further correct the output of the codec to obtain the corrected feature F r ∈R H×W×C Finally, for F r Use a 3×3 convolutional layer to get the residual image R∈R H×W×3 , added to the input image X to obtain the output restored image O∈R H×W×3 .

[0143] Embodiment 3 of the present invention is:

[0144] Please refer to Fig.10A compression coding artifact removal terminal 1 includes a memory 2, a processor 3, and a computer program stored in the memory 2 and executable on the processor 3. When the processor executes the computer program, the steps in any one of the compression coding artifact removal methods in embodiments one to two are completed.

[0145] Embodiment 4 of the present invention is:

[0146] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps of any one of the compression coding artifact removal methods in embodiments one to two.

[0147] In summary, the present invention provides a method for removing compression coding artifacts, a terminal and a computer-readable medium, which achieve a stable and robust restoration effect on compressed images of different quality factors by introducing quantization matrix information; designs a partial adaptive instance normalization module, a Haar wavelet-based downsampling module and a modulation reconstruction module, thereby improving the accuracy and stability of image restoration; and realizes flexible restoration of images of different compression qualities in a single model, thereby improving the compatibility and practicability of the model.

[0148] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for removing compression coding artifacts, characterized in that: Includes steps: S1, input JPEG file and obtain compressed image and quantization matrix of JPEG file; S2. Perform a convolution operation on the corresponding tensor of the compressed image and obtain shallow features; S3, inputting the shallow features and the quantization matrix into a partial adaptive normalization module to generate embedded features; S4. Input the embedded features into a network model with an encoder-decoder structure and output the restored image file through the network model.

2. The method for removing compression coding artifacts according to claim 1, characterized in that: The step S4 specifically comprises the following steps: Inputting the embedded features into a network model having a four-stage symmetrical encoder-decoder structure; each stage of the encoder is provided with a triple feature extraction module, and the triple feature extraction module is used to perform feature extraction; The restored image file is outputted through the network model.

3. A method for removing compression coding artifacts according to claim 2, characterized in that: The step S4 further comprises the steps of: After the encoder is used to extract features, the features are downsampled using a downsampling module based on Haar wavelets.

4. The method for removing compression coding artifacts according to claim 3, characterized in that: The method of downsampling the features using the downsampling module based on Haar wavelet specifically includes the following steps: The image is decomposed into low-frequency components and high-frequency components using multi-level wavelet transform; Specifically, it is implemented by the following formula: F t =HWT(F x ); In the formula, F x represents the feature map of the input downsampling module; where F x ∈R H×W×C , R H×W×C Represents an image with a spatial dimension of H×W and a number of channels of C; F t Represents the output result of wavelet transform based on Haar function, where F t ∈R H / 2×W / 2×4C , whose resolution is F x 1 / 4; F d Represents the final output result of the downsampling module, where F d ∈R H / 2×W / 2×2C ; LFA stands for lossless feature aggregation module, which is used to learn the lossless features generated by wavelet transform based on Haar function and further obtain the low-dimensional representation of the features; Conv1 and Conv2 represent a 3×3 convolution layer respectively, and Conv3 represents a 1×1 convolution layer that can reduce the number of channels to 1 / 2 of the original; BN represents batch normalization, and σ represents the GELU activation function.

5. The method for removing compression coding artifacts according to claim 2, characterized in that: The step S4 further comprises the steps of: Each layer of the decoder is provided with a modulation reconstruction module, and the modulation reconstruction module is used to learn modulation parameters according to the quantization matrix and guide the features to perform adaptive affine transformation.

6. The method for removing compression coding artifacts according to claim 5, characterized in that: The modulation reconstruction module learns the modulation parameters according to the quantization matrix and guides the features to perform adaptive affine transformation, specifically including the following steps: The quantization matrix generates two learnable modulation features, and the modulation reconstruction module is used to perform adaptive affine transformation of the modulation features; Specifically, it is implemented by the following formula: In the formula, F i Represents the feature map of the input modulation reconstruction module; where, The spatial dimension size is The number of channels is images; F o represents the output feature map of the modulation reconstruction module; Conv1 and Conv2 represent a 3×3 convolution, Conv3 represents a 1×1 convolution, σ P and σ G Represent the PReLU and GELU activation functions, ⊙ and Respectively represent the multiplication and addition of corresponding elements; γ and β represent the feature maps used for scaling and translation operations, respectively, which are performed as follows: c = s S (Conv1(Broadcast(Q i ))); β=σ T (Conv2(Broadcast(Q i ))); In the formula, σ S and σ T Represent the Sigmoid activation function and Tanh activation function respectively, Conv1 and Conv2 represent a 3×3 convolution respectively; Q i represents the prior information of the input modulation reconstruction module; where, Broadcast represents the broadcast mechanism in matrix operations, which expands the variance and mean finally generated to the dimension with the same spatial size as the input features.

7. The method for removing compression coding artifacts according to claim 2, characterized in that: The feature extraction using the triple feature extraction module specifically includes the following steps: The triple feature extraction module is used to model the dependency of features at different levels in global, regional and local ranges in parallel, and to extract adaptive features of artifacts at different scales.

8. The method for removing compression coding artifacts according to claim 7, characterized in that: The triple feature extraction module includes a triple attention module, which is provided with an efficient self-attention mechanism, a random displacement window attention mechanism and a lightweight convolutional neural network; The efficient self-attention mechanism is the overall feature extraction branch in the triple feature extraction module; The random shift window attention mechanism is a partial feature extraction branch in the triple feature extraction module; The lightweight convolutional neural network is a detail feature extraction branch in the triple feature extraction module.

9. A compression coding artifact removal terminal, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor completes the steps of a method for removing compression coding artifacts as described in any one of claims 1 to 8 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps in the method for removing compression coding artifacts as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Dynamic illumination face image quality enhancement method based on multi-scale attention mechanism

    CN115880225A