Image noise level estimation method, device, electronic device and storage medium

By extracting multi-dimensional features of the image and using a binary classification network to estimate the noise level, the problem of inaccurate noise estimation and low universality in the existing technology is solved, and accurate noise level assessment under different lighting conditions is achieved.

CN113658118BActive Publication Date: 2024-08-27VIVO MOBILE COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110880750.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-02
Publication Date
2024-08-27
Estimated Expiration
2041-08-02

AI Technical Summary

Technical Problem

Existing image noise level estimation methods are not accurate enough under abnormal lighting conditions, have low universality, and are difficult to adapt to different types of noise distribution.

Method used

By extracting feature information from the image, a multi-dimensional feature extraction model (such as a branch network of Bayer images and RGB images) is used to generate feature information, and a binary classification network is used to determine the estimated values ​​of noise and noise-free, calculate the difference and map it to the predetermined value. Set the noise level value within the interval.

Benefits of technology

It achieves accurate estimation of image noise level under any lighting conditions, improves the accuracy and universality of noise level estimation, and avoids reliance on assumptions about noise distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113658118B
    Figure CN113658118B
Patent Text Reader

Abstract

The present application discloses a method, device, electronic device and storage medium for estimating the degree of image noise, which belongs to the field of artificial intelligence. The method for estimating the degree of image noise includes: acquiring a first image; extracting feature information corresponding to the first image from the first image; determining a first estimated value and a second estimated value corresponding to the first image according to the feature information; wherein the first estimated value is an estimated value indicating that the first image belongs to a noisy image, and the second estimated value is an estimated value indicating that the first image belongs to a noise-free image; calculating the difference between the first estimated value and the second estimated value; mapping the difference to a target value within a preset continuous interval, and using the target value as the estimated value of the degree of noise of the first image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of artificial intelligence, and specifically relates to a method, device, electronic device and storage medium for estimating the degree of image noise. Background Art

[0002] With the continuous development of image processing technology, people's requirements for image quality are getting higher and higher. Since electronic devices generate a lot of heat during the photo shooting process, this heat is evenly distributed on the CMOS crystal unit of the electronic device, forming mottled spots, that is, image noise. Therefore, it is often necessary to perform noise reduction processing on the images taken by the electronic device. In the process of image noise reduction, if the degree of noise reduction is too light, the noise removal will not be clean, and if the degree of noise reduction is too heavy, the image will become blurred. Therefore, it is usually necessary to estimate the noise level of the image, so as to provide a reference for the degree of image noise reduction required in the subsequent image noise reduction process.

[0003] Existing methods for estimating image noise levels mainly assume that the noise obeys a certain statistical distribution under normal lighting conditions, and then measure the noise level of the image by estimating the parameter value of the distribution.

[0004] Thus, since the existing technology is mainly aimed at estimating the image noise level under normal lighting conditions, the noise contained in images taken under other lighting conditions is often estimated inaccurately. In addition, it also needs to rely on strong assumptions, such as assuming that image noise obeys a certain noise distribution, but the types of noise in reality vary greatly, and it is difficult to use a single specific distribution to model all noise. Therefore, the estimation of the image noise level is often not accurate enough and has low universality. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a method, device, electronic device and storage medium for estimating the image noise level, which can solve the problem that the existing estimation of the image noise level is not accurate enough and has low universality.

[0006] In a first aspect, an embodiment of the present application provides a method for estimating image noise level, the method comprising:

[0007] acquiring a first image;

[0008] extracting feature information corresponding to the first image from the first image;

[0009] Determine, according to the feature information, a first estimated value and a second estimated value corresponding to the first image; wherein the first estimated value is an estimated value indicating that the first image is a noisy image, and the second estimated value is an estimated value indicating that the first image is a noise-free image;

[0010] calculating a difference between the first estimate and the second estimate;

[0011] The difference is mapped to a target value within a preset continuous interval, and the target value is used as an estimated value of the noise level of the first image.

[0012] In a second aspect, an embodiment of the present application provides an image noise level estimation device, the device comprising:

[0013] A first acquisition module, used to acquire a first image;

[0014] A feature extraction module, used to extract feature information corresponding to the first image from the first image;

[0015] An image estimation module, configured to determine a first estimation value and a second estimation value corresponding to the first image according to the feature information; wherein the first estimation value is an estimation value indicating that the first image is a noisy image, and the second estimation value is an estimation value indicating that the first image is a noise-free image;

[0016] A difference calculation module, used for calculating the difference between the first estimated value and the second estimated value;

[0017] The difference mapping module is used to map the difference to a target value within a preset continuous interval, and use the target value as a noise level estimation value of the first image.

[0018] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0019] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0020] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0021] In an embodiment of the present application, feature information corresponding to the first image is extracted from the acquired first image, a first estimated value that the first image is a noisy image and a second estimated value that the first image is a noise-free image are determined based on the feature information, and then the difference between the first estimated value and the second estimated value is mapped to a target value within a preset continuous interval, and the target value is used as an estimated value of the noise level of the first image. Thus, without assuming whether the first image obeys a certain noise distribution, an estimation of the noise level of the first image can be achieved. In addition, the embodiment of the present application can estimate the noise level of the first image taken under any lighting conditions, thereby improving the accuracy and universality of the image noise level estimation. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is one of the flow charts of a method for estimating image noise level according to an exemplary embodiment;

[0023] Figure 2 is a schematic diagram of a GRBG pixel array according to an exemplary embodiment;

[0024] Figure 3 is a schematic diagram of a Sigmoid activation function curve according to an exemplary embodiment;

[0025] Figure 4 is a schematic diagram of a noise level estimation model structure according to an exemplary embodiment;

[0026] Figure 5 is a second flowchart of a method for estimating image noise level according to an exemplary embodiment;

[0027] Figure 6a is an example diagram of a dark light image according to an exemplary embodiment;

[0028] Figure 6b is an example diagram of a Bayer image according to an exemplary embodiment;

[0029] Figure 6c is an example diagram of an image to which Poisson noise is added according to an exemplary embodiment;

[0030] Figure 6d is an example diagram of an image to which Poisson noise and Gaussian noise are added according to an exemplary embodiment;

[0031] Figure 6e is an example diagram of an RGB image according to an exemplary embodiment;

[0032] Figure 6f is an example diagram of a noisy dark-light image after bilateral filtering according to an exemplary embodiment;

[0033] Figure 7 is a structural block diagram of a device for estimating image noise level according to an exemplary embodiment;

[0034] Figure 8 is a structural block diagram of an electronic device according to an exemplary embodiment;

[0035] Fig. 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0037] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0038] The following, in conjunction with the accompanying drawings, describes in detail the image noise level estimation method, device, electronic device and storage medium provided by the embodiments of the present application through specific embodiments and their application scenarios.

[0039] The image noise level estimation method provided in the present application can be applied to the scenario of estimating the noise level of an image. In addition, the image noise level estimation method provided in the embodiment of the present application can be executed by an image noise level estimation device, or a control module in the image noise level estimation device for executing the image noise level estimation method. In the embodiment of the present application, the image noise level estimation method provided in the embodiment of the present application is illustrated by taking the image noise level estimation device executing the image noise level estimation method as an example.

[0040] Figure 1 The figure is a flow chart of a method for estimating the noise level of an image according to an exemplary embodiment.

[0041] like Figure 1 As shown, the image noise level estimation method may include the following steps:

[0042] Step 110: Acquire a first image.

[0043] Here, the first image may be an image captured by a user or an image obtained from an album. The method of acquiring the first image includes but is not limited to user uploading, real-time shooting, etc., which are not limited here. The first image may contain a certain amount of noise, which may be the noise generated when the image is captured by an image sensor.

[0044] Step 120: extract feature information corresponding to the first image from the first image.

[0045] Here, the feature information may be multi-dimensional information extracted from the first image, such as feature information extracted from a color dimension and / or feature information extracted from a spatial dimension. The spatial dimension may be a dimension in which pixels in the image are arranged. Of course, feature information of other dimensions may also be extracted from the first image, which is not limited here.

[0046] In an optional implementation manner, the above step 120 may specifically include:

[0047] Converting the first image into a corresponding second image; wherein the second image is a Bayer image;

[0048] Extracting a first feature corresponding to the first image from the first image using a first branch network in the noise level estimation model, and extracting a second feature corresponding to the first image from the second image using a second branch network in the noise level estimation model;

[0049] Feature information corresponding to the first image is generated based on the first feature and the second feature.

[0050] Here, in order to improve the diversity of image feature extraction, a pre-trained noise level estimation model can be used to extract image features of the first image from multiple dimensions. The noise level estimation model may include at least two branch networks, and the noise level estimation model is used to estimate the noise level of the first image. Specifically, according to different feature extraction dimensions, different branch networks can be used to perform feature extraction processing respectively. The first feature can be, for example, a feature extracted from a color dimension, and the second feature can be, for example, a feature extracted from a spatial dimension.

[0051] In addition, the Bayer image can be an image in which pixels are arranged in a GRBG pixel array, wherein the GRBG pixel array can be as follows: Figure 2Since the Bayer image allows the model to better distinguish noise types and provide the model with more image noise information, the first image can be converted into a corresponding Bayer image, i.e., the second image, before the image is input into the noise level estimation model, so as to use the Bayer image to extract the spatial features of the pixel arrangement in the first image.

[0052] Exemplarily, the first image can be input into the first branch network, so as to use the first branch network to perform color feature extraction processing on the first image to obtain the first feature; in addition, the Bayer image corresponding to the first image, that is, the second image, can be input into the second branch network, so as to use the second branch network to perform spatial feature extraction processing on the second image to obtain the second feature, and then the first feature and the second feature can be fused to generate feature information corresponding to the first image. For example, the first feature and the second feature can be stacked according to the channel dimension and reshaped into a one-dimensional vector, and the one-dimensional vector can be the feature information corresponding to the first image. In this way, image feature extraction from different dimensions can be achieved.

[0053] In this way, by converting the first image into a corresponding Bayer image, the model can better distinguish the noise type and provide more noise information to the model, thereby improving the accuracy of the noise level estimation model in identifying the noise level of the first image. In addition, the image features are extracted from two dimensions, image color and pixel arrangement, providing the model with image feature information of different dimensions, so that the model can extract image features more comprehensively and accurately.

[0054] Step 130: Determine a first estimated value and a second estimated value corresponding to the first image according to the feature information.

[0055] The first estimated value may be an estimated value indicating that the first image is a noisy image, and the second estimated value may be an estimated value indicating that the first image is a noise-free image.

[0056] Here, the first image can be classified according to the extracted feature information, specifically into a noise image class and a noise-free image class. The first estimated value can be an unnormalized probability value that the first image is a noise image, and the second estimated value can be an unnormalized probability value that the first image is a noise-free image. Exemplarily, the first image can be classified by a binary classification network, and the logits output by the binary classification network can be used to obtain the first estimated value and the second estimated value.

[0057] In an optional implementation manner, the above step 130 may specifically include:

[0058] The feature information is input into a binary classification network in a noise level estimation model, the first image is classified using the binary classification network, and a first estimation value and a second estimation value corresponding to the first image are output.

[0059] Here, the noise level estimation model may further include a binary classification network, through which the first image may be classified to obtain a first estimation value and a second estimation value.

[0060] In a specific example, the feature information corresponding to the first image is input into the binary classification network in the noise level estimation model, and the binary classification network can be used to classify the first image. When the output logits is (90, 10), the estimated value of the first image belonging to the noise image can be obtained, that is, the first estimated value is 90, and the estimated value of the first image belonging to the noise-free image can be obtained, that is, the second estimated value is 10.

[0061] In this way, by classifying the first image through a binary classification network, various noises can be comprehensively considered without distinguishing which specific noise types are contained therein, and an accurate estimation of whether there is image noise and the degree of noise in the first image can be achieved, thereby improving the accuracy of subsequent noise level estimation values.

[0062] Step 140: Calculate the difference between the first estimated value and the second estimated value.

[0063] Here, the noise level of the first image can be represented by the difference between the first estimated value and the second estimated value. Specifically, the difference can be a value obtained by subtracting the second estimated value from the first estimated value.

[0064] For example, when the estimated value of the first image being a noisy image, that is, the first estimated value, is 6.25, and the estimated value of the first image being a noise-free image, that is, the second estimated value, is 3.75, it can be calculated that the difference between the two is 2.5.

[0065] Step 150: Map the difference value to a target value within a preset continuous interval, and use the target value as a noise level estimation value of the first image.

[0066] The preset continuous interval range may be, for example, [0, 1]. Of course, it may also be other continuous interval ranges, which is not limited here.

[0067] In a specific example, if the difference between the first estimated value and the second estimated value is 2.5, and the preset continuous interval range is [0,1], then the Sigmoid activation function set in the binary classification network can be used to map 2.5 to a value in [0,1], such as Figure 3 As shown, when x=2.5, it can be mapped to a value of about 0.91, that is, the estimated value of the noise level of the first image is 0.91.

[0068] It should be noted that, when the preset continuous interval range is [0, 1], the closer the final noise level estimation value is to 1, the higher the image noise level is, and the closer it is to 0, the lower the image noise level is.

[0069] In this way, by extracting feature information corresponding to the first image from the acquired first image, a first estimated value that the first image is a noisy image and a second estimated value that the first image is a noise-free image are determined based on the feature information, and then by mapping the difference between the first estimated value and the second estimated value to a target value within a preset continuous interval, and using the target value as the noise level estimate of the first image, the noise level of the first image can be estimated without assuming whether the first image obeys a certain noise distribution. In addition, the embodiment of the present application can estimate the noise level of the first image taken under any lighting conditions, thereby improving the accuracy and universality of the image noise level estimation.

[0070] Based on this, in an optional implementation, before using the first branch network in the noise level estimation model to extract the first feature corresponding to the first image from the first image, and using the second branch network in the noise level estimation model to extract the second feature corresponding to the first image from the second image, the image noise level estimation method provided in the embodiment of the present application may also include:

[0071] Performing transformation processing on the first image to obtain N third images corresponding to the first image; wherein the transformation processing includes at least one of brightening processing and darkening processing, and N is a positive integer;

[0072] Converting the N third images into corresponding N fourth images; wherein the fourth images are Bayer images;

[0073] The method comprises: extracting a first feature corresponding to the first image from the first image by using a first branch network in the noise level estimation model, and extracting a second feature corresponding to the first image from the second image by using a second branch network in the noise level estimation model, including:

[0074] The first image and the N third images are stacked according to the channel dimension to obtain a first stacked image, and the second image and the N fourth images are stacked according to the channel dimension to obtain a second stacked image;

[0075] The first branch network is used to extract color information from the first stacked image to obtain a first feature corresponding to the first image, and the second branch network is used to extract spatial information from the second stacked image to obtain a second feature corresponding to the first image.

[0076] Exemplarily, in order to improve the robustness of the binary classification network to brightness, the first image can also be brightened and / or darkened to obtain a corresponding brightened and / or darkened image, that is, N third images. In this way, the N third images can also be converted into corresponding Bayer images, that is, N fourth images, using the same processing method as the first image. Before the image is input into the binary classification network, the pixel values ​​of each pixel in the first image and its transformed image and the Bayer image can be normalized by dividing by 255 for subsequent calculations. Then, the normalized first image and the N third images can be stacked according to the channel dimension, and the corresponding normalized Bayer images can also be stacked according to the channel dimension and input into the first branch network and the second branch network respectively. The first branch network extracts the pixel value information of the image in the RGB three channels, that is, the color information, so that the obtained color feature is used as the first feature; the second branch network can capture the arrangement information between the pixels, so that the obtained spatial feature is used as the second feature.

[0077] In this way, by brightening and / or darkening the target sample image, the robustness of the network to image brightness can be increased, thereby improving the effect of network training.

[0078] In an optional embodiment, the first branch network includes a first feature extraction subnetwork and a first cross attention subnetwork, and the second branch network includes a second feature extraction subnetwork and a second cross attention subnetwork;

[0079] The above-mentioned method of extracting color information from the first stacked image using the first branch network to obtain a first feature corresponding to the first image, and extracting spatial information from the second stacked image using the second branch network to obtain a second feature corresponding to the first image may specifically include:

[0080] Using the first feature extraction subnetwork to extract color information from the first stacked image to obtain color features corresponding to the first image, and using the second feature extraction subnetwork to extract spatial information from the second stacked image to obtain spatial features corresponding to the first image;

[0081] Using the first cross attention sub-network, preprocessing the color feature to obtain a first processing result, and using the second cross attention sub-network, preprocessing the spatial feature to obtain a second processing result;

[0082] The first processing result is fused with the spatial feature to obtain the second feature, and the second processing result is fused with the color feature to obtain the first feature.

[0083] Here, in order to comprehensively consider color features and spatial features, a CAB (Cross Attention Block), that is, a cross attention sub-network, can be set in each branch network. The CAB can be used to fuse color features and spatial features.

[0084] Exemplarily, the first branch network and the second branch network can be connected via CAB. Specifically, the color feature extracted by the first feature extraction module in the first branch network can be processed by the first CAB, and then a dot multiplication operation is performed with the spatial feature extracted by the second branch network to obtain a cross-color feature, that is, the second feature. In addition, the spatial feature extracted by the second feature extraction module in the second branch network can be processed by the second CAB, and then a dot multiplication operation is performed with the color feature extracted by the first branch network to obtain a cross-spatial feature, that is, the first feature. Among them, CAB may include a 1×1 convolution layer and a Sigmoid function, which are used to reduce the dimension and normalize the input features so that they can be dot-multiplied with other features.

[0085] In this way, by deeply fusing the color features of the image and the spatial features of the Bayer image, more and more comprehensive features can be considered during model training, thereby achieving better network training results.

[0086] In summary, a specific example is given to illustrate the above image processing process by taking the case where the first image is input into the noise level estimation model and the noise level of the first image is estimated using the noise level estimation model.

[0087] like Figure 4 As shown, the first image 41 is brightened and darkened, and converted into corresponding Bayer images respectively. Then, each input image is divided by 255 for normalization. Figure 3The three images are stacked together according to the channel dimension to obtain a stacked image 42. At the same time, the Bayer images corresponding to the three images are also stacked accordingly to obtain a stacked image 43. The stacked image 42 is input into the color branch network 44, and the stacked image 43 is input into the space branch network 45. After the corresponding feature extraction module, the color feature and the space feature can be obtained. The color feature is processed by the CAB sub-network 441 and multiplied point by point with the space feature to obtain a cross-color feature, and the space feature is processed by the CAB sub-network 451 and multiplied point by point with the color feature to obtain a cross-space feature. Then, the cross-color feature and the cross-space feature are stacked according to the channel dimension, and after the reshape function 46 is used to generate a one-dimensional vector, it is input into the classifier 47, and the binary classification result 471 is output. After the binary classification result 471 is subjected to a difference operation, the difference value obtained is mapped to a target value in the interval [0,1] using the Sigmoid function, and the target value is determined as the noise level estimation value of the first image.

[0088] Based on the above embodiment, before using the above noise level estimation model to estimate the noise level of an image, the noise level estimation model may be trained. Specifically, Figure 5 As shown, in a possible embodiment, before the above step 120, the image noise level estimation method may further include:

[0089] Step 1201: Acquire a first sample image.

[0090] Here, the first sample image may be an original noise-free sample image obtained from a sample image library, or may be a noise-free sample image obtained by transformation based on the original sample image, wherein the transformation method includes but is not limited to darkening, brightening, etc.

[0091] When using electronic devices to take photos in dark scenes, due to insufficient light, electronic devices usually use higher ISO (International Standardization Organization) standards to ensure the clarity of the captured images. The higher the ISO standard, the more light the electronic device receives and the greater the heat generated. Therefore, images taken in dark scenes often have more noise than images taken in normal light, and dark images need more noise reduction.

[0092] Based on this, when the first image is an image taken in a dark light scene, the model can be trained for the dark light shooting scene. Specifically, the first sample image obtained can be a noise-free sample image obtained after darkening. In this way, the model trained by the dark light image can be more targeted in estimating the noise level of the dark light image. Based on this, in an optional implementation, before step 1201, the image noise level estimation method provided in the embodiment of the present application can also include:

[0093] Get the original image;

[0094] Convert the original image from RGB color space to HSV color space;

[0095] Performing random darkening processing on the brightness V channel in the HSV color space corresponding to the original image to obtain a plurality of noise-free sample images; wherein the random darkening processing includes at least one of linear darkening and exponential darkening, and the plurality of noise-free sample images includes the first sample image;

[0096] The above step 110 may specifically include:

[0097] A first sample image is obtained from a plurality of noise-free sample images.

[0098] Here, the original image may be a noise-free original sample image obtained from a sample image library. The RGB color space may be a space with red, green, and blue as color parameters, and the HSV color space may be a space with hue, saturation, and value as color parameters.

[0099] For example, the original image can be converted from RGB color space to HSV color space, and then the value of the V channel is divided by 255 to normalize the value of the V channel to between 0 and 1. Then the V channel is randomly darkened, wherein a random selection can be made from the following three darkening methods: linear darkening, random exponential darkening, and a combination of the two. In this way, multiple dark-light images with different darkening degrees can be obtained, and then any one image from the multiple dark-light images can be selected as the first sample image, for example, Figure 6a The dark-light image is shown as a first sample image.

[0100] In this way, by darkening the original image in the process of constructing the training sample, any one image is selected from multiple dark light noise-free sample images as the first sample image, so that in the subsequent model training process, the dark light image can be processed in a targeted manner, so that the model can more accurately estimate the noise level of the dark light image.

[0101] Step 1202: convert the first sample image into a corresponding first target image.

[0102] For example, we can first Figure 6a The first sample image shown is converted from an RGB image to a Bayer image in the arrangement of a GRBG pixel array, that is, mosaic, to obtain a first target image, and its image effect is as follows Figure 6b shown.

[0103] Step 1203, adding preset noise to the first target image to obtain a first noisy image; wherein the preset noise includes at least one of Poisson noise and Gaussian noise.

[0104] Since electronic devices need to convert photons into electrons when taking images, and in the process of photon-to-electron conversion, the discrete characteristics of the current cause the generated shot noise to obey the Poisson distribution. Therefore, Poisson noise can be added to the first target image. The variance range of Poisson noise can be set to 0.5~1. The noise image obtained after noise synthesis is as follows Figure 6c shown.

[0105] In addition, since the current signal obtained by the electronic device after taking the image needs to be amplified by the analog amplifier, and the read noise generated in the process of amplifying the signal by the analog amplifier obeys the Gaussian distribution, Figure 6c Gaussian noise is further added to the noise image shown in the figure, and the variance range can be set to 0.5 to 1. The noise image obtained after synthesis, that is, the first noise image, can have the following image effect: Figure 6d shown.

[0106] Of course, the order of adding the Poisson noise and the Gaussian noise can be changed, that is, adding the Gaussian noise first and then adding the Poisson noise, which is not limited here.

[0107] Step 1204: convert the first noise image into a corresponding second target image.

[0108] For example, the first noise image can be converted from a noisy Bayer image to an RGB image, that is, demosaiced, to obtain a second target image, and the image effect is as follows: Figure 6e shown.

[0109] Step 1205, denoising the second target image to obtain a second sample image; wherein the first target image and the first noise image are Bayer images, and the first sample image and the second target image are RGB images.

[0110] Since the electronic device itself has an ISP (Image Signal Processing) module, it can process the image including black level compensation, color interpolation (demosaicing), denoising, automatic white balance, color correction and other processes. Therefore, in order to simulate the denoising process in the ISP of the electronic device, the embodiment of the present application can use bilateral filtering to process the image. Figure 6e The second target image shown in the figure is subjected to denoising, and a small amount of noise is removed while ensuring the image edge is clear, thereby obtaining a dark light image after adding noise, i.e., the second sample image. The image effect is as follows Figure 6f shown.

[0111] In an optional implementation, after step 1205, the image noise level estimation method provided by the embodiment of the present application may further include:

[0112] Performing data augmentation processing on the second sample image to obtain a plurality of noisy sample images corresponding to the first sample image; wherein the data augmentation processing includes at least one of random flipping, random rotation, random cropping, and random hue transformation;

[0113] The above step 130 may specifically include:

[0114] Combining the first sample image with any one of the multiple noisy sample images to obtain multiple positive and negative sample pairs;

[0115] Use multiple positive and negative sample pairs to train the preset binary classification network.

[0116] Here, after obtaining the noisy image corresponding to the first sample image, that is, the second sample image, data augmentation can be performed on the second sample image to enrich the noisy image sample set corresponding to the first sample image, for example, the second sample image is randomly flipped, randomly rotated, randomly cropped, and randomly toned, etc., which are not limited here. In this way, multiple noisy sample images corresponding to the first sample image can be obtained. When training a binary classification network, the first sample image can be combined with any one of the noisy sample images, so that multiple positive and negative sample pairs can be obtained, and the multiple sample pairs are used for training.

[0117] In this way, by performing data augmentation on the dark light noise image, a limited original image can be used to obtain multiple positive and negative sample pairs, thereby reducing the cost of sample construction.

[0118] Step 1206: Use the first sample image and the second sample image as positive and negative sample pairs to train the initial noise level estimation model until the initial noise level estimation model converges to obtain the noise level estimation model.

[0119] In the embodiment of the present application, the sample images used when training the initial noise level estimation model may include multiple positive and negative sample pairs, and here only the first sample image and the second sample image are used as positive and negative sample pairs to train the initial noise level estimation model as an example for explanation. The initial noise level estimation model may be a neural network that divides the image into two categories: noisy and noise-free.

[0120] Exemplarily, a negative sample label can be added to the first sample image, and a positive sample label can be added to the second sample image. The first sample image and the second sample image are respectively input into the initial noise level estimation model, and the classification result corresponding to the first sample image is output, and the classification result is normalized by the Softmax activation function to obtain the classification probability value, and the cross entropy loss is calculated according to the classification probability value and the label corresponding to the sample image, and the Adam optimization algorithm is used to update the network weight until the initial noise level estimation model converges.

[0121] In addition, the classification result output by the initial noise level estimation model can be the result obtained before the activation function is input, such as the logits output by the binary classification network, that is, the logarithm of the ratio of the occurrence of an event to the non-occurrence of an event, which represents the unnormalized probability in the neural network. Since the classification result output by the binary classification network is a two-dimensional value, such as (a, b), where a represents the unnormalized probability that the image is a noisy image, and b represents the unnormalized probability that the image is a noise-free image. Therefore, by adding a difference function to the output end of the converged initial noise level estimation model and replacing the Softmax activation function with the target activation function, such as Sigmoid, Tanh, etc., the two-dimensional value can be mapped to a noise level estimation value within a preset continuous interval, for example, (a, b) is mapped to a certain value within a preset continuous range of the interval as a noise level estimation value. In this way, a noise level estimation model can be obtained.

[0122] Therefore, after the noise level estimation model is constructed, the image taken by the user or the noisy image obtained by other means, such as the first image, can be input into the noise level estimation model, and the noise level estimation value corresponding to the image can be output.

[0123] In this way, by simulating the noise generation process when an electronic device captures an image, the constructed noise sample image can be closer to the real noise image, and compared with the existing direct use of the real noise image, the artificial addition of noise in the embodiment of the present application can make the added noise level more controllable, thereby obtaining a more ideal noise sample image, and the model trained based on the noise sample image is also more accurate. In addition, by using the noise-free first sample image and its corresponding noisy second sample image as a positive and negative sample pair, the initial noise level estimation model is trained, and then the noise level estimation model can be obtained. In this way, since it is only necessary to construct a positive and negative sample pair containing a noisy image and a noise-free image when training a binary classification network, and there is no need to annotate the noise level of each sample image, the construction cost of the model can be reduced.

[0124] Based on the same inventive concept, the present application also provides an image noise level estimation device. Figure 7 The image noise level estimation device provided in the embodiment of the present application is described in detail.

[0125] Figure 7 The figure is a structural block diagram of a device for estimating image noise level according to an exemplary embodiment.

[0126] like Figure 7 As shown, the image noise level estimation device 700 may include:

[0127] A first acquisition module 701, used to acquire a first image;

[0128] A feature extraction module 702 is used to extract feature information corresponding to the first image from the first image;

[0129] The image estimation module 703 is used to determine a first estimation value and a second estimation value corresponding to the first image according to the feature information; wherein the first estimation value is an estimation value indicating that the first image is a noisy image, and the second estimation value is an estimation value indicating that the first image is a noise-free image;

[0130] A difference calculation module 704, used to calculate the difference between the first estimated value and the second estimated value;

[0131] The difference mapping module 705 is used to map the difference to a target value within a preset continuous interval, and use the target value as the noise level estimation value of the first image.

[0132] The image noise level estimation device 700 is described in detail below, as follows:

[0133] In one embodiment, the feature extraction module 702 may specifically include:

[0134] A first conversion submodule, used for converting the first image into a corresponding second image; wherein the second image is a Bayer image;

[0135] A feature extraction submodule, configured to extract a first feature corresponding to the first image from the first image using a first branch network in the noise level estimation model, and to extract a second feature corresponding to the first image from the second image using a second branch network in the noise level estimation model;

[0136] The information generation submodule is used to generate feature information corresponding to the first image according to the first feature and the second feature.

[0137] In one embodiment, the image estimation module 703 may specifically include:

[0138] The image classification submodule is used to input feature information into a binary classification network in the noise level estimation model, classify the first image using the binary classification network, and output a first estimation value and a second estimation value corresponding to the first image.

[0139] In one embodiment, the feature extraction module 702 may further include:

[0140] a transformation processing submodule, configured to perform transformation processing on the first image to obtain N third images corresponding to the first image before extracting the first feature corresponding to the first image from the first image using the first branch network in the noise level estimation model and extracting the second feature corresponding to the first image from the second image using the second branch network in the noise level estimation model; wherein the transformation processing includes at least one of brightening processing and darkening processing, and N is a positive integer;

[0141] A second conversion submodule, used for converting the N third images into corresponding N fourth images; wherein the fourth images are Bayer images;

[0142] The feature extraction submodule may specifically include:

[0143] An image stacking unit, used for stacking the first image and the N third images according to the channel dimension to obtain a first stacked image, and stacking the second image and the N fourth images according to the channel dimension to obtain a second stacked image;

[0144] The feature extraction unit is used to extract color information from the first stacked image using the first branch network to obtain a first feature corresponding to the first image, and to extract spatial information from the second stacked image using the second branch network to obtain a second feature corresponding to the first image.

[0145] In one embodiment, the first branch network may include a first feature extraction subnetwork and a first cross attention subnetwork, and the second branch network may include a second feature extraction subnetwork and a second cross attention subnetwork;

[0146] The feature extraction unit may specifically include:

[0147] A feature extraction subunit is used to extract color information from the first stacked image using a first feature extraction subnetwork to obtain color features corresponding to the first image, and to extract spatial information from the second stacked image using a second feature extraction subnetwork to obtain spatial features corresponding to the first image;

[0148] A feature processing subunit, configured to preprocess the color feature using the first cross-attention subnetwork to obtain a first processing result, and to preprocess the spatial feature using the second cross-attention subnetwork to obtain a second processing result;

[0149] The feature fusion subunit is used to fuse the first processing result with the spatial feature to obtain the second feature, and to fuse the second processing result with the color feature to obtain the first feature.

[0150] In one embodiment, the image noise level estimation device 700 may further include:

[0151] A sample acquisition module, used for acquiring a first sample image before extracting feature information corresponding to the first image from the first image;

[0152] A first conversion module, used for converting a first sample image into a corresponding first target image;

[0153] A noise adding module, used for adding preset noise to the first target image to obtain a first noise image; wherein the preset noise includes at least one of Poisson noise and Gaussian noise;

[0154] A second conversion module, used for converting the first noise image into a corresponding second target image;

[0155] An image denoising module, used for performing denoising processing on the second target image to obtain a second sample image; wherein the first target image and the first noise image are Bayer images, and the first sample image and the second target image are RGB images;

[0156] The model training module is used to use the first sample image and the second sample image as positive and negative sample pairs to train the initial noise level estimation model until the initial noise level estimation model converges to obtain the noise level estimation model.

[0157] In one embodiment, the image noise level estimation device 700 may further include:

[0158] A data augmentation module is used for performing data augmentation processing on the second sample image after performing denoising processing on the second target image to obtain a second sample image, so as to obtain a plurality of noisy sample images corresponding to the first sample image; wherein the data augmentation processing includes at least one of random flipping, random rotation, random cropping and random hue transformation;

[0159] The above-mentioned model training module may specifically include:

[0160] A combination submodule, used for combining the first sample image with any one of the multiple noisy sample images to obtain multiple positive and negative sample pairs;

[0161] The training submodule is used to train the initial noise level estimation model using multiple positive and negative sample pairs.

[0162] In one embodiment, the image noise level estimation device 700 may further include:

[0163] A second acquisition module, used for acquiring an original image before acquiring the first sample image;

[0164] A space conversion module is used to convert the original image from RGB color space to HSV color space;

[0165] A darkening processing module, used for performing random darkening processing on the brightness V channel in the HSV color space corresponding to the original image to obtain a plurality of noise-free sample images; wherein the random darkening processing includes at least one of linear darkening and exponential darkening, and the plurality of noise-free sample images includes the first sample image;

[0166] Therefore, by extracting feature information corresponding to the first image from the acquired first image, a first estimated value that the first image is a noisy image and a second estimated value that the first image is a noise-free image are determined based on the feature information, and then by mapping the difference between the first estimated value and the second estimated value to a target value within a preset continuous interval, and using the target value as the noise level estimate of the first image, the noise level of the first image can be estimated without assuming whether the first image obeys a certain noise distribution. In addition, the embodiment of the present application can estimate the noise level of the first image taken under any lighting conditions, thereby improving the accuracy and universality of the image noise level estimation.

[0167] The image noise level estimation device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0168] The image noise level estimation device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0169] The image noise level estimation device provided in the embodiment of the present application can achieve Figures 1 to 5 , Figures 6a to 6f To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0170] Alternatively, if Figure 8 As shown, an embodiment of the present application also provides an electronic device 800, including a processor 801, a memory 802, and a program or instruction stored in the memory 802 and executable on the processor 801. When the program or instruction is executed by the processor 801, each process of the above-mentioned image noise level estimation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0171] It should be noted that the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.

[0172] Fig. 9 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0173] The electronic device 900 includes but is not limited to: a radio frequency unit 901, a network module 902, an audio output unit 903, an input unit 904, a sensor 905, a display unit 906, a user input unit 907, an interface unit 908, a memory 909, and a processor 910 and other components.

[0174] Those skilled in the art will appreciate that the electronic device 900 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 910 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Fig. 9 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0175] Among them, the processor 910 is used to obtain a first image; extract feature information corresponding to the first image from the first image; determine a first estimated value and a second estimated value corresponding to the first image based on the feature information; wherein the first estimated value is an estimated value that the first image is a noisy image, and the second estimated value is an estimated value that the first image is a noise-free image; calculate the difference between the first estimated value and the second estimated value; map the difference to a target value within a preset continuous interval, and use the target value as an estimated value of the noise level of the first image.

[0176] Therefore, by extracting feature information corresponding to the first image from the acquired first image, a first estimated value that the first image is a noisy image and a second estimated value that the first image is a noise-free image are determined based on the feature information, and then by mapping the difference between the first estimated value and the second estimated value to a target value within a preset continuous interval, and using the target value as the noise level estimate of the first image, the noise level of the first image can be estimated without assuming whether the first image obeys a certain noise distribution. In addition, the embodiment of the present application can estimate the noise level of the first image taken under any lighting conditions, thereby improving the accuracy and universality of the image noise level estimation.

[0177] Optionally, processor 910 is also used to convert a first image into a corresponding second image; wherein the second image is a Bayer image; using a first branch network in a noise level estimation model, extracting a first feature corresponding to the first image from the first image, and using a second branch network in the noise level estimation model, extracting a second feature corresponding to the first image from the second image; and generating feature information corresponding to the first image based on the first feature and the second feature.

[0178] Optionally, the processor 910 is further used to input the feature information into a binary classification network in the noise level estimation model, classify the first image using the binary classification network, and output a first estimation value and a second estimation value corresponding to the first image.

[0179] Optionally, the processor 910 is also used to transform the first image to obtain N third images corresponding to the first image; wherein the transformation processing includes at least one of brightening processing and darkening processing, and N is a positive integer; converting the N third images into corresponding N fourth images; wherein the fourth image is a Bayer image; and stacking the first image and the N third images according to the channel dimension to obtain a first stacked image, and stacking the second image and the N fourth images according to the channel dimension to obtain a second stacked image; using the first branch network to extract color information from the first stacked image to obtain a first feature corresponding to the first image, and using the second branch network to extract spatial information from the second stacked image to obtain a second feature corresponding to the first image.

[0180] Optionally, the processor 910 is also used to extract color information from the first stacked image using the first feature extraction subnetwork to obtain color features corresponding to the first image, and to extract spatial information from the second stacked image using the second feature extraction subnetwork to obtain spatial features corresponding to the first image; to preprocess the color features using the first cross-attention subnetwork to obtain a first processing result, and to preprocess the spatial features using the second cross-attention subnetwork to obtain a second processing result; to fuse the first processing result with the spatial features to obtain a second feature, and to fuse the second processing result with the color features to obtain the first feature.

[0181] Optionally, the processor 910 is further used to obtain a first sample image; convert the first sample image into a corresponding first target image; add preset noise to the first target image to obtain a first noise image; wherein the preset noise includes at least one of Poisson noise and Gaussian noise; convert the first noise image into a corresponding second target image; denoise the second target image to obtain a second sample image; wherein the first target image and the first noise image are Bayer images, and the first sample image and the second target image are RGB images; use the first sample image and the second sample image as positive and negative sample pairs, train an initial noise level estimation model, until the initial noise level estimation model converges, and obtain a noise level estimation model.

[0182] Optionally, the processor 910 is further used to perform data augmentation processing on the second sample image to obtain multiple noise sample images corresponding to the first sample image; wherein the data augmentation processing includes at least one of random flipping, random rotation, random cropping and random hue transformation; and, the first sample image is combined with any image of the multiple noise sample images to obtain multiple positive and negative sample pairs; and the multiple positive and negative sample pairs are used to train an initial noise level estimation model.

[0183] In this way, by extracting feature information corresponding to the first image from the acquired first image, a first estimated value that the first image is a noisy image and a second estimated value that the first image is a noise-free image are determined based on the feature information, and then by mapping the difference between the first estimated value and the second estimated value to a target value within a preset continuous interval, and using the target value as the noise level estimate of the first image, the noise level of the first image can be estimated without assuming whether the first image obeys a certain noise distribution. In addition, the embodiment of the present application can estimate the noise level of the first image taken under any lighting conditions, thereby improving the accuracy and universality of the image noise level estimation.

[0184] It should be understood that in the embodiment of the present application, the input unit 904 may include a graphics processor (Graphics Processing Unit, GPU) 9041 and a microphone 9042, and the graphics processor 9041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 906 may include a display panel 9061, and the display panel 9061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 907 includes a touch panel 9071 and other input devices 9072. The touch panel 9071 is also called a touch screen. The touch panel 9071 may include two parts: a touch detection device and a touch controller. Other input devices 9072 may include but are not limited to a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 909 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 910 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 910.

[0185] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned image noise level estimation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0186] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0187] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned image noise level estimation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0188] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0189] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0190] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0191] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A method for estimating image noise level, characterized in that: include: acquiring a first image; extracting feature information corresponding to the first image from the first image; Determine, according to the feature information, a first estimated value and a second estimated value corresponding to the first image; wherein the first estimated value is an estimated value indicating that the first image is a noisy image, and the second estimated value is an estimated value indicating that the first image is a noise-free image; calculating a difference between the first estimate and the second estimate; The difference is mapped to a target value within a preset continuous interval, and the target value is used as an estimated value of the noise level of the first image.

2. The method according to claim 1, characterized in that: The extracting feature information corresponding to the first image from the first image includes: Converting the first image into a corresponding second image; wherein the second image is a Bayer image; Extracting a first feature corresponding to the first image from the first image using a first branch network in the noise level estimation model, and extracting a second feature corresponding to the first image from the second image using a second branch network in the noise level estimation model; Feature information corresponding to the first image is generated according to the first feature and the second feature.

3. The method according to claim 1, characterized in that The determining, according to the feature information, a first estimated value and a second estimated value corresponding to the first image comprises: The feature information is input into a binary classification network in a noise level estimation model, the first image is classified using the binary classification network, and a first estimation value and a second estimation value corresponding to the first image are output.

4. The method according to claim 2, characterized in that: Before extracting a first feature corresponding to the first image from the first image using a first branch network in the noise level estimation model, and extracting a second feature corresponding to the first image from the second image using a second branch network in the noise level estimation model, the method further includes: Performing transformation processing on the first image to obtain N third images corresponding to the first image; wherein the transformation processing includes at least one of brightening processing and darkening processing, and N is a positive integer; Convert the N third images into corresponding N fourth images; wherein the fourth images are Bayer images; The method of extracting a first feature corresponding to the first image from the first image by using a first branch network in the noise level estimation model, and extracting a second feature corresponding to the first image from the second image by using a second branch network in the noise level estimation model, comprises: The first image and the N third images are stacked according to a channel dimension to obtain a first stacked image, and the second image and the N fourth images are stacked according to a channel dimension to obtain a second stacked image; The first branch network is used to extract color information from the first stacked image to obtain a first feature corresponding to the first image, and the second branch network is used to extract spatial information from the second stacked image to obtain a second feature corresponding to the first image.

5. The method according to claim 4, characterized in that The first branch network includes a first feature extraction subnetwork and a first cross attention subnetwork, and the second branch network includes a second feature extraction subnetwork and a second cross attention subnetwork; The method of extracting color information from the first stacked image using the first branch network to obtain a first feature corresponding to the first image, and extracting spatial information from the second stacked image using the second branch network to obtain a second feature corresponding to the first image includes: Using the first feature extraction subnetwork to extract color information from the first stacked image to obtain color features corresponding to the first image, and using the second feature extraction subnetwork to extract spatial information from the second stacked image to obtain spatial features corresponding to the first image; Using the first cross-attention sub-network, pre-processing the color feature to obtain a first processing result, and using the second cross-attention sub-network, pre-processing the spatial feature to obtain a second processing result; The first processing result is fused with the spatial feature to obtain the second feature, and the second processing result is fused with the color feature to obtain the first feature.

6. The method according to any one of claims 2 to 5, characterized in that: Before extracting feature information corresponding to the first image from the first image, the method further includes: Acquire a first sample image; Converting the first sample image into a corresponding first target image; Adding preset noise to the first target image to obtain a first noise image; wherein the preset noise includes at least one of Poisson noise and Gaussian noise; Converting the first noise image into a corresponding second target image; Performing denoising processing on the second target image to obtain a second sample image; wherein the first target image and the first noise image are Bayer images, and the first sample image and the second target image are RGB images; The first sample image and the second sample image are used as positive and negative sample pairs to train an initial noise level estimation model until the initial noise level estimation model converges, thereby obtaining the noise level estimation model.

7. The method according to claim 6, characterized in that After performing denoising processing on the second target image to obtain the second sample image, the method further includes: Performing data augmentation processing on the second sample image to obtain a plurality of noise sample images corresponding to the first sample image; wherein the data augmentation processing includes at least one of random flipping, random rotation, random cropping and random tone transformation; The step of using the first sample image and the second sample image as a positive and negative sample pair to train an initial noise level estimation model includes: Combining the first sample image with any one of the multiple noise sample images to obtain multiple positive and negative sample pairs; The initial noise level estimation model is trained using the multiple positive and negative sample pairs.

8. An image noise level estimation device, characterized in that: include: A first acquisition module, used for acquiring a first image; A feature extraction module, used to extract feature information corresponding to the first image from the first image; an image estimation module, configured to determine a first estimation value and a second estimation value corresponding to the first image according to the feature information; wherein the first estimation value is an estimation value indicating that the first image is a noisy image, and the second estimation value is an estimation value indicating that the first image is a noise-free image; A difference calculation module, used for calculating the difference between the first estimated value and the second estimated value; The difference mapping module is used to map the difference to a target value within a preset continuous interval, and use the target value as a noise level estimation value of the first image.

9. The device according to claim 8, characterized in that The feature extraction module comprises: A first conversion submodule, configured to convert the first image into a corresponding second image; wherein the second image is a Bayer image; a feature extraction submodule, configured to extract a first feature corresponding to the first image from the first image by using a first branch network in the noise level estimation model, and to extract a second feature corresponding to the first image from the second image by using a second branch network in the noise level estimation model; An information generating submodule is used to generate feature information corresponding to the first image according to the first feature and the second feature.

10. The device according to claim 8, characterized in that The image estimation module comprises: The image classification submodule is used to input the feature information into a binary classification network in a noise level estimation model, classify the first image using the binary classification network, and output a first estimation value and a second estimation value corresponding to the first image.

11. The device according to claim 9, characterized in that The feature extraction module further includes: a transformation processing submodule, configured to perform transformation processing on the first image to obtain N third images corresponding to the first image before extracting the first feature corresponding to the first image from the first image by using the first branch network in the noise level estimation model and extracting the second feature corresponding to the first image from the second image by using the second branch network in the noise level estimation model; wherein the transformation processing includes at least one of brightening processing and darkening processing, and N is a positive integer; A second conversion submodule, used for converting the N third images into corresponding N fourth images; wherein the fourth images are Bayer images; The feature extraction submodule comprises: an image stacking unit, configured to stack the first image and the N third images according to a channel dimension to obtain a first stacked image, and to stack the second image and the N fourth images according to a channel dimension to obtain a second stacked image; A feature extraction unit is used to extract color information from the first stacked image using the first branch network to obtain a first feature corresponding to the first image, and to extract spatial information from the second stacked image using the second branch network to obtain a second feature corresponding to the first image.

12. The device according to claim 11, characterized in that The first branch network includes a first feature extraction subnetwork and a first cross attention subnetwork, and the second branch network includes a second feature extraction subnetwork and a second cross attention subnetwork; The feature extraction unit comprises: a feature extraction subunit, configured to extract color information from the first stacked image using the first feature extraction subnetwork to obtain color features corresponding to the first image, and to extract spatial information from the second stacked image using the second feature extraction subnetwork to obtain spatial features corresponding to the first image; A feature processing subunit, configured to preprocess the color feature using the first cross-attention sub-network to obtain a first processing result, and preprocess the spatial feature using the second cross-attention sub-network to obtain a second processing result; The feature fusion subunit is used to fuse the first processing result with the spatial feature to obtain the second feature, and to fuse the second processing result with the color feature to obtain the first feature.

13. The device according to any one of claims 9 to 12, characterized in that: The device also includes: A sample acquisition module, configured to acquire a first sample image before extracting feature information corresponding to the first image from the first image; A first conversion module, used for converting the first sample image into a corresponding first target image; A noise adding module, configured to add preset noise to the first target image to obtain a first noise image; wherein the preset noise includes at least one of Poisson noise and Gaussian noise; A second conversion module, used for converting the first noise image into a corresponding second target image; An image denoising module, configured to perform denoising on the second target image to obtain a second sample image; wherein the first target image and the first noise image are Bayer images, and the first sample image and the second target image are RGB images; The model training module is used to use the first sample image and the second sample image as positive and negative sample pairs to train an initial noise level estimation model until the initial noise level estimation model converges to obtain the noise level estimation model.

14. The device according to claim 13, characterized in that The device also includes: a data augmentation module, configured to perform data augmentation processing on the second sample image after performing denoising processing on the second target image to obtain the second sample image, so as to obtain a plurality of noisy sample images corresponding to the first sample image; wherein the data augmentation processing includes at least one of random flipping, random rotation, random cropping and random hue transformation; The model training module includes: A combining submodule, used for combining the first sample image with any one of the multiple noisy sample images to obtain multiple positive and negative sample pairs; A training submodule is used to train the initial noise level estimation model using the multiple positive and negative sample pairs.

15. An electronic device, characterized in that: The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method for estimating the image noise level as described in any one of claims 1 to 7.

16. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the image noise level estimation method according to any one of claims 1 to 7 are implemented.