Hybrid Genetic Algorithm with Filters to Image Enhancement

107 Hybrid Genetic Algorithm with Filters to Image Enhancement Baydaa S Bhnam baydaa_sulaiman@uomosul.edu.iq College of Computer Sciences and Mathematics  University of Mosul  Received on: 14/10/2012 Accepted on: 30/01/2013 ABSTRACT Image enhancement is a useful and necessary part of image processing and its analysis. The quality of an image could be corrupted by different kinds of noises, added due to the undesired conditions or during the transmission. In this paper, a Hybrid Genetic Algorithm with Filters (HGAF ) is suggested for the removing of impulse noise from digital images. The new suggested algorithm HGAF uses popular (mean , median and min-max filters) and other proposed filters as fitness function for it in order to design eight proposed genetic filters. These eight proposed genetic filters are applied on several gray images corrupted by two types of noise (salt-and-pepper and gaussian noises) with different levels for comparison and to show the effectiveness of them by using the Peak Signal to Noise Ratio (PSNR) and Root Mean Square Error (RMSE). Also, proposed two methods of parents selection to compare between them and types of crossovers and mutations that are used.


Introduction
In the last few years, Evolutionary Computation (EC) solutions [8],have been applied to solve difficult optimization problems via simulated evolution. By repeatedly utilizing selection and reproduction principles to the population of individuals representing solutions to the problem , the evolutionary techniques evolve a satisfactory solution quickly and efficiently. Therefore, EC tools find applications in many problems ranging from telecommunication networks [3], to fuzzy learning [21], to modeling, and data mining [6], as well as image processing problems mostly related to gray-scale restoration [10],feature extraction, and coding. In this study, we intend to use genetic algorithm (GA) in image filtering and enhancement applications. This choice is reasonable due to the fact that: (i) the intention of this experimentation is to obtain the globally optimal setting of the directional processing based vector filtering scheme considered, (ii) GAs are relatively easy to implement, (iii) the optimization problem defined over the vectorial inputs is complex,and (iv) GAs work well in noisy conditions [16]and [19].
Digital images are prone to impulse noise as a result of errors in the image acquisition , transmission , sensing and storage etc. Noise significantly degrades the image quality and cause great loss of information details in the image; thus, denoising is an essential step to improve the image quality. Image denoising has been widely investigated as an initial image processing method during the past four decades [18]. Random variations in the sensor readings make the recorded values different from the ideal ones, introducing errors and undesirable side effects in the subsequent stages of the image processing process [16]. These errors will appear on the image output in different ways depending on the type of disturbance in the signal. Image Noise is classified as Amplifier (Gaussian), Salt(maximum)-and-pepper(minimum)(Impulse),Shot , Quantization (uniform),Film grain, on-isotropic, Speckle(Multiplicative) and Periodic noise [13]and [ 17].

Related work
applied on several gray images corrupted by two types of noise (salt-and-pepper and gaussian noises) with different levels for comparison and to show the effectiveness of them using the Peak Signal to Noise Ratio (PSNR) and RMSE.
This work is organized as follows: Section 3 deals with proposed Hybrid Genetic Algorithm with Filters (HGAF) for de-noising in the images. In section 4, finds fitness function of HGAF in order to design proposed genetic filters. Experimental results in Section 5. The results of filters [5] after and before developed them by HGAF is presented in Section 6. Section 7 shows the results of popular and proposed filters, but without applying HGAF. Section 8 puts forward the conclusions drawn by this paper and Future Research.

The Hybrid Genetic Algorithm with Filters (HGAF)
The HGAF has several fitness functions for removing noise from the image. These fitness functions are popular filters (mean , median , min-max filters) and other proposed filters(that will be explained later) in order to design eight proposed filters for removing noise from images. These genetic filters different from [5] about execute GA over all image as well as window. Also, proposed two methods of parent selected rather than parent selection randomly. These proposed genetic filters have been implemented by using MATLAB 7.10.0(R2010a). The performance of these proposed genetic filtering is analyzed and discussed. The simple and widely used objective image quality metrics are Root Mean Square Error (RMSE) and Peak Signal-to-Noise Ratio (PSNR) [11]and [12]: Here Imold(r,c) is the original image , Imnew(r,c) is an enhanced image, L is 255 and M and N are the total number of pixels in the horizontal and the vertical dimensions of the image.
The Steps of the HGAF as follows: Step 1) Read original image and then add noise to it.
Step 2) Select a two dimensional window P of size 3×3. (consider each pixel in P as chromosome ).
Step 3) Compute the fitness function for the window P using one of popular or proposed filters.
Step 4) Select the parent using one of the proposed methods: • Method 1 : Select parent closer to the original pixel.
• Method 2 : Select parent closer to original window median.
Step 5) Apply crossover between fitness value and each point in window P and, then apply mutation.
Step 6) Compute RMSE of resulting window. Repeat steps from 3 to 6 until the stopping criterion is achieved. The stopping criteria taken is: optimum found or no increase in quality for 50 generations of window.
Step 7) Select the window that minimum RMSE and put it in an array (B). Repeat steps from 2 to7 until all the windows in the entire image are processed.
Step 8) Compute RMSE and PSNR of the resulting image in B. Repeat Steps from 2 to 8 until the stopping criterion is achieved. The stopping criteria taken is: optimum found or no increase in quality for 50 generations of image. Fig. 1 shows the flow control of the HGAF. Firstly, read the original image Im , corrupted image K and then, select a window P of size 3×3. After that, compute fitness function for the window P using one of the popular (mean, median and min-max filters) or proposed filters(that will be explained later). At each time, new two points are created in order to find new window by the crossover between each pixel in a window and the fitness value instead of each two pixels in a window that is used in [5]. Then, one of the pixels is selected using one of the proposed selection methods (select pixel closer to the original pixel or closer to original window median) instead of random selection used in [5] , and apply Mutation to avoid the local minima trapping of the algorithm. The RMSE is computed for the window. After the completion of the first iteration for the window, new window is created and the process continues until the stopping criterion is achieved. Then, a window that minimum RMSE is selected among 50 generation for window and put it in the array B. Repeat this process for each window until all the windows in the entire image are processed , then RMSE and PSNR are computed for the processed image. After the completion of the first iteration for the image , repeat this process for each window until the stopping criterion is achieved (number of generation for image) or old RMSE equal new RMSE (for the image) or old PSNR equal new PSNR. Finally , the image that minimum RMSE and maximum PSNR showed among 50 generation for image. This is another difference from [5] about execute the GA over the image as well as window.

Find Fitness Function of HGAF In order to Design Proposed Genetic Filters
The HGAF is hybrid with many filters most of them popular and others proposed. These filters are used as fitness function of HGAF. The popular filters are used mean, median , and min-max filters , after hybrid them with HGAF called: Genetic mean filter , Genetic median filter and Genetic min-max filter respectively. The proposed filters are elucidated as follows:

• Proposed Genetic Mean Filter
Assume that the pixel being processed is Px and the window_noise is P as 3*3 from the image _noise K. In this proposed filter, Px will be replaced by the mean of the subset of the sorted window Sw according to the conditions that are early determined. Fig.2 shows the proposed genetic mean filter to find the fitness value. The algorithm of this filter to find the fitness value F for window P as follow: The algorithm of the proposed genetic mean filter: Begin Px = P(5) ; Sw = Sort the window_noise (P) Find fitness(F) for window(P) as the following: Case: Px > max(P) ; then F is the mean of last three pixel of Sw as : F=(Sw (7)+Sw (8)+ Sw (9))/3 Case: Px < min(P) ; then F is the mean of first three pixel of Sw as : F=( Sw (1)+Sw (2)+Sw (3))/3 Case: median(P) < Px <=max(P) F=(Sw (6)+Sw (7)+Sw (8))/3 Case: min(P) <= Px< median(P) F=(Sw (2)+Sw (3)+Sw (4))/3 otherwise F= P (5) end

111
Where P is the window_noise as 3*3 , Px is the pixel being processed , F is the Fitness value , Sw is the window_noise 3*3 after been sorted ascending , max(P) is the maximum pixel of P , min(P) is the minimum pixel of P and median(P) is the median pixel of P.

• First Proposed Genetic Median Filter
In this proposed filter, instead of replaced Px with mean , here it will replaced by the median of the subset of the sorted window Sw according to the conditions that are early determined. The algorithm of this filter is is explained below:

• Second Proposed Genetic Median Filter
The idea of this filter is same as of the first proposed genetic median filter but different of it by first two conditions to find the fitness value and as follows: F= max(P) Case: Px < min(P) F=min(P)

• Second Proposed Genetic Midrange Filter
Also, this filter uses midrange metric but, for sorted window after first and last pixel of it are excepted. This algorithm is as follows:  The algorithm of the second proposed genetic midrange filter:

Experimental Results
Begin Sw = Sort window (P) Find fitness(F) for window(P) as the following: Case: Px > max(P) F= max(P) Case: Px < min(P) F=min(P) Otherwise F=(Sw (3)+Sw (7)) /2 end  Tables 5,6,7 and 8 show the values of PSNR and RMSE when apply the second method of parents selection closer to original window median , same type of crossover and mutation and corrupted these images by 0.05 and 0.1 salt-and-pepper noise and Gaussian.     Tables 9 and 10 show the results when apply the second method of parents selection , heuristic crossover , add and sub mutation and corrupted these images by 0.05 salt & pepper noise and gaussian respectively. Fig.3 show the best results of second proposed genetic median filter and first proposed genetic midrange filter.

Results of Filters [5] After and Before Developed them by HGAF
The filters in [5] have been developed them according to HGAF. Tables 11 and 12 show the results of these filters [5] after developed by HGAF and apply the second method of parents selection. Table 13 shows the results of the best genetic filters according to the [5].

Results of the popular and proposed filters but without apply HGAF
The mean , median, min-max and proposed filters have been tested on these images but, without HGAF. Tables 14 and 15 show the results of these filters without HGAF .