Method for generating image super-resolution dataset, image super-resolution model, and training method

Generate a data set through blind image degradation processing, simulate the real-world degradation causes, and train the image super-resolution model, which solves the problem of poor generalization ability of the end-side model and achieves fast learning and efficient super-resolution effects.

WO2024221696A1PCT designated stage expired Publication Date: 2024-10-31WELLINK TECH CO LTD

Patent Information

Application Number
PCT/CN2023/117704
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-26
Filing Date
2023-09-08
Publication Date
2024-10-31

AI Technical Summary

Technical Problem

The end-side super-resolution model has problems with poor generalization ability and slow learning speed during training. Especially under hardware limitations, it is difficult to handle low-resolution images caused by various degradation reasons in the real world.

Method used

Generate high- and low-resolution image data sets through blind image degradation processing to simulate real-world degradation causes and use them to train image super-resolution models. Randomly select blur, scaling, noise, and compression operations to generate blind degradation data sets, and use ESRGAN and SwinIR. , HAT model is trained and weighted fusion is performed to improve the model generalization ability.

Benefits of technology

It achieves rapid learning of strong generalization capabilities on the end-side model, improves training efficiency and effects, and enables the model to better handle low-resolution images in the real world, with strong generalization capabilities and super-resolution effects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023117704_31102024_PF_FP_ABST
    Figure CN2023117704_31102024_PF_FP_ABST
Patent Text Reader

Abstract

A method for generating an image super-resolution dataset, an image super-resolution model, and a training method. The method for generating the image super-resolution dataset comprises the steps: S101: constructing a high-resolution image set; S102: performing blind image degradation on all of the high-resolution images HR1, to obtain an LR1-HR1 dataset; S103: using the LR1-HR1 dataset to train the first model, and after training is complete, obtaining and storing the model parameters of the first model; S104: constructing a low-resolution image set; and S105: inputting all of the low-resolution images LR2 into the first model obtained above, and by means of first-model reasoning, obtaining an LR2-SR2 dataset. An image super-resolution model training method involves using the LR2-SR2 dataset obtained via the above method to train a second model. The image super-resolution model, which is obtained by training the second model using the above method; the second model being an ECBSR model. The use of the LR2-SR2 dataset of the present invention allows for training a model having a relatively simple structure, with a high learning speed and strong trained model generalization capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

Method for generating image super-resolution dataset, image super-resolution model and training method Technical Field

[0001] The present invention relates to the field of image super-resolution, and in particular to a method for generating an image super-resolution dataset, a model training method, and an image super-resolution model. Background Art

[0002] Image super-resolution (SR) is a technology that restores low-resolution input to high-resolution (HR) output, improving display quality. Image super-resolution is divided into cloud super-resolution and on-device super-resolution. Cloud super-resolution performs image super-resolution on the server, while on-device super-resolution performs image super-resolution on the terminal device. Real-world image quality degradation is caused by a variety of factors. Therefore, datasets generated using specific degradation methods often perform poorly when processing real images. To handle the super-resolution of low-resolution images caused by various reasons and improve the generalization ability of the super-resolution model, it is necessary to simulate different low-resolution images using different degradation methods to train the super-resolution model. However, due to hardware limitations on the device, the model structure of the on-device super-resolution model is generally simpler than that of the cloud super-resolution model. Therefore, when using the aforementioned low-resolution images and their corresponding high-resolution images as training sets, problems such as poor model training results and slow learning speed can occur.

[0003] Patent document CN112488924A discloses an image super-resolution model training method, comprising: obtaining a low-resolution image and its corresponding true high-resolution image and true visible light image to form a training sample set; inputting the low-resolution image in the training sample set into a preset image super-resolution model to obtain an alternative high-resolution image; performing image mode conversion on the alternative high-resolution image and the true high-resolution image respectively to obtain a first visible light image and a second visible light image; constructing a loss function based on the difference between the first visible light image and the second visible light image and the true visible light image, and the difference between the alternative high-resolution image and the true high-resolution image; and performing model training on the preset image super-resolution model based on the loss function to obtain a trained preset image super-resolution model.

[0004] In related technologies, the construction of training images with different degradation causes is not considered, and it is impossible to output good super-resolution images for low-resolution images with different degradation causes when processing real-world images, and the generalization ability of the model is poor.

[0005] Summary of the Invention

[0006] The present invention aims to solve the problems of poor model training effect and slow learning speed in training to improve the generalization ability of the model when training on the end-side model. It provides a low-resolution image and corresponding high-resolution image training set suitable for simple structure models, which has good training effect, fast learning speed, and strong generalization ability of the model after training, as well as a model training method based on the above training set and an image super-resolution model obtained by training.

[0007] In view of the above limitations, the present invention proposes a method for generating an image super-resolution dataset, comprising the steps of:

[0008] S101: Build a high-resolution image set;

[0009] S102: performing blind image degradation processing on the high-resolution image HR1 of the high-resolution image set to obtain a corresponding low-resolution image LR1, thereby obtaining an LR1-HR1 data pair; performing the above operation on all the high-resolution images HR1 of the high-resolution image set to obtain an LR1-HR1 data set;

[0010] S103: Using the LR1-HR1 dataset to train a first model, and after the training is completed, obtaining and saving model parameters of the first model; the first model is an image super-resolution model;

[0011] S104: constructing a low-resolution image set;

[0012] S105: Input the low-resolution image LR2 in the low-resolution image set into the first model with the model parameters to obtain a super-resolution image SR2, thereby obtaining an LR2-SR2 data pair; perform the above operation on all low-resolution images LR2 in the low-resolution image set to obtain an LR2-SR2 data set.

[0013] Furthermore: the step S103 includes:

[0014] S1031: Inputting the low-resolution image LR1 into the first model, and the first model outputting a super-resolution image SR1;

[0015] S1032: Calculate the loss function using the high-resolution image HR1 and the super-resolution image SR1;

[0016] S1033: When the loss function is less than a first preset threshold, save the model parameters;

[0017] S1034: Repeat steps S1031 to S1033 for each LR1-HR1 data pair in the training set, and obtain the model parameters of the first model after completion.

[0018] Furthermore, the image blind degradation processing is to perform any one or more of the following operations on the high-resolution image HR1 according to a random selection method:

[0019] Blur operation: According to the random selection method, one or two of Gaussian blur and Sinc filter blur are selected for operation;

[0020] Scaling operation: According to the random selection method, one or more of bilinear interpolation, bicubic interpolation, and regional interpolation are selected for operation;

[0021] Superimposed noise operation: According to the random selection method, one or two of Gaussian noise and Poisson noise are selected for operation;

[0022] Image compression operation: compressing the image, wherein the compression factor is 30%-95%;

[0023] The image blind degradation process is performed once, or the image blind degradation process is iteratively performed twice.

[0024] Furthermore: the random selection method is to randomly give all options a random score between 0 and 1. When the random score of the option is less than a second preset threshold, the operation is not performed; all random scores greater than or equal to the second preset threshold are normalized as the weight of the corresponding option, and the operation corresponding to the option with the random score greater than or equal to the second preset threshold is performed, and the execution results of all options are weighted according to the weight to obtain the output result.

[0025] Further: in the step S103, the first model includes: an ESRGAN model, a SwinIR model, and a HAT model; the ESRGAN model, the SwinIR model, and the HAT model are trained respectively using the LR1-HR1 dataset, and the model parameters corresponding to each model are saved;

[0026] In step S105, the low-resolution image LR2 is input into the ESRGAN model, the SwinIR model, and the HAT model respectively, and the obtained results are weightedly fused according to preset weights to obtain the super-resolution image SR2;

[0027] The preset weights are: ESRGAN model weight 0.2, SwinIR model weight 0.4, and HAT model weight 0.4.

[0028] Further: in the steps S101-S102, the obtained LR1-HR1 data set includes: n types of sub-training sets;

[0029] In step S103, when performing model training on the first model, the n types of sub-training sets are used for training respectively to obtain n groups of sub-model parameters;

[0030] In step S105, for the k groups of sub-model parameters, one group of sub-model parameters is selected in turn as the model parameters of the first model, and the low-resolution image LR2 is input to obtain the output result; all the output results are weightedly fused according to preset weights to obtain the super-resolution image SR2.

[0031] Furthermore: in the steps S101-S102, the obtained LR1-HR1 data set includes: 1 basic training set; k types of sub-training sets;

[0032] In the step S103, the first model is trained using the basic training set to obtain basic model parameters;

[0033] Using k types of sub-training sets to train the first model with basic model parameters respectively, to obtain k groups of sub-model parameters;

[0034] In step S105, one set of sub-model parameters is sequentially selected from the k sets of sub-model parameters as the model parameters of the first model, and the low-resolution image LR2 is input to obtain an output result; all output results are weightedly fused according to preset weights to obtain the super-resolution image SR2. A method for training an image super-resolution model uses the LR2-SR2 dataset obtained by the above method to train a second model, the second model being an image super-resolution model, and the training method includes:

[0035] S201: Inputting an LR2 image into the second model, and the second model outputting an SR2′ image;

[0036] S202: Calculating a loss function using the super-resolution image SR2 and the super-resolution image SR2′; when the loss function is less than a third preset threshold, saving the model parameters;

[0037] S203: Repeat steps S201 to S202 for each LR2-SR2 data pair of the LR2-SR2 data set, and obtain the model parameters of the second model after completion.

[0038] Furthermore: the loss function is calculated as follows:

[0039] Calculate the L1 loss function, GAN loss function, and perceptual loss function respectively;

[0040] The results of the above calculations are weighted according to the preset weights to obtain the loss function.

[0041] An image super-resolution model is obtained by training the second model using the above method; the second model is an ECBSR model.

[0042] Compared with the related art, the present invention has the following advantages:

[0043] One aspect of the present invention is a method for generating an image super-resolution dataset. Using a blind image degradation process, a blindly degraded high- and low-resolution image LR1-HR1 dataset is obtained as a training set for a first model. Blind image degradation is used to simulate image resolution reduction caused by various real-world reasons, thereby enabling the first model to learn strong generalization capabilities. Specifically, the method achieves better results in processing low-resolution images caused by various real-world degradation reasons. The trained first model is used to infer low-resolution images LR2 to obtain an LR2-SR2 dataset. The LR2-SR2 dataset is then used to train the model to be trained. Even if the structure of the model to be trained is relatively simple, it can quickly approach the first model through knowledge transfer, thereby rapidly learning the generalization capabilities of the first model.

[0044] The model training method of one invention point of the present invention trains the second model by using the LR2-SR2 dataset obtained by using the first model to infer the low-resolution image LR2. Through knowledge transfer, the second model can quickly approach the first model, thereby quickly learning the generalization ability of the first model.

[0045] An image super-resolution model of one invention point of the present invention uses a first model to infer the low-resolution image LR2 to obtain the LR2-SR2 dataset for training the second model. Even when the structure of the second model is relatively simple, the second model can quickly approach the first model, thereby quickly learning the generalization ability of the first model. The trained second model has strong generalization ability, and thus can handle the low-resolution image problem caused by various reasons in real situations with a smaller model structure, repair and super-resolve the above-mentioned images, and obtain better super-resolution effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] FIG1 is a flow chart of a method for generating an image super-resolution dataset according to an embodiment of the present invention;

[0047] FIG2 is a flow chart of step S103 in a method for generating an image super-resolution dataset according to an embodiment of the present invention;

[0048] FIG3 is a flow chart of a super-resolution model training method according to an embodiment of the present invention;

[0049] FIG4 is a schematic diagram of blind image degradation processing according to an embodiment of the present invention. DETAILED DESCRIPTION

[0050] To make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below. However, it should be understood that the description herein is only for explaining the present invention and is not intended to limit the scope of the present invention.

[0051] Unless otherwise defined, all technical and scientific terms used herein have the same meanings as commonly understood by those skilled in the art to which this invention pertains. The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The characterization methods used herein can be found in the relevant descriptions in the prior art and will not be elaborated upon herein.

[0052] In order to further understand the present invention, the present invention is further described in detail below in conjunction with the best embodiment.

[0053] Example 1

[0054] As shown in FIG1 , a method for generating an image super-resolution dataset includes the following steps:

[0055] S101: Build a high-resolution image set;

[0056] S102: performing blind image degradation processing on the high-resolution image HR1 of the high-resolution image set to obtain a corresponding low-resolution image LR1, thereby obtaining an LR1-HR1 data pair; performing the above operation on all the high-resolution images HR1 to obtain an LR1-HR1 data set;

[0057] S103: Using the LR1-HR1 dataset to train a first model, and after the training is completed, obtaining and saving model parameters of the first model; the first model is an image super-resolution model;

[0058] S104: constructing a low-resolution image set;

[0059] S105: Input the low-resolution image LR2 in the low-resolution image set into the first model with the model parameters to obtain a super-resolution image SR2, thereby obtaining an LR2-SR2 data pair; perform the above operation on all low-resolution images LR2 to obtain an LR2-SR2 data set.

[0060] When training a super-resolution model, the method for generating high- and low-resolution data pairs for the training set typically uses a degradation method using high-resolution images. Related degradation methods generally assume a predefined degradation process from high-resolution images to low-resolution images, but this method is difficult to apply to real images with complex degradation types. To address this issue, a blind degradation method was developed. This method uses an uncertain degradation process to complete the transition from high-resolution images to low-resolution images. Using the training set generated by this blind degradation method allows the model to learn stronger generalization capabilities, making it more capable of handling real images with complex degradation types. However, the training set generated by this blind degradation method places high demands on the model structure and hardware computing power during training. Therefore, the first model can have a more complex model structure. Therefore, strong generalization capabilities can be quickly learned through the blind degradation training set. After learning through the first model, a real low-resolution image LR2 is used to generate the LR2-SR2 dataset as a training set through inference by the first model. This dataset is used for learning a model with a simpler structure, so that the inference effect of the simpler model approaches that of a model with a complex structure and strong learning ability, thereby completing the knowledge transfer from the complex model to the simple model. Therefore, this training set has high training efficiency, fast speed, and good effect, and is suitable for training simple structure models. The blind degradation method can be a degradation method based on the CMDSR framework, or an adaptive learning degradation method based on the CycleGAN framework.

[0061] The first model is an image super-resolution model, including but not limited to the ESRGAN model, the SwinIR model, the HAT model, etc.

[0062] By using a blind image degradation method, a dataset of blindly degraded high- and low-resolution images (LR1-HR1) is obtained and used as the training set for the first model. Blind image degradation simulates the reduction in image resolution caused by various real-world reasons, enabling the first model to learn strong generalization capabilities. Specifically, it is effective in processing low-resolution images caused by various real-world degradation reasons. The trained first model is used to infer the low-resolution images (LR2) to obtain the LR2-SR2 dataset. This dataset is then used to train the model to be trained. Even if the structure of the model to be trained is relatively simple, it can quickly approach the first model through knowledge transfer, thereby quickly learning the generalization capabilities of the first model.

[0063] Example 2

[0064] As shown in FIG1-2, based on Example 1, further: step S103 includes:

[0065] S1031: Inputting the low-resolution image LR1 into the first model, and the first model outputting a super-resolution image SR1;

[0066] S1032: Calculate the loss function using the high-resolution image HR1 and the super-resolution image SR1;

[0067] S1033: When the loss function is less than a first preset threshold, save the model parameters;

[0068] S1034: Repeat steps S1031 to S1033 for each LR1-HR1 data pair in the training set, and obtain the model parameters of the first model after completion.

[0069] The first preset threshold value ranges from 0.01 to 0.05.

[0070] Furthermore, the image blind degradation processing is to perform any one or more of the following operations on the high-resolution image HR1 according to a random selection method:

[0071] Blur operation: According to the random selection method, one or two of Gaussian blur and Sinc filter blur are selected for operation;

[0072] Scaling operation: According to the random selection method, one or more of bilinear interpolation, bicubic interpolation, and regional interpolation are selected for operation;

[0073] Superimposed noise operation: According to the random selection method, one or two of Gaussian noise and Poisson noise are selected for operation;

[0074] Image compression operation: compressing the image, wherein the compression factor is 30%-95%;

[0075] The image blind degradation process is performed once, or the image blind degradation process is iteratively performed twice.

[0076] The Sinc filter is an ideal low-pass filter used to remove high-frequency components from a signal's spectrum. Its design is based on the Sinc function: sinc(t) = sin(πt) / πt, where t represents time. The Sinc function has a very smooth frequency response in the frequency domain, but its infinite time domain response prevents its direct use in practical applications.

[0077] The implementation of a Sinc filter is achieved by defining the filter coefficients in the frequency domain as a Sinc function and obtaining the filter's time domain response by discretizing these coefficients. In filter design, the performance of the filter can be controlled by adjusting parameters such as the cutoff frequency and filter size.

[0078] By adding Sinc filtering, the Sinc filter simulates the ringing and overshoot artifacts by setting different factors to increase the artifacts, thereby removing the oscillation artifacts in the image after training.

[0079] Gaussian blur, also known as Gaussian smoothing, involves convolving an image with a normal distribution. The original pixel has the largest Gaussian distribution value and the largest weight, while neighboring pixels have decreasing weights as they are farther from the original pixel. The mathematical expression for the normal distribution is used in Gaussian blurring.

[0080] The Sinc filter is an ideal electronic filter that removes all signal components above a given bandwidth and retains only low-frequency signals. In the field of digital signals, the normalized Sinc function is defined as:

[0081] Bilinear interpolation is performed by first using linear interpolation in one direction and then using linear interpolation in the other direction. Bilinear interpolation uses four pixels to calculate the value of one pixel.

[0082] Bicubic interpolation calculates the value of a single pixel using the values ​​of 16 surrounding pixels. Compared to bilinear interpolation, bicubic interpolation uses a more complex interpolation formula and smoothes pixels during the process. Practical applications include, but are not limited to, bicubic interpolation methods based on BiCubic basis functions.

[0083] Areal interpolation is the reaggregation of data from one set of polygons (the source polygons) to another set of polygons (the target polygons).

[0084] Gaussian noise refers to a type of noise whose probability density function follows a Gaussian distribution (i.e., normal distribution). It is usually sensor noise caused by poor lighting and high temperature. Adding Gaussian noise to the image can simulate the noise caused by these reasons.

[0085] Poisson noise is noise whose probability density follows a Poisson distribution.

[0086] Image compression is a method of compressing images based on image compression algorithms, including but not limited to lossy compression such as JPEG and JP2, and lossless compression such as TIFF, PNG, and GIF.

[0087] Compression factor = file size after compression / file size before compression.

[0088] A random number between 30% and 95% is randomly selected as the compression factor in each image compression operation.

[0089] The image blind degradation process is iteratively performed twice, as shown in FIG4 , which means that the result of the first image blind degradation process is brought into the second blind degradation process as input.

[0090] In related technologies, blind degradation datasets are generated using an unknown degradation kernel. This process typically involves a continuously modified degradation kernel, without a fixed kernel. This process is therefore referred to as blind degradation. However, this constant modification of the degradation kernel results in a significant computational overhead. The blind image degradation processing method employed in this invention employs a random selection approach to simulate real-world degradation mechanisms, achieving blind degradation processing with minimal computational effort.

[0091] Furthermore: the random selection method is to randomly give all options a random score between 0 and 1. When the random score of the option is less than a second preset threshold, the operation is not performed; all random scores greater than or equal to the second preset threshold are normalized as the weight of the corresponding option, and the operation corresponding to the option with the random score greater than or equal to the second preset threshold is performed, and the execution results of all options are weighted according to the weight to obtain the output result.

[0092] Normalization refers to redistributing all random scores greater than or equal to the second preset threshold so that their sum equals 1. For example, if the second preset threshold is 0.7, and the scores greater than or equal to 0.7 are [0.8, 0.9], they will be normalized to [0.8 / 1.7, 0.9 / 1.7]. The options corresponding to other scores less than 0.7 are not operated on.

[0093] The results of all option executions are weighted according to the weights. This means multiplying the corresponding output values ​​of all options by their respective weights and then adding them together. Corresponding output values ​​refer to output values ​​with the same position number (depending on the representation method, such as the row and column numbers of a matrix). The term "weighted calculation" is used throughout this article.

[0094] By using the random selection method and setting the second preset threshold, the cause of degradation can be randomly simulated to achieve blind image degradation. The second preset threshold is 0.4 to 0.8.

[0095] The dataset generated by the above blind degradation can enhance the generalization ability, expression ability and image reconstruction accuracy of the first model.

[0096] Further: in the step S103, the first model includes: an ESRGAN model, a SwinIR model, and a HAT model; the ESRGAN model, the SwinIR model, and the HAT model are trained respectively using the LR1-HR1 dataset, and the model parameters corresponding to each model are saved;

[0097] In step S105, the low-resolution image LR2 is input into the ESRGAN model, the SwinIR model, and the HAT model respectively, and the obtained results are weightedly fused according to preset weights to obtain the super-resolution image SR2;

[0098] The preset weights are: ESRGAN model weight 0.2, SwinIR model weight 0.4, and HAT model weight 0.4.

[0099] The weighted fusion refers to multiplying the predicted values ​​of the components with the same sequence number (position) output by each model by the corresponding weight and then adding them together. The following "weighted fusion" is the same as

[0100] The ESRGAN model has an SRResNet network structure, including one or more residual dense block (RRDB) modules;

[0101] The SwinIR model consists of a shallow feature extraction module, a deep feature extraction module, and a reconstruction module;

[0102] The shallow feature extraction module uses one or more convolutional layers;

[0103] The deep feature extraction module includes one or more residual Swin Transformer modules (RSTB); a convolutional layer is connected to the back of all RSTB modules, and a residual connection is connected to the back of the convolutional layer;

[0104] The RSTB module includes: one or more STL layers (Swin Transformer Layer), a convolutional layer connected to the back of all STL layers, and a residual connection connected to the back of the convolutional layer;

[0105] The reconstruction module fuses the features obtained by the shallow feature extraction module and the deep feature extraction module to perform image reconstruction;

[0106] The HAT model includes one or more RSTB modules and one or more residual hybrid attention modules.

[0107] The residual hybrid attention module includes one or more hybrid attention blocks (HABs), one or more channel attention blocks are connected to the back of all the hybrid attention blocks, a convolutional layer is connected to the back of all the channel attention blocks, and a residual connection is connected to the back of the convolutional layer;

[0108] The channel attention module includes:

[0109] Convolution module: includes 1 convolution layer, 1 activation function, and 1 convolution layer;

[0110] Residual module: includes 1 global pooling layer, 1 convolution layer, 1 activation function, and 1 convolution layer;

[0111] The hybrid attention module includes: adding a channel attention module (CAB) and a sliding window-based self-attention layer (SW-MSA) on the basis of the STL layer;

[0112] The RSTB module includes: one or more STL layers (Swin Transformer Layer), a convolutional layer connected to the back of all STL layers, and a residual connection connected to the back of the convolutional layer;

[0113] A residual connection is introduced between the convolution module and the residual module, and the residual connection is connected to the subsequent stage of the residual module.

[0114] The structure of the above model can be adjusted as needed, such as adding or reducing a certain layer, increasing or reducing the number of layers, etc., as long as the adjustment is within the framework of the basic model.

[0115] The ESRGAN model is mainly good at solving the problems of blurred details and artifacts.

[0116] The SwinIR model has stronger local representation capabilities and can achieve higher performance using less information; it can restore high-frequency details and reduce the blurring effect, producing sharp and natural edges.

[0117] The HAT model can recover more and clearer details, and has a significant advantage in cases with a lot of repeated textures. In terms of text recovery, HAT can also restore clearer text edges than other methods.

[0118] In the above, the first model is formed by weighted fusion of one or more of the ESRGAN model, the SwinIR model, and the HAT model.

[0119] By integrating the above multiple complex blind super-resolution large models and utilizing the differences in learning capabilities and feature expressions of different super-resolution models, we can achieve the fusion of diverse semantic information and obtain more accurate reasoning results.

[0120] In the steps S101-S102, the obtained LR1-HR1 data set includes: n types of sub-training sets;

[0121] In step S103, when performing model training on the first model, the n types of sub-training sets are used for training respectively to obtain n groups of sub-model parameters;

[0122] In step S105, for the k groups of sub-model parameters, one group of sub-model parameters is selected in turn as the model parameters of the first model, and the low-resolution image LR2 is input to obtain the output result; all the output results are weightedly fused according to preset weights to obtain the super-resolution image SR2.

[0123] The n types of sub-training sets refer to training sets targeting a specific type of feature, such as a specific training set for facial processing in portraits or a specific training set for text processing. These types are not limited to the above types, depending on the application needs. The first model is trained using the above-classified training sets targeting a specific type. The trained first model can achieve good processing results in this field. After the first model is trained with the specific training set, the model parameters corresponding to that type are obtained, which are called sub-model parameters.

[0124] Therefore, in the above, the first model obtains multiple model parameters after training with multiple sub-training sets. When the first model performs inference, the output results corresponding to different sub-model parameters are weighted and fused to obtain the output of the first model.

[0125] By selecting one or more sub-model parameters as needed and weightedly fusing the results of different sub-model parameters, you can target specific features and achieve better results. For example, by weighted fusing the results of a sub-model parameter trained for portrait images with a sub-model parameter trained for text images, you can process the same image containing both portraits and text with good super-resolution results. n is the number of types to be trained (an integer ranging from 2 to 6).

[0126] Further:

[0127] In the steps S101-S102, the obtained LR1-HR1 data set includes: 1 basic training set; k types of sub-training sets;

[0128] In the step S103, the first model is trained using the basic training set to obtain basic model parameters;

[0129] The first model with basic model parameters is trained respectively using k types of sub-training sets to obtain k groups of sub-model parameters; k=2-6.

[0130] In step S105, for the k groups of sub-model parameters, one group of sub-model parameters is selected in turn as the model parameters of the first model, and the low-resolution image LR2 is input to obtain the output result; all the output results are weightedly fused according to preset weights to obtain the super-resolution image SR2.

[0131] The basic training set contains various types of features, enabling the model to achieve a certain level of output performance during super-resolution inference after training. Sub-training sets are training sets focused on a specific type of feature, such as a specific training set for facial processing in portraits or text processing. These types are not limited to these, depending on application needs. Using these categorized training sets for specific types of features to train the first model, the first model can achieve better performance in that area.

[0132] The base model obtained by training the first model with the base training set refers to the first model with the base model parameters obtained after training with the base training set. Further training this model with a sub-training set for a specific type can enable the first model to quickly learn in that domain and achieve good results, thereby shortening learning time and improving learning efficiency. This process is also called model fine-tuning, which is a training method that allows the model to be quickly trained to adapt to tasks in different domains.

[0133] One or more sub-training sets can be selected as needed to train the basic model separately. After the training is completed, multiple sets of corresponding sub-model parameters are obtained. The output results of different sub-model parameters are then weighted and fused. This can achieve better results in specific task processing and shorten the training time.

[0134] Fusion of the outputs of these different models, fusion of the outputs during inference after training on a classification training set, further training of specific classifications based on the base model for model fine-tuning, and fusion of the outputs of the models trained for each classification (with different model parameters) during inference are all optimization methods that can improve the model's inference quality and bring the inferred super-resolution image closer to the true high-resolution image. These three optimization methods can be combined or used individually as needed to increase the accuracy of the super-resolution model's output.

[0135] Furthermore: the loss function is calculated as follows:

[0136] Calculate the L1 loss function, GAN loss function, and perceptual loss function respectively;

[0137] The loss function is obtained by weighting the above calculation results according to the preset weights.

[0138] The L1 loss function (MAE), also known as the mean absolute error, refers to the average of the absolute differences between the model's predicted value f(x) and the true value y. Its formula is:

[0139] Among them, f(x i ) and y iThey represent the predicted value and the corresponding true value of the i-th sample respectively, and n is the number of samples.

[0140] Perceptual loss function: It is to compare the output image I and the original high-resolution image I HR Entering a differentiable function, the perceptual loss function formula is:

[0141] The GAN loss function formula is:

[0142] Among them, the GAN loss function consists of two parts: the discriminant network and the generator network. In V(D,G), V is the symbol representing a loss function, D represents the discriminant network, and G represents the generator network.

[0143] Example 3

[0144] As shown in FIG3 , based on Example 1 or 2, a model training method is provided, in which a second model is trained using the LR2-SR2 dataset obtained by the method described in Example 1 or 2. The second model is an image super-resolution model, and the training method includes:

[0145] S201: Inputting an LR2 image into the second model, and the second model outputting an SR2′ image;

[0146] S202: Calculating a loss function using the super-resolution image SR2 and the super-resolution image SR2′; when the loss function is less than a third preset threshold, saving the model parameters;

[0147] S203: Repeat steps S201 to S202 for each LR2-SR2 data pair of the LR2-SR2 data set, and obtain the model parameters of the second model after completion.

[0148] Furthermore: the loss function is calculated as follows:

[0149] Calculate the L1 loss function, GAN loss function, and perceptual loss function respectively;

[0150] The loss function is obtained by weighting the above calculation results according to the preset weights.

[0151] The value range of the third preset threshold is 0.01 to 0.05.

[0152] The second model is trained on the LR2-SR2 dataset obtained by using the first model to infer the low-resolution image LR2, so that the second model can quickly approach the first model and quickly learn the generalization ability of the first model. The second model can be a simple image super-resolution model.

[0153] Example 4

[0154] An image super-resolution model is obtained by training the second model using the method of Example 3; the second model is an ECBSR model.

[0155] By using the first model to infer the low-resolution image LR2 to obtain the LR2-SR2 dataset for training the second model, even when the second model structure is relatively simple, the second model can quickly approach the first model, thereby quickly learning the generalization ability of the first model. The trained second model has strong generalization ability, and therefore can use a smaller model structure to handle the low-resolution image problems caused by various reasons in real situations, repair and super-resolve the above-mentioned images, and obtain better super-resolution effects.

[0156] In an embodiment of the present invention, the method for generating an image super-resolution dataset, the model training method, and the model of the present invention can be used for training and learning of an end-side model. It can be understood that the method and model are not limited to the above-mentioned applications, and can be used in all application scenarios that require improving the generalization ability of the model and improving the efficiency of model training.

[0157] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions or improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for generating an image super-resolution dataset, characterized in that: Includes steps: S101: Build a high-resolution image set; S102: performing blind image degradation processing on the high-resolution image HR1 of the high-resolution image set to obtain a corresponding low-resolution image LR1, and obtaining an LR1-HR1 data pair; performing the above operation on all the high-resolution images HR1 of the high-resolution image set to obtain an LR1-HR1 data set; S103: training a first model using the LR1-HR1 data set, and obtaining and saving model parameters of the first model after the training is completed; the first model is an image super-resolution model; S104: construct a low-resolution image set; S105: Input the low-resolution image LR2 in the low-resolution image set into the first model with the model parameters to obtain a super-resolution image SR2, thereby obtaining an LR2-SR2 data pair; perform the above operation on all low-resolution images LR2 in the low-resolution image set to obtain an LR2-SR2 data set.

2. The method according to claim 1, characterized in that: The step S103 includes: S1031: inputting the low-resolution image LR1 into the first model, and the first model outputs a super-resolution image SR1; S1032: Calculate the loss function using the high-resolution image HR1 and the super-resolution image SR1; S1033: When the loss function is less than a first preset threshold, save the model parameters; S1034: Repeat steps S1031 to S1033 for each LR1-HR1 data pair of the LR1-HR1 data set, and upon completion, obtain the model parameters of the first model.

3. The method according to claim 1, characterized in that: The image blind degradation processing is to select and perform any one or more of the following operations on the high-resolution image HR1 according to a random selection method: Blur operation: According to the random selection method, one or two of Gaussian blur and Sinc filter blur are selected for operation; Scaling operation: According to the random selection method, one or more of bilinear interpolation, bicubic interpolation, and regional interpolation are selected for operation; Superposition noise operation: According to the random selection method, one or two of Gaussian noise and Poisson noise are selected for operation; Image compression operation: compressing the image, wherein the compression factor is 30%-95%; The image blind degradation process is performed once, or the image blind degradation process is iteratively performed twice.

4. The method according to claim 3, characterized in that: The random selection method is to randomly give a random score between 0 and 1 to all options. When the random score of the option is less than a second preset threshold, the operation is not performed; all random scores greater than or equal to the second preset threshold are normalized as the weight of the corresponding option, and the operation corresponding to the option with the random score greater than or equal to the second preset threshold is performed, and the execution results of all options are weighted according to the weight to obtain the output result.

5. The method according to claim 1, characterized in that: In the step S103, the first model includes: an ESRGAN model, a SwinIR model, and a HAT model; the ESRGAN model, the SwinIR model, and the HAT model are trained respectively using the LR1-HR1 data set, and the model parameters corresponding to each model are saved; In the step S105, the low-resolution image LR2 is input into the ESRGAN model, the SwinIR model, and the HAT model respectively, and the obtained results are weighted fused according to preset weights to obtain the super-resolution image SR2; The preset weights are: ESRGAN model weight is 0.2, SwinIR model weight is 0.4, and HAT model weight is 0.

4.

6. The method according to claim 1, characterized in that: In the steps S101-S102, the obtained LR1-HR1 data set includes: n types of sub-training sets; In the step S103, when the first model is trained, the n types of sub-training sets are used to perform training respectively to obtain n groups of sub-model parameters; In the step S105, for the k groups of sub-model parameters, one group of sub-model parameters is selected in turn as the model parameters of the first model, and the low-resolution image LR2 is input to obtain the output result; all the output results are weightedly fused according to preset weights to obtain the super-resolution image SR2.

7. The method according to claim 1, characterized in that: In the steps S101-S102, the LR1-HR1 data set obtained includes: 1 basic training set; k types of sub-training sets; In the step S103, the first model is trained using the basic training set to obtain basic model parameters; the first model with the basic model parameters is trained using k types of sub-training sets respectively to obtain k groups of sub-model parameters; In the step S105, for the k groups of sub-model parameters, one group of sub-model parameters is selected in turn as the model parameters of the first model, and the low-resolution image LR2 is input to obtain the output result; all the output results are weighted according to the preset weights Weighted fusion is performed to obtain the super-resolution image SR2.

8. A method for training an image super-resolution model, characterized in that: Using the LR2-SR2 data set obtained by the method according to any one of claims 1 to 7, the second model is trained, where the second model is an image super-resolution model, and the training method includes: S201: Inputting the LR2 image into the second model, and the second model outputting the SR2′ image; S202: Calculate a loss function using the super-resolution image SR2 and the super-resolution image SR2′; when the loss function is less than a third preset threshold, save the model parameters; S203: Repeat steps S201 to S202 for each LR2-SR2 data pair of the LR2-SR2 data set, and obtain the model parameters of the second model after completion.

9. The method according to claim 2 or 8, characterized in that: The loss function is calculated as follows: Calculate the L1 loss function, GAN loss function, and perceptual loss function respectively; The results of the above calculations are weighted according to the preset weights to obtain the loss function.

10. An image super-resolution model, characterized in that: The second model is obtained by training the second model using the method according to claim 8; the second model is an ECBSR model.

Citation Information

Patent Citations

  • Super-resolution image reconstruction method and system based on degradation model

    CN113538245A

  • Image blind degradation method for infrared image super-resolution enhancement

    CN114862690A

  • Blind image super-resolution reconstruction method and system based on fusion degradation prior

    CN114972036A

  • Image super-resolution model training method and device and computer readable storage medium

    CN115760563A

  • Image super-resolution reconstruction method based on high-order degradation cycle generative adversarial network

    CN115936985A

Cited By

  • Visual language infrared pedestrian re-identification network model method based on binary mixing

    CN120032395A