Optimum Threshold Detection using Genetic Algorithm for Image Denoising

DOI : 10.17577/IJERTV6IS060370

Download Full-Text PDF Cite this Publication

Text Only Version

Optimum Threshold Detection using Genetic Algorithm for Image Denoising

Pramitha V T PG Student

Department of Electronics and Communication Engineering

N S S College of Engineering, Palakkad

Anil Kumar K R Faculty

Department of Electronics and Communication Engineering

N S S College of Engineering, Palakkad

Abstract – Image processing is the technique of analyzing and manipulating a digitized image to improve the quality of the image. Removal of noise from original image is a major challenge in digital image processing. Denoising algorithm is selected based on the type of application used. The high frequency analysis techniques like Non Harmonic Analysis (NHA) based denoising methods are currently used in image processing. They have good noise removal accuracy. But choice of threshold is a major limitation of such methods. This paper proposes an optimum threshold detection scheme based on genetic algorithm for image denoising.

Key WordsDenoising, NHA, genetic algorithm, optimum threshold


    Image denoising is an important task in image processing. There are various methods available for image denoising. A good denoising method helps to remove the noise of an image without much loss in edge details. Selection of the denoising technique depends on two the type of the image and type of the noise present in it [1].

    Images can be broadly divided in to three types. They are binary images, gray scale images and color images. Binary images take only two discrete values, black and white. In encoding black is represented as 0 and white as 1. Gray scale images are commonly called as monochrome images. It does not consist of color information. The pixel value gives the intensity of the image. It contains 8 bits per pixel data. Thus 256 brightness levels are present. Color images have different colors for different bands. Normally it has red, green and blue images. Thus they are often called as RGB images. It consists of 24 bits per pixel image [2].

    Noises arises due to various factors like bit error rate, speed, dead pixels etc. They can be broadly divided as additive noise and multiplicative noise. In additive noise, the noise pixel gets added to the original image pixel. In the multiplicative noise, the noisy image pixel is the product of original and noise pixel value. The examples of additive noise are Gaussian noise, salt and pepper noise. Speckle noise is a type of multiplicative noise.

    Spatial domain filtering and transform domain filtering are the two major denoising approaches. In spatial domain filtering, simple spatial filters are used to remove the noise. There are two types of spatial filters: Linear filters and Non linear filters [3]. Mean filters and weiner filters are

    examples of linear filters. In mean filtering method, the pixels showing abnormal behavior from their surrounding pixels are replaced by the mean value of the sliding window used. Thus the intensity variations between adjacent pixels are reduced. Thus image gets smoothened. Median filter is an example of Non linear filters. Here the central pixel value of window is replaced by median value of the window. These filters have good edge preservation abilities [4].

    Transform domain filtering technique employs wavelet based noise removal method [5]. The noise in the signal domain is mapped to the noise in transform domain. The signal energy will concentrate in transform domain. But noise energy, due to its random nature will not. Thus noise component can be easily removed.

    In this paper different denoising techniques including Gaussian filtering, bilateral filtering and non harmonic analysis (NHA) based denoising are implemented and their performances are compared. Though the NHA method gives better results than the other methods, choice of threshold is a major limitation in this method. The main aim is to find the optimum threshold value for denoising. For that genetic algorithm (GA) technique was employed to find the optimum threshold value. The final results show that the proposed scheme outperforms the existing methods.

    The paper is organized as follows: Section II briefly explains the denoising schemes evaluated. Section III explains the GA based optimum threshold detection scheme. Methodology is explained in Section IV. Section V analyses the performance and results. Section VI deal with conclusions and future scopes.


    Image denoising using Gaussian filtering, bilateral filtering and mask NHA are evaluated. Gaussian filtering is a simple spatial domain filtering method. Bilateral filtering is a type of domain filtering. NHA is a high resolution frequency analysis technique.

    1. Gaussian filtering

      The Gaussian filter smoothen the image irrespective of the edges. It is based on peak detection. Peaks are considered as impulses. The two-dimensional zero-mean

      discrete Gaussian function given in Eq. 2.1 is used as a smoothing filter in image processing.

      increases the frequency resolution of DFT and DCT but reduces their spatial resolution. NHA can obtain a frequency of satisfactory resolution with a relatively small

      g(x, y) exp[((i)2 ( j)2 ) / 2 2 ]


      window because it does not depend on the size of the analysis window.

      Here 2 is the noise variance. The amount of smoothing performed by the filter will be the same in all directions. Gaussian filter smoothens by replacing each image pixel with a weighted average of the neighboring pixels such that the weight given to a neighbor decreases monotonically with distance from the central pixel. This property is important since an edge is a local feature in an image, and a smoothing operation that gives more significance to pixels farther away will distort the features [6].

      The width, and the degree of smoothing, of a Gaussian filter is parameterized by Gaussian spread parameter (j). The relationship between j and the degree of smoothing is very simple. A larger j implies a wider Gaussian filter and greater smoothing. We can adjust the degree of smoothing to achieve a compromise between excessive blur of the desired image features. Large Gaussian filters can be implemented very efficiently because Gaussian functions are separable [6].

    2. Bilateral filtering

      The bilateral filter is a non-linear technique that can blur an image while preserving strong edges. It is commonly used in computational photography applications such as tone mapping, style transfer, relighting, and denoising. Its formulation is simple: each pixel is replaced by a weighted average of its neighbors. It depends only on two parameters that indicate the size and contrast of the features to preserve. It can be used in a non-iterative manner. This makes the parameters easy to set since their effect is not cumulative over several iterations [10].


      However, analysis using NHA leads to distorted results in case of non-stationary signals because like DFT and DCT, NHA assumes the stationarity of the signals of the analysis window. Further, sidelobes occur if an image containing edges is analyzed. To address this problem, define and then mask the edge regions. Thus homogeneity is introduced in the image. This is the preprocessing step of denoising [8].

      The mask NHA method exhibits better denoising performance than the existing techniques. But the major limitation in this method is the choice of threshold. Inorder to overcome this limitation, genetic algorithm based optimum threshold detection is suggested

  3. GA BASED OPTIMUM THRESHOLD DETECTION Genetic algorithms GAs) are inspired by Darwin's theory of evolution. Solution to a problem solved by genetic algorithms is evolved. Algorithm is started with a set of solutions (represented by chromosomes) called population. Solutions from one population are taken and used to form a new population. This is motivated by a hope, that the new population will be better than the old one. Solutions which are selected to form new solutions (offspring) are selected according to their fitness – the more suitable they are the more chances they have to reproduce. This is repeated until some condition (for example number of populations or

    improvement of the best solution) is satisfied [11].

    Crossover selects genes from parent chromosomes and creates a new offspring. After a crossover is performed, mutation is done. This is to prevent falling all solutions in population into a local optimum of solved problem.


    B Gs (| p q |)Gr (I p I q )Iq



    Mutation changes randomly the new offspring. For binary encoding we can switch a few randomly chosen bits from 1 to 0 or from 0 to 1.

    The bilateral filtering is given Eq. 2.2. W is the normalization factor. Gs is the space gaussian that decreases the value of distant pixels. Gr is the range gaussian that reduces intensity variation. Pa and q are pixel positions and I is the intensity

    1. Non Harmonic Analysis (NHA)

      Non Harmonic Analysis technique estimates the Fourier coefficients by assuming a signal model similar to Fourier Transform. However, the NHA estimates the Fourier coefficients by performing shape fitting of the target signal and signal model using the least squares method. In this way, NHA can reduce the effect of the shape or length of analysis window and can predict surrounding information from a part of the signal [7]. Frequency is expressed as line spectrum. Thus side lobes are reduced. Hence thresholding accuracy is improved. Using a large analysis window

      Chromosomes are selected from the population to be the parents to crossover. The problem is to select these chromosomes. According to Darwin's evolution theory the best ones should survive and create new offspring. The basic part of the selection process is to stochastically select from one generation to create the basis of the next generation. The requirement is that the fittest individuals have a greater chance of survival than weaker ones. This replicates nature in that fitter individuals will tend to have a better probability of survival and will go forward to form the mating pool for the next generation. There are many methods how to select the best chromosomes, for example Roulette wheel selection, Boltzman selection, Tournament selection, Rank selection, Steady state selection.

      The flow chart of the genetic algorithm technique is shown in Fig. 3.1

      Fig. 3.1 Flow chart of genetic algorithm

      The random population is created first. Fittest chromosomes are selected based on any of the selection methods. Then crossover and mutation is performed. Fitness function is evaluated. Optimization is performed till it reaches the maximum iterations.

      In the proposed method, we need to find the optimum threshold value for denoising. The threshold values found using hard or soft thresholding [9] schemes can be used as the initial values. Our aim is to maximize the Peak Signal to Noise Ratio (PSNR). Thus fitness function is to be chosen satistisfying the above constraint. Fix the maximum number of iterations. The optimization process is repeated until the optimum threshold value for denoising is found. Finally thresholding is done and the performance of the denoised image is evaluated.


    .The algorithm for the mask NHA scheme is explained as follows.

      1. Extract edges from a noisy image using canny edge detection

      2. Dene the edge regions through binary dilation of edges

      3. Remove the edge regions from the noisy image

      4. Define the masking matrices and obtain the diagonal details using gradient image

      5. Extract the spectra of the patches

      6. Calculate the spectra of patches and apply universal thresholding

      7. Restore the patches to obtain the final NHA based denoised image

      8. In step 6, after calculating the spectra of patches, use GA based thresholding to get the denoised image

      9. Compare the performance of the NHA and GA based methods with Gaussian and bilateral filtering.


    The standard Lena image (256×256) is used as the input image. Gaussian white noise is added to it. Fig. 5.1 shows the input noisy image.

    Fig. 5.1 Input noisy image

    The Gaussian filtering based and bilateral filtering based denoised images are shown in Fig. 5.2 and Fig. 5.3 respectively.

    Fig. 5.2 Gaussian filtering based denoised image

    The edge details are not preserved in both cases. Thus denoising quality is adversely affected.

    Fig. 5.3 Bilateral filtering based denoised image

    Defining the edge regions through binary dilation is the initial step of mask NHA algorithm. The dilated NHA image is shown in Fig. 5.4.

    Fig. 5.4 Dilated image

    The mask NHA based denoised image is shown in Fig.

    5.5. The proposed GA thresholding based denoised image is shown in Fig. 5.6.

    The genetic algorithm based method exhibits better edge preservation results.

    Fig. 5.5 mask NHA based denoised image

    Fig. 5.6 GA based denoised image

    . Edge details are shown in Fig. 5.7 and 5.8 respectively.

    Fig. 5.7 Edge details of mask NHA

    Fig. 5.8 Edge details of GA based image

    Table 5.1 Performance evaluation of the denoising techniques.

    Denoising Method/Performance Parameters

    PSNR(in dB)





    Gaussian Filter






    Bilateral Filter






    Mask NHA






    GA based method






    Table 5.1 shows the performance evaluation of the denoising techniques. The parameters chosen for the performance evaluation are Peak Signal to Noise Ratio (PSNR), Mean Absolute Error (MAE), Mean Square Error (MSE), Root Mean Square Error (RMSE) and Structural Similarity Index (SSIM.

    We can see that the PSNR value is the maximum for the GA based proposed scheme. Also the error parameters are effectively reduced. Mask NHA method shows better performance than Gaussian and Bilateral based methods. SSIM value is also improved.


Image denoising technique based on mask NHA was implemented here. It shows better performance than the existing Gaussian and Bilateral filtering methods. But choice of threshold was the major limitation of the scheme. To overcome this, genetic algorithm technique was used. Optimum threshold value was detected using the genetic algorithm. Thus denoising quality was improved. Also it gives good edge preservation results. If a good edge preserving segmentation is also incorporated in this method, the performance can be further improved. Thus, there is room for subsequent research.


  1. Azriel Rosenfeld, Picture Processing by Computer, New York:

    Academic Press, 1969

  2. Space Technology Hall of Fame:Inducted Technologies/1994"Space Foundation. 1994. Archived from the original on 4 July 2011.

    Retrieved 7 January 2010

  3. Scott E mbaugh, Computer Vision and Image Processing, Prentice Hall PTR, New Jersey, 1998

  4. Suman Shrestha, Image denoising using new adaptive based median filter Signal & Image Processing : An International Journal (SIPIJ) Vol.5, No.4, August 2014

  5. M. K. Mihcak, I. Kozintsev, and K. Ramchandran, Spatially adaptive statistical modeling of wavelet image coefficients and its application to denoising, in Proc. IEEE ICASSP, SnowBird, 1999, pp. 325356

  6. Charles Boncelet, Image Noise Models in Alan C.Bovik,

    Handbook of Image and Video Processing, 2005

  7. M. Hasegawa, T. Kako, S. H. Hirobayashi, T. Misawa, T. Yoshizawa, and Y. Inazumi, Image inpainting on the basis of spectral structure from 2-D nonharmonic analysis, IEEE Trans.

    Image Process., vol. 22, no. 8, pp. 30083017, Aug. 2013

  8. Fumitaka Hosotani, Yuya inuzuka, Masaya Hasegawa, Shigeki Hirobayashi andTtadanobu Misawa "Image denoising with edge- preserving and segmentation based on mask nha", ieee transactions on image processing, vol. 24, no. 12, december 2015

  9. Donoho D.L., and Johnstone I. M., 1994. Ideal spatial adaptation via wavelet shrinkage Biometrika, vol. 81, pp. 425-455

  10. Ming Zhang and Bahadir K. Gunturk Multiresolution Bilateral Filtering for Image denoising ieee transactions on image processing, 2324-2334 vol. 17, no. 12, december 2008

  11. Georges R. Harik, Fernando G. Lobo, and David E. Goldberg, The Compact Genetic Algorithm, IEEE transactions on evolutionary computation, vol. 3, no. 4, pp-287-298, November 1999

Leave a Reply