ISSN: 2005-4238 IJAST 634
Copyright ⓒ 2019 SERSC
A GRAY SCALE IMAGE SEGMENTATION TECHNIQUE USING HISTOGRAM EQUALIZATION BASED FIREFLY ALGORITHM
N.Shunmuganathan1, V.Sheshathri2, Dr.R.Sankarasubramanian3
1,2Ph.D. Research Scholar, 3Associate Professor
1,2,3Department of Computer Science, Erode Arts and Science college, Erode, Tamilnadu, India
ABSTRACT:
The segmentation of images is one of the essential processing phases, in which an image is separated into several parts. Histogram equalization is a technique which generates a kind of threshold values that can be used for the segmentation of the image. It remains a difficult problem to determine the wide range of thresholds and their values. The suggested optimization strategy for the Firefly algorithm (HEFA) is used to exercise large variation values for segmentation techniques with the best number of threshold rates. The mostly firefly-based Histograms Equalization is used to access the multi-threshold looking at maximum entropy, while additional statistics on the finest image segment are observed with the optimisation objective function. Our proposed HEFA technological features have better convergence rates, providing a reasonable segmental value of PSNR and SSIM, based on experimental results in contrast to the CSO and FA techniques. The experimental results are shown to be the higher- segmented version of the proposed HEFA technique.
Keywords: Histogram Equalization, Firefly, Threshold, PSNR, SSIM, Maximum Entropy 1. Introduction
Image segmentation is a fundamental machine visualization division that has an open effect on the quality of extraction and classification functionality. In the past few decades, several methods of segmentation images in various fields have been proposed and applied. If several items from the context are segmented, then thresholding technology wishes to be applied to multi-level thresholds.
Nonetheless, when you look closely for multilevel constraints, high estimate accuracy and extended measurement time occur. To solve the detailed issues, multilevel thresholding has provided many metaheuristic optimal algorithms.
Image segmentation requires the recognition of the individual objects in an image based on the size, color, texture etc. That section represents some kind of user information. The limits of any picture in the form of its segments are therefore necessary to be isolated [6]. Image segmentation is one of the most complex image analysis activities, the goal of which is to extract information in the form of an image data [2]. It is essential to partition pixels into groups of coherent properties to establish fair treatments and multimedia tools. This method is seen as a segmentation of images [ 12]. The method is a feasible new solution that can be useful in image segmentation [ 5]. Firefly algorithm is a swarm- based algorithm which solves problem-solving and has been found to be superior to other optimization problems.
The k-mean classification algorithm is optimized with a firefly algorithm in local optimum. The firefly algorithm, which has several implementations, is employed for solving optimisation problems.
Swarm intelligence based process. The firefly algorithm must be updated or combined with other algorithms to wide areas of problem[7]. Multilevel thresholds based on histograms are one of the most destructive methods of segmenting images[9]. It is used as a gray image using Firefly and social spider algorithms based on histogram based multilevel thresholds. To optimize objective functional values, use the Kapur and Otsu threshold processes.
The aim of the segmentation problem is to calculate the value for the variables so that the specified limitations and objective functions are met. A quick selection of optimal multilevel thresholds is needed
ISSN: 2005-4238 IJAST 635
Copyright ⓒ 2019 SERSC
for the image application in real time. This suggests a new algorithm to evaluate optimal thresholds and values based on an algorithm of firefly. The remainder of the paper is discussed as follows: Related works discussed in section 2. The suggested histogram dependent firefly algorithm is discussed in Section 3. The experimental results were addressed in section 4 and section 5 concludes the paper.
2. Literature Review
Naidu, and M.S.R. et. al., proposed firefly multi-level image segmentation algorithm thresholds with Shannon entropy or entropy optimization [6]. Due to its simplicity, computational cost the multilevel thresholding methods are effective for bilevel thresholding. Thresholds may be local or global, but these approaches are expensive computationally. Optimization techniques are important to maximize the objective function outcomes in the computational time reduction of local or global methods.
Mr. Darwish, and Saad et. al., a conventional Content-Based image rerecording approach (CBIRs), which provides a new attempt for multi-label image annotation [11], for the visual similarity of low- level image features. Images are segmented according to the Otsu process, selecting and optimizing the intra-cluster variance within the image. The image model is too broad to be interpreted as an individual joint probability distribution so that incomplete and systemic information has to be added in advance.
V. Rajinikanth . et. al., discussed with the Firefly Algorithm (FA), the Optimal multi-tier segmentation of the image is proposed. By optimizing Otsu's between class variance function [10], the optimal threshold of every color variable is achieved. The RGB data set is demonstrated and tested using the current FA and three randomization search strategies. Sharma's Akash, and. Al., the proposed algorithm for clustering forms part of the data mining algorithm which groups data into different clusters. All data points in one cluster are clustered with the same properties. The k-means algorithm and firefly pixel into a segmentation cluster
E. and Niharika. Al., Propose a noisy synthetic opening radar (SAR) fragmentation algorithm [7].
The clustering and thresholding process for SAR images was used in k-means (KM). Due to the common noise in SAR images, the segmentation is always challenging. Clustering approaches are standard techniques for segmentation but do not yield meticulous results. Nonetheless, threshold value selection is a problem and needs improvement in the SAR image segmentation. Donatella Giuliani suggested an unregulated gray scale fragmentation approach based on the combination of the Gaussian mixture model and firefly algorithm[4]. In histogram based research of cluster centroids the Firefly Algorithm has been applied. The gray values for the parameter estimation of a Gaussian model blend are used in the initialization stage.
Wazib Ansar, et. al., the image segmentation using multi-level thresholds Cat Swarm Optimization (CSO) [14] was presented. A collection of threshold values that help to update the threshold values of every cat to partition a given image. The segmented images are viewed as a collection of regions and a cluster of associated pixels with gray levels within a given pixel dimension. CSO leads to better global solution when applied to image segmentation.
3. Proposed Methodology
In the area of computer vision and image processing, image segmentation remains an important question. There is no generalized image segmentation algorithm available depending on the issue. The accurate, fast, automatic and robust segmentation of the image in meaningful regions is important. For image segmentation a new method is proposed using the Firefly Algorithm (HEFA) based on histogram equalization to determine the optimal threshold values. Sections 3.1 address the equalization histogram and 3.2 illustrate the firefly algorithm in the image segmentation.
ISSN: 2005-4238 IJAST 636
Copyright ⓒ 2019 SERSC
3.1 Histogram Equalization
Histogram equation is derived from the uniform cumulative brightness distribution of the original image by the scale factor. In order to restructure intensity, multiply this factor in the original image.
An image is displayed as a data set;
X = {X(𝑖, 𝑗)|X(𝑖. 𝑗) ∈ {𝑋0, 𝑋1… 𝑋𝐿−1}} (1) Where,
Each component has one of L intensity levels
X(i,j) denotes the normalized intensity of the (i,j)th pixel in the image plane, and Xk is the kth intensity level
In the process of equalizing the brightness histogram of a particular image X, the probability density function (PDF) defined by Eq (2) is initially standardised.
𝑃𝑋(𝑋𝑘) =𝑛𝑛𝑘, 0 ≤ 𝑋𝑘 ≤ 1, and ∑𝐿−1𝑘=0𝑃𝑋(𝑋𝑘) = 1 (2)
Where,
n - Total number of pixel in the input image nk - Number that Xk appear in X
The Cumulative Distribution Function (CDF) of Xk is determined by using the following equation (3) for the first time by means of probability density function.
𝑆𝑘 = 𝑇(𝑋𝑘) = ∑𝑘𝑗=0𝑃𝑋(𝑋𝑘) = ∑𝑘𝑗=0𝑛𝑛𝑗, (3) Where,
k=0,1,..,L-1 and T (XL-1)=1.
Sk is the value of the cumulative distribution function at the kth intensity level
The output image has a density function, which is equally distributed, after an equal image receives a histogram with a uniform distribution. A washed-out effect also exists, when globally equalled histograms shift the mean brightness of the input image to the central point. When a picture is good, certain places with bad quality are modified. To solve this problem, local histograms that are the same size and equal the luminosity distributions in a specific region improve the contrast. Eq.(3) generates the cumulative distribution feature of Xk in the ith blocks first for the global equalization process.
𝑆𝑘 = 𝑇(𝑋𝑖 𝑘) =
𝑖 ∑ 𝑖𝑃𝑋(𝑋𝑗) = ∑ 𝑖𝑛𝑗
𝑖𝑛 𝑘𝑗=0
𝑘𝑗=0 (4)
0 ≤ 𝑋𝑘 ≤ 1, 𝑇(𝑋𝑖 𝐿−1) = ∑𝐿−1𝑗=0 𝑖𝑃𝑋(𝑋𝑗) = 1 Where,
𝑖𝑛 is the number of pixels in ith block 𝑖𝑛𝑗 represents the number of pixels having the kth level in ith block
3.2 Firefly Algorithm
One of the stochastic optimization process algorithms suggested by Yang is Firefly Algorithm (FA). It is based on the blinking behavior of fireflies and most fireflies are luminarily bright. The light draws the resistance and the prowess. The luminance signals of each firefly may be transmitted to other new fireflies. FA is usually dependent on luminosity and appeal.
ISSN: 2005-4238 IJAST 637
Copyright ⓒ 2019 SERSC
Algorithm
It is based on two main ideas: the emission of light intensity and the degree to which two fireflies produce an attraction. The threshold value is available from the range[ 0, L-1]. It is available. Firefly is one of the best metaheuristic algorithms to increase histogram entropy. For maximum threshold value, FA can be used effectively. In order to measure the optimal threshold, histogram-based image
segmentation using firefly algorithms is suggested using maximum entropy.
The firefly movement is similar to a brighter firefly
𝑋𝑖𝑡+1= 𝑋𝑖𝑡+ 𝛽0𝑒− 𝑦𝑑𝑖𝑗2(𝑋𝑗𝑡− 𝑋𝑖𝑡) + 𝑟𝑎𝑛𝑑𝑜𝑚𝑖𝑧𝑎𝑡𝑖𝑜𝑛 𝑝𝑎𝑟𝑎𝑚𝑒𝑡𝑒𝑟 (5) Where,
𝑋𝑖𝑡+1 is updated position of firefly 𝑋𝑖𝑡 is initial position of firefly
𝛽0𝑒− 𝑦𝑑𝑖𝑗2(𝑋𝑗𝑡− 𝑋𝑖𝑡) is attractive force between parameter The necessary parameters to update the position of a firefly algorithm
𝛼1. 𝑠𝑖𝑔𝑛(𝑟𝑎𝑛𝑑 − 1/2) ⨁ B (s) (6) 𝛼1. 𝑠𝑖𝑔𝑛(𝑟𝑎𝑛𝑑 − 1/2) ⨁ 𝐴 = 𝜋𝑟2B(s) (7)
𝛼1. 𝑁𝑖 (0, 1) (8)
3.3 Proposed HEFA Method for Image Segmentation
By using the histogram equalization, an image must first be transformed into gray image, since only those images are able to achieve a similar image intensity. The picture must first be converted to gray images for this process. The medium filter is used for removing the noise from the image. Histograms on the pre-processed image are then equalized. Then the final result of the image in segmented form with the application of the firefly algorithm. The HEFA method is used to perform a segmentation of the image.
START;
Initialize parameters, D and f(T);
Generate initial locations of ‘n’ fireflies for xi (i=1,2, ...n) Calculate intensity values of ith firefly based on ith f(T) value If iter < Miter;
For i=1,2, ..., n;
For j=1,2, ..., n;
If intensity of firefly j<i,
Evaluate Cartesian distance and do i towards j;
End if;
Repeat until iter = Miter;
calculate light intensity and update firefly positions;
End for j;
End for i;
Sort the fireflies in descending order based on the rank find optimal value;
End if;
Record the f(T) and optimal threshold values STOP;
ISSN: 2005-4238 IJAST 638
Copyright ⓒ 2019 SERSC
Figure 1. Flow Diagram of Proposed Approach Pre-processing
The first step in image segmentation is pre-processing. The preprocessing process includes noise reduction and artifact removal. This uses the median filtering to eliminate noise from gray images while reducing the sharpness of the image considerably as a preprocess.
Median filter
The median filter is a statistically dependent non-linear image processing technique. The digital image or sequence's noisy value is replaced with the median neighborhood or masks value. The pixel in the mask is graded according to its gray levels and the median value is deposited to replace the noisy value.
The median filter is a non-linear noise reduction filter, and it has a relatively complicated mathematical analysis for a random noise imaging. A picture of a zero shows the noise of the median filtering below normal distribution.
𝜎𝑚𝑒𝑑2 =4𝑛𝑓12(𝑛̅)≈ 𝜎𝑖2
𝑛+𝜋2−1 .𝜋2 (9) Where,
𝜎𝑖2is noise power of the variance
n is the size of the median filtering mask and f(𝑛̅) is the function of the noise density The noise variance of the average filtering is
𝜎02=𝑛1 𝜎42 (10) Comparing of equation (9) and equation (10), the median filtering effects depend on the size of the mask and the distribution of the noise.
Start
Pre-processing Convert Gray Scale Image Noise Elimination Using Median Filter
Segmentation
Apply Histogram Equalization Apply Firefly Algorithm
Final Segmented Image
Calculate PSNR, SSIM for Final Image
ISSN: 2005-4238 IJAST 639
Copyright ⓒ 2019 SERSC
Algorithm
4. Discussion
Sample input gray scale images are used for these tests and they have different dimensions. Each image section uses HEFA for gray images separately. Calculate performance appraisal metrics, such as PSNR and Structural Similarity Index Matrix (SSIM), used to inquire on segmented image quality. In addition, processing time and the objective value of the function are useful parameters for evaluating image quality using PSNR. In general, the SSIM is used to calculate the dominance of the image and the relative value of the picture. Both experiments have been carried out and fitted with MATLAB R2013a.
Peak Signal to Noise Ratio (PSNR)
PSNR is defined as the process which it reduces the noise in image and increases the quality of image to attain the best performance close the result. A higher value of PSNR indicates better quality of segmented image. The equation of PSNR is given in Eq.
PSNR = 20 log10 (MSE255) (11) MSE= 𝑚∗𝑛1 ∑𝑚−1𝑖=0 ∑𝑛−1𝑗=0[𝑥(𝑖, 𝑗) − 𝑦(𝑖, 𝑗)]2
Figure 2. Test Images, Corresponding Histograms and Segmented Images (a) Lena (b) Starfish (c) Flower and (d) Church
Structured Similarity Index Matrix (SSIM)
Evaluates the visual similarity between the original image and segmented image is calculated with the following equation
𝑆𝑆𝐼𝑀 = (2𝜇𝐼𝜇𝐼̃+ 𝐶1)(2𝜎𝐼𝐼̃ + 𝐶2)/(𝜇𝐼2+ 𝜇𝐼̃2− 𝐶1)(𝜎𝐼2+ 𝜎𝐼̃2− 𝐶2) …(12) TABLE 1. Comparisons of Parameters of Gray Scale Image
PARAMETERS PSNR SSIM
Images/Methods CSO FA HEFA CSO FA HEFA
Lena 27.03 28.82 34.25 0.6703 0.7065 0.8824
Step 1: Open the color image
Step 2: Color image is transformed into gray scale image Step 3: Apply the median filter to eliminate the noise
Step 4: The equalization of histogram is carried out from the pre-processed image Step 5: Generate population Xi (I = 1,2,3…..N) in randomized way within the range Step 6: Initialize Absorption coefficient, Maximum Attraction Step Size as levy Flight,
maximum iteration
Step 7: Fitness value calculation for each firefly
Step 8: Firefly update their position towards brighter one Step 9: Repeat step 6 to 8 till reach the maximum iteration
Step 10: Determine the optimum threshold value and segment the image Step 11: The new image produces gray scale segmented image
Step 12: Now compare the result of gray scale image and segmented image
Step 13: Calculate the PSNR and SSIM between gray scale image segmented image
ISSN: 2005-4238 IJAST 640
Copyright ⓒ 2019 SERSC
Star Fish 28.32 29.24 34.98 0.5889 0.5844 0.8916
Flower 28.99 29.65 34.67 0.6087 0.6558 0.8745
Church 26.09 28.72 34.09 0.6332 0.6706 0.8439
Original Image
Gray Scale Image
Median Filter Image
Histogram Equalization
Graph
Histogram Equalized
Image
Histogram Equalized
Graph Image
HEFA segmented
Image
ISSN: 2005-4238 IJAST 641
Copyright ⓒ 2019 SERSC
5. Conclusion
For gray image segmentation is proposed the histogram equalization technique based on a firefly algorithm (HEFA). It uses the good firefly search functions and uses some popular methods like CSO and FA. The PSNR and SSIM are used to measure performance to determine segment quality in light of the coincidences between segmented and gray images. In comparison with current CSO and FA methods the proposed HEFA method is compared with PSNR parameters and SSIM values higher.
Experimental results have shown that the evidence showing better results on gray images is given by the HEFA process.
References
[1] Akash Sharma and Smriti Sehgal., “Image Segmentation using Firefly Algorithm”, International Conference on Information Technology (InCITe) – The Next Generation IT Summit on the Theme – Internet of Things: Connect your Worlds, pp. 99-102, 2016.
[2] Arana-Daniel. N, Gallegos. A.A, Lopez-Franco. C, and Alanis. A.Y., “Smooth Global and Local Path Planning for Mobile Robot Using Particle Swarm Optimization, Radial Basis Functions, Splines and Bezier Curves”, IEEE Congress on Evolutionary Computation (CEC), IEEE, pp.
175–182, 2014.
[3] Bhavana Vishwakarma and Amit Yerpude, “A New Method for Noisy Image Segmentation using Firefly Algorithm”, International Journal of Science and Research (IJSR), Vol. 3, Issue 5, pp. 1721- 1725, 2014.
[4] Donatella Giuliani, “A Grayscale Segmentation Approach Using the Firefly Algorithm and the Gaussian Mixture Model”, International Journal of Swarm Intelligence Research, Vol. 9, Issue 1, pp. 39-57, 2018.
[5] A. Freitas “Comprehensible Classification Models: A Position Paper”, ACM-SIGKDD Explorations, Vol. 15, Issue 1, Pp.1-10, 2014.
[6] M.S.R. Naidu, P. Rajesh Kumar and K. Chiranjeevi., “Shannon and Fuzzy Entropy based Evolutionary Image Thresholding for Image Segmentation”, Alexandria Engineering Journal, Vol.
57, Issue 3, pp. 1649-1655, 2017.
[7] E. Niharika, H.Adeeba, A. S. R. Krishna and P. Yugander, “K-means based Noisy SAR Images Segmentation using Median Filtering and Otsu Method”, International Conference on IoT and Application(ICIOT), pp. 1-4, 2017.
[8] Pinaki Pratim Acharjya, Soumsy Mukherjee and Dibyendu Ghoshal, “Digital Image Segmentation Using Median and Filtering and Morphological Approach”, International Journal of Advanced Research in Computer Science and Software Engineering Vol. 4, Issue 1, pp. 552-557, 2014.
[9] Rahul Singh, Prateek Agarwal, Manish Kashyap and Mahua Bhattacharya, “Kapur ‘s and Otsu’s based Optimal Multilevel Image Threshodling Using Social Spider and Firefly Algorithm”, International Conference on Communication and Signal Processing, pp. 2220-2224, 2016.
[10] V. Rajinikanth, M. S. Couceiro, “RGB Histogram based Color Image Segmentation Using Firefly Algorithm”, International Conference on Information and Communication Technologies (ICICT 2014), Procedia Computer Science, Science Direct, Vol. 46, pp.1449 – 1457, 2015.
[11] Saad M. Darwish, Mohamed A. El-Iskandarani, and Guitar M. Shawkat, “Automatic MULTI-Label Image Annotation System Guided by Firefly Algorithm and Bayesian Classifier”, Proceedings of the World Congress on Engineering, Vol. I, 2016.
ISSN: 2005-4238 IJAST 642
Copyright ⓒ 2019 SERSC
[12] B.Saini, V.Singh and S.Kumar, “Information Retrieval Models and Searching Methodologies:
Survey”, International Journal of Advance Foundation and Research in Science and Engineering, Vol. 1, Issue 2, Pp. 57-62, 2014.
[13] K. Vennila and K.Thamizhmaran, “Multilevel Image Segmentation Based on Firefly Algorithm”, CiiT International Journal of Biometrics and Bioinformatics, Vol. 9, No. 3, pp. 57-60, 2017.
[14] Wazib Ansar and Tanmay Bhattacharya, “A new Gray Image Segmentation Algorithm using Cat Swarm Optimization”, International Conference on communication and Signal Processing, pp.
1004-1008, 2016.