Image restoration method, model training method, chip, medium, program product and GPU server
Through the image repair model training method, combined with the diffusion model and deep learning network, the problems of image blur and color distortion in underwater imaging technology are solved, the acquisition of high-quality images in the deep sea environment is achieved, and the visual effect and information content of the image are improved. .
Patent Information
- Application Number
- CN202410868179.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-01
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-07-01
AI Technical Summary
Underwater imaging technology faces problems such as image blur, loss of detail, and color distortion caused by optical characteristics. It is especially difficult to obtain high-quality images in deep-sea environments with insufficient illumination and complex ocean environments.
The image repair model training method is adopted, and the diffusion model and deep learning network are combined through forward noise addition and reverse denoising training to optimize the model parameters to adapt to the imaging conditions of the specific environment, and use the color correction module to accurately correct the image.
Significantly improves the image denoising effect, ensures the accuracy and integrity of the output image color, improves the usability and information content of underwater images, and enhances the visual quality of the image.
Smart Images

Figure CN118864321A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of GPU branch image processors in artificial intelligence hardware platforms, and in particular to an image restoration method, a model training method, a chip, a medium, a program product, and a GPU server. Background Art
[0002] Underwater environmental information collection, especially in optical imaging, presents a series of unique and complex challenges. These challenges are mainly due to the physical properties of the underwater world that are very different from the terrestrial imaging environment. At the same time, particles and plankton in the water will scatter the light passing through, causing the direction of the light captured during the imaging process to change, which will lead to blurred images, loss of details, reduced contrast, and dispersion phenomena will further aggravate the color distortion of the imaging. In deep water environments such as deep sea or deep lakes, the above problems are more serious. Since sunlight has difficulty penetrating into deep water areas, these areas are almost completely dark. In such an environment, the main source of visible light comes from certain specific bioluminescent phenomena, such as the bioluminescence of fluorescent jellyfish and some deep-sea fish. However, the light provided by these bioluminescence is very limited and far from enough to illuminate the surrounding environment, resulting in extremely low visibility in deep-sea imaging. This extremely low light condition, coupled with the influence of the physical properties of the water body on light, greatly limits the application of underwater imaging technology, making it extremely difficult to obtain high-quality underwater images.
[0003] Underwater image enhancement technology is a key technical means to improve the visual quality of images. These technologies are dedicated to processing images that are degraded due to the unique optical properties of underwater (such as light absorption, scattering and dispersion) to improve the usability and information content of the images. Among the traditional underwater image enhancement methods, methods based on underwater physical models occupy an important position. Although the methods based on physical models have a solid foundation in principle, they face significant challenges in practical applications. Such methods rely on accurate estimation of parameters such as the depth of the underwater environment and the light propagation coefficient, which are often difficult to obtain accurately in real environments. In addition, due to the complexity and variability of the marine environment, methods based on simplified physical models may not fully capture all the characteristics of underwater imaging, resulting in a lack of robustness in the enhancement results and sometimes even unnatural visual effects. Summary of the invention
[0004] 1. Technical issues to be solved
[0005] The present invention is expected to at least partially solve one of the above technical problems.
[0006] 2. Technical Solution
[0007] The first aspect of the present invention provides a model training method for image restoration. The model training method comprises:
[0008] Step A, forward noise addition, includes: converting the original image I raw And the repaired reference image I ref Perform synthesis to obtain a synthetic image I 0: I0=f(I raw , I ref ), f is the synthesis function; Gaussian noise is gradually introduced into the synthetic image I0 in N steps to obtain the noisy image I N , N ≥ 100;
[0009] Step B, reverse denoising training, includes: M denoising training steps, wherein the mth denoising training step includes: using a noise estimation neural network to perform noise estimation, Among them, F θ is the noise estimation neural network, X m is the noisy image of the current step; I ref is the reference image, The estimated noise of the noise estimation neural network regression output; noise removal, get the denoised image: Where, m = MM-1, ..., 1, M ≥ 100, M ≤ N, X M =I N , when the M-step denoising training step is not completed, X m-1 as the input of the next denoising training step; after the M-step denoising training step is completed, a denoised image X0 is obtained; wherein, in the denoising training step, the noise estimation neural network is trained by back propagation, and the loss function L of the noise estimation neural network includes: the difference L1 between the mean of the estimated noise obtained in the denoising training step and the true noise mean.
[0010] A second aspect of the present invention provides an image restoration method. The image restoration method comprises:
[0011] Obtaining an image to be repaired;
[0012] The image to be repaired is synthesized with the Gaussian noise image to obtain a synthesized image;
[0013] Denoising the synthetic image, including: S steps of denoising,
[0014] The s-th denoising step includes: using a noise estimation neural network to perform noise estimation, Among them, F θ To obtain the noise estimation neural network through the above model training method, X s is the noisy image of the current step; The estimated noise of the noise estimation neural network regression output; noise removal, get the denoised image: Where, s = S, S-1, ..., 1, S ≥ 100. When the denoising process is not completed, X s+1 As the input of the next denoising process, after the denoising process is completed, the denoised image X0 is obtained.
[0015] A third aspect of the present invention provides a computer chip. The computer chip is configured to implement: the above model training method for image restoration; or the above image restoration method.
[0016] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements: the above-mentioned model training method for image restoration; or, an image restoration method.
[0017] A fifth aspect of the present invention provides a computer program product. The computer program product comprises: a computer program, wherein when the computer program is executed by a processor, the computer program implements: the above-mentioned model training method for image restoration; or an image restoration method.
[0018] A sixth aspect of the present invention provides a GPU server. The GPU server includes: a processor; a memory on which a computer program is stored; wherein when the processor executes the computer program, it implements: the above-mentioned model training method for image restoration; or, an image restoration method.
[0019] 3. Beneficial Effects
[0020] It can be seen from the above technical solution that the present invention has at least one of the following beneficial effects compared with the prior art:
[0021] 1. A diffusion model is introduced. Through supervised learning strategy, the model parameters are optimized to adapt to the imaging conditions of a specific environment, and the denoising effect is greatly improved.
[0022] 2. In the reverse denoising step, the color correction module uses a deep learning network to accurately correct the color of each pixel to ensure that the final output image fully reflects the color of the original scene. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 The present invention is a flowchart of a model training method for image restoration according to an embodiment of the present invention.
[0024] Figure 2A for Figure 1 Schematic diagram of image changes during forward denoising and backward denoising training in the model training method for image restoration shown.
[0025] Figure 2B for Figure 1Schematic diagram of backward denoising training in the model training method for image restoration shown.
[0026] Figure 2C for Figure 1 Schematic diagram of noise estimation in backward denoising training in the model training method for image restoration shown.
[0027] Figure 3 for Figure 2B Schematic diagram of the color correction step in backward denoising training.
[0028] Figure 4 The figure is a quality comparison of image denoising using different methods in different situations on the UIEB underwater image enhancement dataset.
[0029] Figure 5 Schematic diagram of a computer chip according to an embodiment of the present invention.
[0030] Figure 6 Schematic diagram of a GPU server according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention proposes a model training method and an image restoration method for image restoration, which introduce a diffusion model and optimize the model parameters through a supervised learning strategy to adapt to the imaging conditions of a specific environment. On this basis, the present invention also designs a color correction module, which uses a deep learning network to accurately correct the color of each pixel to ensure that the final output image fully reflects the color of the original scene.
[0032] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific implementation methods and with reference to the accompanying drawings.
[0033] A first aspect of the present invention provides a model training method for image restoration. Figure 1 The present invention is a flowchart of a model training method for image restoration according to an embodiment of the present invention. Figure 2A for Figure 1 Schematic diagram of image changes during forward denoising and backward denoising training in the model training method for image restoration shown. Figure 2B for Figure 1 Schematic diagram of backward denoising training in the model training method for image restoration shown. Figure 2C for Figure 1 Schematic diagram of noise estimation in backward denoising training in the model training method for image restoration shown.
[0034] like Figure 1 , Figure 2A , Figure 2B , Figure 2C As shown, the model training method for image restoration in an embodiment of the present invention includes:
[0035] Step A, forward noise addition, includes:
[0036] Sub-step A0, image synthesis: The original image I raw And the restored reference image I ref The synthesis is performed to obtain the synthetic image I0: I0 = f((I raw , I ref ), f is the synthesis function;
[0037] Sub-steps A1 to A N , Image noise, Gaussian noise is gradually introduced into the synthetic image in N steps to obtain a noisy image (Noisy Image) iN, N ≥ 100;
[0038] Step B, reverse denoising training, includes:
[0039] Sub-steps B1 to B M , M-step denoising training steps (Sampling Denoise Process), wherein the m-th denoising training step includes:
[0040] Noise estimation, using the Noise Estimate Network to estimate noise, Among them, F θ is the noise estimation neural network, X m is the noisy image of the current step; I ref is the reference image, Estimated noise for the regression output of the noise estimation neural network;
[0041] Noise removal, get denoised images (Denoise Images):
[0042] Where, m = M, M-1, ..., 1, M ≥ 100, M ≤ N, X M =I N , when the reverse denoising training is not completed, X m-1 As the input of the next denoising training step; after the M-step denoising training step is completed, the denoised image X0 is obtained
[0043] In the denoising training step, the noise estimation neural network is trained by back propagation, and the loss function L of the noise estimation neural network includes: the difference L1 between the mean of the estimated noise obtained in the denoising training step and the mean of the real noise.
[0044] The following is a detailed description of the model training method for image restoration in this embodiment.
[0045] In the present invention, in sub-step A0, the original image and the reference image are obtained by one of the following methods: ① obtaining the original image from an underwater image enhancement training dataset such as UIEB or EUVP, raw and reference image I ref ; ②Own original image I raw After the image enhancement algorithm is used, the reference image I is obtained. ref , wherein the image enhancement algorithm is, for example, a generative adversarial network or a convolutional neural network-based processing algorithm.
[0046] In this embodiment, in sub-step A0, data input (InputData) is performed to convert the original image (RawImages) I raw and reference images (Conditional Images)I ref Perform linear synthesis to obtain the synthetic image I0; I0 = I raw +αI ref ; α is a linear coefficient: 0.5<α<2. Preferably, α=1
[0047] Those skilled in the art should understand that the above image synthesis method is only an example. In other embodiments of the present invention, the linear coefficient can be adjusted, and other nonlinear synthesis methods existing in the prior art such as quadratic or cubic polynomials and image synthesis based on weight distribution can be used. All of these can implement the present invention and are within the protection scope of the present invention.
[0048] In this embodiment, in the step of introducing Gaussian noise on the synthetic image, Gaussian noise is introduced linearly. n =I n-1 +N n , N n is the Gaussian noise introduced in the nth step, n=1, 2,…, N.
[0049] In particular, for the first noise introduction step, I1 = I0 + N1, where I0 = I raw +I ref , I raw is the original image; N1 is the noise introduced in the first noise introduction step.
[0050] Among them, the noise N n The algorithm randomly samples the noise signal from the Gaussian distribution. Due to the randomness of the algorithm, the noise added each time will be different in distribution. For the process of obtaining the noise, please refer to the relevant description of the prior art, which will not be repeated here.
[0051] Similarly, those skilled in the art should understand that the above Gaussian noise introduction method is only an example. In other embodiments of the present invention, the linear coefficient can be adjusted, and other nonlinear methods can be used to introduce Gaussian noise. All of these can implement the present invention and are within the protection scope of the present invention.
[0052] In this embodiment, N=5000, but the present invention is not limited thereto. In other embodiments of the present invention, as long as N≥100, the present invention can be implemented, preferably, N≥2000.
[0053] So far, the forward noise addition in the present invention has been introduced. It can be seen that in the forward noise addition, since the process of adding noise can be regarded as a linear transformation, the model does not need to learn any parameters. And the final generated noisy image I N Features without corresponding original images are sent to the reverse denoising training related module for processing.
[0054] As mentioned above, the reverse denoising training includes: M denoising training steps. Among them, the mth denoising training step includes:
[0055] Noise estimation, using noise estimation neural network for noise estimation, Among them, F θ is the noise estimation neural network, X m is the noisy image of the current step; I ref is the reference image, Estimated noise for the regression output of the noise estimation neural network;
[0056] Noise removal, get the denoised image:
[0057] Where, m = M, M-1, ..., 1, M ≥ 100, X M =I N ,
[0058] like Figure 2B and Figure 2CAs shown in the figure, since the process of adding noise is regarded as a linear transformation, the noise added to the noisy picture can be gradually estimated in the reverse denoising training. The network regression output of each noise estimation neural network is the noise added in the current step in the forward denoising compared with the previous step. During training (TrainingAddNoiseProcess / NoiseEstimation Network), the noise estimation neural network mainly learns the ability to predict noise (Predicted noise) from each step, and gradually improves the denoising model by backpropagating the distance (loss / Loss) between the predicted noise and the actual noise (True noise). Regarding reverse denoising training, the following aspects need special explanation:
[0059] (1) Types of noise estimation neural networks
[0060] In the reverse denoising training of this embodiment, U Net Neural network. The following is Net The neural network is described in detail. Net The basic structure of a neural network includes an encoder, a decoder, and a jump path connecting the two. The encoder extracts the features of the input image through downsampling and convolutional layers, gradually reducing the image size and increasing the channel depth. Then, these features are gradually restored to the original image size in the decoder after a series of processing and upsampling operations.
[0061] The main task of the encoder part is to extract useful features from the input data. It consists of multiple convolutional layers and pooling layers alternating, each layer increasing the feature dimension while reducing the spatial dimension. Specifically, the input image first passes through the convolutional layer to extract features, and then passes through the pooling layer for downsampling. This structure enables the network to capture multi-scale features from shallow to deep layers.
[0062] The decoder has the opposite structure to the encoder, and mainly restores the encoder's output features to the original image size through upsampling and convolution operations. In the denoising diffusion model, the decoder's goal is to predict the noise and generate a clean target image. Upsampling can be achieved through deconvolution, which can effectively convert low-resolution feature maps into high-resolution outputs.
[0063] Skip connections connect the encoder’s feature maps directly to the corresponding decoder layers. This design allows the network to consider both low-level details and high-level semantic information, thereby improving the quality of image generation. In the diffusion model, these connections help the model more effectively utilize features from different levels for accurate noise prediction and removal.
[0064] About U NetFor further information on neural networks, refer to the following two papers:
[0065] 【1】Ho J,JainA,Abbeel P.Denoising diffusion probabilistic models[J].Advances in neural informationprocessingsystems,2020,33:6840-6851.
[0066] 【2】U-Net: Ronneberger O, Fischer P, Brox TU-net: Convolutional networks for biomedical image segmentation[C] / / Medicalimagecomputingandcomputer-assistedintervention–MICCAI2015:18thinternational conference,Munich,Germany,October 5-9,2015,proceedings,partIII 18.Springer InternationalPublishing,2015:234-241.
[0067] Since this embodiment only adopts the existing U Net Neural network, therefore, the contents related to the present invention are described in detail. Net The content of neural network itself will not be discussed in depth.
[0068] Those skilled in the art should understand that Net The neural network is only an example. In other embodiments of the present invention, other types of neural networks may also be used, such as: end-to-end CNN network, ResNet, codec neural network, variational autoencoder. As long as the neural network meets the codec structure conditions, it can be applied to the present invention and will not be described in detail here.
[0069] (2) Input of the noise estimation neural network
[0070] For the noise estimation neural network F θ For the mth reverse denoising step, its input includes: (1) the noise image X of the current step m , (2) Reference image I ref , (3) time code value m; its output is: the estimated value of the mean of the noise signal distribution added at the m-1th moment. During training, the network mainly learns the ability to extract noise from each step, that is, the ability of the gradual denoising model.
[0071] It should be noted that in the prior art, the input of the noise estimation neural network is: the original image I raw In the present invention, if Figure 2C As shown, the reference image I after denoising is used. ref With the original image I raw Combination I in ; In this case, the color distribution of the original image can be corrected while removing the added Gaussian noise. At the same time, the encoded time step (Time step embedding) needs to be input to let the network know the steps (time) of forward denoising and reverse denoising.
[0072] (3) Loss function of noise estimation neural network
[0073] For U Net A neural network, wherein the loss function (Loss) L of the noise estimation neural network includes: a difference L1 (expressed by KL divergence: KLdivergence) between the estimated noise mean obtained in the m-th denoising training step and the true noise mean.
[0074] For professional terms in image processing such as noise mean, noise mean difference, etc., please refer to the relevant description of the prior art and will not be further explained here.
[0075] Regarding the true noise mean, it can be divided into the following two cases:
[0076] ① When M = N, the N steps of introducing Gaussian noise correspond to the N denoising training steps respectively, and the mean of the true noise (Truenoise) is the mean of the Gaussian noise introduced in the corresponding step of introducing Gaussian noise in the forward denoising process;
[0077] like Figure 2A As shown, in this embodiment, M=N; M≥2000. The steps in the forward denoising and backward denoising training correspond one to one, so the mean of the real noise in each backward denoising training just corresponds to the mean of the Gaussian noise introduced in the corresponding Gaussian noise introduction step in the forward denoising process, which makes the calculation simpler and the debugging more convenient.
[0078] ② When M<N, the first M steps of introducing Gaussian noise among the N steps of introducing Gaussian noise are intercepted to correspond to the M denoising training steps, and the mean of the true noise is the mean of the Gaussian noise introduced in the corresponding steps of introducing Gaussian noise in the forward denoising process.
[0079] In this embodiment, M=N, U Net The neural network performs back propagation based on the above loss function L1, thereby adjusting the connection weights of each layer of its own network, thereby completing the m-th step of denoising training.
[0080] In this embodiment, the difference between the estimated noise mean and the true noise mean is represented by KL divergence, but those skilled in the art should understand that other representations may be used to represent the difference between the estimated noise mean and the true noise mean, and the present invention can also be implemented.
[0081] (4) Training process of noise estimation neural network
[0082] like Figure 2B As shown, after the noise estimation neural network completes the prediction, the predicted noise (Predictednoise) is subtracted from the current step. At this point, a denoising training step is completed. The next time, the noise estimation neural network will change from 'm' to 'ml'. The forward process is still controllable and linear. The degradation of underwater images mainly depends on the initial input to constrain the entire process of adding noise and removing noise. According to this method, noisy images can be gradually removed by the distribution estimator. In the process of image denoising, because the input training data is paired (including the reference image and the image to be processed), the training process can be regarded as being carried out under the constraint of the reference image. Given a training output image y, we generate a noisy sample y e And train a neural network f θ Perform regression denoising on the given X and noise samples. This process can be expressed as:
[0083] loss = E (x,y),∈,γ ||f θ (x,y0)-∈||
[0084] y0 is the initial input of the image. θ The output of represents the estimated image mean obtained by the estimator, and this value is constrained by the reference image. Where x is the reference image used to train the network. In this optimization process, the estimator does not just use the information of the current and initial input images to estimate the mean of the distribution at the previous step, as in traditional DDPM. Instead, the reference image is used as conditional information and embedded into the input vector of the estimator. This process can be expressed as:
[0085]
[0086] In the process of diffusion denoising, since the diffusion noise is randomly added, the image simply output by noise estimation and correction will have a certain color difference. Most of this color difference is the cumulative deviation of the network's noise estimation during the reverse denoising process. Therefore, how to deal with this accumulated error is also the focus of the algorithm. In order to eliminate this accumulated color noise interference, the present invention also proposes a pixel-level color correction module based on a channel fusion mechanism to correct the resulting color deviation.
[0087] In this embodiment, in the denoising training steps of 2501 to 5000, each training step includes:
[0088] Noise estimation is performed using a noise estimation neural network.
[0089] Noise removal,
[0090] Color correction, using the color correction module to correct color deviation;
[0091] Where m = M2, M2-1, ..., 1. When the reverse denoising training is not completed, X m-1 As the input of the next denoising training step; after the reverse denoising training is completed, the denoised image X0 is obtained;
[0092] In the denoising / color correction step, the noise estimation neural network is trained by back propagation, and the back propagation loss L is: L = L1 + L2, where L1 can refer to the previous description, and L2 is the image after color correction and the reference image I ref The distance between them can be Euclidean distance, chessboard distance, two-norm distance, KL divergence, etc.
[0093] Figure 3 for Figure 2B Schematic diagram of the color correction step in backward denoising training. Figure 3 As shown, in this embodiment, the main function of the color correction step (ColorCastCorrectionModule) is to correct the color deviation generated during diffusion. This step is an image reconstruction step of a codec structure. In this module, data processing is first performed to extract the L channel (Lchannel) in the LAB color mode of the input image, the R channel (RChannel), the G channel (GChannel), and the B channel (BChannel) in the RGB color mode; then the data is passed to the encoder for compression and dimensionality reduction. The encoder is mainly responsible for compressing the image, extracting color features and encoding; the decoder is mainly responsible for restoring the image and correcting the color.
[0094] Regarding the color correction steps, the following aspects need further explanation:
[0095] (1) Input of color correction step
[0096] For the color correction step, the input is the L channel in the LAB color mode, and the R channel, G channel, and B channel in the RGB color mode of the image after the noise is removed;
[0097] In the image enhancement task involved in this algorithm, there are many advantages to using the LAB color model. First, the LAB color model consists of a luminance component (L) and two chrominance components (a and b), where luminance represents the brightness of the image and chrominance represents the color information. Since luminance and chrominance are represented separately, it is more flexible to process.
[0098] The LAB model is better at dealing with the effects of lighting changes. Since its brightness channel (L) is insensitive to lighting changes, this property can be used to perform operations such as lighting equalization to further improve image quality.
[0099] The input of the module includes the L channel in RGB and Lab channels. The Lab color model consists of a brightness component L and two chromaticity components ab, where L represents the brightness of the image and chromaticity represents the color information. Since brightness and chromaticity are represented separately, they can be processed more flexibly, allowing each channel of the Lab model to be operated independently to achieve different image enhancement goals.
[0100] (2) Color Compression Encoder
[0101] Please refer to Figure 3 The color compression coding takes the L channel, R channel, G channel, and B channel as input, and its specific processing process includes: CRP*3 step, CA step, and DBC step.
[0102] The CRP*3 module (convolution-ReLU-pooling module) further includes: a convolution module, a ReLu module, and a pooling module, which are used to perform downsampling convolution processing on the 4-channel image, thereby removing unnecessary texture information and retaining color features; performing nonlinear activation on the image after the downsampling convolution processing to enhance the expression ability of the features; performing pooling processing on the image after the nonlinear activation to obtain a color compressed image;
[0103] The CA module (channel attention module) is used to extract attention from the multi-channel image output by the convolution-ReLU-pooling module and find the important parts in different channels.
[0104] The DBC module is used to further compress and extract the weighted feature maps output from the channel attention module. It performs dual-branch convolution on the same feature map through convolution kernels of different scales, and then merges the results of the two branches to enhance the detail expression of the feature map.
[0105] (3) Deconvolution reconstruction decoding step (Transposed convolution reconstruction decoder)
[0106] Deconvolution reconstruction decoding is used to reconstruct key color information using the feature map output by color compression coding as input. Figure 3 As shown in the figure, in the transposed convolution reconstruction decoder part, trilinear interpolation (TI) and two transposed convolutions (TCR) are used for upsampling. At the same time, the attention-related model in the encoder is connected to the TCR part of the decoder through attention fusion via jump links. The channel attention results are further used to enhance the weights of favorable channels in the reconstruction process, thereby improving the restoration effect.
[0107] Specifically, in the convolutional reconstruction decoder, the input is the encoded output of the color compression encoder; trilinear interpolation (TI) is used to perform preliminary restoration and reconstruction of the image, and then two deconvolution modules are used to restore the image details and color expression based on the channel weight details provided by channel attention.
[0108] In the color correction step, the decoder part will output the corrected image, which will be compared with the reference image (I ref ) to compare and calculate the L2 distance (that is, the distance between the current corrected image and the reference image). This loss will be passed to the noise estimation neural network (NoiseEstimationNetwork) and used together with the mean estimation loss L1 of the noise estimation neural network for reverse denoising until it is completely denoised. This will be explained in detail in the loss function section.
[0109] For the color correction step, the following aspects also need to be explained:
[0110] (1) Color correction is the preferred step
[0111] In this embodiment, the denoising cumulative error is corrected by a color correction step, but this is only a preferred embodiment of the present invention, which has a better image restoration effect. However, in other embodiments of the present invention, the color correction step may not be included, although the effect will be slightly inferior to that of this embodiment, but the present invention can still be implemented.
[0112] (2) The color correction module is an incomplete neural network
[0113] It should be noted that the color correction step is a separate neural network, but it cannot be fully and independently reverse denoised and trained. After obtaining the corrected image, it relies on the noise estimation neural network for reverse denoising and training.
[0114] (3) When to introduce the color correction step
[0115] In this embodiment, color correction is set in the denoising training step. In the previous denoising training, the cumulative deviation is small and no color correction is required. However, when the cumulative deviation is large in the subsequent steps, color correction is introduced.
[0117] Specifically, in this embodiment, M=5000. In the first 2500 steps of denoising training, color correction is not performed, that is, only the denoising process is included. Starting from step 2501, color correction is added to the denoising training steps from 2501 to 5000, that is, it includes: denoising step and color correction step.
[0118] Those skilled in the art should understand that the timing of introducing the color correction step and the number of cycles may also be adjusted according to the needs of the actual scene, and are not limited to the scope given in this embodiment.
[0119] At this point, the introduction to the model training method for image restoration in an embodiment of the present invention is complete.
[0120] Based on the above-mentioned model training method for image restoration. The second aspect of the present invention also provides an image restoration method. In an exemplary embodiment of the present invention, the image restoration method includes:
[0121] Obtaining an image to be repaired;
[0122] The image to be repaired is synthesized with the Gaussian noise image to obtain a synthesized image;
[0123] Denoising the composite image includes: S denoising steps, the S denoising steps further including: S1 denoising step; S2 denoising / color correction step, S1+S2=S:
[0124] ① In the denoising step of step S1, For the sth denoising step, it includes:
[0125] Noise estimation is performed using a noise estimation neural network. Among them, F θ To obtain the noise estimation neural network through the above model training method, X s is the noisy image of the current step; Estimated noise for the regression output of the noise estimation neural network;
[0126] Noise removal,
[0127] Where s = S, S-1, ..., S-S1. When the denoising process is not completed, X s-1 As the input of the next denoising process.
[0128] ② In the denoising / color correction step of step S2, the denoising / color correction step of step s includes:
[0129] Noise estimation is performed using a noise estimation neural network. Among them, X s is the noisy image of the current step; Estimated noise for the regression output of the noise estimation neural network;
[0130] Noise removal,
[0131] Use the color correction module to perform color correction;
[0132] Where s = S2, S2-1, ..., 1. When the reverse denoising process is not completed, X s-1 As the input of the next denoising process; after the denoising process is completed, the denoised image X0 is obtained.
[0133] In order to verify the image restoration effect of the image restoration method of this embodiment. The applicant conducted a comparative experiment. In the comparative experiment, a GPU server (GPU: NVIDIARTXA6000, operating system: Ubuntu) was used to train and test the algorithm proposed in the present invention. When using the dataset for evaluation, three main scenes where underwater image shooting is prone to problems were selected: underwater color cast scene, underwater hazy scene, and underwater low-light scene. Underwater color cast scenes can also be divided into (blue color cast and green color cast). The UIEB890
[10] dataset was used as the experimental object. On the UIEB dataset, the method of the present invention was quantitatively compared with the prior art deep learning enhancement method, and the results are shown in Table 1.
[0134] Table 1 Results of quantitative comparison between the method of the present invention and the deep learning enhancement method in the prior art
[0135]
[0136] In Table 1, Fusion, UWCNN, MFFN, UIEC2Net, UColor, PUIE-Net, BRUE, and NU2Net are the underwater image enhancement methods in the prior art, Raw is the original image, Water-Diff(ours) is the method of the present invention, and UCIQE, UIQM, CCF, and FDUM are evaluation indicators. Figure 1 As shown, the UCIQE index using the MFFN method is the highest, and Water-Diff is the second highest. The UIQM index using the Water-Diff method is the highest, and BRUE is the second highest. The CCF index using the BRUE method is the highest, and Water-Diff is the second highest. The BRUE index using the FDUM method is the highest, and UIEC2Net is the second highest.
[0137] Figure 4 This is a quality comparison chart of image denoising using different methods under different conditions on the UIEB dataset. Figure 4 As shown:
[0138] ①The image enhancement method of Ancuti et al. can improve image contrast, but is not effective in removing haze and enhancing low light.
[0139] The image enhancement method of Ancuti et al. can be found in the literature: Ancuti C O, Ancuti C, DeVleeschouwer C, et al. Color balance and fusion for underwater image enhancement [J]. IEEE Transactions on image processing, 2017, 27 (1): 379-393.
[0140] ② In blue and yellow scenes, UGAN and FUnIE cannot restore colors well. UIEC^2-Net can handle color cast better, but cannot enhance background contours in haze scenes. GLCHE can effectively remove haze, but cannot effectively compensate for light in low-light scenes.
[0141] The UGAN method can be found in the following literature: Fabbri C, Islam MJ, Sattar J. Enhancing underwater imagery using generative adversarial networks [C] / / 2018 IEEE international conference on robotics and automation (ICRA). IEEE, 2018: 7159-7165.
[0142] The FUnIE method can be found in the following literature: Islam MJ, Xia Y, Sattar J. Fast underwater image enhancement for improved visual perception [J]. IEEE Robotics and Automation Letters, 2020, 5(2): 3227-3234.
[0143] ③MFFN improves contrast and image outline, but produces a yellow tint.
[0144] MFFN can be found in the following literature: Chen R, Cai Z, Cao W. MFFN: An underwater sensing sceneimage enhancement method based on multiscale feature fusion network [J]. IEEE Transactions onGeoscience andRemoteSensing, 2021, 60: 1-12.
[0145] ④The MTUR method improves image contrast, but the color restoration and dehazing effects are poor.
[0146] The MTUR method can be found in the following literature: Yan K, Liang L, Zheng Z, et al. Medium transmission map matters for learning to restore real-world underwater images [J]. Applied Sciences, 2022, 12(11): 5420.
[0147] ⑤Water-Net is better at recovering image details, but is not as effective as other methods in low-light enhancement.
[0148] The Water-Net method can be found in the following literature: C. Li et al., "An Underwater Image Enhancement Benchmark Dataset and Beyond," in IEEE Transactions on Image Processing, vol. 29, pp. 4376-4389, 2020, doi: 10.1109 / TIP.2019.2955241.
[0149] ⑥ Compared with the above methods, the method of the present invention, namely UIESC in the figure, can effectively remove color cast and blur, while adjusting brightness and enhancing image texture to obtain better visual quality.
[0150] In summary, underwater images based on imaging have a certain degree of degradation due to wavelength absorption, scattering and other reasons. How to repair this degradation is challenging. The present invention combines a diffusion model and a correction network. The diffusion model is used to reconstruct the image distribution and utilizes a color correction module based on a channel fusion mechanism. Experimental results show that the method of the present invention can solve the problem of underwater image degradation well and has strong robustness. This provides a reliable reference framework for future underwater image processing technology, and has important practical significance for improving image analysis capabilities in fields such as underwater autonomous robots, underwater archaeology, and biodiversity research.
[0151] Those skilled in the art should understand that, although this embodiment is verified by taking underwater images as an example, the present invention can also be applied to other image enhancement scenarios, such as foggy scenes, old photo restoration, etc., which are also within the protection scope of the present invention.
[0152] At this point, the image restoration method according to the embodiment of the present invention has been introduced.
[0153] Based on the above-mentioned model training method and image restoration method, the third aspect of the present invention provides a computer chip. Figure 5 Schematic diagram of a computer chip according to an embodiment of the present invention. Figure 5 As shown, the computer chip of the embodiment of the present invention is configured to implement: the model training method for image restoration as in the above embodiment; or, the image restoration method as in the above embodiment.
[0154] Based on the above-mentioned model training method and image restoration method, the fourth aspect of the present invention provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements: the model training method for image restoration as in the above embodiment; or, the image restoration method as in the above embodiment.
[0155] Based on the above-mentioned model training method and image restoration method, the fifth aspect of the present invention provides a GPU server. Figure 6 The figure is a schematic diagram of a GPU server according to an embodiment of the present invention. The GPU server comprises: a processor; a memory having a computer program stored thereon; wherein when the processor executes the computer program, the model training method for image restoration as described above; or the image restoration method as described above is implemented.
[0156] Based on the above-mentioned model training method and image restoration method, the sixth aspect of the present invention provides a computer program product. The computer program product includes: a computer program, wherein when the computer program is executed by a processor, it implements: the model training method for image restoration as in the above embodiment; or, the image restoration method as in the above embodiment.
[0157] At this point, the various embodiments of the present invention have been introduced. According to the above description, those skilled in the art should have a clear understanding of the present invention.
[0158] It should be noted that, unless explicitly indicated to the contrary, the numerical parameters in the description and claims of the present invention may be approximate values and may be changed according to the content of the present invention. Specifically, all the numbers indicating the content of the composition, reaction conditions, etc. recorded in the description and claims should be understood to be modified by the term "about" in all cases, which in some embodiments is expressed as a change of ±10%.
[0159] The present invention may also be implemented as a device or apparatus program (e.g., a computer program and a computer program product) for performing a portion or all of the methods described herein. Such a program implementing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
[0160] The present invention can be implemented by means of hardware including several different elements and by means of a suitably programmed computer. The various component embodiments of the present invention can be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. The physical implementation of the hardware structure includes but is not limited to physical devices, which include but are not limited to transistors, memristors, DNA computers, single-chip microcomputers, microprocessors or digital signal processors (DSPs). In addition, the present invention is not directed to any specific programming language. It should be understood that the content of the present invention can be implemented using various programming languages, and the description of specific languages herein is to disclose the best implementation of the present invention.
[0161] Those skilled in the art should understand that in the claims and description of the present invention, the word "comprising" does not exclude the existence of elements (or steps) not listed in the claims. The word "a" or "an" preceding an element (or step) does not exclude the existence of multiple such elements (or steps).
[0162] For certain implementations, if they are not the key content of the present invention and are well known to ordinary technicians in the relevant technical field, they are not described in detail in the drawings or text of the specification due to space limitations. In this case, reference can be made to relevant existing technologies for understanding.
[0163] Furthermore, the above embodiments are provided merely to enable the present invention to satisfy legal requirements, and the present invention may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein.
[0164] Similarly, it should be understood that in order to simplify the present invention, in the above description of the exemplary embodiments of the present invention, the various features of the present invention are sometimes grouped together into a single embodiment, figure, or description thereof. However, the method of the invention should not be interpreted as reflecting the following intention: the claimed invention requires more features than the features explicitly stated in each claim. More specifically, as reflected in the claims, each inventive aspect lies in less than all the features of the previous single embodiment. Moreover, the embodiments can be mixed and matched with each other or with other embodiments based on design and reliability considerations, that is, the technical features in different embodiments can be freely combined to form more embodiments. Therefore, the claims following the specific embodiment are hereby explicitly incorporated into the specific embodiment, wherein each claim itself serves as a separate embodiment of the present invention.
[0165] The above specific embodiments provide a detailed description of the objectives, technical means and beneficial effects of the present invention. It should be understood that the purpose of the detailed description is to enable those skilled in the art to understand the present invention more clearly, and it is not used to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A model training method for image restoration, characterized in that: include: Step A, forward noise addition, includes: The original image I raw And the repaired reference image I ref The synthesis is performed to obtain the synthetic image I0: I0 = f(I raw ,I ref ), f is the synthesis function; Gaussian noise is gradually introduced into the synthetic image I0 in N steps to obtain a noisy image I N , N ≥ 100; Step B, reverse denoising training, includes: M denoising training steps, for the mth denoising training step, including: Noise estimation is performed using a noise estimation neural network. Among them, F θ is the noise estimation neural network, X m is the noisy image of the current step; I ref is the reference image, Estimated noise for the regression output of the noise estimation neural network; Noise removal, get the denoised image: Where, m = M, M-1, ..., 1, M ≥ 100, M ≤ N, X M =I N , when the M-step denoising training step is not completed, X m-1 As the input of the next denoising training step; after the M-step denoising training step is completed, the denoised image X0 is obtained; In the denoising training step, the noise estimation neural network is trained by back propagation, and the loss function L of the noise estimation neural network includes: the difference L1 between the mean of the estimated noise obtained in the denoising training step and the mean of the real noise.
2. The model training method according to claim 1, characterized in that: In the forward denoising, the original image and the reference image are obtained by one of the following methods: obtaining the original image I in UIEB or EUVP raw and reference image I ref ; Own original image I raw After the image enhancement algorithm is used, the reference image I is obtained. ref ; And / or, in the reverse denoising training, in the denoising training step: When M=N, the N steps of introducing Gaussian noise correspond to the N denoising training steps respectively, and the true noise mean is the mean of the Gaussian noise introduced in the corresponding step of introducing Gaussian noise in the forward noise adding process; Or, when M<N, the first M Gaussian noise introducing steps among the N Gaussian noise introducing steps are intercepted and correspond to the M denoising training steps respectively, and the true noise mean is the mean of the Gaussian noise introduced in the corresponding Gaussian noise introducing steps in the forward noisy process.
3. The model training method according to claim 2, characterized in that: In the step A, The original image I raw and reference image I ref Perform linear synthesis to obtain the synthetic image I0; I0 = I raw +αI ref ; α is the linear coefficient: 0.5<α<2; And / or, in the step of introducing Gaussian noise on the synthetic image for the nth step, Gaussian noise is introduced linearly, I n =I n-1 +N n , N n is the Gaussian noise introduced in the nth step, n=1, 2,…,N.
4. The model training method according to claim 3, characterized in that: N≥2000; and / or, M=N; And / or, the noise estimation neural network is U Net network; And / or, α=1.
5. The model training method according to claim 4, characterized in that: The U Net The network includes an encoder, a decoder, and a skip path connecting the two; where: The encoder is used to extract useful features from the input data and reduce the spatial dimension. It consists of multiple convolutional layers and pooling layers alternating. In each layer, the input image first passes through the convolutional layer to extract features, and then passes through the pooling layer for downsampling. This structure enables the network to capture multi-scale features from shallow to deep layers. The structure of the decoder is opposite to that of the encoder. The output features of the encoder are restored to the original image size through upsampling and convolution operations. Skip connections directly connect the encoder feature maps to the corresponding decoder layers.
6. The model training method according to claim 1, characterized in that: The M-step denoising training steps include: M1 step denoising training step; And, the denoising / color correction step of step M2, M1+M2=M, for the mth denoising / color correction step, including: Noise estimation is performed using a noise estimation neural network. Noise removal, get the denoised image: The color deviation of the denoised image is corrected using a color correction module, which is a deep learning neural network; Where m = M2, M2-1, ..., 1. When the reverse denoising training is not completed, X m-1 As the input of the next denoising training step; after the reverse denoising training is completed, the denoised image X0 is obtained; In the denoising / color correction step, the noise estimation neural network is trained by back propagation, and the back propagation loss L is: L = L1 + L2, where L2 is the difference between the color-corrected image and the reference image I ref The distance between.
7. The model training method according to claim 6, characterized in that: The color correction module comprises: Data processing, extracting the L channel in the LAB color mode, and the R channel, G channel, and B channel in the RGB color mode of the image after noise removal; Color compression encoding, taking the L channel, R channel, G channel, and B channel as input, includes: The convolution-ReLU-pooling module is used to perform downsampling convolution processing on the 4-channel image; perform nonlinear activation on the image after the downsampling convolution processing; perform pooling processing on the image after the nonlinear activation to obtain a multi-channel image after color compression processing; The channel attention module is used to extract attention from the multi-channel image output by the convolution-ReLU-pooling module, find the important parts in different channels, and obtain feature maps with weights; The DBC module is used to further compress and extract the weighted feature maps output from the channel attention module. It performs dual-branch convolution on the same feature map through convolution kernels of different scales, and then merges the results of the two branches to enhance the detail expression of the feature map. Convolution reconstruction decoding takes the feature map of the color compression encoding output as input and reconstructs key color information, including: The TI module is used to perform preliminary upsampling of the feature map and restore preliminary image details; The TCR module is used to refine the feature map obtained by upsampling the TI module, add details and restore normal color distribution. At the same time, it receives the channel weight information provided by the channel attention module and reconstructs the image color according to the relationship between different channels to obtain a color-corrected image.
8. The model training method according to claim 6, characterized in that: The M≥2000, the And / or, the distance is Euclidean distance, chessboard distance, bi-norm distance, or KL divergence.
9. An image restoration method, characterized in that: include: Obtaining an image to be repaired; The image to be repaired is synthesized with the Gaussian noise image to obtain a synthesized image; Denoise the synthetic image, including: S denoising steps, wherein for the s-th denoising step, it includes: Noise estimation is performed using a noise estimation neural network. Among them, F θ To obtain a noise estimation neural network by the model training method according to any one of claims 1 to 8, X s is the noisy image of the current step; Estimated noise for the regression output of the noise estimation neural network; Noise removal, Where, s = S, SI, ..., 1, S ≥ 100. When the denoising process is not completed, X s-1 As the input of the next denoising process; after the denoising process is completed, the denoised image X0 is obtained.
10. The image restoration method according to claim 8, characterized in that: The denoising steps of the S steps include: S1 is the denoising step; The denoising / color correction step of step S2, S1+S2=M, wherein the denoising / color correction step of step s includes: Noise estimation is performed using a noise estimation neural network. Among them, X s is the noisy image of the current step; Estimated noise for the regression output of the noise estimation neural network; Noise removal, get the denoised image: Use the color correction module to perform color correction on the denoised image; Where s = S2, S2-1, ..., 1. When the denoising process is not completed, X s-1 As the input of the next denoising process; after the denoising process is completed, the denoised image X0 is obtained; Wherein, the noise estimation neural network is a noise estimation neural network obtained by the model training method described in any one of claims 6 to 8, and the color correction module is a color correction module described in any one of claims 6 to 8.
11. The image restoration method according to claim 10, characterized in that: The image to be restored is an underwater image; and / or, said S≥2000, said 12. A computer chip, characterized in that: The computer chip is configured to implement: the model training method for image restoration as described in any one of claims 1 to 8; or the image restoration method as described in claim 9 or 10.
13. A computer-readable storage medium, characterized in that: A computer program is stored thereon, which, when executed by a processor, implements: a model training method for image restoration as described in any one of claims 1 to 8; or an image restoration method as described in claim 9 or 10.
14. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, it implements: the model training method for image restoration according to any one of claims 1 to 8; Or, the image restoration method as described in claim 9 or 10.
15. A GPU server, characterized in that: include: processor; a memory having a computer program stored thereon; Wherein, when the processor executes the computer program, it implements: the model training method for image restoration as described in any one of claims 1 to 8; or the image restoration method as described in claim 9 or 10.
Citation Information
Patent Citations
Full-focus image diffusion generation method based on light field data
CN118212136A
SAR image generation method based on de-noising diffusion probability model
CN118230191A
Video blind denoising method based on deep learning, computer device and computer-readable storage medium
US20210327031A1
Cited By
Image restoration method, server, image forming device and storage medium
CN121599869A
