Image processing method, image processing device and storage medium
The multi-scale denoising network model is used to conduct down-interval sampling training on images collected by terminal devices, which solves the problem of serious low-frequency noise in images in low-light environments, improves image quality, and improves user experience.
Patent Information
- Application Number
- CN202011282394.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-16
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2040-11-16
AI Technical Summary
When the terminal device shoots in a low-light environment, especially when shooting night scenes, the low-frequency noise in the image is serious, which is difficult to effectively process with existing technology, resulting in a decrease in image quality and affecting the user experience.
Using a multi-scale denoising network model, a multi-scale denoising network model is constructed by performing down-interval sampling training on the original image, and the image to be processed is input to remove noise and improve image quality.
Effectively removes noise from images and improves image quality, especially in low-light environments, significantly improving image clarity and user experience.
Smart Images

Figure CN112288657B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing, and in particular to an image processing method, an image processing device, and a storage medium. Background Art
[0002] With the development of terminal technology, the configuration of terminals is getting higher and higher, and the shooting function of terminals has gradually become an essential function of terminals. Users' demand for shooting with terminals has also increased day by day. Using terminals to shoot videos and images has become a part of daily life due to its convenience. People hope to shoot high-quality images through terminals.
[0003] When shooting images and videos, noise is inevitably introduced in each step of image acquisition, transmission, compression, etc. Eliminating noise in images and restoring high-definition images is a focus of widespread concern.
[0004] Due to the limitation of the terminal design, the camera aperture is small, which leads to more serious noise, especially low-frequency noise, in images taken in low-brightness environments, such as night scenes, compared with images taken at normal brightness due to the low ambient light. In current technology, low-frequency noise cannot be effectively processed, which reduces image quality and affects user experience. Summary of the invention
[0005] In order to overcome the problems existing in the related art, the present disclosure provides an image processing method, an image processing device and a storage medium.
[0006] According to a first aspect of an embodiment of the present disclosure, there is provided an image processing method, which is applied to an electronic device, wherein an image acquisition device is installed in the electronic device, and the image processing method comprises: acquiring an image to be processed including noise acquired by the image acquisition device; inputting the image to be processed into a multi-scale denoising network model to obtain a target image with noise removed; the multi-scale denoising network model is obtained by training an original image acquired by the image acquisition device and performing down-sampling on the original image.
[0007] In one embodiment, the multi-scale denoising network model is obtained based on the original image captured by the image acquisition device and the image after down-sampling the original image in the following manner: a preset number of original images are captured based on the image acquisition device, and a first training sample pair set is constructed based on the preset number of original images, wherein the first sample pair in the first training sample pair set includes a first noise image and a first noise-free image determined based on the original image; down-sampling is performed at least once on the first training sample in the first training sample pair set, and the multi-scale denoising network model is trained based on the first training sample pair set and the training sample pair set obtained after down-sampling is performed at least once.
[0008] In one embodiment, downsampling is performed at least once on the first training sample in the first training sample pair set, and the multi-scale denoising network model is trained based on the first training sample pair set and the training sample pair set after downsampling at least once, including: downsampling is performed on the first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set, the second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first downsampling multiple relative to the first training sample pair, the third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second downsampling multiple relative to the first training sample pair, and the first downsampling multiple is different from the second downsampling multiple; based on the first training sample pair set, the second training sample pair set and the third training sample pair set, the multi-scale denoising network model is trained.
[0009] In one embodiment, the multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set, including: determining a first target loss function corresponding to the first training sample pair set, a second target loss function corresponding to the second training sample pair set, and a third target loss function corresponding to the third training sample pair set; performing weighted summation on the first target loss function, the second target loss function and the third target loss function to obtain a multi-scale target loss function for training the multi-scale denoising network model, wherein the weights corresponding to the first target loss function, the second target loss function and the third target loss function are reduced in sequence; and training the multi-scale denoising network model based on the multi-scale target loss function.
[0010] In one embodiment, the multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set, including: extracting features from the first training sample pair set, the second training sample pair set and the third training sample pair set respectively to obtain a first feature, a second feature and a third feature; up-sampling the third feature by a second interval multiple and fusing it with the second feature to obtain a first fused feature, and up-sampling the second feature by a first interval multiple and fusing it with the first feature to obtain a second fused feature; fusing the first fused feature and the second fused feature to obtain a third fused feature; and training the multi-scale denoising network model based on the first feature, the first fused feature and the third fused feature.
[0011] In one embodiment, a first training sample pair set is constructed based on the preset number of original images, including: selecting an original image with the highest clarity from the preset number of original images acquired by the image acquisition device as a reference image; performing alignment and fusion based on the reference image to obtain a noise-free image corresponding to the original image; and using the reference image and the noise-free image as a first training sample pair to construct a first training sample pair set.
[0012] In one embodiment, the collecting a preset number of original images based on the image collection device includes: collecting a preset number of original images for the same scene target based on the image collection device.
[0013] According to a second aspect of an embodiment of the present disclosure, there is provided an image processing device, which is applied to an electronic device, wherein an image acquisition device is installed in the electronic device, and the image processing device comprises: an acquisition module, which is used to acquire an image to be processed including noise acquired by the image acquisition device; an image processing module, which is used to input the image to be processed into a multi-scale denoising network model to obtain a target image with noise removed; the multi-scale denoising network model is obtained based on an original image acquired by the image acquisition device and image training after down-sampling of the original image.
[0014] In one embodiment, the multi-scale denoising network model is obtained based on the original image captured by the image acquisition device and the image after down-sampling the original image in the following manner: a preset number of original images are captured based on the image acquisition device, and a first training sample pair set is constructed based on the preset number of original images, wherein the first sample pair in the first training sample pair set includes a first noise image and a first noise-free image determined based on the original image; down-sampling is performed at least once on the first training sample in the first training sample pair set, and the multi-scale denoising network model is trained based on the first training sample pair set and the training sample pair set obtained after down-sampling is performed at least once.
[0015] In one embodiment, the multi-scale denoising network model adopts the following method to perform at least one down-sampling on the first training sample in the first training sample pair set, and trains based on the first training sample pair set and the training sample pair set after at least one down-sampling: down-sampling is performed on the first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set, the second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first down-sampling multiple relative to the first training sample pair, the third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second down-sampling multiple relative to the first training sample pair, and the first down-sampling multiple is different from the second down-sampling multiple; based on the first training sample pair set, the second training sample pair set and the third training sample pair set, the multi-scale denoising network model is trained.
[0016] In one embodiment, the multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set in the following manner: determining a first target loss function corresponding to the first training sample pair set, a second target loss function corresponding to the second training sample pair set, and a third target loss function corresponding to the third training sample pair set; performing weighted summation on the first target loss function, the second target loss function and the third target loss function to obtain a multi-scale target loss function for training the multi-scale denoising network model, wherein the weights corresponding to the first target loss function, the second target loss function and the third target loss function are reduced in sequence; and training the multi-scale denoising network model based on the multi-scale target loss function.
[0017] In one embodiment, the multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set in the following manner: feature extraction is performed on the first training sample pair set, the second training sample pair set and the third training sample pair set respectively to obtain a first feature, a second feature and a third feature; the third feature is upsampled by a second interval multiple and then feature fused with the second feature to obtain a first fused feature, and the second feature is upsampled by a first interval multiple and then feature fused with the first feature to obtain a second fused feature; the first fused feature and the second fused feature are feature fused to obtain a third fused feature; based on the first feature, the first fused feature and the third fused feature, the multi-scale denoising network model is trained.
[0018] In one embodiment, the multi-scale denoising network model constructs a first set of training sample pairs based on the preset number of original images in the following manner: selecting an original image with the highest clarity from the preset number of original images acquired by the image acquisition device as a reference image; performing alignment and fusion based on the reference image to obtain a noise-free image corresponding to the original image; and using the reference image and the noise-free image as a first training sample pair to construct a first set of training sample pairs.
[0019] In one embodiment, the multi-scale denoising network model collects a preset number of original images based on the image acquisition device in the following manner: the image acquisition device collects a preset number of original images for the same scene target.
[0020] According to a third aspect of an embodiment of the present disclosure, a function control device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: execute any one of the aforementioned image processing methods.
[0021] According to a fourth aspect of an embodiment of the present disclosure, a non-temporary computer-readable storage medium is provided. When instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to execute any one of the aforementioned image processing methods.
[0022] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: a multi-scale denoising network model is obtained based on an original image including noise acquired by an image acquisition device, and image training is performed on the original image after down-sampling, and the image to be processed is input into the multi-scale denoising network model to obtain a target image with noise removed, thereby effectively removing the noise included in the image acquired by the image acquisition device and improving the image quality.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0025] Figure 1 The figure is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure.
[0026] Figure 2 It is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0027] Figure 3 It is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0028] Figure 4 It is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0029] Figure 5 It is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0030] Figure 6 It is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0031] Figure 7 It is a schematic diagram of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure.
[0032] Figure 8 is a block diagram of an image processing device according to an exemplary embodiment of the present disclosure.
[0033] Fig. 9 The invention is a block diagram of an image processing apparatus according to an exemplary embodiment. DETAILED DESCRIPTION
[0034] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0035] The shooting function of the terminal has become a must-have function. As users' demand for shooting with the terminal increases, the configuration of the terminal is getting higher and higher. Using the terminal to shoot videos and images has become a part of daily life due to its convenience. People hope to shoot high-quality images through the terminal.
[0036] When shooting images and videos, noise is inevitably introduced in each step of image acquisition, transmission, compression, etc. Eliminating noise in images and restoring high-definition images is a focus of widespread concern.
[0037] Due to the limitation of the terminal design, the camera aperture is small, which leads to more serious noise, especially low-frequency noise, in images taken in low-brightness environments, such as night scenes, compared with images taken at normal brightness due to the low ambient light. In current technology, low-frequency noise cannot be effectively processed, which reduces image quality and affects user experience.
[0038] Therefore, the present disclosure provides an image processing method, which obtains a multi-scale denoising network model based on an original image including noise acquired by an image acquisition device and image training after down-sampling of the original image, inputs the image to be processed into the multi-scale denoising network model, obtains a target image with noise removed, effectively removes the noise included in the image acquired by the image acquisition device, and improves the image quality.
[0039] Figure 1 is a flowchart of an image processing method according to an exemplary embodiment of the present disclosure. Figure 1 As shown, the image processing method is used in an electronic device, and an image acquisition device is installed in the electronic device. The image processing method includes the following steps.
[0040] In step S101, an image to be processed including noise acquired by an image acquisition device is acquired.
[0041] In step S102, the image to be processed is input into a multi-scale denoising network model to obtain a target image with noise removed. The multi-scale denoising network model is obtained by training the original image acquired by the image acquisition device and performing down-sampling on the original image.
[0042] Image acquisition devices in electronic devices such as digital cameras and mobile phones adjust the photosensitivity of the image acquisition devices according to the different intensities of the light source. In order to ensure image quality, when the shutter time is fixed and the aperture size is fixed, the information is amplified by adjusting the signal magnification. Signal amplification increases the dark current of the circuit, causing the captured image to produce mottled spots, that is, image noise. At the same time, the noise in the signal is amplified, producing coarse particle shadows. The high-frequency part is the part with the fastest changing grayscale value of the pixel in the image, and the low-frequency part is the part with the slowest changing grayscale value. In dark shooting scenes such as night scenes, electronic devices amplify the signal to increase the image brightness, further exacerbating the color noise of the image, especially the low-frequency color noise.
[0043] In the embodiment of the present disclosure, the original image captured by the image capture device can be understood as an unprocessed image, and can usually be understood as an original image including noise.
[0044] Downsampling the original image can obtain an image with a smaller scale than the original image, which is used to realize sampling of different granularities of the signal, so as to extract different features at different scales and obtain more powerful feature expression. Based on the original image including noise collected by the image acquisition device and the image obtained by downsampling the original image, the denoising network model is trained, and the obtained network model is multi-scale. The multi-scale network model is used for image denoising, and the network model has high accuracy and good denoising effect.
[0045] According to an embodiment of the present disclosure, a multi-scale denoising network model is obtained by performing image training based on an original image including noise acquired by an image acquisition device and performing image training after down-sampling of the original image. The image to be processed is input into the multi-scale denoising network model to obtain a target image with noise removed, thereby effectively removing the noise included in the image acquired by the image acquisition device and improving the image quality.
[0046] Figure 2 is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 2 As shown, the multi-scale denoising network model training method includes the following steps.
[0047] In step S201, a preset number of original images are collected by an image acquisition device, and a first training sample pair set is constructed based on the preset number of original images. The first sample pair in the first training sample pair set includes a first noisy image determined based on the original image and a first noise-free image.
[0048] In step S202, downsampling is performed on the first training sample in the first training sample pair set at least once, and a multi-scale denoising network model is trained based on the first training sample pair set and the training sample pair set obtained after downsampling is performed at least once.
[0049] In the embodiment of the present disclosure, based on the image acquisition device collecting a preset number of original images, the original images can be images collected by the image acquisition device for different scenes and fixed scene targets, including noise, and the preset number can be pre-set according to the requirements of image processing. Based on the first noise image determined by the original image, and the first noise-free image corresponding to the first noise image, the first noise image and the corresponding first noise-free image constitute a first sample pair, and multiple first sample pairs constitute a first training sample pair set. It can be understood that the number of first sample pairs in the first training sample pair set is less than the preset number of original images.
[0050] The first training sample in the first training sample pair set is downsampled to obtain a training sample of a smaller scale relative to the first training sample, thereby sampling the signal at different granularities to extract image features at different scales. In the disclosed embodiment, the first training sample in the first training sample pair set is downsampled at least once, and at least one set of downsampled training sample pairs is obtained. It can be understood that the first noisy image and the first noise-free image in the first training sample pair set are downsampled respectively to obtain at least one set of downsampled training sample pairs.
[0051] Based on the first training sample pair set and the training sample pair set after at least one down-interval sampling, a multi-scale denoising network model is trained. The denoising network model is trained, and the training effect of the multi-scale denoising network model is good, which provides a good model foundation for image denoising processing using the multi-scale network model.
[0052] According to an embodiment of the present disclosure, a multi-scale denoising network model is obtained by performing image training based on an original image including noise acquired by an image acquisition device and performing image training after down-sampling of the original image. The image to be processed is input into the multi-scale denoising network model to obtain a target image with noise removed, thereby effectively removing the noise included in the image acquired by the image acquisition device and improving the image quality.
[0053] Figure 3 is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 3 As shown, the multi-scale denoising network model training method includes the following steps.
[0054] In step S301, down-sampling is performed on the first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set.
[0055] The second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first down-sampling multiple relative to the first training sample pair. The third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second down-sampling multiple relative to the first training sample pair. The first down-sampling multiple is different from the second down-sampling multiple.
[0056] In step S302, a multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set.
[0057] In the embodiment of the present disclosure, the first training sample in the first training sample pair set is downsampled to obtain training samples of a smaller scale than the first training sample, namely, the second training sample pair set and the third training sample pair set, so as to achieve sampling of different granularities of the signal and extract image features of different scales.
[0058] In one embodiment, in the disclosed embodiment, a first training sample pair in a first training sample pair set is down-sampled at a first down-sampling multiple to obtain a second training sample pair set, and a second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image.
[0059] In the embodiment of the present disclosure, the third training sample pair set may be obtained by performing down-sampling on the first training sample pair set, or may be obtained by performing down-sampling on the second training sample pair set.
[0060] In one embodiment of the present disclosure, a first training sample pair in the first training sample pair set is downsampled at a second downsampling multiple to obtain a third training sample pair set. A third training sample pair in the third training sample pair set includes a third noise image and a third noise-free image, and the second downsampling multiple is different from the first downsampling multiple, for example, the second downsampling multiple is greater than the first downsampling multiple.
[0061] In one embodiment of the present disclosure, the second training sample pair in the second training sample pair set may be downsampled at a third downsampling multiple to obtain a third training sample pair set. The third training sample pair in the third training sample pair set includes a third noise image and a third noise-free image. The third downsampling multiple is the same as or different from the first downsampling multiple.
[0062] In one example, for example, the first training sample pair in the first training sample pair set is downsampled by 2 times the interval, that is, the first training sample is sampled at intervals of two pixels to obtain the second training sample pair set. When the image of the first training sample, that is, the pixel value of the original image is a large-scale image of 512×512, the second training sample pair is a medium-scale image relative to the first training sample pair, and the image pixel value of the second training sample is 256×256.
[0063] The method for obtaining the third training sample pair set may be to downsample the first training sample pair in the first training sample pair set by 4 times the interval, that is, to sample the first training sample at an interval of four pixels to obtain the third training sample pair set. When the image of the first training sample, that is, the original image, has a large-scale image with a pixel value of 512×512, the third training sample pair is a small-scale image relative to the first training sample pair, and the image pixel value of the third training sample is 128×128. The method for obtaining the third training sample pair set may also be to downsample the second training sample pair in the second training sample pair set by 2 times the interval, that is, to sample the second training sample at an interval of two pixels to obtain the third training sample pair set.
[0064] According to an embodiment of the present disclosure, based on a first set of large-scale, medium-scale and small-scale training sample pairs, a second set of training sample pairs and a third set of training sample pairs, a multi-scale denoising network model is trained to obtain a multi-scale denoising network model, and an image to be processed is input into the multi-scale denoising network model to obtain a target image with noise removed, thereby effectively removing the noise included in the image captured by the image acquisition device and improving the image quality.
[0065] Figure 4 is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 4 As shown, the multi-scale denoising network model training method includes the following steps.
[0066] In step S401, a first target loss function corresponding to the first training sample pair set, a second target loss function corresponding to the second training sample pair set, and a third target loss function corresponding to the third training sample pair set are determined.
[0067] In step S402, the first objective loss function, the second objective loss function and the third objective loss function are weightedly summed to obtain a multi-scale objective loss function for training a multi-scale denoising network model, wherein the weights corresponding to the first objective loss function, the second objective loss function and the third objective loss function are reduced in sequence.
[0068] In step S403, a multi-scale denoising network model is trained based on the multi-scale target loss function.
[0069] In the disclosed embodiment, the flat area in a single image often accounts for a large proportion, and there are relatively few areas rich in structural pixels such as edges, contours, and textures, that is, there is less high-frequency information in the image and relatively more low-frequency information. In the later stage of training the multi-scale denoising network model, the loss function will fluctuate around the stable value, and it is difficult to continue to converge to achieve higher accuracy, which is not conducive to further learning of structural pixels that occupy a small proportion, and it is difficult to fully learn the recovery of high-frequency details. Since low-frequency information accounts for a large proportion in small-scale images, when determining the multi-scale target loss function, the weight of the small-scale image can be taken as a weight smaller than that of the large-scale image. The first target loss function, the second target loss function, and the third target loss function are weighted and summed to obtain the multi-scale target loss function for training the multi-scale denoising network model, and the weights corresponding to the first target loss function, the second target loss function, and the third target loss function are reduced in sequence.
[0070] When determining the multi-scale target loss function, the following formula can be used, namely:
[0071] Loss=a×Loss1+b×Loss2+c×Loss3
[0072] Among them, Loss1, Loss2 and Loss3 represent the first target loss function, the second target loss function and the third target loss function of the three scale images of large-scale image, medium-scale image and low-scale image respectively, and a, b and c correspond to the weights of large-scale image, medium-scale image and low-scale image respectively. The weights corresponding to the first target loss function, the second target loss function and the third target loss function decrease in turn, that is, a>b>c, a, b and c take values between 0 and 1, so that the weight of the large-scale image, that is, the original image, takes a large value. For example, it can be a=1, b=0.7, c=0.4.
[0073] According to an embodiment of the present disclosure, a weighted sum is performed on the first target loss function corresponding to the large-scale image, the second target loss function corresponding to the medium-scale image, and the third target loss function corresponding to the small-scale image to obtain a multi-scale target loss function for training a multi-scale denoising network model. The weights corresponding to the first target loss function, the second target loss function, and the third target loss function are reduced in sequence, so that the model trained using the multi-scale target loss function can avoid the smoothness of the processing result caused by the elimination of high-frequency details in the image during image processing, thereby improving the quality of image processing.
[0074] Figure 5 is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 5As shown, the multi-scale denoising network model training method includes the following steps.
[0075] In step S501, feature extraction is performed on the first training sample pair set, the second training sample pair set and the third training sample pair set respectively to obtain a first feature, a second feature and a third feature.
[0076] In step S502, the third feature is upsampled at the second interval multiple and then fused with the second feature to obtain a first fused feature, and the second feature is upsampled at the first interval multiple and then fused with the first feature to obtain a second fused feature.
[0077] In step S503, the first fusion feature and the second fusion feature are fused to obtain a third fusion feature.
[0078] In step S504, a multi-scale denoising network model is trained based on the first feature, the first fused feature and the third fused feature.
[0079] In the disclosed embodiment, feature extraction is performed on the first training sample pair set, the second training sample pair set, and the third training sample pair set, respectively, to obtain the first feature, the second feature, and the third feature. The first training sample pair set corresponds to the original image, that is, the large-scale image, the second training sample pair set corresponds to the medium-scale image, and the third training sample pair set corresponds to the medium-scale image. That is, the first feature corresponds to the original image feature, the second feature corresponds to the medium-scale image feature, and the third feature corresponds to the small-scale image feature.
[0080] After the small-scale image features are upsampled at the second interval multiple, they are fused with the medium-scale image features to obtain the first fused features, and after the medium-scale image features are upsampled at the first interval multiple, they are fused with the large-scale image features to obtain the second fused features. The first fused features and the second fused features are fused to obtain the third fused features. Based on the original image features, the first fused features and the third fused features, a multi-scale denoising network model is trained.
[0081] When performing feature fusion, for example, the three feature maps of different scales can be connected through feature channels to obtain a multi-channel feature block, which is then passed through multiple residual blocks and upsampled by deconvolution. Features of different scales are connected to features of corresponding sizes to achieve feature fusion of images of different scales. It can be understood that other feature fusion methods in image processing technology can also be used, and the present disclosure does not limit the method of multi-scale feature fusion.
[0082] According to the embodiments of the present disclosure, feature extraction is performed on the first training sample pair set, the second training sample pair set and the third training sample pair set, and a multi-scale denoising network model is trained based on the first feature, the first fusion feature and the third fusion feature, so that the information of the multi-scale denoising network model is richer, and the accuracy of the model is further improved, thereby improving the quality of image processing.
[0083] In the disclosed embodiment, the training of the multi-scale denoising network model may be performed by using a stochastic gradient descent method, such as the Adam optimization algorithm, to adaptively adjust the learning rate for different parameters. For example, the initial learning rate of the multi-scale denoising network model is set to 0.0001, and the learning rate is decayed by 0.7 for every 10,000 iterations during training. The image size is set to 512×512, and each batch is set to 4.
[0084] Figure 6 is a flowchart of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 6 As shown, the multi-scale denoising network model training method includes the following steps.
[0085] In step S601, an original image with the highest definition is selected as a reference image from a preset number of original images collected by an image collection device.
[0086] In step S602, alignment and fusion are performed based on the reference image to obtain a noise-free image corresponding to the original image.
[0087] In step S603, the reference image and the noise-free image are used as a first training sample pair to construct a first training sample pair set.
[0088] In the embodiment of the present disclosure, the original image with the highest definition is selected as the reference image from the preset number of original images collected by the image acquisition device. The original image with the highest definition can be determined by an image recognition algorithm or manual selection. Alignment and fusion are performed based on the reference image, and the correspondence between pixels in different frames is obtained by alignment and fusion, and the corresponding pixels are weighted averaged to obtain a noise-free image corresponding to the original image, and the noise-free image is used as (GroundTruth, GT). The reference image and the corresponding noise-free image are used as the first training sample pair, and multiple first training sample pairs constitute a first training sample pair set.
[0089] According to an embodiment of the present disclosure, an original image with the highest clarity among the original images captured by an image acquisition device is selected as a reference image, a noise-free image is obtained based on the reference image, a first training sample pair is formed, a first training sample pair set is constructed, and a denoising network model is trained using more accurate image data, so that the trained model is suitable for processing noisy images, thereby improving the quality of image processing.
[0090] In one embodiment, the image acquisition device acquires a preset number of original images for the same scene target.
[0091] In the embodiments of the present disclosure, the electronic device may be fixed to determine the consistency of image shooting conditions, and a preset number of original images may be collected for the same scene target. For example, for the same scene, the scene target may be fixed and a preset number of original images may be continuously shot.
[0092] According to an embodiment of the present disclosure, an image acquisition device collects a preset number of original images of the same scene target, that is, real noise data is used to train a denoising network model, so that the model training effect is better and support is provided for image processing.
[0093] Figure 7 is a schematic diagram of a multi-scale denoising network model training method according to an exemplary embodiment of the present disclosure. Figure 7 , the process of image processing of three scale images is illustrated from top to bottom. That is, the large-scale image, the medium-scale image and the small-scale image are subjected to multi-layer convolution respectively, and the first training sample pair set, the second training sample pair set and the third training sample pair set are respectively extracted to obtain the first feature, the second feature and the third feature. The third feature of the small-scale image is upsampled by the second interval multiple and then fused with the second feature of the medium-scale image to obtain the first fused feature, and the second feature of the medium-scale image is upsampled by the first interval multiple and then fused with the first feature of the large-scale image to obtain the second fused feature. The first fused feature and the second fused feature are fused to obtain the third fused feature. Based on the first feature, the first fused feature and the third fused feature, a multi-scale denoising network model is trained, and the multi-scale denoising network model is used to perform image denoising processing to improve the accuracy of the model, thereby improving the quality of image processing.
[0094] Based on the same concept, an embodiment of the present disclosure also provides an image processing device.
[0095] It is understandable that in order to realize the above functions, the image processing device provided by the embodiment of the present disclosure includes hardware structures and / or software modules corresponding to the execution of each function. In combination with the units and algorithm steps of each example disclosed in the embodiment of the present disclosure, the embodiment of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the technical solution of the embodiment of the present disclosure.
[0096] Figure 8 is a block diagram of an image processing device according to an exemplary embodiment of the present disclosure. Figure 8 The image processing device 100 is applied to an electronic device in which an image acquisition device is installed. The image processing device 100 includes an acquisition module 101 and an image processing module 102.
[0097] The acquisition module 101 is used to acquire the image to be processed including noise acquired by the image acquisition device.
[0098] The image processing module 102 is used to input the image to be processed into a multi-scale denoising network model to obtain a target image with noise removed. The multi-scale denoising network model is obtained based on the original image collected by the image acquisition device and the image training after the original image is down-sampled.
[0099] In one embodiment, a multi-scale denoising network model is obtained based on an original image captured by an image acquisition device and an image after downsampling the original image in the following manner: a preset number of original images are captured by the image acquisition device, and a first training sample pair set is constructed based on the preset number of original images, wherein a first sample pair in the first training sample pair set includes a first noise image determined based on the original image and a first noise-free image; downsampling is performed at least once on a first training sample in the first training sample pair set, and based on the first training sample pair set and the training sample pair set obtained after downsampling is performed at least once, a multi-scale denoising network model is trained.
[0100] In one embodiment, a multi-scale denoising network model performs at least one down-sampling on a first training sample in a first training sample pair set in the following manner, and is trained based on the first training sample pair set and the training sample pair set after at least one down-sampling: down-sampling is performed on a first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set, the second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first down-sampling multiple relative to the first training sample pair, the third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second down-sampling multiple relative to the first training sample pair, and the first down-sampling multiple is different from the second down-sampling multiple; based on the first training sample pair set, the second training sample pair set and the third training sample pair set, the multi-scale denoising network model is trained.
[0101] In one embodiment, a multi-scale denoising network model is trained based on a first training sample pair set, a second training sample pair set, and a third training sample pair set in the following manner: determining a first target loss function corresponding to the first training sample pair set, a second target loss function corresponding to the second training sample pair set, and a third target loss function corresponding to the third training sample pair set; performing weighted summation on the first target loss function, the second target loss function, and the third target loss function to obtain a multi-scale target loss function for training the multi-scale denoising network model, wherein the weights corresponding to the first target loss function, the second target loss function, and the third target loss function are respectively reduced in sequence; and training the multi-scale denoising network model based on the multi-scale target loss function.
[0102] In one embodiment, a multi-scale denoising network model is trained based on a first training sample pair set, a second training sample pair set, and a third training sample pair set in the following manner: feature extraction is performed on the first training sample pair set, the second training sample pair set, and the third training sample pair set, respectively, to obtain a first feature, a second feature, and a third feature; the third feature is upsampled by a second interval multiple and then feature fused with the second feature to obtain a first fused feature, and the second feature is upsampled by a first interval multiple and then feature fused with the first feature to obtain a second fused feature; the first fused feature and the second fused feature are feature fused to obtain a third fused feature; based on the first feature, the first fused feature, and the third fused feature, a multi-scale denoising network model is trained.
[0103] In one embodiment, a multi-scale denoising network model constructs a first set of training sample pairs based on a preset number of original images in the following manner: selecting an original image with the highest clarity from a preset number of original images acquired by an image acquisition device as a reference image; performing alignment and fusion based on the reference image to obtain a noise-free image corresponding to the original image; and using the reference image and the noise-free image as a first training sample pair to construct a first set of training sample pairs.
[0104] In one embodiment, the multi-scale denoising network model collects a preset number of original images based on an image acquisition device in the following manner: the image acquisition device collects a preset number of original images for the same scene target.
[0105] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0106] Fig. 9 8 is a block diagram of an apparatus 800 for image processing according to an exemplary embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0107] Reference Fig. 9 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0108] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0109] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0110] The power component 806 provides power to the various components of the device 800. The power component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0111] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0112] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0113] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0114] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800 and the temperature change of the device 800. The sensor assembly 814 can include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 can also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 can also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor or a temperature sensor.
[0115] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0116] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.
[0117] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0118] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.
[0119] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.
[0120] It can be further understood that, unless otherwise specified, “connection” includes a direct connection without other components between the two, and also includes an indirect connection with other components between the two.
[0121] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0122] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0123] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. An image processing method, It is characterized in that Applied to electronic equipment, the electronic equipment is equipped with an image acquisition device, and the image processing method includes: Acquire the image to be processed including noise acquired by the image acquisition device; Inputting the image to be processed into a multi-scale denoising network model to obtain a target image with denoised noise; The multi-scale denoising network model is obtained by training the original image acquired by the image acquisition device and performing down-sampling on the original image; The multi-scale denoising network model is obtained based on the original image acquired by the image acquisition device and the image obtained by downsampling the original image in the following manner: Based on the image acquisition device, a preset number of original images are collected, and a first training sample pair set is constructed based on the preset number of original images, wherein a first sample pair in the first training sample pair set includes a first noise image and a first noise-free image determined based on the original images; Performing down-sampling on the first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set, The second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first downsampling multiple relative to the first training sample pair. The third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second lower interval sampling multiple relative to the first training sample pair. The first down-interval sampling multiple is different from the second down-interval sampling multiple; Based on the first training sample pair set, the second training sample pair set and the third training sample pair set, training to obtain the multi-scale denoising network model; Extracting features from the first training sample pair set, the second training sample pair set, and the third training sample pair set respectively to obtain a first feature, a second feature, and a third feature; The third feature is upsampled by a second interval multiple and then merged with the second feature to obtain a first fused feature, and the second feature is upsampled by a first interval multiple and then merged with the first feature to obtain a second fused feature; Fusing the first fused feature and the second fused feature to obtain a third fused feature; The multi-scale denoising network model is trained based on the first feature, the first fusion feature and the third fusion feature.
2. The image processing method according to claim 1, It is characterized in that The multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set, including: Determine a first objective loss function corresponding to the first training sample pair set, a second objective loss function corresponding to the second training sample pair set, and a third objective loss function corresponding to the third training sample pair set; Performing weighted summation on the first objective loss function, the second objective loss function, and the third objective loss function to obtain a multi-scale objective loss function for training the multi-scale denoising network model, wherein the weights corresponding to the first objective loss function, the second objective loss function, and the third objective loss function are decreased in sequence; The multi-scale denoising network model is trained based on the multi-scale target loss function.
3. The image processing method according to claim 1, It is characterized in that Constructing a first training sample pair set based on the preset number of original images includes: Selecting an original image with the highest definition from a preset number of original images collected by the image collection device as a reference image; Performing alignment and fusion based on the reference image to obtain a noise-free image corresponding to the original image; The reference image and the noise-free image are used as a first training sample pair to construct a first training sample pair set.
4. The image processing method according to claim 3, It is characterized in that The collecting of a preset number of original images based on the image collection device comprises: Based on the image acquisition device, a preset number of original images are acquired for the same scene target.
5. An image processing device, It is characterized in that Applied to electronic equipment, the electronic equipment is equipped with an image acquisition device, and the image processing device includes: An acquisition module, used for acquiring the image to be processed including noise acquired by the image acquisition device; An image processing module is used to input the image to be processed into a multi-scale denoising network model to obtain a target image with noise removed; The multi-scale denoising network model is obtained by training the original image acquired by the image acquisition device and performing down-sampling on the original image; The multi-scale denoising network model is obtained based on the original image acquired by the image acquisition device and the image obtained by downsampling the original image in the following manner: Based on the image acquisition device, a preset number of original images are collected, and a first training sample pair set is constructed based on the preset number of original images, wherein a first sample pair in the first training sample pair set includes a first noise image and a first noise-free image determined based on the original images; Performing down-sampling on the first training sample pair in the first training sample pair set to obtain a second training sample pair set and a third training sample pair set, The second training sample pair in the second training sample pair set includes a second noisy image and a second noise-free image, and has a first downsampling multiple relative to the first training sample pair. The third training sample pair in the third training sample pair set includes a third noisy image and a third noise-free image, and has a second lower interval sampling multiple relative to the first training sample pair. The first down-interval sampling multiple is different from the second down-interval sampling multiple; Based on the first training sample pair set, the second training sample pair set and the third training sample pair set, training to obtain the multi-scale denoising network model; Extracting features from the first training sample pair set, the second training sample pair set, and the third training sample pair set respectively to obtain a first feature, a second feature, and a third feature; The third feature is upsampled by a second interval multiple and then merged with the second feature to obtain a first fused feature, and the second feature is upsampled by a first interval multiple and then merged with the first feature to obtain a second fused feature; Fusing the first fused feature and the second fused feature to obtain a third fused feature; The multi-scale denoising network model is trained based on the first feature, the first fusion feature and the third fusion feature.
6. The image processing device according to claim 5, It is characterized in that The multi-scale denoising network model is trained based on the first training sample pair set, the second training sample pair set and the third training sample pair set in the following manner: Determine a first objective loss function corresponding to the first training sample pair set, a second objective loss function corresponding to the second training sample pair set, and a third objective loss function corresponding to the third training sample pair set; Performing weighted summation on the first objective loss function, the second objective loss function, and the third objective loss function to obtain a multi-scale objective loss function for training the multi-scale denoising network model, wherein the weights corresponding to the first objective loss function, the second objective loss function, and the third objective loss function are decreased in sequence; The multi-scale denoising network model is trained based on the multi-scale target loss function.
7. The image processing device according to claim 5, It is characterized in that The multi-scale denoising network model constructs a first training sample pair set based on the preset number of original images in the following manner: Selecting an original image with the highest definition from a preset number of original images collected by the image collection device as a reference image; Performing alignment and fusion based on the reference image to obtain a noise-free image corresponding to the original image; The reference image and the noise-free image are used as a first training sample pair to construct a first training sample pair set.
8. The image processing device according to claim 7, It is characterized in that The multi-scale denoising network model collects a preset number of original images based on the image acquisition device in the following manner: Based on the image acquisition device, a preset number of original images are acquired for the same scene target.
9. An image processing device, It is characterized in that include: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to: execute the image processing method described in any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium, when instructions in the storage medium are executed by a processor of a mobile terminal, the mobile terminal is enabled to execute the image processing method according to any one of claims 1 to 4.
