Noise Estimation for Image Sensor Based on Local Entropy and Median Absolute Deviation

Noise estimation for image sensor is a key technique in many image pre-processing applications such as blind de-noising. The existing noise estimation methods for additive white Gaussian noise (AWGN) and Poisson-Gaussian noise (PGN) may underestimate or overestimate the noise level in the situation of a heavy textured scene image. To cope with this problem, a novel homogenous block-based noise estimation method is proposed to calculate these noises in this paper. Initially, the noisy image is transformed into the map of local gray statistic entropy (LGSE), and the weakly textured image blocks can be selected with several biggest LGSE values in a descending order. Then, the Haar wavelet-based local median absolute deviation (HLMAD) is presented to compute the local variance of these selected homogenous blocks. After that, the noise parameters can be estimated accurately by applying the maximum likelihood estimation (MLE) to analyze the local mean and variance of selected blocks. Extensive experiments on synthesized noised images are induced and the experimental results show that the proposed method could not only more accurately estimate the noise of various scene images with different noise levels than the compared state-of-the-art methods, but also promote the performance of the blind de-noising algorithm.


Introduction
Images captured by charge-coupled device (CCD) image sensors will bring about many types of noise, which are derived from CCD image sensor arrays, camera electronics and analog to digital conversion circuits. Noise is the most concerning problem in imaging systems for it directly degrades the image quality. Therefore, image de-noising is a critical procedure to ensure high quality images. Most of existing de-noising algorithms process the noisy images via assuming that the noise level parameters are given. However, this is not the correct operation in real noisy images, because the noise level parameters generally are unknown in the real world. Blind de-noising without requesting any prior knowledge is a high-profile study. How to accurately estimate the noise parameters is a challenging issue in blind de-noising field, hence, noise level estimation has attracted many studies and a number of noise estimation algorithms have been developed [1][2][3].
Actually, estimating the CCD noise level function (NLF) is to extract ground true noise from noisy image by finding the proximal noise probability density function (PDF). Comprehensive noise noise estimation approaches by collecting irregular shaped smooth blocks. For their simplicity and efficiency, the block-based noise estimation methods are drawing more and more attention recently. Whereas, there is a challenge for stripping homogenous blocks that can easily influence the performance of estimation.
Some previous studies have mentioned that entropy can be used for image segmentation and texture analysis [23][24][25]. Meanwhile, other studies also reported that entropy has a robust stability to noise [26,27]. However, there is little research on applying the entropy to estimate image sensor noise. Considering the good performances of entropy, the local gray statistical entropy (LGSE) is proposed in this paper to extract blocks with weak textures. By making the utmost out of the block-based method and robust MAD-based method, a novel noise estimator including the LGSE for blocks selection and Haar wavelet-based local median absolute deviation (HLMAD) for local variance calculation is designed.
In our work, we also engage in Poisson-Gaussian noise (PGN), which is the less studied but better modeled for the actual camera noise. The existing PGN sensor noise estimators can be classified as: Scatterplot fitting-based methods, least square fitting-based methods and maximum likelihood estimation-based methods. The scatterplot fitting-based methods are proposed to group a set of local means and variances of the selected blocks, and to fit those scatter points using linear regression [28][29][30]. The least square fitting-based methods [31][32][33] use a least square approach to estimate PGN parameters by sampling weak textured blocks and fitting a group of sampled data. In [34,35], the maximum likelihood estimation-based methods still extract smooth blocks first, and then exploit the maximum likelihood function to estimate PGN parameters. The three categories of PGN estimators are equally popular for estimating PGN parameters. Specifically in this paper, we choose maximum likelihood estimation (MLE) to process extracted local mean-variance data for PGN estimation.
There are four contributions in this paper: (1) We analyze the noise sources of an imaging camera, and choose the simple but effective noise models in the image domain to describe most of noise forms of imaging sensor. (2) In the view of conventional noise estimation methods, textures and edges of noisy images are eliminated first in those algorithms. Inspired by this principle, an effective method using LGSE to select homogenous blocks without high frequency details is proposed in this paper. As far as we know, this is a novel approach to utilize local gray entropy in noise estimation.
(3) By comparing traditional noise estimation methods, we find local median absolute deviation has a robust performance to compute local standard deviation and MLE can overcome the weakness of scatterplot-based estimation. By combining above two methods and their advantages, a reliable noise estimation method is established. (4) Due to these measures, a robust image sensor noise level estimation scheme is presented, and it is superior to some of the state-of-the-art noise estimation algorithms.
The structure of this paper is organized as follows: The noise model of image sensor in image domain is discussed, and the AWGN model and PGN model are presented in Section 2. The LGSE and HLMAD based noise estimation algorithm is described, and the whole details of the novel and robust method are presented in Section 3. Experimental results and discussions on synthesized noisy datasets are shown in Section 4. Finally, Section 5 gives the conclusion of this paper.

Image Sensor Noise Model
Irie et al. [5,6] indicted that the CCD camera noise model includes comprehensive noise sources: Reset noise, thermal noise, amplifier noise, flicker noise, circuit readout noise and photon shot noise. Here, the reset noise, thermal noise, amplifier noise, flicker noise and circuit readout noise vary only in additive spatial domain and can be generally included in the readout noise. Hence, the total noise of a CCD camera can be defined as the combination of the readout noise (additive Gaussian process) and photon shot noise (multiplicative Poisson process) [5].
In the CCD noise analysis experiment, we used a 532 nm He-Ne laser to generate light beams, chose CCD97 (produced by e2v, England) in the standard mode (without using multiplicative gain register) to realize the photo-electric conversion, and selected the 16-bit data acquisition card (0-65535 DN) to collect the images. In this experiment, the diaphragm was used to adjust the intensity of the illumination, and the polaroid and optical lens were used to preserve the illumination uniformity on CCD97 light receiving surface. In order to ensure the stability of the scene and the uniformity of the CCD97 received light, a photomultiplier tube was selected as the wide-range micro-illuminometer to monitor the stable brightness at the CCD light receiving surface before the experiment. In addition, the average operation of 25 images in each group can overcome the output fluctuation of He-Ne laser and promote the accuracy of system testing.
To identify and calculate the total noise, readout noise and shot noise of image sensor according to the measurements of [5,6], 100 image groups in different illumination intensities were captured in optical darkroom, and each group had 25 consecutive images without illumination and 25 consecutive images with illumination. Due to the captured images under uniform illumination intensity, the total noise variance in each group is equal to the average value of variances of 25 consecutive images with a given illumination. The variance of the readout noise in each group can be computed by averaging the variances of 25 images captured in dark conditions. The shot noise variance in each group is the difference value between total noise variance and readout noise variance. By measuring the noise variances of these images, the photon transfer curve (PTC) and its logarithm were computed. The experimental platform and the computed PTC curve are shown in Figure 1. Figure 1a shows the experimental platform of CCD noise analysis. Figure 1b depicts that the total noise of image sensor contains signal independent readout noise (red dots) and signal dependent shot noise (green dots). It can be seen from Figure 1b that the noise curve is almost flat under low illumination levels implying that the noise (mostly readout noise) in dark regions of an image is signal independent, while as the illumination increases, the shot noise becomes more and more signal dependent. CCD97 light receiving surface. In order to ensure the stability of the scene and the uniformity of the CCD97 received light, a photomultiplier tube was selected as the wide-range micro-illuminometer to monitor the stable brightness at the CCD light receiving surface before the experiment. In addition, the average operation of 25 images in each group can overcome the output fluctuation of He-Ne laser and promote the accuracy of system testing.
To identify and calculate the total noise, readout noise and shot noise of image sensor according to the measurements of [5,6], 100 image groups in different illumination intensities were captured in optical darkroom, and each group had 25 consecutive images without illumination and 25 consecutive images with illumination. Due to the captured images under uniform illumination intensity, the total noise variance in each group is equal to the average value of variances of 25 consecutive images with a given illumination. The variance of the readout noise in each group can be computed by averaging the variances of 25 images captured in dark conditions. The shot noise variance in each group is the difference value between total noise variance and readout noise variance. By measuring the noise variances of these images, the photon transfer curve (PTC) and its logarithm were computed. The experimental platform and the computed PTC curve are shown in Figure 1. Figure 1a shows the experimental platform of CCD noise analysis. Figure 1b depicts that the total noise of image sensor contains signal independent readout noise (red dots) and signal dependent shot noise (green dots). It can be seen from Figure 1b that the noise curve is almost flat under low illumination levels implying that the noise (mostly readout noise) in dark regions of an image is signal independent, while as the illumination increases, the shot noise becomes more and more signal dependent. According to the noise analysis of the CCD image sensor, two parametric models were used to model the image sensor noise: The generalized zero-mean additive white Gaussian noise (AWGN) model and the Poisson-Gaussian noise (PGN) model.

Additive White Gaussian Noise Model
In the various sources of CCD camera noise, the reset noise, thermal noise, amplifier noise and circuit readout noise can be seen as additive spatial and temporal noise. For all of these noise sources that obey the zero-mean whited additive Gaussian distribution, their joint noise distribution model can be simplified as: where ( , ) x y is the pixel location, and ( , ) N f x y denote original noisy image, noise-free image and random noise image at ( , ) x y , respectively. Generally, the random noise image According to the noise analysis of the CCD image sensor, two parametric models were used to model the image sensor noise: The generalized zero-mean additive white Gaussian noise (AWGN) model and the Poisson-Gaussian noise (PGN) model.

Additive White Gaussian Noise Model
In the various sources of CCD camera noise, the reset noise, thermal noise, amplifier noise and circuit readout noise can be seen as additive spatial and temporal noise. For all of these noise sources that obey the zero-mean whited additive Gaussian distribution, their joint noise distribution model can be simplified as: where (x, y) is the pixel location, and f (x, y), f S (x, y), f N (x, y) denote original noisy image, noise-free image and random noise image at (x, y), respectively. Generally, the random noise image f N (x, y) is assumed to be a whited additive Gaussian distribution noise with zero mean and unknown variance σ 2 n : In the AWGN model, due to the images always having rich textures, the unknown variance σ 2 n estimation still is a head-scratching issue for blind de-noising. To solve this problem, a novel noise variance estimation method is proposed in this paper.

Poisson-Gaussian Noise Model
For the practical image sensor noise model, the signal-dependent shot noise cannot be ignored. As depicted in Figure 1b, with the increase of irradiation, the measured shot noise also increased significantly. As the shot noise follows the Poisson distribution, the actual CCD camera noise model can be treated as a mixed model of multiplicative Poisson noise and additive Gaussian white noise: where η(x, y) is the mixed total noise image at (x, y). In the Poisson-Gaussian mixed noise model, the mixed total noise image η(x, y) contains signal-dependent (Poisson distribution) noise and signal-independent (Gaussian distribution) noise, and is modeled as: where p S (x, y) follows Poisson distribution, that is p S (x, y) ∼ P( f S (x, y)), and as mentioned above, the f N (x, y) ∼ N(0, σ 2 n ) at (x, y). Hence, the noise level function becomes: where σ 2 η (x, y) is the local total noise variance of mixed noise model, f S (x, y) is the expected intensity of noise-free image which is approximately equal to the local mean value f (x, y) of original noise image, ρ and σ 2 n represent the Poisson noise parameter and Gaussian noise variance, respectively. In the PGN model, our mission was mainly to estimate the two parameters ρ and σ 2 n . We can calculate the local mean f (x, y) of the selected image blocks, and estimate the local total variance σ 2 η (x, y). Then, a set of local mean-variance was extracted to accurately estimate ρ and σ 2 n by MLE.

Proposed Homogenous Blocks Selection Method
Primarily, a group of image blocks with size (M + 1) × (N + 1) from input noisy image of size R × C is generated by sliding the rectangular window pixel-by-pixel, and the group of blocks is expressed: is the total number of blocks, and the local mean of nearly noise-free signal is computed via averaging all the noisy pixels in the block: where the local window is around (x, y), and the window size is (M + 1) × (N + 1). Then, the proposed homogenous blocks selection method is introduced as following. In information theory, Shannon entropy [36] can effectively reflect the information contained in an event. The local gray statistic method is similar to Shannon entropy, but the new modified method focuses on how messy the gray texture values are. Firstly, given the original noisy image, the local map of normalized pixel grayscale value can be calculated as: where i ∈ (x − M/2, x + M/2) and j ∈ (y − N/2, y + N/2) created the location (i, j) in local window around (x, y). Meanwhile f (i, j) is the gray level of original noisy image, g(i, j) is the normalized pixel grayscale value, and ξ = 10 −9 is a small constant used to avoid the denominator becoming zero. Then, the proposed LGSE is defined as follows: where H le (x, y) is the local gray entropy of 3 × 3 center pixels and all of the (M + 1) × (N + 1) neighbor pixels around the location (x, y). According to the theory of Shannon entropy, the LGSE reflects the degree of dispersion of local image grayscale texture. When the local image of gray distribution is uniform, the LGSE is relatively bigger, and when the local image of gray texture level distribution has a large dispersion, the LGSE is smaller. Due to the LGSE is the outcome of combined action of all pixels in the local window, the local entropy itself has a robust ability to resist noise. Six different noise-free textured blocks and their corresponding values of LGSE are given in Figure 2. As shown in Figure 2, the weakly textured blocks have relatively higher LGSE values. Note that here the weak texture is a generic term that includes not only smooth blocks, but also some slightly textured blocks. In Figure 3, the noisy image blocks are the blocks where the noise-free image blocks in Figure 2  In information theory, Shannon entropy [36] can effectively reflect the information contained in an event. The local gray statistic method is similar to Shannon entropy, but the new modified method focuses on how messy the gray texture values are. Firstly, given the original noisy image, the local map of normalized pixel grayscale value can be calculated as: where is a small constant used to avoid the denominator becoming zero. Then, the proposed LGSE is defined as follows: where ( , ) le H x y is the local gray entropy of 3 × 3 center pixels and all of the ( ) ( ) neighbor pixels around the location ( , ) x y . According to the theory of Shannon entropy, the LGSE reflects the degree of dispersion of local image grayscale texture. When the local image of gray distribution is uniform, the LGSE is relatively bigger, and when the local image of gray texture level distribution has a large dispersion, the LGSE is smaller. Due to the LGSE is the outcome of combined action of all pixels in the local window, the local entropy itself has a robust ability to resist noise. Six different noise-free textured blocks and their corresponding values of LGSE are given in Figure 2. As shown in Figure 2, the weakly textured blocks have relatively higher LGSE values. Note that here the weak texture is a generic term that includes not only smooth blocks, but also some slightly textured blocks. In Figure 3, the noisy image blocks are the blocks where the noise-free image blocks in

Homogenous Blocks Selection Based on LGSE with Histogram Constraint Rule
Dong et al. [33] indicated that the image gray level histogram and block texture degree have a strong relationship. Inspired by this vision, to reduce or even overcome the disturbance of too many outliers, the gray level histogram-based constraint rule is introduced to firstly filter out the image blocks with disorderly rich textures.
In [19,28,30], the estimated noise level functions (NLFs) all have a comb shape in these scatterplots. These comb-shaped NLFs indicate that the pixel intensities approaching the highest or lowest pixel intensity may cause a disaster for noise estimation, because the brightest or darkest pixels may generate a number of outliers, ultimately reducing the precision of noise estimation. Therefore, we first exclude the blocks whose pixel mean value is too dark (0-15, the pixel intensity range is 0 to 255) or too bright (240-255) in the gray level histogram: where i f is the mean gray value of the i-th block, i e is the exclusion rule of darkest or brightest blocks, and i b is the updated values of i-th block by darkest or brightest block removal operation.
[16, 239] r I ∈ is the residual gray level of B after dark or bright block removal operation. The probability of occurrence of r I can be computed by: where ( ) r hist I denotes the frequency of r I in gray level histogram and PN T is the total pixel number of non-zero values of B . The blocks where gray values do not occur frequently may also have high LGSE values, which will generate some undesirable isolated values. Therefore, rather than dealing with all of gray levels, we only explore the gray levels with high occurrences. Accordingly, we try to eliminate the blocks with low frequency of occurrence below a certain threshold value. To solve this gap, the joint probability is firstly introduced as:

Homogenous Blocks Selection Based on LGSE with Histogram Constraint Rule
Dong et al. [33] indicated that the image gray level histogram and block texture degree have a strong relationship. Inspired by this vision, to reduce or even overcome the disturbance of too many outliers, the gray level histogram-based constraint rule is introduced to firstly filter out the image blocks with disorderly rich textures.
In [19,28,30], the estimated noise level functions (NLFs) all have a comb shape in these scatterplots. These comb-shaped NLFs indicate that the pixel intensities approaching the highest or lowest pixel intensity may cause a disaster for noise estimation, because the brightest or darkest pixels may generate a number of outliers, ultimately reducing the precision of noise estimation. Therefore, we first exclude the blocks whose pixel mean value is too dark (0-15, the pixel intensity range is 0 to 255) or too bright (240-255) in the gray level histogram: where f i is the mean gray value of the i-th block, e i is the exclusion rule of darkest or brightest blocks, and b i is the updated values of i-th block by darkest or brightest block removal operation. I r ∈ [16,239] is the residual gray level of B after dark or bright block removal operation. The probability of occurrence of I r can be computed by: where hist(I r ) denotes the frequency of I r in gray level histogram and T PN is the total pixel number of non-zero values of B. The blocks where gray values do not occur frequently may also have high LGSE values, which will generate some undesirable isolated values. Therefore, rather than dealing with all of gray levels, we only explore the gray levels with high occurrences. Accordingly, we try to eliminate the blocks with low frequency of occurrence below a certain threshold value. To solve this gap, the joint probability is firstly introduced as: where φ( f i ) = hist( f i )/max[hist(I r )] is the frequency of f i versus maximum frequency of I r and thr is the threshold to evaluate and remove the blocks with low occurrence frequency of mean gray value. In terms of Bayes rule, the conditional probability can be expressed as: By using the Equations (12)(13)(14), the blocks whose occurrence probability of their mean gray value f i is smaller than the conditional probability value will be eliminated. These procedures of gray level histogram-based constraint rule can be simply considered that we arrange the gray levels of pixels in a descending order, select the blocks of mean gray value f i greater than thr, and renew block set B. To be specific, we set thr = median(φ( f i )) to remove disorderly blocks. Hence, the blocks where the mean gray values do not occur frequently represent disorderly rich textured blocks, and the LGSE values of those blocks can be set as zero values. In Figure 4, the whole procedure of histogram-based constraint rule for eliminating outliers is shown using the "Birds" image as example. Figure 4a shows the original "Birds" image and its corresponding gray level histogram is shown in Figure 4b,c is the result of the selected gray levels using histogram constraint rule to overcome outliers. In Figure 4d, the green dots have covered the residual pixel blocks after the operation of histogram constraint rule.
is the frequency of i f versus maximum frequency of r I and thr is the threshold to evaluate and remove the blocks with low occurrence frequency of mean gray value. In terms of Bayes rule, the conditional probability can be expressed as: By using the Equations (12)(13)(14), the blocks whose occurrence probability of their mean gray value i f is smaller than the conditional probability value will be eliminated. These procedures of gray level histogram-based constraint rule can be simply considered that we arrange the gray levels of pixels in a descending order, select the blocks of mean gray value i f greater than thr , and renew block set B . To be specific, we set to remove disorderly blocks. Hence, the blocks where the mean gray values do not occur frequently represent disorderly rich textured blocks, and the LGSE values of those blocks can be set as zero values. In Figure 4, the whole procedure of histogram-based constraint rule for eliminating outliers is shown using the "Birds" image as example. Figure 4a shows the original "Birds" image and its corresponding gray level histogram is shown in Figure 4b,c is the result of the selected gray levels using histogram constraint rule to overcome outliers. In Figure 4d, the green dots have covered the residual pixel blocks after the operation of histogram constraint rule. The histogram constraint rule is a simple pretreatment to remove undesirable outliers but cannot obtain the reliable weakly textured blocks. To further suppress the disturbance of the textures of residual blocks, the LGSE-based homogenous image blocks selection method is proposed: where τ is the selected minimum value of LGSE, max le H is the maximum value of LGSE, and δ is the select ratio to control the weakly textured blocks selection. Based on the statistics and observation of noise estimation processing of 134 scene images, the select ratio is empirically set 10% δ = of the total pixel number of whole images in our experiments. This setting means that we only selected 10% of the block set as homogenous blocks. An example for the homogenous blocks selection in "Birds" image is shown in Figure 5 and the 15 × 15 red boxes have outlined the finally selected homogenous blocks. The whole operations of homogenous blocks selection of "Barbara" and "House" are shown in Figure 6. The histogram constraint rule is a simple pretreatment to remove undesirable outliers but cannot obtain the reliable weakly textured blocks. To further suppress the disturbance of the textures of residual blocks, the LGSE-based homogenous image blocks selection method is proposed: where τ is the selected minimum value of LGSE, maxH le is the maximum value of LGSE, and δ is the select ratio to control the weakly textured blocks selection. Based on the statistics and observation of noise estimation processing of 134 scene images, the select ratio is empirically set δ = 10% of the total pixel number of whole images in our experiments. This setting means that we only selected 10% of the block set as homogenous blocks. An example for the homogenous blocks selection in "Birds" image is shown in Figure 5 and the 15 × 15 red boxes have outlined the finally selected homogenous blocks. The whole operations of homogenous blocks selection of "Barbara" and "House" are shown in Figure 6.

Haar Wavelet-Based Local Median Absolute Deviation for Local Variance Estimation
In this paper, a robust Haar wavelet-based local median absolute deviation (HLMAD) method is presented to estimate the standard deviation of noisy image block. The Haar wavelet, which is one of the simplest but most commonly used among wavelet transforms, can be exploited to detect noise for its good regularity and orthogonality. In the first scale of 2-D Haar wavelet analysis, the HH coefficients represent the high frequency component that is the noise component in selected homogenous blocks. The sub-band wavelet coefficients (HH) of first scale of 2-D Haar wavelet transform are calculated by:

Haar Wavelet-Based Local Median Absolute Deviation for Local Variance Estimation
In this paper, a robust Haar wavelet-based local median absolute deviation (HLMAD) method is presented to estimate the standard deviation of noisy image block. The Haar wavelet, which is one of the simplest but most commonly used among wavelet transforms, can be exploited to detect noise for its good regularity and orthogonality. In the first scale of 2-D Haar wavelet analysis, the HH coefficients represent the high frequency component that is the noise component in selected homogenous blocks. The sub-band wavelet coefficients (HH) of first scale of 2-D Haar wavelet transform are calculated by:

Haar Wavelet-Based Local Median Absolute Deviation for Local Variance Estimation
In this paper, a robust Haar wavelet-based local median absolute deviation (HLMAD) method is presented to estimate the standard deviation of noisy image block. The Haar wavelet, which is one of the simplest but most commonly used among wavelet transforms, can be exploited to detect noise for its good regularity and orthogonality. In the first scale of 2-D Haar wavelet analysis, the HH coefficients represent the high frequency component that is the noise component in selected homogenous blocks. The sub-band wavelet coefficients (HH) of first scale of 2-D Haar wavelet transform are calculated by: where f (x, y) is the original noisy image, H 1x (x, y) is the high frequency component of first step which uses 1-D Haar analysis in each row of the noisy image, and H 2xy (x, y) is the high frequency coefficients of 2-D Haar wavelet analysis. Since the MAD is a more stable statistical deviation measure than sample variance, it works much better for more noise distributions. In addition, the MAD is more robust to outliers in datasets than sample standard deviation. By applying the robust MAD depicted in [15,16] to estimate the noise variance, the local block standard deviationσ η (x, y) is derived as: where MAD[H 2xy (i, j)] is the median value of absolute deviation of the high frequency coefficients of 2-D Haar wavelet H 2xy (i, j), the constant of proportionality factor k = Φ −1 (3/4) = 0.6745, andσ η (x, y) is the estimated standard deviation of the selected homogenous image block.

Maximum Likelihood Estimation for Multi-Parameter Estimation
According to the central limit theorem, the distribution of the sample approximately follows normal distribution when the number of sampling points is sufficient. Therefore, by fitting the NLF model σ 2 η (x, y) = ρ f S (x, y) + σ 2 n , the likelihood function of the dataset of selected homogenous blocks would be written as: where T is the total number of selected blocks, dataset D is a set of local pixel mean value and local total variance pair ( f S ,σ 2 η ), and d i = ( f i ,σ 2 ηi ), in here, f i andσ 2 ηi are the pixel mean value and the estimated noise variance of the i-th block. In addition, the ln-likelihood function is: According to the nature of maximum likelihood estimator, the two parametersρ andσ 2 n could be estimated through maximizing the probability L(ρ, σ 2 n ) of the selected samples: Here, the gradient descent method is applied to solve the maximum likelihood function: And the two parametersρ andσ 2 n of NLF can be estimated reliably.

Proposed Noise Parameter Estimation Algorithm for the AWGN Model
In the most commonly used image sensor noise model that is AWGN model, the noise standard deviation is the only parameter that needs to be estimated. According to these above mentioned methods and theories, the accurate noise standard deviation estimation algorithm is established. Firstly, we divide the noisy image into a group of blocks by sliding window pixel-by-pixel, and compute the mean gray value of each block. The LGSE of each block is calculated, and the LGSE values of darkest and brightest blocks are excluded. Next, the LGSE values of residual blocks make a descending order, and the homogenous blocks can be extracted by selecting several largest LGSE values. Then, the local standard deviation of each selected block is computed by the HLMAD, and build up a cluster of local standard deviation. Finally, the noise standard deviation is precisely estimated by picking the median of the cluster:σ whereσ η is the cluster of local standard deviationσ η (x, y),σ n is the estimated noise standard deviation for AWGN model. The whole of the proposed noise parameter estimation algorithm for the CCD sensor AWGN model is summarized in Algorithm 1.

Algorithm 1. Proposed noise parameter estimation algorithm for the AWGN model
Input: Noisy image f , window size N, blocks selection ratios δ. Output: Estimated noise standard deviationσ n .
Step 1: Group a set of blocks by sliding window pixel-by-pixel: Step 2: Compute the mean gray value f (x, y) of all pixels at each block.
Step 3: for block index k = 1:BN do Compute the LGSE of blocks according to (8) and (9). end for Step 4: Exclude the LGSE of blackest and whitest blocks according to (10) and (11).
Step 5: Select homogenous blocks based on selection of residual LGSE using (15).
Step 6: for homogenous block index t = 1:T do Obtain the local standard deviation of homogenous block by HLMAD according to (16)(17)(18).

end for
Step 7: Estimate the noise standard deviationσ n via using median estimator derived from (23).

Proposed Noise Parameter Estimation Algorithm for the PGN Model
We also work on the PGN model, which is the most likely model for practical image sensor noise. It is noteworthy that the proposed estimation algorithm for the PGN model generally agrees with the proposed algorithm for AWGN model. Contrasted with Algorithm 1, for the PGN model, we append the gray level histogram-based constraint rule method for firstly removing disorderly blocks, and compute the local mean value of selected blocks. Then, the local mean-variance pair ( f ,σ 2 η ) of selected blocks can be obtained. Finally, by utilizing the MLE estimator to process the local mean-variance pair ( f ,σ 2 η ), the two parametersρ andσ 2 n ) of PGN model are estimated credibly. The whole of the proposed noise parameter estimation algorithm for the image sensor PGN model is summarized in Algorithm 2.

Algorithm 2. Proposed noise parameter estimation algorithm for the PGN model
Input: Noisy image f , window size N, blocks selection ratios δ. Output: Estimated NLF parametersρ andσ 2 n .
Step 1: Group a set of blocks by sliding window pixel-by-pixel: Step 2: Compute the mean gray value f (x, y) of all pixels in each block.
Step 3: for block index k = 1:BN do Compute the LGSE of blocks according to (8) and (9). end for Step 4: Exclude the LGSE of blackest and whitest blocks according to (10) and (11).
Step 5: Utilize the gray level histogram-based constraint rule to remove disorderly blocks, and exclude the LGSE of low frequency gray value according to (12)(13)(14).
Step 6: Select homogenous blocks based on selection of residual LGSE using (15).
Step 7: for homogenous block index t = 1:T do Compute the mean gray value of all pixels in selected block using (7). Obtain the local variance of homogenous block by HLMAD according to (16)(17)(18).

Experimental Results
In this section, a series of experiments on synthesized noisy images under various scene images are conducted to evaluate the performance of proposed noise estimation algorithm. Furthermore, some state-of-the-art algorithms and classical algorithms are selected for performance comparison. These experiments are performed in Matlab 2016a (developed by MathWorks, Massachusetts, USA) on the computer with 3.2 Ghz Intel i5-6500 CPU and 16 Gb random access memory.

Test Dataset
The test dataset is composed of 134 images for synthesized noisy images, which were generated by adding the AWGN or PGN component to three typical test datasets. These three datasets consisted of classic standard test images (CSTI), Kodak PCD0992 images [37] and Berkeley segmentation dataset (BSD) images [38]. The CSTI images have 10 classic standard test images of size 512 × 512 and are shown in Figure 7. The Kodak PCD0992 images have 24 images of size 768 × 512 or 512 × 768 released by the Eastman Kodak Company for unrestricted usage, and many researchers use them as a standard test suite for image de-noising testing. The BSD images totally have 100 test images and 200 train images of size 481 × 321 or 321 × 481, but in our experiments, we randomly selected 25 images from the Berkeley test set and 75 images from Berkeley train set to process. Therefore, the test dataset contains various scene images. Testing on this dataset proves that the algorithm is suitable for many scenarios. Sensors 2019, 19, x FOR PEER REVIEW 13 of 23 Figure 7. Classic standard test images for synthesized noisy images: "Barbara," "Lena," "Pirate," "Cameraman," "Warcraft," "Couple," "Peppers," "Bridge," "Hill" and "Einstein."

Effects of Parameters
In this part, the experiment is conducted to compare the performance of proposed noise estimation algorithm under various parameter configurations. To qualify the accuracy of the proposed noise estimation algorithm, the mean error of noise level estimation is used to compare the effects of different parameters: . Obviously, the more accurate the noise estimation algorithm is, the smaller the mean error is.
The proposed noise estimation algorithm is a block-based method, and the performance of proposed method is related to block size. In this experiment, the test dataset with selected 134 images was processed by the proposed noise estimation algorithm with different block sizes. The mean errorbars of different block sizes are shown in Figure 8, and it indicates that the block size 15 N = can be more suitable for these noisy scene images.  . Classic standard test images for synthesized noisy images: "Barbara," "Lena," "Pirate," "Cameraman," "Warcraft," "Couple," "Peppers," "Bridge," "Hill" and "Einstein."

Effects of Parameters
In this part, the experiment is conducted to compare the performance of proposed noise estimation algorithm under various parameter configurations. To qualify the accuracy of the proposed noise estimation algorithm, the mean error of noise level estimation is used to compare the effects of different parameters: where σ 2 added is the added noise variance, σ 2 est is the group of estimated noise variances, and σ 2 est is the average value of estimated noise variance. In this parameter selection experiment, we set noise level n ∈ [0, 30]. Obviously, the more accurate the noise estimation algorithm is, the smaller the mean error is.
The proposed noise estimation algorithm is a block-based method, and the performance of proposed method is related to block size. In this experiment, the test dataset with selected 134 images was processed by the proposed noise estimation algorithm with different block sizes. The mean error-bars of different block sizes are shown in Figure 8, and it indicates that the block size N = 15 can be more suitable for these noisy scene images.  Figure 7. Classic standard test images for synthesized noisy images: "Barbara," "Lena," "Pirate," "Cameraman," "Warcraft," "Couple," "Peppers," "Bridge," "Hill" and "Einstein."

Effects of Parameters
In this part, the experiment is conducted to compare the performance of proposed noise estimation algorithm under various parameter configurations. To qualify the accuracy of the proposed noise estimation algorithm, the mean error of noise level estimation is used to compare the effects of different parameters: . Obviously, the more accurate the noise estimation algorithm is, the smaller the mean error is.
The proposed noise estimation algorithm is a block-based method, and the performance of proposed method is related to block size. In this experiment, the test dataset with selected 134 images was processed by the proposed noise estimation algorithm with different block sizes. The mean errorbars of different block sizes are shown in Figure 8, and it indicates that the block size 15 N = can be more suitable for these noisy scene images.

Comparison to AWGN Estimation Baseline Methods
In this part, four classical noise level estimation methods and three state-of-the-art noise level estimation methods are introduced in the comparison experiments to evaluate the performance of the proposed AWGN level estimation method. The Immerkaer's fast noise variance estimation (FNVE) [9], Khalil's median absolute deviation (MAD) based noise estimation [39], Santiago's variance mode (VarMode) noise level estimation [40] and Zoran's discrete cosine transform (DCT) based noise estimation [12] were chosen as the classical noise level estimation methods. The Olivier's nonlinear noise estimator (NOLSE) [11], Pyatykh's principal component analysis (PPCA) based noise esti-mation [17] and Lyu's noise variance estimation (EstV) [13] were selected as the state-of-the-art noise estimation methods. Figure 9 shows three example images ("Barbara", "House", "Birds") which were selected from three image datasets, and the corresponding noise level estimation results were obtained by the compared noise estimation methods. The original images are shown in the first row. Figure 9d-f shows their results of noise level estimation respectively. As shown in Figure 9, the DCT-based noise estimator performs better at low noise level, but underestimates the noise at higher noise level. FNVE, MAD, VarMode and NOLSE noise estimators easily overestimate the noise level. EstV noise estimator underestimates the noise level in each instance. For most noise levels, both the PPCA-based AWGN estimator and the proposed AWGN estimator work well. In these three scenes, our proposed method outperforms these several existing noise estimation methods. In this part, four classical noise level estimation methods and three state-of-the-art noise level estimation methods are introduced in the comparison experiments to evaluate the performance of the proposed AWGN level estimation method. The Immerkaer's fast noise variance estimation (FNVE) [9], Khalil's median absolute deviation (MAD) based noise estimation [39], Santiago's variance mode (VarMode) noise level estimation [40] and Zoran's discrete cosine transform (DCT) based noise estimation [12] were chosen as the classical noise level estimation methods. The Olivier's nonlinear noise estimator (NOLSE) [11], Pyatykh's principal component analysis (PPCA) based noise estimation [17] and Lyu's noise variance estimation (EstV) [13] were selected as the state-of-the-art noise estimation methods. Figure 9 shows three example images ("Barbara", "House", "Birds") which were selected from three image datasets, and the corresponding noise level estimation results were obtained by the compared noise estimation methods. The original images are shown in the first row. Figure 9d-f shows their results of noise level estimation respectively. As shown in Figure 9, the DCT-based noise estimator performs better at low noise level, but underestimates the noise at higher noise level. FNVE, MAD, VarMode and NOLSE noise estimators easily overestimate the noise level. EstV noise estimator underestimates the noise level in each instance. For most noise levels, both the PPCA-based AWGN estimator and the proposed AWGN estimator work well. In these three scenes, our proposed method outperforms these several existing noise estimation methods. To further prove the capability of the proposed method, we expanded our experiments on test dataset with 134 images. Tables 1-3 show the results of different AWGN estimation algorithms on the CSTI images, the Kodak PCD0992 images and the BSD images, respectively. In Tables 1-3, we set the added noise levels n σ = 0, 1, 5, 10, 15, 20 and 25. As shown in the Tables 1-3, FNVE, MAD, NOLSE and VarMode estimators overestimate the noise level. This is because these filter-based methods fail to fully consider the effects of image textures on noise estimation. DCT and EstV estimators work well for low noise levels, even better than the proposed estimator when the noise level is less than five, but seriously underestimate the noise level at high noise conditions. The reason To further prove the capability of the proposed method, we expanded our experiments on test dataset with 134 images. Tables 1-3 show the results of different AWGN estimation algorithms on the CSTI images, the Kodak PCD0992 images and the BSD images, respectively. In Tables 1-3, we set the added noise levels σ n = 0, 1, 5, 10, 15, 20 and 25. As shown in the Tables 1-3, FNVE, MAD, NOLSE and VarMode estimators overestimate the noise level. This is because these filter-based methods fail to fully consider the effects of image textures on noise estimation. DCT and EstV estimators work well for low noise levels, even better than the proposed estimator when the noise level is less than five, but seriously underestimate the noise level at high noise conditions. The reason is that these two methods use band-pass statistical kurtosis to extract noise components and eliminate the interference of textures to noise estimation. For higher noise levels, these estimators remove too many noise components while removing textures, which leads to underestimation of noise. Compared with those above methods, the PPCA estimator has a better performance. In most cases, the proposed AWGN estimation method is superior to the PPCA estimator. Generally speaking, the experimental results prove that the proposed AWGN estimator not only is suitable for most noise levels, but also has the better estimation capability compared with those state-of-the-art methods.  [35] were selected as baseline methods because they are well studied and widely used for assessing new PGN estimator. Figure 10 shows three example images, and their corresponding estimated NLF results. The noisy images with ρ = 0.5 and σ 2 n = 10 are shown in the first row. The second row displays their NLF results of the proposed estimation method respectively. The third row shows the estimated NLF results of different PGN estimation methods respectively. It can be seen in Figure 10 that, the CPG, SPGN and RCF noise estimation methods overestimate the NLF in three examples, while both the LPCA-based PGN estimator and proposed PGN estimator work well, and the proposed method works better than LPCA on "Barbara" and "Birds" at noise parameters ρ = 0.5 and σ 2 n = 10.  Figure 10 shows three example images, and their corresponding estimated NLF results. The noisy images with ρ = 0.5 and 2 n σ =10 are shown in the first row. The second row displays their NLF results of the proposed estimation method respectively. The third row shows the estimated NLF results of different PGN estimation methods respectively. It can be seen in Figure 10 that, the CPG, SPGN and RCF noise estimation methods overestimate the NLF in three examples, while both the LPCA-based PGN estimator and proposed PGN estimator work well, and the proposed method works better than LPCA on "Barbara" and "Birds" at noise parameters ρ = 0.5 and 2 n σ = 10.  Table 6 shows that both the proposed PGN estimator and LPCA-based PGN estimator have comparable estimation results and are better than other estimators on BSD  Tables 4-6, CPG, RCF and SPGN estimators overestimate the parameters of NLF. Tables 4 and 5 depict that the proposed PGN estimator work better than other PGN estimators on CSTI images and Kodak PCD0992 images in all cases. Table 6 shows that both the proposed PGN estimator and LPCA-based PGN estimator have comparable estimation results and are better than other estimators on BSD images. This indicates that the LPCA-based PGN estimator performs well for BSD images of size 481 × 321 but the proposed PGN estimator can obtain the best performance for all three image datasets, which means that the proposed PGN estimator can work more stably for images with different sizes. Consequently, compared with these representative PGN estimators, the proposed PGN estimator shows more accuracy for various scenarios at different PGN parameters. Blind de-noising is a pre-processing application that needs the estimated noise parameters. In this part, we try to prove that the proposed AWGN estimator and proposed PGN estimator can promote the performance of existing blind de-noising algorithms. In this part, we chose the state-of-the-art de-noising algorithm BM3D [42] to remove the estimated AWGN of noisy image, and selected representative PGN de-noising algorithm VST-BM3D [43] to eliminate the estimated PGN of noisy image.
In order to make a reliable comparison of similarity between noise-free image and de-noised image, two image quality assessment methods were used in this paper: (1) The structural similarity index measurement (SSIM) [44] and (2) the peak signal-to-noise ratio (PSNR). The SSIM is defined as: where f is the noisy image, f S is the noise-free image, u f and u f S are the mean values of noisy image and noise-free image, respectively; σ f , σ f S and σ f , f S are standard deviations of noisy image, noise-free image and their covariance, respectively; C 1 and C 2 are small positive constants used to avoid the denominator becoming zero. The PSNR is written as: where MSE is the mean squared error of noisy image and can be derived from: where the size of input noisy image is R × C, and (r, c) is the pixel location.

Noise Estimation Tuned for AWGN Blind De-Noising
To quantitatively evaluate the performance of proposed noise estimation algorithm for blind de-noising, all 134 test images of the test dataset were used in AWGN blind de-noising experiment. The added noise levels were set as σ n = 1, 5, 10, 15, 20 and 25 in this experiment. The average SSIM and PSNR comparisons of different AWGN estimators with BM3D for blind de-noising on the test dataset are shown in Figure 11. Figure 11a depicts the SSIM values of different AWGN estimators with BM3D for blind de-noising, and the proposed estimator with BM3D de-noising algorithm has the biggest SSIM values at different noise levels. This demonstrates that the proposed AWGN estimator can promote the structure similarity index of blind de-noising. Figure 11b shows the proposed estimator with BM3D de-noising algorithm has the highest bars of PSNR value at different noise levels. This indicates that the proposed AWGN estimator can decrease the distortion of blind de-noising. In summary, the proposed AWGN estimator can increase the performance of blind de-noising stably.  Figure 12 shows the average SSIM and PSNR values of different PGN estimators with VST-BM3D for blind de-noising at different noise parameters, and the proposed PGN estimator with VST-BM3D de-noising algorithm has the largest SSIM and PSNR values at different noise parameters and is superior to LPCA. This demonstrates that the proposed PGN estimator can improve the performance of PGN blind de-noising. From above experiments, it can be seen that the proposed AWGN and PGN estimators not only can work stably for various scene images with different noise parameters, but also can promote the performance of blind de-noising.  Figure 12 shows the average SSIM and PSNR values of different PGN estimators with VST-BM3D for blind de-noising at different noise parameters, and the proposed PGN estimator with VST-BM3D de-noising algorithm has the largest SSIM and PSNR values at different noise parameters and is superior to LPCA. This demonstrates that the proposed PGN estimator can improve the performance of PGN blind de-noising. From above experiments, it can be seen that the proposed AWGN and PGN estimators not only can work stably for various scene images with different noise parameters, but also can promote the performance of blind de-noising.

Conclusions and Future Work
A novel method based on the properties of LGSE and HLMAD is presented in this paper to estimate the AWGN and PGN parameters of an image sensor at different noise levels. By using the map of LGSE, the proposed method can select homogenous blocks from an image with complex

Conclusions and Future Work
A novel method based on the properties of LGSE and HLMAD is presented in this paper to estimate the AWGN and PGN parameters of an image sensor at different noise levels. By using the map of LGSE, the proposed method can select homogenous blocks from an image with complex textures and strong noise. The local noise variances of the selected homogenous blocks are efficiently computed by the HLMAD, and the noise parameters can be estimated accurately by the MLE. Extensive experiments verify that the proposed AWGN and PGN estimation algorithms have a better estimation performance than compared state-of-the-art methods, including FNVE, MAD, VarMode, DCT, NOLSE, PPCA, EstV for the AWGN model and CPG, RCF, SPGN, LPCA for the PGN model. The experimental results also demonstrate that the proposed method can work stably for various scene images at different noise levels and can improve the performance of blind de-noising. Therefore, combing the proposed noise estimators with recent de-noising methods to develop a novel blind de-noising algorithm, which can remove image sensor noise and preserve fine details effectively for actual noisy scene images, is one important direction in our future studies.