Bat Algorithm Based Non-linear Contrast Stretching for Satellite Image Enhancement

: The remote sensing images acquired from the satellites are low contrast images. The availability of low contrast images and failure of the traditional methods such as Histogram Equalization and Gamma correction in preserving the brightness levels in the image are the main issues in satellite image processing. This paper proposes an optimized contrast stretching using non-linear transformation for image enhancement. The non-linear transformation is influenced by the appropriate choice of control parameters for the sample images since manual tuning for individual images is tedious. A Bat algorithm based tuning is employed for the automated selection of control parameters in the transformation. The performance of the optimization algorithm is compared against other metaheuristic algorithms such as Ant Colony Optimization (ACO) and Particle Swarm Optimization (PSO). It is noted that the bat algorithm based contrast enhancement outperforms the other optimization techniques in terms of metrics such as Peak Signal to Noise Ratio (PSNR), Mean Square Error (MSE), Absolute Mean Brightness Error (AMBE), Entropy and CPU time (Central Processing Unit).


Introduction
Remote sensing images are used in a range of applications such as agriculture, navigation, surveillance and so on. The images obtained from satellites being low quality have to be improved for better human perception and for other remote sensing applications [1]. In order to use the remote sensing images for advanced applications, it is necessary that the original information in the image is retained and the image quality is improved.
Over the years, many image enhancement techniques have been developed for improving the visibility of the remote sensing images. The most commonly used technique is Histogram Equalization (HE). Though the image is enhanced, there is a shift in the mean brightness of the image which does not make it ideal for human perception. To overcome this drawback, many variations of histogram equalization have been proposed [2]. Bi-histogram Equalization and Contrast Limited Adaptive Histogram Equalization are some of the modified HE. Even though, the quality of the image is improved to a great extent, the limitations of HE are still present. Contrast enhancement is another category of image enhancement which stretches the dynamic range of the image to improve the image visibility. It is one of the most critical problems faced in areas such as medical image processing [3,4], video processing and remote sensing [5,6]. An image contrast enhancement using sub-histogram equalization and fuzzy clustering is presented in [7]. Here the images are separated into sub-histograms by utilizing clustering technique based on the brightness level where the number of clusters is determined by the image histogram analysis. A non-uniform illumination correction

Materials and Methods
In this work, the input RGB (Red Green Blue) or true color image is transformed to HSI (Hue-Saturation-Intensity) color domain and the transformed intensity image is subjected to histogram equalization and this image is further enhanced using a bat algorithm based contrast stretching. Figure 1 shows the framework for contrast enhancement.
Geosciences 2020, 10, x FOR PEER REVIEW 2 of 12 clusters is determined by the image histogram analysis. A non-uniform illumination correction using contrast optimization has an adaptive contrast enhancement involving fusion technique [8]. A histogram planting based contrast enhancement is presented in [9]. Gamma correction is yet another contrast enhancement technique which is a non-linear technique and modifies the individual image pixels [10]. Various modifications of gamma correction are also done to improve the performance of this method [11]. An image brightness enhancement using adaptive gamma correction involving fusion of source image, histogram equalized and gamma corrected images is proposed in [12]. A hybrid image enhancement using optimal gamma correction and weighted sum technique is presented in [13]. The weighted sum approach is mainly adopted for preserving the image brightness. Combining optimization algorithm with traditional contrast enhancement approaches is an upcoming area of research and is effective in improving the accuracy of the enhancement technique. A differential evolution based contrast and brightness enhancement of satellite images is presented in [14]. Another image enhancement technique involving DWT (Discrete Wavelet Transform) and SVD (Singular Value Decomposition) optimized using Artificial Bee Colony optimization is proposed in [15,16]. Here the DWT of the image is adaptively thresholded using the optimization technique. An image contrast enhancement utilizing Differential evolution is described in [17]. Here an optimal fuzzy system is designed for the enhancement of images. An adaptive histogram compaction for contrast enhancement is presented in [18]. A local remapping method is utilized to extend the dynamic range of the image. Another most prominent method for brightness preservation is fusion approach. A social spider based optimization for contrast enhancement is proposed in [19]. Here two enhanced version of the image namely: one with high PSNR (Peak Signal-to-Noise Ratio) and another with high entropy are considered.
In the proposed method, an optimized contrast stretching using bat optimization is presented wherein a histogram equalized image is subjected to a non-linear contrast stretching transformation to overcome the limitation of HE that it fails to preserve the image brightness. The enhanced image using the proposed method is compared against other optimization schemes such as ACO and PSO and the results are compared in terms of PSNR, MSE, AMBE, Entropy and CPU time. With the use of frequency tuning method in Bat algorithm, the variation of solution in the population is increased and utilizes zooming for balancing the exploitation and exploration during the search phase by imitating the changes in pulse emission and loudness of the bat while searching its prey.
The paper is organized as follows: Section 2 explains the materials and the proposed methodology. The sub divisions under this section explain contrast stretching transformation and the optimization algorithms in detail .Section 3 explains the experimental results of the enhanced image in terms of various performance metrics such as PSNR, MSE, AMBE, Entropy and CPU time for 3 different samples. Section 4 discusses the inference from the proposed work and finally, the conclusion of the paper with the future works is presented in Section 5.

Materials and Methods
In this work, the input RGB (Red Green Blue) or true color image is transformed to HSI (Hue-Saturation-Intensity) color domain and the transformed intensity image is subjected to histogram equalization and this image is further enhanced using a bat algorithm based contrast stretching. Figure 1 shows the framework for contrast enhancement. The histogram enhanced image by itself may not be suitable for further processing stages as it limits the brightness level of the entire image. In order to attain a better image quality, the histogram equalized image is contrast enhanced. Contrast stretching is done using a non-linear transformation whose parameters are optimized using various evolutionary algorithms including Bat algorithm, Ant Colony optimization and Particle swarm optimization and the performance metrics for the enhanced image is analyzed.

Histogram Equalization
Histogram equalization improves the global image contrast by distributing the image intensities. It leads to improvement in contrast of the low contrast images. It is done by spreading the most common intensity values.
Let X = X(i,j) be the source image to be equalized where X(i,j) is the intensity values in the image and made up of L discrete levels {X 0 , X 1 , X 2 , . . . , X L−1 } with X(i,j) ∈ {X 0 , X 1 , X 2 , . . . , X L−1 }. For the source image X, the probability density function or PDF p(X k ) is given using Equation (1) as [20]: for k = 0, 1, 2, . . . , L − 1, where n k denotes the number of pixels having intensity X k and n denotes the number of samples in the entire image X.
In relation to the image PDF, its cumulative distribution function or CDF is calculated using Equation (2) as: where k = 0, 1, 2, . . . , L − 1. HE maps the source image to a wider range (X 0 , X L−1 ) by employing CDF in the form of a transformation function which is defined using Equation (3) as: and the histogram equalized output image Y = { Y(i,j)} can be computed using Equation (4) as: where (i,j) represents the co-ordinates of the image pixels.

Contrast Stretching Transformation
Spatial domain transformation on an input image f (x,y) is defined by the Equation (5) as [21]: where g(x,y) is the transformed image, T is the transformation operation applied on the input image in the neighborhood of pixels (x,y). The transformation is denoted using Equation (6) as: where a and c are the unknown variables, m(x,y) represents the mean of the input image centered around (x,y) by moving an n × n window over the entire image and K(x,y) is the contrast stretching function considering the local and global details in the image. The local mean of the image is described using Equation (7) as: The contrast stretching function K(x,y) is defined using Equation (8) as: Geosciences 2020, 10, 78 4 of 12 where k and b are the contrast stretching parameters which control the extend by which the contrast is enhanced, D is the global mean and σ(x,y) is the standard deviation of (x,y) pixel in the image as the n × n window is moved around the image. D is defined using Equation (9) as: where M × N denotes the image size and the standard deviation σ(x,y) is described using Equation (10) as: The contrast stretching transformation can be expanded to get Equation (11): where k and b are the unknown parameters which control the extend of contrast stretching and a and c are the unknowns which decide the mean brightness of the image. Satellite images are complex in size, color and textural variations. Manually tuning a, b, c and k for contrast stretching may not be a feasible solution considering the complexity and the number of satellite images. Also slight variations in the control parameters can lead to very dark or overly bright images which may not be pleasant for the human vision. Hence choice of the control parameters is critical. For this, selection of control parameters adaptively is preferred.

BAT Optimized Contrast Stretching
The parameters a, b, c and k control the contrast stretching enhancement. Finding the optimal values of these control parameters result in optimized contrast enhancement. Bat algorithm takes inspiration from the echo location behavior of the bat community. Bats uses a type of echo to detect the prey, to keep away from obstacles and locate their habitats in the dark. By listening to the echo which bounce back from the object, the bats decide their hunting strategies. The bat algorithm was developed based on three ideas [22].
(i) Bats use the echos to measure the distance and can identify the difference between food and obstacles. (ii) Bats fly with a velocity v i at a position x i , having a frequency f min and degree of loudness A 0 to search the prey. (iii) The loudness of the bats vary by a great extend and changes from a large positive value A 0 to a minimum value A min .
The bat algorithm can be described as follows: • Initialize the n bat population randomly and it is considered that each bat represents a solution to the optimization problem. This algorithm is used to find the optimal values for a, b, c and k.
Geosciences 2020, 10, 78 5 of 12 where β is a random value in [0, 1], x* is the current best solution. Here the fitness value computed is the MSE. A local search to change the current best solution is performed using random walk and is given by Equation (15): where A t is the average loudness of the bat and ε is a random value chosen from [−1,1]. The search path is modified in terms of the pulse rate r and loudness A which are also to be updated with the iteration using Equations (16) and (17): where α and γ are constants such that 0 < α < 1 and γ > 0. Figure 2 shows the bat optimization algorithm.
Geosciences 2020, 10, x FOR PEER REVIEW 5 of 12 where A t is the average loudness of the bat and Ɛ is a random value chosen from [−1,1]. The search path is modified in terms of the pulse rate r and loudness A which are also to be updated with the iteration using Equations (16) and (17): where α and γ are constants such that 0< α<1 and γ>0. Figure 2 shows the bat optimization algorithm. The advantage of Bat algorithm is that it can automatically tune into region where promising solutions to the optimization problem can be found and has a very fast convergence rate. By using parameter control, the pulse rate and loudness can be varied as the iteration progresses such that as the optimal solution is reached, it can switch from exploration to exploitation phase easily.

ACO Optimization
ACO is based on the behavior of ants in their colony. While searching for food, the ants leave a trail of chemical called pheromone which helps the other ants in foraging for food. With time and increasing number of ants, the pheromone concentration varies using which the ants can arrive at their solution. The shortest path is found using the pheromone deposit. The ant selects the suceeding  The advantage of Bat algorithm is that it can automatically tune into region where promising solutions to the optimization problem can be found and has a very fast convergence rate. By using parameter control, the pulse rate and loudness can be varied as the iteration progresses such that as the optimal solution is reached, it can switch from exploration to exploitation phase easily.

ACO Optimization
ACO is based on the behavior of ants in their colony. While searching for food, the ants leave a trail of chemical called pheromone which helps the other ants in foraging for food. With time and increasing number of ants, the pheromone concentration varies using which the ants can arrive at their solution. The shortest path is found using the pheromone deposit. The ant selects the suceeding node based on the pheromone accumulation [23].This process continues until the solution is reached. The ant moves from node i to j with probability given by Equation (18) [24]: where τ i,j represents the quantity of pheromone at the edge i, j. α controls the effect of τ i,j , η i,j represents the desirabilityof i, j and β controls the effect of η i,j . The amount of pheromone is calculated using Equation (19) as: where τ i,j represents the quantity of pheromone at the edge i, j and ρ is the rate of pheromone evaporation. The density of deposited pheromone at (i,j) by m ants is denoted using Equations (20) and (21) as: where ∆τ i,j k is the pheromone density, Q is a constant and L is the length of the route.

PSO Optimization
PSO is inspired by the behavior of a swarm of birds. The algorithm initiates each particle as the solution to the optimization problem under consideration. Each particle is identified by velocity with which it traverses the search space. The velocity and position of the particle gets updated following each iteration [25]. The algorithm remembers the best position of the particle and also considers its own previous best solution. Thus the particle best and global best solutions are found and the new velocity of the particle is updated using Equation (22) where V i (k) is the ith particle's velocity for time k, P i (k) is the ith particle's position for time k, P ibest is the best known position of ith particle and G best is the best position of the entire swarm, w is the weight factor, c1 and c2 denote the cognitive and social accelerating factor. φ 1 and φ 2 denote the uniformly distributed random numbers in the range 0 to 1.
The new position of the particle is found using Equation (23) as: V i (k + 1) is the new velocity of ith particle, P i (k) is the ith particle's position for time k.

Results
To evaluate the effect of the control parameters on contrast stretching, a set of 30 LANDSAT images are considered as sample images and the results for 3 images are displayed. The images are taken Google Earth portal (http://earth.google.com). Table 1 gives the initialized parameters and their values for different optimization techniques. All the techniques are simulated in Matlab 2018a on an Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz system. This system is manufactured by HP, Bangalore, India. The performance evaluation of the enhanced image is done by comparing the enhanced contrast stretching results for different optimization technoques such as Bat algorithm, ACO and PSO in terms of performance metrics such as PSNR, MSE, AMBE, Entropy and CPU time. Table 2 show the comparison of performance metrics for different optimization techniques  Figure 3 shows the enhanced images for different optimization techniques.
Geosciences 2020, 10, x FOR PEER REVIEW 8 of 12 indicate that the proposed technique outperforms other optimization techniques.On an average, the PSNR has increased to 44.9777 dB for Bat optimized contrast stretching over 34.2593 dB for PSO optimized contrast stretching. The entropy values have increased to 6.0519 for Bat optimized contrast stretching over 5.1059 for PSO optimized contrast stretching and CPU time has decreased to 220.8396 sec for Bat optimized contrast stretching over 428.8161 sec for PSO optimized contrast stretching. Figure 3 shows the enhanced images for different optimization techniques.
Image 1 Image 2 Image 3 Original Image Bat algorithm ACO PSO Figure 3. Enhanced outputs for different optimization.
From Figure 3, it is clear the Bat optimized contrast stretching gives a better quality image over ACO and PSO based contrast stretching where the images are over darkened and not at all suitable for further image processing analysis.

Discussion
Contrast stretching is mainly used for enhancing the dynamic range of the low resolution satellite imagery and making it suitable for human vision. The non-linear contrast stretching transformation has four control variables a, b, c and k where a and c decide the mean brightness preservation and b and k decide the extent of contrast stretching. Selecting the values of a, b, c, and k manually can be difficult since a slight variation in the control parameter values can drastically affect the satellite image by over-stretching or under-stretching the image contrast which makes the image unpleasant to view. Figure 4 shows a sample image with selected values of control parameters.
Geosciences 2020, 10, x FOR PEER REVIEW 9 of 12 From Figure 3, it is clear the Bat optimized contrast stretching gives a better quality image over ACO and PSO based contrast stretching where the images are over darkened and not at all suitable for further image processing analysis.

Discussion
Contrast stretching is mainly used for enhancing the dynamic range of the low resolution satellite imagery and making it suitable for human vision. The non-linear contrast stretching transformation has four control variables a, b, c and k where a and c decide the mean brightness preservation and b and k decide the extent of contrast stretching. Selecting the values of a, b, c, and k manually can be difficult since a slight variation in the control parameter values can drastically affect the satellite image by over-stretching or under-stretching the image contrast which makes the image unpleasant to view. Figure 4 shows a sample image with selected values of control parameters. It is clear from Figure 4 that manual tuning of the control parameters with a slight change in its values can over-stretch or under-stretch the image thus leading to bad quality images. Hence it is necessary that proper selection of parameters is critical for which we have optimized the control parameters for individual images. Saturation refers to the richness in color details in the image. Over stretching of the image contrast leads to saturation artifacts which gives the image an unrealistic appearance as shown in Figure 4c whereas under stretching of the image contrast leads to darker image as shown in Figure 4b which does not convey any details. Thus appropriate tuning of the parameters can limit the extent of contrast stretching and prevent over-saturation or under-saturation thereby retaining the natural color details in the image as shown in Figure 4a. Figure 5 represents the convergence plots for different optimization techniques.  It is clear from Figure 4 that manual tuning of the control parameters with a slight change in its values can over-stretch or under-stretch the image thus leading to bad quality images. Hence it is necessary that proper selection of parameters is critical for which we have optimized the control parameters for individual images. Saturation refers to the richness in color details in the image. Over stretching of the image contrast leads to saturation artifacts which gives the image an unrealistic appearance as shown in Figure 4c whereas under stretching of the image contrast leads to darker image as shown in Figure 4b which does not convey any details. Thus appropriate tuning of the parameters can limit the extent of contrast stretching and prevent over-saturation or under-saturation thereby retaining the natural color details in the image as shown in Figure 4a. Figure 5 represents the convergence plots for different optimization techniques. From Figure 3, it is clear the Bat optimized contrast stretching gives a better quality image over ACO and PSO based contrast stretching where the images are over darkened and not at all suitable for further image processing analysis.

Discussion
Contrast stretching is mainly used for enhancing the dynamic range of the low resolution satellite imagery and making it suitable for human vision. The non-linear contrast stretching transformation has four control variables a, b, c and k where a and c decide the mean brightness preservation and b and k decide the extent of contrast stretching. Selecting the values of a ,b ,c, and k manually can be difficult since a slight variation in the control parameter values can drastically affect the satellite image by over-stretching or under-stretching the image contrast which makes the image unpleasant to view. Figure 4 shows a sample image with selected values of control parameters. It is clear from Figure 4 that manual tuning of the control parameters with a slight change in its values can over-stretch or under-stretch the image thus leading to bad quality images. Hence it is necessary that proper selection of parameters is critical for which we have optimized the control parameters for individual images. Saturation refers to the richness in color details in the image. Over stretching of the image contrast leads to saturation artifacts which gives the image an unrealistic appearance as shown in Figure 4c whereas under stretching of the image contrast leads to darker image as shown in Figure 4b which does not convey any details. Thus appropriate tuning of the parameters can limit the extent of contrast stretching and prevent over-saturation or under-saturation thereby retaining the natural color details in the image as shown in Figure 4a. Figure 5 represents the convergence plots for different optimization techniques. From Figure 5, it is seen that the proposed bat optimization converges faster when compared to ACO and PSO optimizations. This is mainly attributed to the ability of Bat optimization to tune automatically into the region of possible solutions which makes this technique faster and leads to a reduced CPU time. Figure 6 shows the enhanced image outputs with the corresponding histogram plots. From Figure 5, it is seen that the proposed bat optimization converges faster when compared to ACO and PSO optimizations. This is mainly attributed to the ability of Bat optimization to tune automatically into the region of possible solutions which makes this technique faster and leads to a reduced CPU time. Figure 6 shows the enhanced image outputs with the corresponding histogram plots.
PSO optimized ACO optimized Bat optimized Figure 6. Histogram plots for image outputs.
From Figure 6, it is seen that the histogram plot for Bat optimized contrast stretching covers wider dynamic range when compared to the PSO and ACO optimized contrast stretching.

Conclusions
In this work, a bat algorithm for optimizing the control parameters of contrast stretching transformation is presented. The main aim of using bat optimization is that it can zoom into the region of potential solution automatically. In this method, a histogram equalized image is contrast enhanced using a non-linear transformation in which the control parameters are optimized using bat algorithm. The results of the enhanced image are compared against other optimization algorithms such as ACO and PSO. The results indicate that the proposed bat optimization based contrast stretching gives better results over ACO and PSO based contrast stretching. This technique can be extended by exploring hybrid optimization techniques and multi-objective functions to improve the accuracy of the technique. From Figure 6, it is seen that the histogram plot for Bat optimized contrast stretching covers wider dynamic range when compared to the PSO and ACO optimized contrast stretching.

Conclusions
In this work, a bat algorithm for optimizing the control parameters of contrast stretching transformation is presented. The main aim of using bat optimization is that it can zoom into the region of potential solution automatically. In this method, a histogram equalized image is contrast enhanced using a non-linear transformation in which the control parameters are optimized using bat algorithm. The results of the enhanced image are compared against other optimization algorithms such as ACO and PSO. The results indicate that the proposed bat optimization based contrast stretching gives better results over ACO and PSO based contrast stretching. This technique can be extended by exploring hybrid optimization techniques and multi-objective functions to improve the accuracy of the technique.