Image Denoising Model Training Method, Apparatus, Device, and Medium
Through the combination of wavelet transform and Fourier transform, longitudinal stripe noise is screened out and convolutional neural network is trained, which solves the problem of poor longitudinal stripe noise removal in the prior art, and effectively denoising the image and retaining the target and background.
Patent Information
- Application Number
- CN202211084807.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-06
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-09-06
AI Technical Summary
Existing image denoising methods are not effective in removing longitudinal stripe-like noise in surface defect detection of industrial products and may lead to processed image distortion.
The combination of wavelet transform and Fourier transform is used to remove noise, and the horizontal subband image is obtained through Haar discrete wavelet transform, longitudinal stripe noise is filtered out, and the convolutional neural network is trained using superimposed images, and the loss function is constructed for backpropagation to update network parameters to obtain an image denoising model.
Effectively remove longitudinal stripe noise while retaining the target and background, avoiding image distortion and improving image denoising effect.
Smart Images

Figure CN115423718B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of image denoising, for example, it relates to methods, devices, equipment, and media for training an image denoising model. Background Art
[0002] Industrial product surface defect detection is one of the important applications of artificial intelligence in the manufacturing industry. The industrial defect detection method relies on a line array camera to collect images of products on a high-speed continuous production line, and then performs defect detection on the collected images. However, the images obtained by the line array camera have longitudinal striped image noise, and image denoising is required. Since the image noise is striped noise and does not conform to the Gaussian distribution, the denoising effect of traditional image processing methods such as Gaussian filtering is not good. The image processing method based on a convolutional neural network may remove the contour of the defect while removing the striped noise, resulting in distortion of the processed image.
[0003] Existing image denoising methods have problems such as poor denoising effect or distortion of the processed image. Summary of the Invention
[0004] This application provides a method, device, equipment, and medium for training an image denoising model, aiming to solve the problems of poor denoising effect or distortion of the processed image.
[0005] To solve the above problems, this application adopts the following technical solutions:
[0006] This article provides a method for training an image denoising model, including:
[0007] Obtain an image to be processed;
[0008] Denoise the image to be processed to obtain a denoised image;
[0009] Perform wavelet transform on the image to be processed to obtain a horizontal subband image;
[0010] Superimpose the denoised image and the horizontal subband image to obtain a superimposed image;
[0011] Use the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model.
[0012] Preferably, the performing wavelet transform on the image to be processed to obtain a horizontal subband image includes:
[0013] Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency subband image and a non-low-frequency subband image;
[0014] Select the horizontal subband image from the non-low-frequency subband images, where the non-low-frequency subband images include the horizontal subband image, the vertical subband image, and the diagonal subband image.
[0015] Preferably, training the convolutional neural network to be trained using the superimposed image to obtain an image denoising model includes:
[0016] Construct a loss function of the convolutional neural network to be trained using the low-frequency subband coefficients and the horizontal subband coefficients;
[0017] The formula of the loss function is:
[0018]
[0019] where L w is the loss function, cA is the low-frequency subband coefficient, cH is the horizontal subband coefficient, is the low-frequency subband estimated coefficient, is the horizontal subband estimated coefficient;
[0020] Input the superimposed image into the convolutional neural network to be trained, and calculate the loss function value of the loss function;
[0021] Perform backpropagation according to the loss function value, and update the network parameters of the convolutional neural network to be trained;
[0022] Judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training to obtain the image denoising model.
[0023] Preferably, denoising the image to be processed to obtain a denoised image includes:
[0024] Perform a Fourier transform on the image to be processed to obtain a frequency-domain image;
[0025] Remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image;
[0026] Perform an inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
[0027] Preferably, after obtaining the image denoising model, it further includes:
[0028] Obtain the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include the updated low-frequency subband coefficients and the updated horizontal subband coefficients;
[0029] Perform an inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients to obtain an updated low-frequency subband image;
[0030] Perform inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients to obtain the updated horizontal subband image;
[0031] Superimpose the updated low-frequency subband image, the updated horizontal subband image, the vertical subband image, and the diagonal subband image to obtain the final denoised image.
[0032] Preferably, calculating the loss function value of the loss function includes:
[0033] Calculate the loss function value of the loss function under the supervision of the low-frequency subband image.
[0034] Preferably, obtaining the image to be processed includes:
[0035] Obtain the image to be processed collected by the array camera, and the image to be processed is an 8-bit grayscale image.
[0036] This application also provides an image denoising model training device, including:
[0037] An image to be processed acquisition module, configured to acquire an image to be processed;
[0038] An image denoising module, configured to denoise the image to be processed to obtain a denoised image;
[0039] A wavelet transform module, configured to perform wavelet transform on the image to be processed to obtain a horizontal subband image;
[0040] An image superposition module, configured to superimpose the denoised image and the horizontal subband image to obtain a superimposed image;
[0041] A training module, configured to train a convolutional neural network to be trained using the superimposed image to obtain an image denoising model.
[0042] This application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the image denoising model training method described in any one of the above are implemented.
[0043] The method for training an image denoising model of the present application includes obtaining an image to be processed, denoising the image to be processed to obtain a denoised image. Performing wavelet transform on the image to be processed to obtain a horizontal subband image. Superimposing the denoised image and the horizontal subband image to obtain a superimposed image. Using the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model. First denoising the image to be processed can obtain a denoised image containing a relatively complete target and background. Since the image noise of the image to be processed is of the vertical stripe type, wavelet transform performs multi-scale processing on the image to be processed, and the obtained horizontal subband image contains all the vertical stripe noises. The superimposed image obtained by superimposing the denoised image and the horizontal subband image contains only a small amount of impulse noise. Using the superimposed image to train to obtain an image denoising model, the image denoising model can effectively remove the vertical stripe noise while better retaining the target and background. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 FIG. is a schematic flow chart of a method for training an image denoising model according to an embodiment;
[0045] Figure 2 FIG. is a schematic flow chart of performing wavelet transform on an image to be processed according to an embodiment;
[0046] Figure 3 FIG. is a schematic flow chart of using a superimposed image to train a convolutional neural network to be trained according to an embodiment;
[0047] Figure 4 FIG. is a schematic flow chart of denoising an image to be processed according to an embodiment;
[0048] Figure 5 FIG. is a schematic flow chart of using the parameters of an image denoising model to obtain a final denoised image according to an embodiment;
[0049] Figure 6 FIG. is a schematic block diagram of the structure of an image denoising model training device according to an embodiment;
[0050] Figure 7 FIG. is a schematic block diagram of the structure of a computer device according to an embodiment.
[0051] The implementation, functional features and advantages of the object of the present application will be further described with reference to the embodiments and the accompanying drawings. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0052] In order to make the object, technical solution and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0053] Those skilled in the art can understand that, unless specifically stated otherwise, the singular forms "a", "an", "the above", and "the" used herein may also include the plural forms. It should be further understood that the term "comprising" used in the specification of this application means the presence of features, integers, steps, operations, elements, units, units, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, units, units, components, and / or groups thereof. It should be understood that when we say an element is "connected" or "coupled" to another element, it can be directly connected or coupled to other elements, or there may also be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The phrase "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0054] Those skilled in the art can understand that, unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meaning as the general understanding of those of ordinary skill in the art to which this application belongs. It should also be understood that terms such as those defined in a general dictionary should be understood to have a meaning consistent with the meaning in the context of the prior art, and will not be interpreted with an idealized or overly formal meaning unless specifically defined as here.
[0055] In one embodiment, referring to Figure 1 , which is a schematic flowchart of the method for training an image denoising model of this application, includes the following steps S1 - S5:
[0056] S1: Obtain the image to be processed.
[0057] Obtain the image to be processed collected by the array camera, and the image to be processed is an 8-bit grayscale image. The image to be processed is obtained by continuously collecting images of the surface of an industrial product by a line array camera, and the image to be processed contains longitudinal stripe noise.
[0058] In addition to the longitudinal stripe noise, the image to be processed also includes a target and a background. The target is a surface defect, and the background is other areas of the surface product except for the surface defect.
[0059] S2: Denoise the image to be processed to obtain a denoised image.
[0060] Perform a Fourier transform on the image to be processed to obtain a frequency domain image;
[0061] Remove the high-frequency components of the frequency domain image to obtain a processed frequency domain image;
[0062] Perform an inverse Fourier transform on the processed frequency domain image to obtain the denoised image.
[0063] The Fourier transform can convert the image to be processed from the spatial domain to the frequency domain. Compared with the target and the background, the impulse noise changes faster in the frequency domain. The impulse noise in the frequency domain is a high-frequency component, while the target and the background are low-frequency components.
[0064] The high-frequency components of the frequency-domain image are in the regions with higher brightness in the frequency-domain image. By assigning the regions with higher brightness in the frequency-domain image to 0, the high-frequency components of the frequency-domain image can be removed, and the processed frequency-domain image can be obtained.
[0065] Use the inverse Fourier transform to convert the processed frequency-domain image from the frequency domain to the spatial domain to obtain the denoised image.
[0066] S3: Perform wavelet transform on the image to be processed to obtain a horizontal subband image.
[0067] Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency subband image and a non-low-frequency subband image;
[0068] Select the horizontal subband image from the non-low-frequency subband images. The non-low-frequency subband images include the horizontal subband image, the vertical subband image, and the diagonal subband image.
[0069] Haar discrete wavelet can perform multi-scale decomposition on the image to be processed to obtain a low-frequency subband image, a horizontal subband image, a vertical subband image, and a diagonal subband image.
[0070] The low-frequency subband image is the approximation of the image to be processed. The horizontal subband image is the detail value in the horizontal direction of the image to be processed. The vertical subband image is the detail value in the vertical direction of the image to be processed. The diagonal subband image is the detail value in the diagonal direction of the image to be processed.
[0071] Since the image collected by the line array camera has longitudinal stripe noise, and the longitudinal stripe noise is in the horizontal direction and does not exist or only exists very little in the vertical and diagonal directions, the horizontal subband image is selected from the results obtained by the Haar discrete wavelet transform.
[0072] S4: Superimpose the denoised image and the horizontal subband image to obtain a superimposed image.
[0073] The denoised image contains the target and the background, and the denoised image does not contain or only contains a small amount of impulse noise. The horizontal subband image contains longitudinal stripe noise. Add the denoised image and the horizontal subband image to obtain a superimposed image.
[0074] S5: Use the superimposed image to train the convolutional neural network to be trained to obtain an image denoising model.
[0075] Construct the loss function of the convolutional neural network to be trained using the low-frequency subband coefficients and the horizontal subband coefficients;
[0076] The formula of the loss function is:
[0077]
[0078] where L w is the loss function, cA is the low-frequency subband coefficient, cH is the horizontal subband coefficient, is the low-frequency subband estimation coefficient, is the horizontal subband estimation coefficient;
[0079] Input the superimposed image into the convolutional neural network to be trained, and calculate the loss function value of the loss function;
[0080] Perform backpropagation according to the loss function value, and update the network parameters of the convolutional neural network to be trained;
[0081] Judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training and obtain the image denoising model.
[0082] The image denoising model trained from the superimposed image can effectively remove vertical stripe noise.
[0083] The image denoising model training method of the embodiment of the present application includes obtaining an image to be processed, denoising the image to be processed to obtain a denoised image. Perform wavelet transform on the image to be processed to obtain a horizontal subband image. Superimpose the denoised image and the horizontal subband image to obtain a superimposed image. Use the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model. First denoising the image to be processed can obtain a denoised image containing a relatively complete target and background. Since the image noise of the image to be processed is of the vertical stripe type, wavelet transform performs multi-scale processing on the image to be processed, and the obtained horizontal subband image contains all the vertical stripe noise. The superimposed image obtained by superimposing the denoised image and the horizontal subband image only contains a small amount of impulse noise. Using the superimposed image to train an image denoising model, the image denoising model can effectively remove vertical stripe noise while better retaining the target and background.
[0084] In one embodiment, referring to Figure 2 , the step S3 of performing wavelet transform on the image to be processed to obtain a horizontal subband image includes the following steps S31-S32:
[0085] S31: Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency subband image and a non-low-frequency subband image.
[0086] The Haar discrete wavelet can perform multi-scale decomposition on the image to be processed, obtaining a low-frequency sub-band image, a horizontal sub-band image, a vertical sub-band image, and a diagonal sub-band image.
[0087] The low-frequency sub-band image is the approximation of the image to be processed, the horizontal sub-band image is the detail value in the horizontal direction of the image to be processed, the vertical sub-band image is the detail value in the vertical direction of the image to be processed, and the diagonal sub-band image is the detail value in the diagonal direction of the image to be processed.
[0088] S32: Screen out the horizontal sub-band image from the non-low-frequency sub-band images, where the non-low-frequency sub-band images include the horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image.
[0089] Since the image collected by the line array camera has longitudinal stripe noise, and the longitudinal stripe noise is in the horizontal direction, and there is no or very little longitudinal stripe noise in the vertical and diagonal directions, the horizontal sub-band image is selected from the results obtained by the Haar discrete wavelet transform.
[0090] The horizontal sub-band image is used to train the convolutional neural network to be trained.
[0091] In the embodiment of the present application, performing wavelet transform on the image to be processed to obtain a horizontal sub-band image includes performing Haar discrete wavelet transform on the image to be processed to obtain a low-frequency sub-band image and a non-low-frequency sub-band image. Screen out the horizontal sub-band image from the non-low-frequency sub-band images, where the non-low-frequency sub-band images include the horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image. The horizontal sub-band image is used to train the convolutional neural network to be trained.
[0092] In one embodiment, referring to Figure 3 , step S5 of training the convolutional neural network to be trained using the superimposed image to obtain an image denoising model includes the following steps S51 - S54:
[0093] S51: Construct the loss function of the convolutional neural network to be trained using the low-frequency sub-band coefficients and the horizontal sub-band coefficients.
[0094] The formula of the loss function is:
[0095]
[0096] Among them, L w is the loss function, cA is the low-frequency sub-band coefficient, cH is the horizontal sub-band coefficient, is the low-frequency sub-band estimated coefficient, is the horizontal sub-band estimated coefficient.
[0097] Set the low-frequency sub-band estimated coefficient and the horizontal sub-band estimated coefficient before training the convolutional neural network to be trained.
[0098] Construct a loss function from the low-frequency subband coefficients and the horizontal subband coefficients, and train the convolutional neural network to be trained according to the loss function.
[0099] S52: Input the superimposed image into the convolutional neural network to be trained, and calculate the loss function value of the loss function.
[0100] Calculate the loss function value of the loss function under the supervision of the low-frequency subband image.
[0101] The loss function value is used to measure the difference between the low-frequency subband coefficients and the low-frequency subband estimated coefficients, and the loss function value is also used to measure the difference between the horizontal subband coefficients and the horizontal subband estimated coefficients.
[0102] Train the convolutional neural network to be trained according to the loss function. The convolutional neural network to be trained can be a transformer network or other networks, which is specifically determined according to the actual situation and is not limited here.
[0103] During the training process, the loss function value becomes smaller and smaller, the difference between the low-frequency subband coefficients and the low-frequency subband estimated coefficients becomes smaller and smaller, and the difference between the horizontal subband coefficients and the horizontal subband estimated coefficients also becomes smaller and smaller.
[0104] S53: Perform backpropagation according to the loss function value, and update the network parameters of the convolutional neural network to be trained.
[0105] The smaller the difference between the loss function values in two adjacent iteration processes, the faster the update speed of the network parameters.
[0106] S54: Determine whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training to obtain the image denoising model.
[0107] Set the network parameter threshold. When the difference between the network parameters and the preset network parameters is less than the network parameter threshold, it means that the convolutional neural network in training has met the expectations. At this time, stop training to obtain the image denoising model.
[0108] When the difference between the network parameters and the preset network parameters is greater than or equal to the network parameter threshold, it means that the convolutional neural network in training has not met the expectations. At this time, continue training until the difference between the network parameters and the preset network parameters is less than the network parameter threshold, then stop training to obtain the image denoising model.
[0109] Use the superimposed image to train to obtain an image denoising model. The image denoising model can effectively remove the vertical stripe noise while better retaining the target and the background.
[0110] In the embodiment of the present application, a superposed image is used to train a convolutional neural network to be trained to obtain an image denoising model, including constructing a loss function of the convolutional neural network to be trained using low-frequency subband coefficients and horizontal subband coefficients, inputting the superposed image into the convolutional neural network to be trained, and calculating the loss function value of the loss function. Backpropagation is performed according to the loss function value to update the network parameters of the convolutional neural network to be trained. It is determined whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, the training is stopped to obtain the image denoising model. The image denoising model is obtained by training with the superposed image. The image denoising model can effectively remove vertical stripe noise while better retaining the target and the background.
[0111] In one embodiment, referring to Figure 4 , step S2 of performing denoising on the image to be processed to obtain a denoised image includes the following steps S21-S23:
[0112] S21: Perform a Fourier transform on the image to be processed to obtain a frequency-domain image.
[0113] The Fourier transform can convert the image to be processed from the spatial domain to the frequency domain. Compared with the target and the background, impulse noise changes faster in the frequency domain. Impulse noise is a high-frequency component in the frequency domain, and the target and the background are low-frequency components.
[0114] S22: Remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image.
[0115] The high-frequency components of the frequency-domain image are in the regions with higher brightness in the frequency-domain image. By assigning the regions with higher brightness in the frequency-domain image to 0, the high-frequency components of the frequency-domain image can be removed to obtain a processed frequency-domain image.
[0116] S23: Perform an inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
[0117] The inverse Fourier transform is used to convert the processed frequency-domain image from the frequency domain to the spatial domain to obtain the denoised image.
[0118] Impulse noise is difficult to process in the spatial domain. In the frequency domain, impulse noise, the target, and the background can be distinguished. Therefore, the Fourier transform is used to convert the image to be processed to the frequency domain, and impulse noise is removed in the frequency domain.
[0119] In the embodiment of the present application, denoising is performed on the image to be processed to obtain a denoised image, including performing Fourier transform on the image to be processed to obtain a frequency-domain image. The high-frequency components of the frequency-domain image are removed to obtain a processed frequency-domain image. Inverse Fourier transform is performed on the processed frequency-domain image to obtain a denoised image. Impulse noise is difficult to process in the spatial domain, and in the frequency domain, impulse noise, the target, and the background can be distinguished. Therefore, Fourier transform is used to convert the image to be processed into the frequency domain, and impulse noise is removed in the frequency domain.
[0120] In one embodiment, referring to Figure 5 , after step S5 of training the convolutional neural network to be trained using the superimposed image to obtain an image denoising model, it further includes obtaining a final denoised image using the image denoising model parameters, including the following steps S61 - S64:
[0121] S61: Obtain the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include updated low-frequency subband coefficients and updated horizontal subband coefficients.
[0122] The updated low-frequency subband coefficients and the updated horizontal subband coefficients are used to remove vertical stripe noise.
[0123] S62: Perform inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients to obtain an updated low-frequency subband image.
[0124] Performing inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients can better retain the target and background in the image.
[0125] S63: Perform inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients to obtain an updated horizontal subband image.
[0126] Performing inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients can better remove the vertical stripe noise in the horizontal subband image.
[0127] S64: Superimpose the updated low-frequency subband image, the updated horizontal subband image, the vertical subband image, and the diagonal subband image to obtain a final denoised image.
[0128] The vertical subband image contains the features in the vertical direction of the image to be processed, and there is no or very little vertical stripe noise in the vertical subband image. The diagonal subband image contains the features in the diagonal direction of the image to be processed, and there is no or very little vertical stripe noise in the diagonal subband image.
[0129] Overlaying the updated low-frequency sub-band image, the updated horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image can obtain a final denoised image with no or only very few vertical stripe noises, and the final denoised image preferably retains the targets and backgrounds in the image to be processed.
[0130] Referring to Figure 6 , which is a structural schematic block diagram of an image denoising model training device applied in this solution. The device includes:
[0131] An image to be processed acquisition module 10, configured to acquire an image to be processed;
[0132] An image denoising module 20, configured to denoise the image to be processed to obtain a denoised image;
[0133] A wavelet transform module 30, configured to perform wavelet transform on the image to be processed to obtain a horizontal sub-band image;
[0134] An image overlay module 40, configured to overlay the denoised image and the horizontal sub-band image to obtain an overlaid image;
[0135] A training module 50, configured to use the overlaid image to train a convolutional neural network to be trained to obtain an image denoising model.
[0136] The image denoising model training device according to the embodiment of the present application can implement an image denoising model training method.
[0137] In one embodiment, the wavelet transform module 30 includes:
[0138] A Haar discrete wavelet transform unit, configured to perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency sub-band image and a non-low-frequency sub-band image;
[0139] A horizontal sub-band image screening unit, configured to screen out the horizontal sub-band image from the non-low-frequency sub-band image, and the non-low-frequency sub-band image includes the horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image.
[0140] In one embodiment, the training module 50 includes:
[0141] A loss function construction unit, configured to construct a loss function of the convolutional neural network to be trained by using low-frequency sub-band coefficients and horizontal sub-band coefficients;
[0142] The formula of the loss function is:
[0143]
[0144] Wherein, L wis the loss function, cA is the low-frequency subband coefficient, and cH is the horizontal subband coefficient. is the estimated coefficient of the low-frequency subband. is the estimated coefficient of the horizontal subband;
[0145] The loss function value calculation unit is configured to input the superimposed image into the convolutional neural network to be trained and calculate the loss function value of the loss function;
[0146] The network parameter update unit is configured to perform backpropagation according to the loss function value and update the network parameters of the convolutional neural network to be trained;
[0147] The difference judgment unit is configured to judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop the training to obtain the image denoising model.
[0148] In one embodiment, the image denoising module 20 includes:
[0149] The Fourier transform unit is configured to perform a Fourier transform on the image to be processed to obtain a frequency-domain image;
[0150] The high-frequency component removal unit is configured to remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image;
[0151] The inverse Fourier transform unit is configured to perform an inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
[0152] In one embodiment, the image denoising model training device further includes:
[0153] The image denoising model parameter acquisition unit is configured to acquire the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include the updated low-frequency subband coefficients and the updated horizontal subband coefficients;
[0154] The updated low-frequency subband image calculation unit is configured to perform an inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients to obtain an updated low-frequency subband image;
[0155] The updated horizontal subband image calculation unit is configured to perform an inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients to obtain an updated horizontal subband image;
[0156] The final denoised image calculation unit is configured to superimpose the updated low-frequency subband image, the updated horizontal subband image, the vertical subband image, and the diagonal subband image to obtain a final denoised image.
[0157] In one embodiment, the loss function value calculation unit includes:
[0158] A supervision calculation subunit, configured to calculate a loss function value of the loss function under the supervision of the low-frequency sub-band image.
[0159] In one embodiment, the image to be processed acquisition module 10 includes:
[0160] A first image acquisition unit, configured to acquire the image to be processed collected by an array camera, where the image to be processed is an 8-bit grayscale image.
[0161] Refer to Figure 7 , in an embodiment of the present application, a computer device is further provided. The computer device may be a server, and its internal structure may be as Figure 7 shown. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store denoised images, horizontal sub-band images, etc. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it is used to implement the image denoising model training method.
[0162] The above-mentioned processor executes the above-mentioned image denoising model training method, including:
[0163] Acquire an image to be processed;
[0164] Denoise the image to be processed to obtain a denoised image;
[0165] Perform wavelet transform on the image to be processed to obtain a horizontal sub-band image;
[0166] Superimpose the denoised image and the horizontal sub-band image to obtain a superimposed image;
[0167] Use the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model.
[0168] In one embodiment, the above-mentioned processor performs wavelet transform on the image to be processed to obtain a horizontal sub-band image, including:
[0169] Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency sub-band image and a non-low-frequency sub-band image;
[0170] Screen out the horizontal sub-band image from the non-low-frequency sub-band image, where the non-low-frequency sub-band image includes the horizontal sub-band image, a vertical sub-band image, and a diagonal sub-band image.
[0171] In one embodiment, the above-mentioned processor uses the superimposed image to train a convolutional neural network to be trained, and obtains an image denoising model, including:
[0172] Construct a loss function of the convolutional neural network to be trained using low-frequency subband coefficients and horizontal subband coefficients;
[0173] The formula of the loss function is:
[0174]
[0175] where L w is the loss function, cA is the low-frequency subband coefficient, cH is the horizontal subband coefficient, is the low-frequency subband estimation coefficient, is the horizontal subband estimation coefficient;
[0176] Input the superimposed image into the convolutional neural network to be trained, and calculate the loss function value of the loss function;
[0177] Perform backpropagation according to the loss function value, and update the network parameters of the convolutional neural network to be trained;
[0178] Judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training and obtain the image denoising model.
[0179] In one embodiment, the above-mentioned processor denoises the image to be processed to obtain a denoised image, including:
[0180] Perform Fourier transform on the image to be processed to obtain a frequency-domain image;
[0181] Remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image;
[0182] Perform inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
[0183] In one embodiment, after the above-mentioned processor obtains the image denoising model, it further includes:
[0184] Obtain the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include the updated low-frequency subband coefficients and the updated horizontal subband coefficients;
[0185] Perform inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients to obtain an updated low-frequency subband image;
[0186] Perform inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients to obtain the updated horizontal subband image;
[0187] Superimpose the updated low-frequency subband image, the updated horizontal subband image, the vertical subband image, and the diagonal subband image to obtain the final denoised image.
[0188] In one embodiment, the above processor calculates the loss function value of the loss function, including:
[0189] Calculate the loss function value of the loss function under the supervision of the low-frequency subband image.
[0190] In one embodiment, the above processor obtains the image to be processed, including:
[0191] Obtain the image to be processed collected by the array camera, and the image to be processed is an 8-bit grayscale image.
[0192] Those skilled in the art can understand that Figure 7 The structure shown in
[0193] is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied.
[0194] The above processor executes the above image denoising model training method, including:
[0195] Obtain the image to be processed;
[0196] Denoise the image to be processed to obtain a denoised image;
[0197] Perform wavelet transform on the image to be processed to obtain a horizontal subband image;
[0198] Superimpose the denoised image and the horizontal subband image to obtain a superimposed image;
[0199] Use the superimposed image to train the convolutional neural network to be trained to obtain an image denoising model.
[0200] In one embodiment, the above processor performs wavelet transform on the image to be processed to obtain a horizontal subband image, including:
[0201] Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency subband image and a non-low-frequency subband image;
[0202] Filter out the horizontal subband image from the non-low-frequency subband images, where the non-low-frequency subband images include the horizontal subband image, the vertical subband image, and the diagonal subband image.
[0203] In one embodiment, the above-mentioned processor uses the superimposed image to train the convolutional neural network to be trained, and obtains an image denoising model, including:
[0204] Construct a loss function of the convolutional neural network to be trained using the low-frequency subband coefficients and the horizontal subband coefficients;
[0205] The formula of the loss function is:
[0206]
[0207] where L w is the loss function, cA is the low-frequency subband coefficient, cH is the horizontal subband coefficient, is the low-frequency subband estimated coefficient, is the horizontal subband estimated coefficient;
[0208] Input the superimposed image into the convolutional neural network to be trained, and calculate the loss function value of the loss function;
[0209] Perform backpropagation according to the loss function value, and update the network parameters of the convolutional neural network to be trained;
[0210] Judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training and obtain the image denoising model.
[0211] In one embodiment, the above-mentioned processor denoises the image to be processed to obtain a denoised image, including:
[0212] Perform a Fourier transform on the image to be processed to obtain a frequency-domain image;
[0213] Remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image;
[0214] Perform an inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
[0215] In one embodiment, after the above-mentioned processor obtains the image denoising model, it further includes:
[0216] Obtain the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include the updated low-frequency subband coefficients and the updated horizontal subband coefficients;
[0217] Perform inverse wavelet transform on the low-frequency subband image using the updated low-frequency subband coefficients to obtain an updated low-frequency subband image;
[0218] Perform inverse wavelet transform on the horizontal subband image using the updated horizontal subband coefficients to obtain an updated horizontal subband image;
[0219] Superimpose the updated low-frequency subband image, the updated horizontal subband image, the vertical subband image, and the diagonal subband image to obtain a final denoised image.
[0220] In one embodiment, the above processor calculates the loss function value of the loss function, including:
[0221] Calculate the loss function value of the loss function under the supervision of the low-frequency subband image.
[0222] In one embodiment, the above processor obtains an image to be processed, including:
[0223] Obtain the image to be processed collected by the array camera, and the image to be processed is an 8-bit grayscale image.
[0224] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the above embodiments of the various methods. Any reference to a memory, storage, database, or other medium provided in this application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0225] It should be noted that in this text, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article or method comprising a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, apparatus, article or method. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, apparatus, article or method comprising such element.
[0226] The above are only the preferred embodiments of the present application, and do not limit the patent scope of the present application accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present application.
Claims
1. A method for training an image denoising model, characterized in that, Including: Obtain an image to be processed; Denoise the image to be processed to obtain a denoised image; Perform wavelet transform on the image to be processed to obtain a horizontal sub-band image; Superimpose the denoised image and the horizontal sub-band image to obtain a superimposed image; Use the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model; The performing wavelet transform on the image to be processed to obtain a horizontal sub-band image includes: Perform Haar discrete wavelet transform on the image to be processed to obtain a low-frequency sub-band image and a non-low-frequency sub-band image; Select the horizontal sub-band image from the non-low-frequency sub-band images, where the non-low-frequency sub-band images include the horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image; The using the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model includes: Construct a loss function of the convolutional neural network to be trained using low-frequency sub-band coefficients and horizontal sub-band coefficients; The formula of the loss function is: Among them, L w is the loss function, cA is the low-frequency subband coefficient, and cH is the horizontal subband coefficient, is the low-frequency subband estimation coefficient, is the horizontal subband estimation coefficient; Input the superimposed image into the convolutional neural network to be trained and calculate the loss function value of the loss function; Perform backpropagation according to the loss function value to update the network parameters of the convolutional neural network to be trained; Judge whether the difference between the network parameters and the preset network parameters is less than the network parameter threshold. If so, stop training to obtain the image denoising model.
2. The method for training an image denoising model according to claim 1, wherein The denoising the image to be processed to obtain a denoised image includes: Perform Fourier transform on the image to be processed to obtain a frequency-domain image; Remove the high-frequency components of the frequency-domain image to obtain a processed frequency-domain image; Perform inverse Fourier transform on the processed frequency-domain image to obtain the denoised image.
3. The method for training an image denoising model according to claim 1, wherein After obtaining the image denoising model, it further includes: Obtain the image denoising model parameters corresponding to the image denoising model; the image denoising model parameters include updated low-frequency sub-band coefficients and updated horizontal sub-band coefficients; Perform inverse wavelet transform on the low-frequency sub-band image using the updated low-frequency sub-band coefficients to obtain an updated low-frequency sub-band image; Perform inverse wavelet transform on the horizontal sub-band image using the updated horizontal sub-band coefficients to obtain an updated horizontal sub-band image; Superimpose the updated low-frequency sub-band image, the updated horizontal sub-band image, the vertical sub-band image, and the diagonal sub-band image to obtain a final denoised image.
4. The method for training an image denoising model according to claim 1, wherein The calculating the loss function value of the loss function includes: Calculate the loss function value of the loss function under the supervision of the low-frequency sub-band image.
5. The method for training an image denoising model according to claim 1, wherein The obtaining the image to be processed includes: Obtain the image to be processed collected by an array camera, where the image to be processed is an 8-bit grayscale image.
6. An image denoising model training device for performing the image denoising model training method according to any one of claims 1-5, characterized in that, Including: An image to be processed acquisition module for obtaining an image to be processed; An image denoising module for denoising the image to be processed to obtain a denoised image; A wavelet transform module for performing wavelet transform on the image to be processed to obtain a horizontal sub-band image; An image superimposing module for superimposing the denoised image and the horizontal sub-band image to obtain a superimposed image; A training module for using the superimposed image to train a convolutional neural network to be trained to obtain an image denoising model.
7. A computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that, When the processor executes the computer program, the steps of the image denoising model training method according to any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the image denoising model training method according to any one of claims 1 to 5 are implemented.
Citation Information
Patent Citations
Method for removing noise of images relevant to OCT and OCTA
CN110101362A
Strong reflection fringe noise removal method for Fourier domain optical coherence tomography
CN113935906A