General noise reduction model training method, noise reduction method, device, equipment and medium
Through the two-stage training method, the conversion of multi-branch affine transformation structure and single affine transformation structure is used to solve the problem of image noise reduction model's difference in noise parameters of different image sensors, achieve efficient general noise reduction model training, and improve Generalization ability and robustness of the model.
Patent Information
- Application Number
- CN202410843943.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-17
AI Technical Summary
In the existing technology, in the training of image denoising models, in view of the differences in noise parameters of different image sensors, a lot of manpower and cycles are required to collect and calibrate the noise models, resulting in extended delivery cycles and high memory overhead. Insufficient ability and robustness.
A two-stage training method is adopted. First, a non-blind denoising model is trained based on a multi-branch affine transformation structure to adapt to multiple image sensors. Then it is replaced with a single affine transformation structure to form a blind denoising model and reduce the blindness of direct training. It reduces the difficulty of general-purpose denoising models and improves the generalization ability and robustness of the model.
Through adaptive conversion, the parameter search space is reduced, the performance and noise reduction effect of the image noise reduction model are improved, the model can adapt to different image sensors without specifying noise parameters, and the generalization ability and robustness are improved.
Smart Images

Figure CN118657682A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a universal denoising model training method, an image denoising method, a universal denoising model training device, an electronic device and a computer-readable storage medium. Background Art
[0002] Image noise in the RAW (original, referring to the image just output from the sensor) domain has obvious Gaussian Poisson characteristics, so most of the current noise reduction models focus on noise reduction in the RAW domain, that is, using the RAWNR (RAW Noise Remove) model for noise reduction.
[0003] However, the noise parameter distributions of different image sensors vary greatly. For each sensor, the traditional RAWNR solution requires a lot of manpower and cycles to collect and calibrate the noise model, which greatly prolongs the delivery cycle. In addition, the deployment of multiple models requires huge memory overhead.
[0004] The training scheme for the general denoising model is to directly use data from different sensors to brute force the denoising model. On the one hand, the RAWNR model is relatively small and has insufficient generalization ability. On the other hand, the noise parameters of different sensors vary greatly. Under the premise of unknown noise parameters, it is difficult for the general denoising model to converge and the performance is poor. Summary of the invention
[0005] In view of this, the purpose of the present application is to provide a universal denoising model training method, denoising method, device, equipment and medium, which can reduce the training difficulty of the universal denoising model, improve the generalization ability and robustness of the universal denoising model, and improve the performance and denoising effect of the denoising model.
[0006] The specific plan is as follows:
[0007] In a first aspect, the present application discloses a general denoising model training method, comprising:
[0008] The non-blind denoising model is trained based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model;
[0009] The multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure estimated in the feature domain using the noise image to form a blind denoising model;
[0010] The blind class denoising model is trained to obtain a target universal denoising model.
[0011] Optionally, the non-blind denoising model is trained based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model, including:
[0012] In each iteration of the model, a first noisy image sample in a training data set corresponding to an i-th image sensor is input into the latest non-blind denoising model, wherein the non-blind denoising model includes a multi-branch affine transformation structure and a convolution module that are sequentially arranged, and the training data set corresponding to the i-th image sensor is any one of a plurality of training data sets formed respectively according to noise parameters of a plurality of image sensors;
[0013] In the forward reasoning stage of model training, the affine transformation branch corresponding to the i-th image sensor in the multi-branch affine transformation structure is selected to be connected to the convolution module until the first denoised image data corresponding to the first noisy image sample output by the non-blind denoising model is obtained;
[0014] The non-blind denoising model is optimized by using the first denoised image sample corresponding to the first denoised image sample and the first denoised image data in the training data set corresponding to the i-th image sensor to obtain the latest non-blind denoising model;
[0015] Continue to iterate the latest non-blind denoising model until the iteration is completed to obtain the target non-blind denoising model.
[0016] Optionally, replacing the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in a feature domain using a noise image comprises:
[0017] Replace the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure;
[0018] A parameter prediction module is configured to output the estimated affine transformation parameters to the single affine transformation structure, and an image feature extraction module is configured to receive a noise image and is connected to the parameter prediction module.
[0019] Optionally, the training of the blind denoising model includes:
[0020] Fixing other structures in the blind denoising model except the single affine transformation structure, the parameter prediction module and the image feature extraction module;
[0021] The single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are trained.
[0022] Optionally, the training of the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model includes:
[0023] In each iteration of the model, a second noisy image sample in a training data set corresponding to an m-th image sensor is input into the latest blind class denoising model, wherein the training data set corresponding to the m-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors;
[0024] Extracting image features of the second noisy picture sample using the image feature extraction module in the blind denoising model;
[0025] Performing parameter prediction on the image features through the parameter prediction module in the blind denoising model to obtain affine transformation parameters for the single affine transformation structure matching;
[0026] Using the single affine transformation structure in the blind denoising model to communicate with the convolution module based on the affine transformation parameters, until obtaining second denoised image data output by the blind denoising model corresponding to the second noisy picture sample;
[0027] By using the second denoised image sample corresponding to the second denoised image sample in the training data set corresponding to the mth image sensor and the second denoised image data, the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are optimized to obtain the latest blind denoising model;
[0028] Continue to iterate the latest blind denoising model until the iteration is complete.
[0029] Optionally, the image feature extraction module includes a feature extractor and an average pooling layer;
[0030] The extracting the image features of the second noisy picture sample by using the image feature extraction module in the blind denoising model includes:
[0031] Extracting initial image features from the second noisy picture sample using the feature extractor;
[0032] The initial image features are pooled using the average pooling layer to obtain the image features.
[0033] In a second aspect, the present application discloses an image noise reduction method, comprising:
[0034] Inputting the image to be denoised into a target universal denoising model to obtain a denoised image output by the target universal denoising model;
[0035] The target universal denoising model is a target universal denoising model obtained by using the universal denoising model training method of the above aspect.
[0036] In a third aspect, the present application discloses a general denoising model training device, comprising:
[0037] A non-blind model training unit, used to train the non-blind denoising model based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model;
[0038] A model transformation unit, used to replace the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in the feature domain using the noise image, to form a blind denoising model;
[0039] The blind model training unit is used to train the blind denoising model to obtain a target universal denoising model.
[0040] In a fourth aspect, the present application discloses an electronic device, including a memory and a processor, wherein:
[0041] The memory is used to store the computer program;
[0042] The processor is used to execute the computer program to implement the general denoising model training method as described above or to implement an image denoising method as described above.
[0043] In a fifth aspect, a computer-readable storage medium is used to store a computer program, wherein when the computer program is executed by a processor, it implements the general denoising model training method as described above or implements an image denoising method as described above.
[0044] The present application provides a universal denoising model training method, comprising: training the non-blind denoising model based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model; replacing the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in a feature domain using a noise image to form a blind denoising model; training the blind denoising model to obtain a target universal denoising model.
[0045] It can be seen that the beneficial effects of the present application are as follows: first, a non-blind denoising model is trained through a multi-branch affine transformation structure, and the multi-branch affine transformation structure corresponds to multiple image sensors, so that the target non-blind denoising model obtained by training can be adapted to multiple different image sensors. After the target non-blind denoising model is obtained by training, the multi-branch affine transformation structure in the non-blind denoising model is replaced with a single affine transformation structure that uses the noise image to estimate in the feature domain to form a blind denoising model, which realizes the adaptive conversion from non-blind to blind denoising models, and can reduce the difficulty of directly training blind universal denoising models. Then, the blind denoising model is trained to obtain the target universal denoising model, so that the final blind universal denoising model does not need to specify the prediction parameters that the image sensor can adapt to, which reduces the parameter search space, can improve the generalization ability and robustness of the denoising model, and improve the performance and denoising effect of the denoising model.
[0046] Correspondingly, an image denoising method, a general denoising model training device, equipment and medium provided by the present application also have the above-mentioned technical effects. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0048] Figure 1 A flow chart of a general denoising model training method provided in an embodiment of the present application;
[0049] Figure 2 A schematic diagram of a general denoising model training provided in an embodiment of the present application;
[0050] Figure 3 A schematic diagram of the structure of a general noise reduction model training device provided in an embodiment of the present application;
[0051] Figure 4 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0053] With the development of science and technology, image denoising technology is increasingly used in various electronic products, especially in mobile phone cameras and image chips. Traditional image denoising algorithms have many shortcomings. For example, filter-based image denoising methods such as Gaussian filtering and bilateral filtering will reduce image details and clarity. In addition, block-matching-based image denoising methods such as BM3D (Block-matching and 3D filtering) have high time complexity.
[0054] In contrast, the denoising method based on deep learning can significantly improve the denoising effect at a lower time complexity cost by training the neural network model with a large amount of data prior, and has therefore been widely cited.
[0055] In deep learning-based image noise reduction technology, since image noise in the RAW domain often has obvious Gaussian Poisson characteristics, it is easy to model noise, so most of the models in the industry are concentrated in the RAWNR field. However, the noise parameter distribution of different image sensors varies greatly. For each sensor, the current RAWNR solution in the industry requires a lot of manpower and cycles to collect and calibrate the noise model, which greatly prolongs the delivery cycle. In addition, the deployment of multiple models requires a huge memory overhead, which customers are unwilling to accept.
[0056] During the research and development process, the inventors of the present application discovered that the currently used RAW domain universal denoising model solution is to directly use data from different sensors to brute force train the denoising model. However, on the one hand, the RAWNR model is relatively small and has insufficient generalization ability; on the other hand, the noise parameters of different sensors vary greatly. Under the premise of unknown noise parameters, it is difficult for the universal denoising model to converge.
[0057] In addition, there is also a fast conversion solution for the general noise reduction model of LED (Lighting Every Darkness in Two Pairs) to a special noise reduction model in the related technology. It focuses on how to convert from a general noise reduction model to a special noise reduction model, and the final output is still a special noise reduction model. In addition, the trained general noise reduction model requires noise parameters and does not have the blind characteristics of the conventional general noise reduction model.
[0058] In summary, the industry is in urgent need of a complete general denoising model training solution to accelerate model delivery and reduce the resources required for model deployment.
[0059] In view of the above situation, the present application proposes a two-stage universal denoising model training scheme, and in particular provides a universal denoising model training method, denoising method, device, equipment and medium. By using multiple image sensors and multi-branch affine transformation structures corresponding to multiple image sensors to train a non-blind denoising model in a two-stage training process, the difficulty of directly training a universal denoising model can be reduced, and the search space for adaptive parameters when subsequently replaced with a blind denoising model is reduced. Subsequently, the multi-branch affine transformation structure corresponding to multiple image sensors in the trained non-blind denoising model is replaced with a single affine transformation structure, completing the adaptive conversion from the non-blind denoising model to the blind denoising model, so that the ultimately obtained universal denoising model has better robustness, thereby improving the performance of the universal denoising model as a whole.
[0060] For details, see Figure 1 As shown, the embodiment of the present application discloses a general denoising model training method, including:
[0061] S101, training the non-blind denoising model based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model.
[0062] Among them, each affine transformation branch in the multi-branch affine transformation structure (CSA, Camera-Specific Alignments) uniquely corresponds to one image sensor among multiple different image sensors, that is, the affine transformation branch corresponds to the image sensor one by one.
[0063] In this embodiment, the blind noise reduction model does not need to specify noise (parameter) information when the corresponding model is applied, and the blind noise reduction model has a blind characteristic. The non-blind noise reduction model needs to specify noise parameter information when the model is applied.
[0064] Among them, the non-blind denoising model can be a general denoising model based on the RAW domain, or a general denoising model based on other domains. The non-blind denoising module includes but is not limited to DnCNN (Denoising Convolutional Neural Network), FFDNet (Fast and Flexible Denoising Network), RIDNet (real image denoising network), PMRID (Practical Deep Raw Image Denoising on Mobile Devices), etc.
[0065] That is, in this embodiment, the target non-blind denoising model is firstly obtained by training the non-blind denoising model, and the multi-branch affine transformation structure configured in the non-blind denoising model and the correspondence between the multi-branch affine transformation structure and multiple image sensors are utilized during the training process.
[0066] It should be noted that the target non-blind denoising model obtained above may be a converged non-blind denoising model obtained through training, that is, whether the iterative process finally forms the target non-blind denoising model may be determined according to the convergence of the model.
[0067] In other examples, whether the iteration is completed can also be determined based on the number of iterative training times or parameters related to the loss function to obtain the target non-blind denoising model.
[0068] In one embodiment of the present application, in S101, the non-blind denoising model is trained based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model, including:
[0069] S111, in each iteration of the model, the first noisy image sample in the training data set corresponding to the i-th image sensor is input into the latest non-blind denoising model.
[0070] S112, in the forward reasoning stage of model training, selecting an affine transformation branch corresponding to the i-th image sensor in the multi-branch affine transformation structure to be connected to the convolution module until first denoised image data corresponding to the first noisy image sample output by the non-blind denoising model is obtained;
[0071] S113, optimizing the non-blind denoising model by using the first denoised image sample corresponding to the first denoised image sample and the first denoised image data in the training data set corresponding to the i-th image sensor to obtain the latest non-blind denoising model;
[0072] S114, continue to iterate the latest non-blind denoising model until the iteration is completed to obtain the target non-blind denoising model.
[0073] The training data set corresponding to the i-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors.
[0074] Before training the non-blind noise reduction model, the noise parameters of multiple image sensors can be calibrated, and the clean images of the public data set, i.e., images with high clarity, less noise or no noise, and the noise parameters of the multiple image sensors calibrated above are used to synthesize a training data set of n image sensors. The training data set includes multiple sets of training data pairs formed by noisy image samples and denoised image samples, i.e., clean-noisy training data pairs, where clean is a denoised image sample and noisy is a noisy image sample.
[0075] The training process of the general denoising model involves multiple iterative optimization processes. In each iterative optimization process, noisy data can be randomly taken from the training data sets corresponding to multiple image sensors as the first noisy image sample, and the first noisy image sample comes from the training data set corresponding to the i-th image sensor.
[0076] After the first noisy image sample is input into the non-blind denoising model, the non-blind denoising model is run. In the forward reasoning stage of the model operation, the affine transformation branch corresponding to the i-th image sensor in the multi-branch affine transformation structure is selected to be connected to the subsequent convolution module.
[0077] That is, assuming that the calibrated noise parameters input into the first noisy image sample come from the i-th sensor among multiple image sensors, the first noisy image sample or the intermediate process data related to the first noisy image sample will pass through the CSA branch corresponding to the i-th sensor during the model running process.
[0078] The non-blind denoising model includes a multi-branch affine transformation structure and a convolution module arranged in sequence. It should be noted that after determining the basic architecture of the non-blind denoising model, the non-blind denoising model can be re-parameterized. In particular, for each convolution module, n affine transformation branches can be constructed for its input features to form a multi-branch affine transformation structure.
[0079] Each affine transformation branch may include affine transformation parameters. For example, the affine transformation parameters may include two groups, namely affine transformation parameters γ and β, which can perform affine transformation on the input features. By adapting different affine transformation branches to different image sensors, each affine transformation branch has corresponding affine transformation parameters, thereby being able to match the requirements of different image sensors.
[0080] For example, see Figure 2 The upper part of the figure shows a partial structural diagram of a non-blind denoising model, which includes a multi-branch affine transformation structure arranged in sequence, namely CSA1 to CSA in the figure. n, and the convolution module, i.e., CONV after the multi-branch affine transformation structure in the diagram, for example, the convolution module can be a 3×3 structure.
[0081] Among them, CSA1 to CSAn access input feature F k , in the input feature F k The following relationship exists when performing affine transformation:
[0082] CSA(F k )=γ*F k +β
[0083] γ and β are the affine transformation parameters contained in the affine transformation branch that performs affine transformation on the input features. k is the input feature, CSA(F k ) is the result of affine transformation on the input features.
[0084] Since the affine transformation branch corresponding to the i-th image sensor is connected to the subsequent convolution module, after the affine transformation is completed, the subsequent convolution module can perform convolution processing according to the affine transformation result of the affine transformation branch corresponding to the i-th image sensor.
[0085] It should be noted that the forward reasoning stage is the intermediate process of the non-blind denoising model. After the convolution processing is completed, subsequent processing can be continued according to the model structure until the first denoised image data corresponding to the first noisy image sample is output.
[0086] After obtaining the first denoised image data corresponding to the first noisy image sample output by the non-blind denoising model, the non-blind denoising model can be optimized using the first denoised image sample corresponding to the first noisy image sample in the training data set corresponding to the i-th image sensor and the first denoised image data, thereby obtaining the latest non-blind denoising model.
[0087] The above process is repeated continuously, that is, the latest non-blind denoising model is continuously iterated until the iteration is completed and the target non-blind denoising model can be obtained.
[0088] In some embodiments, the process of optimizing the non-blind denoising model using the first denoised image sample corresponding to the first denoised image sample and the first denoised image data in the training data set corresponding to the i-th image sensor can be achieved through reconstruction loss.
[0089] For example, a loss function may be constructed based on the first denoised image sample and the first denoised image data; and the parameters of the non-blind denoising model may be trained and updated using the obtained loss function.
[0090] The loss function may be at least one of L1, L2, PSNR (Peak Signal-to-Noise Ratio), SSIM (Structural Similarity) and LPIPS (Learned Perceptual Image Patch Similarity).
[0091] You can also choose the cosine annealing learning rate adjustment algorithm as the learning rate adjustment function during training. It has been found in practice that the above non-blind denoising model can complete convergence within 200 epochs (the number of times the entire training data set in the neural network passes through the algorithm).
[0092] In this example, a non-blind denoising model is trained by using multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors, which can reduce the search space for adaptive parameters of the subsequent conversion to a blind denoising model.
[0093] S102, replacing the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in the feature domain using the noise image, to form a blind denoising model.
[0094] S103: training the blind denoising model to obtain a target universal denoising model.
[0095] In order to simplify the training of the blind denoising model, after the non-blind denoising model completes the iteration to obtain the target non-blind denoising model, for example, after the converged blind denoising model is used as the target non-blind denoising model, the multi-branch affine transformation structure in the target non-blind denoising model can be directly replaced with a single affine transformation structure estimated in the feature domain using the noise image, thereby obtaining the blind denoising model.
[0096] After completing the affine transformation structure replacement process in the model, the blind denoising model obtained after the replacement can be trained to obtain the target universal denoising model.
[0097] It can be seen that the present embodiment first trains the non-blind denoising model through a multi-branch affine transformation structure, and the multi-branch affine transformation structure corresponds to multiple image sensors, so that the trained target non-blind denoising model can be adapted to multiple different image sensors. Then, the multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure that uses the noise image to estimate in the feature domain to form a blind denoising model, thereby realizing the adaptive conversion from the non-blind to the blind denoising model, and reducing the difficulty of directly training the blind universal denoising model. Then, the blind denoising model is trained again to obtain the target universal denoising model, so that the final blind universal denoising model does not need to specify the prediction parameters that the image sensor can adapt to, reducing the parameter search space, and improving the generalization ability and robustness of the denoising model.
[0098] In one embodiment of the present application, in the above S102, the multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure that uses the noise image for estimation in the feature domain, including:
[0099] The multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure; a parameter prediction module that outputs the estimated affine transformation parameters to the single affine transformation structure and an image feature extraction module that is connected to the parameter prediction module and is used to receive a noise image are configured.
[0100] The reconstruction process of the blind denoising model is given above. In general, the non-blind general denoising model is trained by the multi-branch affine transformation structure corresponding to multiple image sensors, and after the training is completed, the multi-branch affine transformation structure is replaced with a single affine transformation structure estimated in the feature domain using the noise image, completing the adaptive conversion from the non-blind denoising model to the blind general denoising model, which can reduce the difficulty of directly training the blind denoising model, such as the blind RAWNR model, and can provide a basis for the subsequent training of the blind denoising model.
[0101] Please see Figure 2 , Figure 2 The lower part of the figure shows the basic architecture of the blind denoising model after adaptive transformation, where the original Figure 2 The multi-branch affine transformation structures CSA1 to CSAn shown in the upper part are replaced by a single CSA module, that is, a single affine transformation structure, and an additional image feature extraction module 10 and a parameter prediction module 20 are added.
[0102] The parameter prediction module can be a two-layer convolution structure or a convolution structure of other layers. The parameter prediction module can estimate and adapt the affine transformation parameters γ, β required for a single affine transformation structure in the search space. The image feature extraction module can receive a noisy image, for example, noisy data in the aforementioned multiple training data sets.
[0103] In one embodiment of the present application, the process of training the blind denoising model in S103 to obtain the target universal denoising model may include:
[0104] S131, fixing other structures in the blind denoising model except the single affine transformation structure, the parameter prediction module and the image feature extraction module;
[0105] S132, training the single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model to obtain a target universal denoising model.
[0106] For the blind denoising model after adaptive conversion, the existing model parameters in the non-blind denoising model trained before conversion can be loaded, and the gradients of the structure modified and configured in S102 are frozen, that is, the gradients except the single affine transformation structure, the parameter prediction module and the image feature extraction module are frozen. Then, the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are trained to obtain the target general denoising model.
[0107] In one embodiment of the present application, in the above S132, the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are trained to obtain a target universal denoising model, including:
[0108] S133, in each iteration process of the model, input the second noisy image sample in the training data set corresponding to the mth image sensor into the latest blind class denoising model.
[0109] The training data set corresponding to the m-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors.
[0110] S134, extracting image features of the second noisy picture sample by using an image feature extraction module in the blind denoising model.
[0111] S135, performing parameter prediction on the image features through a parameter prediction module in the blind denoising model to obtain affine transformation parameters for single affine transformation structure matching.
[0112] S136, using the single affine transformation structure in the blind denoising model to connect with the convolution module based on the affine transformation parameters, until the second denoised image data corresponding to the second noisy picture sample output by the blind denoising model is obtained.
[0113] S137, optimizing the single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model through the second denoised image sample corresponding to the second noisy image sample and the second denoised image data in the training data set corresponding to the mth image sensor to obtain the latest blind denoising model.
[0114] S138, continue to iterate the latest blind denoising model until the iteration is completed to obtain the target universal denoising model.
[0115] In the process of training the single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model, in each iteration of the model, any second noisy image sample in any training data set can be randomly selected and input into the current latest blind denoising model, thereby running the blind denoising model.
[0116] During the forward reasoning stage of the blind denoising model, the second noisy image sample will pass through the denoising branch that already exists in the original non-blind denoising model. At the same time, the image feature extraction module will extract the image features of the second noisy image sample, and then perform parameter prediction on the image features based on the parameter prediction module to obtain the matching affine transformation parameters required for the single affine transformation structure.
[0117] The single affine transformation structure is connected to the convolution module based on the affine transformation parameters. After the convolution processing is completed, subsequent processing can be continued according to the model structure until the second denoised image data corresponding to the second noisy picture sample is output.
[0118] In one embodiment of the present application, the image feature extraction module may include a feature extractor and an average pooling layer. Based on this, the image feature extraction module in the blind class denoising model is used to extract the image features of the second noisy image sample in S134, including:
[0119] The feature extractor is used to extract the initial image features in the second noisy image sample; and the average pooling layer is used to pool the initial image features to obtain image features.
[0120] After obtaining the second denoised image data, the single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model can be optimized through the second denoised image samples corresponding to the second noisy image samples in the training data set corresponding to the mth image sensor and the second denoised image data. After the optimization is completed, the blind denoising model is updated, thereby obtaining the latest optimized blind denoising model.
[0121] After obtaining the latest optimized blind denoising model, you can return to continue to use the noisy data to optimize the modified structure until the blind denoising model completes the optimization training.
[0122] For example, when the optimized number of training times is reached, the latest blind denoising model at this time is the target universal denoising model obtained. For another example, when the blind denoising model converges, the latest blind denoising model at the time of convergence is the target universal denoising model obtained.
[0123] In some embodiments, the above-mentioned single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model are optimized, and the process of updating the blind denoising model after the optimization is completed can be achieved through reconstruction loss.
[0124] For example, a loss function can be constructed based on the second denoised image sample and the second denoised image data; the obtained loss function is used to train and update the gradients and parameters of the single affine transformation structure, parameter prediction module and image feature extraction module in the blind denoising model.
[0125] The loss function may be at least one of L1, L2, PSNR, SSIM and LPIPS, and the gradient and / or parameters involved in the modified structure may be updated at a normal learning rate during the optimization process. A cosine annealing learning rate adjustment algorithm may also be selected as a learning rate adjustment function during the training process. It has been found in practice that the blind denoising model can converge within 10 epochs, which reduces the overall training difficulty of the blind denoising model, thereby obtaining a blind target universal denoising model that can eventually adapt to different image sensors.
[0126] This scheme can realize the selectability of multi-branch affine transformation structure according to different image sensors, and then adaptively convert the trained multi-branch affine transformation structure into a single affine transformation structure based on noise feature extraction, which can realize the sparseness of network parameter structure, reduce the search space of network parameter learning, and expand the adjusted affine transformation parameter space, thereby transforming the feature domain, thereby improving the generalization ability of the target general denoising model finally trained.
[0127] In summary, the embodiment of the present application proposes a two-stage universal denoising model training scheme. In the first stage, a non-blind universal denoising model is trained by selecting a multi-branch affine transformation structure according to different image sensors, which reduces the difficulty of directly training a blind denoising model and reduces the search space for the adaptive parameters in the second stage.
[0128] In the second stage, a single affine transformation structure is estimated in the feature domain using the noisy or noisy image data to replace the multi-branch affine transformation structure of the first stage, thereby completing the adaptive conversion from the non-blind general denoising model to the blind denoising model, thereby obtaining the final target general denoising model, for example, the target general denoising model is the Blind RAWNR general model.
[0129] Overall, the conversion from a multi-branch affine transformation structure to a single affine transformation structure in two stages and the adaptive conversion from a non-blind general denoising model to a blind denoising model can reduce the difficulty of directly training a blind denoising model, and improve the robustness of the final target general denoising model by reducing the parameter search space.
[0130] After obtaining the target universal denoising model, the image to be denoised can be input into the target universal denoising model to obtain a denoised image output by the target universal denoising model.
[0131] That is, this solution can also provide an image noise reduction method, including:
[0132] The image to be denoised is input into a target universal denoising model to obtain a denoised image output by the target universal denoising model; wherein the target universal denoising model is the target universal denoising model obtained in the above embodiment.
[0133] It should be noted that the target general denoising model obtained through the above training optimization process has good generalization ability and robustness, which can improve the denoising effect of the model. Correspondingly, it can also make the denoised image have a better denoising effect.
[0134] For further information, see Figure 3 As shown, the embodiment of the present application discloses a general denoising model training device, comprising:
[0135] A non-blind model training unit 101 is used to train the non-blind denoising model based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model;
[0136] A model transformation unit 102, used to replace the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in the feature domain using the noise image, to form a blind denoising model;
[0137] The blind model training unit 103 is used to train the blind denoising model to obtain a target universal denoising model.
[0138] It can be seen that the beneficial effects of the present application are as follows: first, a non-blind denoising model is trained through a multi-branch affine transformation structure, and the multi-branch affine transformation structure corresponds to multiple image sensors, thereby enabling the non-blind denoising model to adapt to multiple different image sensors. After obtaining the target non-blind denoising model, the multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure that uses the noise image to estimate in the feature domain to form a blind denoising model, thereby realizing the adaptive conversion from the non-blind to the blind denoising model, and reducing the difficulty of directly training the blind universal denoising model. Then, the blind denoising model is trained to obtain the target universal denoising model, so that the final blind universal denoising model does not need to specify the prediction parameters that the image sensor can adapt to, reducing the parameter search space, and can improve the generalization ability and robustness of the denoising model, and improve the performance and denoising effect of the denoising model.
[0139] In one embodiment, the non-blind model training unit 101 includes:
[0140] A first input unit is used to input a first noisy image sample in a training data set corresponding to an i-th image sensor into an up-to-date non-blind denoising model during each iteration of the model, wherein the non-blind denoising model includes the multi-branch affine transformation structure and the convolution module arranged in sequence, and the training data set corresponding to the i-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors;
[0141] A selection unit, configured to select, during a forward reasoning phase of model training, an affine transformation branch corresponding to an i-th image sensor in the multi-branch affine transformation structure to be connected to the convolution module until first denoised image data corresponding to the first noisy image sample output by a non-blind denoising model is obtained;
[0142] A first optimization unit is used to optimize the non-blind denoising model by using the first denoised image sample corresponding to the first denoised image sample and the first denoised image data in the training data set corresponding to the i-th image sensor to obtain the latest non-blind denoising model;
[0143] The first iteration unit is used to continue iterating the latest non-blind denoising model until the iteration is completed to obtain a target non-blind denoising model.
[0144] In one implementation, the model transformation unit 102 includes:
[0145] A replacement unit replaces a multi-branch affine transformation structure in a target non-blind denoising model with a single affine transformation structure;
[0146] A configuration unit is used to configure a parameter prediction module that outputs the estimated affine transformation parameters to the single affine transformation structure and an image feature extraction module that is connected to the parameter prediction module and is used to receive a noise image.
[0147] In one embodiment, the blind model training unit 103 is specifically used to fix other structures in the blind denoising model except the single affine transformation structure, the parameter prediction module and the image feature extraction module; and train the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model.
[0148] In one implementation, the blind model training unit 103 includes:
[0149] a second input unit, configured to input, during each iteration of the model, a second noisy image sample in a training data set corresponding to the m-th image sensor into the latest blind class denoising model, wherein the training data set corresponding to the m-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors;
[0150] A feature extraction unit, configured to extract image features of the second noisy picture sample by using the image feature extraction module in the blind denoising model;
[0151] A parameter prediction unit, configured to perform parameter prediction on the image features through the parameter prediction module in the blind denoising model to obtain affine transformation parameters for matching the single affine transformation structure;
[0152] a connecting unit, configured to connect with the convolution module based on the affine transformation parameters by using the single affine transformation structure in the blind denoising model, until second denoised image data corresponding to the second noisy picture sample output by the blind denoising model is obtained;
[0153] A second optimization unit is used to optimize the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model by using the second denoised image sample corresponding to the second denoised image sample and the second denoised image data in the training data set corresponding to the mth image sensor to obtain the latest blind denoising model;
[0154] The second iteration unit is used to continue iterating the latest blind denoising model until the iteration is completed.
[0155] In one embodiment, the image feature extraction module includes a feature extractor and an average pooling layer;
[0156] The feature extraction unit is specifically used to extract the initial image features in the second noisy picture sample using a feature extractor; and to pool the initial image features using an average pooling layer to obtain image features.
[0157] In one embodiment, the device further comprises:
[0158] The running unit is used to input the image to be denoised into the target universal denoising model to obtain the denoised image output by the target universal denoising model.
[0159] Furthermore, the embodiment of the present application discloses an image noise reduction device, comprising:
[0160] The denoising module is used to input the image to be denoised into a target universal denoising model to obtain a denoised image output by the target universal denoising model; wherein the target universal denoising model is the target universal denoising model obtained by the above method embodiment.
[0161] See also Figure 4 As shown, an embodiment of the present application discloses an electronic device 20, including a processor 21 and a memory 22; wherein the memory 22 is used to store computer programs; the processor 21 is used to execute computer programs, the general denoising model training method disclosed in the aforementioned embodiment or the image denoising method disclosed in the aforementioned embodiment.
[0162] For the specific process of the above-mentioned general denoising model training method or image denoising method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0163] Furthermore, the memory 22, as a carrier for storing resources, may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the storage method may be temporary storage or permanent storage.
[0164] In addition, the electronic device 20 also includes a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26; wherein the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input / output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0165] Furthermore, an embodiment of the present application also discloses a computer-readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, it implements the general denoising model training method disclosed in the aforementioned embodiment or the image denoising method disclosed in the aforementioned embodiment.
[0166] For the specific process of the above-mentioned general denoising model training method and image denoising method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, which will not be described in detail here.
[0167] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0168] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0169] The above is a detailed introduction to a general denoising model training method, denoising method, device, equipment and medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A general denoising model training method, characterized in that: include: The non-blind denoising model is trained based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model; The multi-branch affine transformation structure in the target non-blind denoising model is replaced with a single affine transformation structure estimated in the feature domain using the noise image to form a blind denoising model; The blind class denoising model is trained to obtain a target universal denoising model.
2. The general denoising model training method according to claim 1, characterized in that: The non-blind denoising model is trained based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model, including: In each iteration of the model, a first noisy image sample in a training data set corresponding to an i-th image sensor is input into the latest non-blind denoising model, wherein the non-blind denoising model includes the multi-branch affine transformation structure and the convolution module arranged in sequence, and the training data set corresponding to the i-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors; In the forward reasoning stage of model training, the affine transformation branch corresponding to the i-th image sensor in the multi-branch affine transformation structure is selected to be connected to the convolution module until the first denoised image data corresponding to the first noisy image sample output by the non-blind denoising model is obtained; The non-blind denoising model is optimized by using the first denoised image sample corresponding to the first denoised image sample and the first denoised image data in the training data set corresponding to the i-th image sensor to obtain the latest non-blind denoising model; Continue to iterate the latest non-blind denoising model until the iteration is completed to obtain the target non-blind denoising model.
3. The general denoising model training method according to claim 1, characterized in that: The method of replacing the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in a feature domain using a noise image comprises: Replace the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure; A parameter prediction module is configured to output the estimated affine transformation parameters to the single affine transformation structure, and an image feature extraction module is configured to receive a noise image and is connected to the parameter prediction module.
4. The general denoising model training method according to claim 3, characterized in that: The training of the blind denoising model comprises: Fixing other structures in the blind denoising model except the single affine transformation structure, the parameter prediction module and the image feature extraction module; The single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are trained.
5. The general denoising model training method according to claim 4, characterized in that: The training of the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model includes: In each iteration of the model, a second noisy image sample in a training data set corresponding to an m-th image sensor is input into the latest blind class denoising model, wherein the training data set corresponding to the m-th image sensor is any one of a plurality of training data sets respectively formed according to noise parameters of a plurality of image sensors; Extracting image features of the second noisy picture sample using the image feature extraction module in the blind denoising model; Performing parameter prediction on the image features through the parameter prediction module in the blind denoising model to obtain affine transformation parameters for the single affine transformation structure matching; Using the single affine transformation structure in the blind denoising model to communicate with the convolution module based on the affine transformation parameters, until obtaining second denoised image data output by the blind denoising model corresponding to the second noisy picture sample; By using the second denoised image sample corresponding to the second denoised image sample in the training data set corresponding to the mth image sensor and the second denoised image data, the single affine transformation structure, the parameter prediction module and the image feature extraction module in the blind denoising model are optimized to obtain the latest blind denoising model; Continue to iterate the latest blind denoising model until the iteration is complete.
6. A general denoising model training method according to claim 5, characterized in that: The image feature extraction module includes a feature extractor and an average pooling layer; The extracting the image features of the second noisy picture sample by using the image feature extraction module in the blind denoising model includes: Extracting initial image features from the second noisy picture sample using the feature extractor; The initial image features are pooled using the average pooling layer to obtain the image features.
7. An image denoising method, characterized in that: include: Inputting the image to be denoised into a target universal denoising model to obtain a denoised image output by the target universal denoising model; The target universal noise reduction model is a target universal noise reduction model obtained by using any one of claims 1 to 6.
8. A general denoising model training device, characterized in that: include: A non-blind model training unit, used to train the non-blind denoising model based on multiple image sensors and a multi-branch affine transformation structure corresponding to the multiple image sensors in the non-blind denoising model to obtain a target non-blind denoising model; A model transformation unit, used to replace the multi-branch affine transformation structure in the target non-blind denoising model with a single affine transformation structure estimated in the feature domain using the noise image, to form a blind denoising model; The blind model training unit is used to train the blind denoising model to obtain a target universal denoising model.
9. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store the computer program; The processor is used to execute the computer program to implement the general denoising model training method as described in any one of claims 1 to 6 or to implement the image denoising method as described in claim 7.
10. A computer-readable storage medium, characterized in that: Used to store a computer program, wherein when the computer program is executed by a processor, it implements the general denoising model training method as described in any one of claims 1 to 6 or implements an image denoising method as described in claim 7.
