Image processing method based on twin standardized flow neural network, medium and equipment

Learning and decoupling the frequency information of low-resolution and high-resolution images through twin normalized flow neural networks solves the ill-posed problem in image super-resolution, improves detail recovery capabilities and computational efficiency, and achieves more stable training and more accurate Controllable image quality.

CN118735781APending Publication Date: 2024-10-01SHANGHAI JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410802553.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

Existing image super-resolution technology cannot effectively solve the problem of low-resolution images corresponding to multiple high-resolution images, and has problems such as poor detail recovery ability, high computational complexity, unstable training process, and difficult to control the quality of the generated images.

Method used

A method based on the twin normalized flow neural network is used to learn the low-frequency information in low-resolution and high-resolution images through the twin normalized flow module and decouple it from the high-frequency information. The conditional normalized flow module is used to model the conditional probability of the image. distribution to generate high-resolution images.

Benefits of technology

It improves detail recovery capabilities, reduces computational complexity, stabilizes the training process, enhances the controllability of generated image quality, and solves the problem of low-resolution images corresponding to multiple high-resolution images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118735781A_ABST
    Figure CN118735781A_ABST
Patent Text Reader

Abstract

The invention provides an image processing method based on a twin standardized flow neural network, a medium and equipment, and the method comprises the steps: amplifying a low-resolution image through interpolation, and marking the low-resolution image as an LR image; inputting the LR image into a pre-trained twinning standardized flow network model comprising two twinning standardized flow modules for processing to obtain an output tensor, and decomposing the output tensor into a zLL low-frequency tensor and a zLH high-frequency tensor; sampling a high-frequency hidden variable, reversely inputting the high-frequency hidden variable into a condition standardization flow module for processing, obtaining an output tensor, and decomposing the output tensor into a zHL low-frequency tensor and a zHH high-frequency tensor; the zLL low-frequency tensor is copied to the position of the zHL low-frequency tensor, the zLL low-frequency tensor and the zHH high-frequency tensor are spliced into a zH'tensor, and the zH'tensor is reversely input into a twinning standardized flow network model to obtain a high-resolution image.According to the method, the problem of discomfort in a super-resolution task can be effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing technology, and in particular to the field of image super-resolution technology. Background Art

[0002] Image super-resolution is a technique that aims to reconstruct a high-resolution image from a low-resolution image. It has important applications in many fields, such as satellite imaging, medical imaging, video enhancement, and security monitoring, because these fields usually need to recover more details and clarity from limited pixel information.

[0003] With the development of technology, image super-resolution has evolved from early traditional methods such as bilinear and cubic interpolation to methods based on deep learning. Traditional techniques usually rely on mathematical models to insert new pixels, which often leads to loss of image details. In contrast, deep learning methods generate more accurate and delicate results by learning a large number of image pairs (the relationship between low resolution and high resolution). The rise of deep learning methods has greatly promoted the development of image super-resolution technology, resulting in a significant improvement in the quality of reconstructed images.

[0004] With the development of image processing technology, reconstruction-based methods and learning-based methods have gradually emerged. Reconstruction-based methods, such as Lanczos resampling, attempt to estimate high-resolution images more accurately through more complex mathematical models. Learning-based methods, such as sparse coding, use a large amount of image data to learn the relationship between low-resolution and high-resolution images to achieve a more natural image reconstruction effect.

[0005] After entering the 21st century, the rise of deep learning has brought revolutionary changes to image super-resolution technology. Deep learning models represented by convolutional neural networks can automatically learn complex feature representations and mapping relationships from a large amount of data, significantly improving the effect of super-resolution. Since the introduction of the SRCNN model in 2014, the application of deep learning in the field of image super-resolution has grown rapidly, triggering the development of many more advanced models and algorithms, such as VDSR, ESPCN, SRGAN, etc. These methods not only improve the visual quality of images, but also speed up processing speed, promoting the transformation of image super-resolution technology into practical applications.

[0006] The breakthrough of deep learning in the field of image super-resolution began with the introduction of the SRCNN model. SRCNN applied deep learning to the super-resolution task for the first time. It uses a shallow convolutional neural network to learn the nonlinear mapping relationship from low-resolution to high-resolution images. Although the model has a simple structure, it has made significant progress in restoring image details compared to traditional algorithms.

[0007] Subsequently, with the development of deep learning technology, more complex network structures were introduced into the field of image super-resolution. For example, the VDSR model achieves finer image detail restoration by introducing a deeper network structure. In addition, ESPCN directly learns on low-resolution input and outputs high-resolution images through sub-pixel convolutional layers, improving the efficiency and quality of the super-resolution process.

[0008] Another branch of deep learning-based super-resolution technology is to use adversarial networks, such as SRGAN, which further improves the quality of super-resolution images by generating adversarial networks. In SRGAN, the generator network is responsible for generating high-resolution images, while the discriminator network tries to distinguish between the generated images and the real high-resolution images. This adversarial process promotes the generator to produce more realistic and delicate image details.

[0009] Existing image super-resolution technologies, including those based on interpolation, sparse representation, convolutional neural networks (CNNs), and generative adversarial networks (GANs), have improved image resolution to a certain extent, but still have significant defects. Interpolation methods can only interpolate on the basis of existing pixels, resulting in poor detail recovery and blurred edges; sparse representation methods can restore details to a certain extent, but the computational complexity is high and depends on the quality of the dictionary; CNN-based methods require a large amount of high-quality training data and high computing resources, and the model complexity is high; GAN methods are effective in generating image details, but the training process is unstable and the quality of generated images is difficult to control. In addition, a common problem of these methods is that they cannot effectively solve the ill-posed problem in super-resolution tasks, that is, a low-resolution image may correspond to multiple high-resolution images. Summary of the invention

[0010] The present application provides an image processing method, medium and device based on a twin normalized flow neural network, which are used to solve the ill-posed problem of super-resolution tasks in existing image super-resolution processing.

[0011] In the first aspect, an embodiment of the present application provides an image processing method based on a twin normalized flow neural network, comprising: enlarging a low-resolution image through interpolation to make it have the same length and width as a high-resolution image, and marking it as an LR image; inputting the LR image into a pre-trained twin normalized flow network model comprising two twin normalized flow modules for processing, obtaining a tensor output after processing by the twin normalized flow module, marked as a z_L tensor, and decomposing the z_L tensor into two parts: a z_LL low-frequency tensor and a z_LH high-frequency tensor; sampling high-frequency latent variables , and reversely input the high-frequency latent variables into the conditional normalized flow module for processing, obtain the tensor output after processing by the conditional normalized flow module, mark it as z_H tensor, and decompose the z_H tensor into two parts: z_HL low-frequency tensor and z_HH high-frequency tensor; copy the z_LL low-frequency tensor to the position of the z_HL low-frequency tensor, and splice the z_LL low-frequency tensor and the z_HH high-frequency tensor into a z_H' tensor; reversely input the z_H' tensor into the twin normalized flow network model to obtain a high-resolution image.

[0012] In one embodiment of the first aspect, the conditional normalization flow module is conditioned on the z_LL low-frequency tensor.

[0013] In one implementation of the first aspect, the high-frequency latent variables are randomly sampled from a Gaussian distribution.

[0014] In one implementation of the first aspect, the training process of the twin standardized flow module includes: enlarging the low-resolution image through interpolation to make it the same length and width as the high-resolution image, marking it as an LR image, and simultaneously inputting the LR image and the high-resolution image into the twin standardized flow module for processing; obtaining the tensor output by the LR image after processing by the twin standardized flow module, marking it as a z_L tensor, and decomposing the z_L tensor into two parts, a z_LL tensor and a z_LH tensor, and at the same time obtaining the tensor output by the high-resolution image after processing by the twin standardized flow module, marking it as a z_H tensor, and decomposing the z_H tensor into two parts, a z_HL tensor and a z_HH tensor; based on The z_LL tensor and the z_LH tensor obtain a first L2 loss function and a second L2 loss function by calculation, obtain a third L2 loss function based on the z_LL tensor and the z_HL tensor, obtain a first negative log-likelihood loss based on the z_HC tensor, obtain a second negative log-likelihood loss based on the z_LL tensor, and obtain a third negative log-likelihood loss based on the z_HL tensor; based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss, train a twin normalized flow network model including the twin normalized flow module and the conditional normalized flow module.

[0015] In one implementation of the first aspect, the z_LH tensor is set to 0, and the first L2 loss function is obtained by calculating the L2 loss between the z_LH tensor and the zero tensor; the z_LH tensor is set to 0, and after being spliced ​​with the z_LH tensor, it is reversely input into the twin normalization flow module for processing to obtain an image with the same dimension as the LR image, marked as the LR' image, and the second L2 loss function is obtained by calculating the L2 loss between the LR image and the LR' image; the z_LL tensor is equal to the z_HL tensor, and the third L2 loss function is obtained by calculating the L2 loss between the z_LL tensor and the z_HL tensor.

[0016] In one implementation of the first aspect, the training of the twin standardized flow network model including the twin standardized flow module and the conditional standardized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss includes: first training the two twin standardized flow modules in the twin standardized flow network model based on the first L2 loss function and the second L2 loss function, and then training the conditional standardized flow module in the twin standardized flow network model through the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss.

[0017] In one implementation of the first aspect, the training of the twin standardized flow network model including the twin standardized flow module and the conditional standardized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss includes: linearly combining the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss to generate a total L2 loss function, and training the twin standardized flow network model in an end-to-end manner based on the total L2 loss function.

[0018] In one implementation of the first aspect, the twin normalized flow network model adopts the Glow model.

[0019] In a second aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image processing method based on a twin normalized flow neural network as described in any one of the first aspects of the present application.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory storing a computer program; and a processor communicatively connected to the memory, for executing the image processing method based on a twin normalized flow neural network described in any one of the first aspects of the present application when the computer program is called.

[0021] In the image processing method based on the twin normalized flow neural network provided in the embodiment of the present application, the twin normalized flow network model can learn the same low-frequency information in the low-resolution image and the corresponding high-resolution image, and decouple the low-frequency information from the high-frequency information, so as to better capture the details of the image and effectively solve the ill-posed problem in the super-resolution task. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Shown is an overall flow chart of an image processing method based on a twin normalized flow neural network according to an embodiment of the present application.

[0023] Figure 2 Shown is a schematic diagram of the reasoning process of an image processing method based on a twin normalized flow neural network according to an embodiment of the present application.

[0024] Figure 3 Shown is a flowchart of model training in an image processing method based on a twin normalized flow neural network according to an embodiment of the present application;

[0025] Figure 4 Shown is a schematic diagram of a model training process in an image processing method based on a twin normalized flow neural network according to an embodiment of the present application;

[0026] Figure 5 Shown is an overall architecture diagram of a model in an image processing method based on a twin normalized flow neural network according to an embodiment of the present application;

[0027] Figure 6 Shown is a single-step flow module architecture diagram of a model in an image processing method based on a twin standardized flow neural network according to an embodiment of the present application;

[0028] Figure 7 Shown is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0029] Component number description

[0030] 100 Electronic devices

[0031] 101 Memory

[0032] 102 Processor

[0033] 103 Display

[0034] S100~S500 Steps

[0035] Steps S10 to S40 DETAILED DESCRIPTION

[0036] The following describes the embodiments of the present application through specific examples, and those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways according to different viewpoints and applications without departing from the spirit of the present application. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0037] The embodiments of the present application provide an image processing method, medium and device based on a twin normalized flow neural network, which are used to solve the ill-posed problem of super-resolution tasks in existing image super-resolution processing.

[0038] In the embodiment of the present application, the twin normalized flow neural network can learn the same low-frequency information in the low-resolution image and the corresponding high-resolution image, and decouple the low-frequency information from the high-frequency information, so as to better capture the details of the image. The normalized flow network can learn the conditional probability relationship between the low-frequency information and the high-frequency information in the image, and effectively solve the ill-posed problem in the super-resolution task by modeling the image distribution. Compared with the prior art, the embodiment of the present application has significant advantages in the following aspects:

[0039] 1. Strong detail restoration capability: By decoupling the low-frequency and high-frequency information of the twin normalized flow neural network, the detail restoration capability is improved and edge blur and artifact problems are avoided.

[0040] 2. Computation and storage optimization: The standardized flow network effectively models the conditional probability distribution of images, reducing computational complexity and improving computational efficiency.

[0041] 3. Stable training process: Compared with GAN, the method of this embodiment is more stable during the training process, and the quality of the generated high-resolution images is more controllable.

[0042] 4. Solve the ill-posed problem: By modeling the relationship between low-frequency and high-frequency information through a standardized flow network, the problem of a low-resolution image corresponding to multiple possible high-resolution images is effectively solved, thereby improving the well-posedness of the super-resolution task.

[0043] The following will be combined with the attached examples of the present application Figure 1 To Attachment Figure 5 , the technical solution in the embodiment of the present application is described in detail, so that those skilled in the art can understand and implement the image processing method based on the twin normalized flow neural network of the present embodiment without creative labor.

[0044] Figure 1 The flowchart of the image processing method based on the twin normalized flow neural network in the embodiment of the present application is shown. Specifically, Figure 1 As shown, the image processing method based on the twin normalized flow neural network provided in the embodiment of the present application includes the following steps S100 to S500.

[0045] Step S100, enlarging the low-resolution image by interpolation to make it have the same length and width as the high-resolution image, and marking it as the LR image;

[0046] Step S200, input the LR image into a pre-trained twin normalized flow network model including two twin normalized flow modules for processing, obtain the tensor output after processing by the twin normalized flow module, mark it as z_L tensor, and decompose the z_L tensor into two parts: z_LL low-frequency tensor and z_LH high-frequency tensor;

[0047] Step S300, sampling high-frequency latent variables, and reversely inputting the high-frequency latent variables into the conditional normalization flow module for processing, obtaining the tensor output after processing by the conditional normalization flow module, marking it as z_H tensor, and decomposing the z_H tensor into two parts: z_HL low-frequency tensor and z_HH high-frequency tensor;

[0048] Step S400, copying the z_LL low-frequency tensor to the position of the z_HL low-frequency tensor, and splicing the z_LL low-frequency tensor and the z_HH high-frequency tensor into a z_H' tensor;

[0049] Step S500, reverse input the z_H' tensor into the twin normalized flow network model to obtain a high-resolution image.

[0050] The above steps S100 to S500 in the image processing method based on the twin normalized flow neural network of this embodiment are described in detail below.

[0051] Step S100: enlarge the low-resolution image through interpolation to make it have the same length and width as the high-resolution image, and mark it as the LR image.

[0052] Step S200, input the LR image into a pre-trained twin normalized flow network model including two twin normalized flow modules for processing, obtain the tensor output after processing by the twin normalized flow module, mark it as z_L tensor, and decompose the z_L tensor into two parts: z_LL low-frequency tensor and z_LH high-frequency tensor;

[0053] Step S300, sampling high-frequency latent variables, and reversely inputting the high-frequency latent variables into the conditional normalized flow module for processing, obtaining the tensor output after processing by the conditional normalized flow module, marked as z_H tensor, and decomposing the z_H tensor into two parts: z_HL low-frequency tensor and z_HH high-frequency tensor; wherein, in an implementation of this embodiment, the high-frequency latent variables are randomly sampled from a Gaussian distribution. The conditional normalized flow module is conditioned on the z_LL low-frequency tensor.

[0054] Step S400, copying the z_LL low-frequency tensor to the position of the z_HL low-frequency tensor, and splicing the z_LL low-frequency tensor and the z_HH high-frequency tensor into a z_H' tensor;

[0055] Step S500, reverse input the z_H' tensor into the twin normalized flow network model to obtain a high-resolution image.

[0056] Figure 2 The figure shows a schematic diagram of the reasoning process of the image processing method based on the twin normalized flow neural network according to an embodiment of the present application. In this embodiment, the pre-trained twin normalized flow network model including two twin normalized flow modules, after the model training is completed, utilizes the reversible property of the normalized flow network, and this embodiment can perform super-resolution on a low-resolution image without a high-resolution image. Figure 2 The architecture of the twin normalized flow network model at inference time is shown, where arrows depict the direction of data flow during inference.

[0057] like Figure 2 As shown, in this embodiment, the low-resolution image is first interpolated into an LR image so that the size of the LR image reaches the size of the target resolution. Then the LR image is input into the twin normalized flow network to obtain a tensor, marked as a z_L tensor, and the z_L tensor is decomposed into two parts: a z_LL low-frequency tensor and a z_LH high-frequency tensor. Next, this embodiment first samples a high-frequency latent variable z_HC from a Gaussian distribution, and then reversely inputs the high-frequency latent variable z_HCz_HC into a conditional normalized flow module conditioned on the z_LL low-frequency tensor for processing to obtain a z_HH high-frequency tensor. Since this embodiment constrains the equality of low-frequency information in the LR image and the HR image through the L2 loss during model training, this embodiment can directly copy the value of the z_LL low-frequency tensor to the position of the z_HL low-frequency tensor and splice it with the z_HH high-frequency tensor during model reasoning to form a z_H tensor, and then reversely input the z_H tensor into the twin normalized flow module to obtain the final super-resolution result: a high-resolution image (HR).

[0058] It should be noted that since the high-frequency latent variable z_HC is a random variable sampled from a Gaussian distribution, the model will obtain multiple different HR results when the same LR image is input into the model multiple times during inference. However, since the z_LL low-frequency tensor is injected as a condition in the conditional normalization flow module, these HR results and LR inputs have a reasonable correspondence. Therefore, this property of the model proposed in this embodiment responds to and solves the ill-posed problem that a low-resolution image corresponds to multiple possible high-resolution images.

[0059] In this embodiment, the twin normalized flow network model including two twin normalized flow modules needs to be pre-trained. Figure 3 The flowchart of the model training in the image processing method based on the twin normalized flow neural network in one embodiment of the present application is shown as follows: Figure 3As shown, in one implementation of this embodiment, the training process of the twin normalization flow module includes the following steps S10 to S40.

[0060] Step S10, enlarging the low-resolution image by interpolation to make it have the same length and width as the high-resolution image, marking it as an LR image, and simultaneously inputting the LR image and the high-resolution image into the twin normalized stream module for processing;

[0061] Step S20, obtaining the tensor output by the LR image after being processed by the twin normalized flow module, marked as z_L tensor, and decomposing the z_L tensor into two parts: z_LL tensor and z_LH tensor. At the same time, obtaining the tensor output by the high-resolution image after being processed by the twin normalized flow module, marked as z_H tensor, and decomposing the z_H tensor into two parts: z_HL tensor and z_HH tensor.

[0062] Step S30, obtaining a first L2 loss function and a second L2 loss function by calculation based on the z_LL tensor and the z_LH tensor, obtaining a third L2 loss function based on the z_LL tensor and the z_HL tensor, obtaining a first negative log-likelihood loss based on the z_HC tensor, obtaining a second negative log-likelihood loss based on the z_LL tensor, and obtaining a third negative log-likelihood loss based on the z_HL tensor.

[0063] In one implementation of this embodiment, the z_LH tensor is set to 0, and the first L2 loss function is obtained by calculating the L2 loss between the z_LH tensor and the zero tensor; the z_LH tensor is set to 0, and after being spliced ​​with the z_LH tensor, it is reversely input into the twin normalization flow module for processing to obtain an image with the same dimension as the LR image, marked as the LR' image, and the second L2 loss function is obtained by calculating the L2 loss between the LR image and the LR' image; the z_LL tensor is equal to the z_HL tensor, and the third L2 loss function is obtained by calculating the L2 loss between the z_LL tensor and the z_HL tensor.

[0064] Step S40, training a twin normalized flow network model including the twin normalized flow module and the conditional normalized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss, and the third negative log-likelihood loss.

[0065] In one implementation of this embodiment, the training of the twin standardized flow network model including the twin standardized flow module and the conditional standardized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss includes: first training the two twin standardized flow modules in the twin standardized flow network model based on the first L2 loss function and the second L2 loss function, and then training the conditional standardized flow module in the twin standardized flow network model through the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss.

[0066] In another implementation of this embodiment, the training of the twin standardized flow network model including the twin standardized flow module and the conditional standardized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss includes: linearly combining the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss to generate a total L2 loss function, and training the twin standardized flow network model in an end-to-end manner based on the total L2 loss function.

[0067] Figure 4 Shown is a schematic diagram of a model training process in an image processing method based on a twin normalized flow neural network according to an embodiment of the present application; Figure 4 The basic architecture of the twin normalized flow network model is shown, with arrows depicting the direction of data flow when training the model.

[0068] like Figure 4 As shown, in this embodiment, the low-resolution image is first enlarged by interpolation to make it the same length and width as the high-resolution image, called LR, and is input into the twin normalized flow module simultaneously with the high-resolution image (HR).

[0069] After the LR image passes through the twin normalized flow module, the output tensor is called z_L. In this embodiment, the tensor z_L is decomposed into two parts, z_LL and z_LH, which correspond to the low-frequency information and high-frequency information of the LR image respectively. Since the LR image is obtained by interpolating and amplifying the low-resolution image and does not contain high-frequency information itself, this embodiment needs to be trained so that z_LL contains all the information in LR, while z_LH contains no information, that is, z_LH=0. This embodiment first calculates the L2 loss between z_LH and the zero tensor, then keeps z_LL unchanged, changes z_LH to 0 and reversely inputs the twin normalized flow network to obtain an image with the same dimension as LR, called LR', and then calculates the L2 loss between LR and LR'. By training the twin normalized flow module with these two L2 losses, all the information in LR can be encoded into z_LL.

[0070] After the HR image passes through the twin normalized flow module, the output tensor is called z_R. This embodiment also decomposes z_R into z_HL and z_HH, which correspond to the low-frequency and high-frequency information of the HR image, respectively. Since the LR and HR images are paired low-resolution-high-resolution images, the low-frequency information encoding of the two should be the same, that is, z_LL=z_HL, and the training is performed here through the L2 loss. On the other hand, the high-frequency information z_HH of the high-frequency image of HR will be input into another conditional normalized flow module. This is because the high-frequency information and low-frequency information in the image are usually not independent variables, but there is a conditional relationship. Therefore, this embodiment injects z_LL as a condition into the conditional normalized flow module through a conditional affine coupling layer, while ensuring that the normalized flow is still reversible. After z_HH passes through the conditional normalized flow module, the high-frequency information hidden variable z_HC is obtained. This embodiment assumes that z_HC obeys a Gaussian distribution, so as to calculate the negative log-likelihood loss corresponding to the high-frequency part of the HR image. In addition, this embodiment assumes that z_LL and z_HL also obey a Gaussian distribution, and calculates their negative log-likelihood losses respectively. By optimizing these three negative log-likelihood losses, this embodiment can simultaneously train two normalization streams to model the probability distribution of images in the training set.

[0071] When training the entire model, this embodiment can first train the twin standardized flow module through the L2 loss between LR and LR' and z_LH and 0 to ensure the decoupling ability of the twin standardized flow module for high-frequency and low-frequency information, and then train the conditional standardized flow module through the remaining L2 loss function. It can also be directly end-to-end training, linearly combining all L2 loss functions with certain coefficients to obtain a total L2 loss function for training. It should be noted that compared with the segmented training scheme, more rounds of training are required when using the end-to-end training scheme to make the L2 loss function converge and achieve a more ideal effect.

[0072] In one implementation of this embodiment, the twin normalized flow network model preferably adopts the Glow model. There are two normalized flow modules in the twin normalized flow network proposed in this embodiment. This embodiment chooses to refer to the Glow model proposed by OpenAI and make some modifications.

[0073] Figure 5 Shown is the overall architecture diagram of the model in the image processing method based on the twin normalized flow neural network according to one embodiment of the present application. Figure 6 The single-step flow module architecture diagram of the model in the image processing method based on the twin normalized flow neural network according to an embodiment of the present application is shown. Figure 5 and Figure 6 As shown in the figure, the overall architecture of the Glow model is mainly composed of several Figure 6 The single-step flow module in the embodiment and the squeeze module (Squeeze) and separation module (Split) for processing length and width changes are composed. The squeeze module reduces the image of the current step to half of the original in both length and width directions, and increases the number of channels (Channel) to four times the original to keep the total dimension unchanged and the reversibility of the model. It should be noted that in the model proposed in this embodiment, the separation module is removed in this embodiment, so that the model of this embodiment only needs to sample a random variable from a Gaussian distribution once to restore a high-resolution image.

[0074] Figure 6The single-step flow module in contains three layers: activation normalization (actnorm), invertible 1x1 convolution (invertible1x1 conv) and affine coupling layer. The ActNorm layer is used to normalize the activation value. It initializes the parameters based on the data in the first batch processing so that the output activation value has zero mean and unit variance, and then these parameters become trainable variables. The reversible 1x1 convolution layer realizes the reversibility of the convolution operation by linearly transforming the input in the channel dimension. This design allows the position and order of each pixel to be effectively rearranged. The affine coupling layer divides the input into two parts, inputs one part into the convolutional neural network to generate the scaling parameter s and the offset parameter t, and then applies the affine transformation to the other part. Specifically, the input x is divided into xa and xb, and then xb is input into a convolutional neural network to calculate log(s) and t, and then transformed by the formula ya=s*a+t and yb=xb, and finally ya and yb are connected to form the output y. The second normalization flow in the model is a conditional normalization flow module. With z_LL as the condition, this embodiment combines z_LL and xb into the convolutional neural network that calculates s and t, thereby injecting the conditional variables into the normalization flow. This design ensures that all operations in the Glow model are reversible, so that the generative model can efficiently generate and reconstruct data.

[0075] The image processing method based on the twin standardized flow neural network of this embodiment organically combines the twin network and the standardized flow network, which can be used for the research and application of image super-resolution. The twin network has unique advantages in the comparison and identification of image features, while the standardized flow network is good at simulating complex data distribution. This embodiment achieves a deep integration of the twin network and the standardized flow network by adjusting the structure and function of the two, enhancing the model's understanding and processing capabilities of the image content. In terms of implementation, this embodiment also explores new training and optimization strategies to adapt to this composite network structure.

[0076] Compared with the method based on generative adversarial network (GAN), the twin standardized flow network model of this embodiment has significant technical advantages in many aspects. First, it is more stable during the training process and is not prone to the common mode collapse problem in GAN training. Secondly, the quality of high-resolution images generated by the twin standardized flow network model is more controllable, avoiding the disadvantage that the quality of images generated by GAN is difficult to control. In addition, this method makes the calculation more efficient and the demand for hardware resources is relatively low by decoupling and modeling the frequency information of the image. Finally, compared to GAN, which has a one-to-one correspondence between input and output during reasoning, the standardized flow network can also enable low-resolution images to correspond to a variety of possible high-resolution images, solving the ill-posed problem in super-resolution tasks. These advantages enable the twin standardized flow network model to show higher performance and better application prospects in image super-resolution tasks.

[0077] The protection scope of the image processing method based on the twin standardized flow neural network described in the embodiment of the present application is not limited to the execution order of the steps listed in this embodiment. All solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present application are included in the protection scope of the present application.

[0078] An embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the image processing method based on the twin normalized flow neural network provided in any embodiment of the present application is implemented.

[0079] In the embodiment of the present application, any combination of one or more storage media can be used. The storage medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, - but not limited to - an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, a device or a device or used in combination with it.

[0080] An embodiment of the present application also provides an electronic device. Figure 7Shown is a schematic diagram of the structure of the electronic device 100 provided in the embodiment of the present application. In some embodiments, the electronic device may be a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA) and other terminal devices. In addition, the image processing method based on the twin standardized flow neural network provided in the present application can also be applied to training data sets, servers, and image processing systems based on terminal artificial intelligence. The embodiment of the present application does not impose any restrictions on the specific application scenarios of the image processing method based on the twin standardized flow neural network.

[0081] like Figure 7 As shown, the electronic device 100 provided in the embodiment of the present application includes a memory 101 and a processor 102 .

[0082] The memory 101 is used to store computer programs; preferably, the memory 101 includes: ROM, RAM, disk, USB flash drive, memory card or CD-ROM and other media that can store program codes.

[0083] Specifically, the memory 101 may include a computer system readable medium in the form of a volatile memory, such as a random access memory (RAM) and / or a cache memory. The electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. The memory 101 may include at least one program product having a set (e.g., at least one) of program modules, which are configured to perform the functions of the various embodiments of the present application.

[0084] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the image processing method based on the twin normalized flow neural network provided in any embodiment of the present application.

[0085] Optionally, the processor 102 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0086] Optionally, the electronic device 100 in this embodiment may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is used to display a GUI interaction interface related to the image processing method based on the twin normalized flow neural network.

[0087] In summary, the twin normalized flow network model in the image processing method based on the twin normalized flow neural network provided in the embodiment of the present application can learn the same low-frequency information in the low-resolution image and the corresponding high-resolution image, and decouple the low-frequency information from the high-frequency information, so as to better capture the details of the image and effectively solve the ill-posed problem in the super-resolution task. Therefore, the present application effectively overcomes the various shortcomings in the prior art and has a high industrial utilization value.

[0088] The above embodiments are merely illustrative of the principles and effects of the present application and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. An image processing method based on twin normalized flow neural network, characterized in that: include: The low-resolution image is enlarged by interpolation to make it the same length and width as the high-resolution image, and marked as the LR image; The LR image is input into a pre-trained twin normalized flow network model including two twin normalized flow modules for processing, a tensor output after being processed by the twin normalized flow module is obtained, which is marked as a z_L tensor, and the z_L tensor is decomposed into two parts: a z_LL low-frequency tensor and a z_LH high-frequency tensor; Sampling high-frequency latent variables, and reversely inputting the high-frequency latent variables into the conditional normalized flow module for processing, obtaining the tensor output after being processed by the conditional normalized flow module, marking it as z_H tensor, and decomposing the z_H tensor into two parts: z_HL low-frequency tensor and z_HH high-frequency tensor; Copy the z_LL low-frequency tensor to the position of the z_HL low-frequency tensor, and concatenate the z_LL low-frequency tensor and the z_HH high-frequency tensor into a z_H' tensor; The z_H' tensor is inversely input into the twin normalized flow network model to obtain a high-resolution image.

2. The image processing method based on twin normalized flow neural network according to claim 1 is characterized in that: The conditional normalization flow module is conditioned on the z_LL low-frequency tensor.

3. The image processing method based on twin normalized flow neural network according to claim 1 is characterized in that: The high-frequency latent variables are randomly sampled from a Gaussian distribution.

4. The image processing method based on twin normalized flow neural network according to claim 1 is characterized in that: The training process of the twin normalization flow module includes: The low-resolution image is enlarged by interpolation to make it have the same length and width as the high-resolution image, marked as an LR image, and the LR image and the high-resolution image are simultaneously input into the twin normalization flow module for processing; The tensor outputted by the LR image after being processed by the twin normalized flow module is obtained, marked as z_L tensor, and the z_L tensor is decomposed into two parts: z_LL tensor and z_LH tensor. Meanwhile, the tensor outputted by the high-resolution image after being processed by the twin normalized flow module is obtained, marked as z_H tensor, and the z_H tensor is decomposed into two parts: z_HL tensor and z_HH tensor. Obtaining a first L2 loss function and a second L2 loss function by calculation based on the z_LL tensor and the z_LH tensor, obtaining a third L2 loss function based on the z_LL tensor and the z_HL tensor, and obtaining a first negative log-likelihood loss based on the z_HC tensor, obtaining a second negative log-likelihood loss based on the z_LL tensor, and obtaining a third negative log-likelihood loss based on the z_HL tensor; A twin normalized flow network model including the twin normalized flow module and the conditional normalized flow module is trained based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss, and the third negative log-likelihood loss.

5. The image processing method based on twin normalized flow neural network according to claim 4 is characterized in that: Let the z_LH tensor be 0, and obtain the first L2 loss function by calculating the L2 loss between the z_LH tensor and the zero tensor; let the z_LH tensor be 0, concatenate it with the z_LH tensor and reversely input it into the twin normalization flow module for processing to obtain an image with the same dimension as the LR image, marked as LR' image, and obtain the second L2 loss function by calculating the L2 loss between the LR image and the LR' image; the z_LL tensor is equal to the z_HL tensor, and the third L2 loss function is obtained by calculating the L2 loss between the z_LL tensor and the z_HL tensor.

6. The image processing method based on twin normalized flow neural network according to claim 4 is characterized in that: The training of the twin normalized flow network model including the twin normalized flow module and the conditional normalized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss, and the third negative log-likelihood loss includes: First, the two twin standardized flow modules in the twin standardized flow network model are trained based on the first L2 loss function and the second L2 loss function, and then the conditional standardized flow module in the twin standardized flow network model is trained by the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss and the third negative log-likelihood loss.

7. The image processing method based on twin normalized flow neural network according to claim 4 is characterized in that: The training of the twin normalized flow network model including the twin normalized flow module and the conditional normalized flow module based on the first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss, and the third negative log-likelihood loss includes: The first L2 loss function, the second L2 loss function, the third L2 loss function, the first negative log-likelihood loss, the second negative log-likelihood loss, and the third negative log-likelihood loss are linearly combined to generate a total L2 loss function, and the twin normalized flow network model is trained in an end-to-end manner based on the total L2 loss function.

8. The image processing method based on twin normalized flow neural network according to claim 1 or 4, characterized in that: The twin standardized flow network model adopts the Glow model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the image processing method based on the twin normalized flow neural network described in any one of claims 1 to 8 is implemented.

10. An electronic device, characterized in that: The electronic device comprises: A memory storing a computer program; A processor is communicatively connected to the memory, and executes the image processing method based on the twin normalized flow neural network described in any one of claims 1 to 8 when calling the computer program.