Improved PSO Algorithm Based on Exponential Center Symmetric Inertia Weight Function and Its Application in Infrared Image Enhancement

: In this paper, an improved PSO (Particle Swarm Optimization) algorithm is proposed and applied to the infrared image enhancement. The contrast of infrared image is enhanced while the image details are preserved. A new exponential center symmetry inertia weight function is constructed and the local optimal solution jumping mechanism is introduced to make the algorithm consider both global search and local search. A new image enhancement method is proposed based on the advantages of bi-histogram equalization algorithm and dual-domain image decomposition algorithm. The ﬁtness function is constructed by using ﬁve kinds of image quality evaluation factors, and the parameters are optimized by the proposed PSO algorithm, so that the parameters are determined to enhance the image. Experiments showed that the proposed PSO algorithm has good performance, and the proposed image enhancement method can not only improve the contrast of the image, but also preserve the details of the image, which has a good visual effect.


Introduction
The work of this paper mainly includes two parts. First, we propose an exponential central symmetric inertia weight function and a local optimal solution jump mechanism to optimize the PSO algorithm, and then we put forward a new infrared image enhancement method based on the combination of bi-histogram equalization and dual-domain image decomposition algorithm. The proposed improved PSO algorithm is used for parameters optimization and then to obtain the enhanced image. The contrast of images are improved while preserving image details.
Meta-heuristic algorithms have strong flexibility, are simple and easy to implement, do not rely on gradient information, and avoid local optimal solutions. Therefore, they are widely used in various fields of engineering problems. Meta-heuristic algorithms can be divided into evolutionary-based, physics-based, and swarm-based algorithms.
Evolutionary-based algorithms are inspired by the principles of biological evolution in nature, the most typical being the genetic algorithm [1]. Each new individual is a combination of the best from the previous generation; individuals formed by the combination of excellent individuals are likely to be better than the previous generation, thus the algorithm is optimized with the process of evolution.
Physics-based algorithms simulate rules of physical change, such as simulated annealing algorithm [2] and gravity search algorithm [3]. This kind of algorithms simulates some basic physical laws, such as the laws of gravity, ray, electromagnetic force, etc.
Among them, PSO algorithm is often considered. Although it has some defects, such as premature convergence and can easily to fall into local optimal solution, many scholars have improved PSO. Although meta-heuristic algorithms differ in principle, they have a common feature that they are composed of exploration and exploitation phases [13]. The exploration phase wants to traverse as many possible search areas as possible. Finding a balance between the two, i.e., global search and local search, is a challenging task. Ma [19] proposed a chaotic PSO algorithm with arctangent acceleration coefficient to seek a balance between global search and local search. Wang [20] proposed a hybrid quantum PSO algorithm, which uses flight and jump operations to improve the accuracy of QPSO (Quantum Particle Swarm Optimization) and enhance the search ability. Zhang [21] introduced scalar operators and learning operators into PSO and proposed a vector cooperative PSO algorithm. Zhou [22] introduced two mechanisms, namely competitive group optimization and reverse learning, choosing different learning mechanisms according to fitness value, and proposed a reverse learning competitive PSO algorithm. Engelbrecht [23] proposed a dynamic PSO algorithm based on arithmetic crossover. Chen [24] used two different crossover operations to disseminate promising samples through the crossover of the optimal position of each particle's personal history to establish an effective guiding paradigm and maintain good diversity. Tawhid [25] combined the PSO algorithm with the crossover operator of genetic algorithm to solve the global optimization problem, avoiding the problems of population stagnation and premature convergence.
With the continuous development and progress of infrared technology, the infrared imaging system has been widely used in target detection [26], precise guidance [27], optical remote sensing [28], night navigation [29], and other fields. However, the low contrast of infrared image limits its application. Therefore, it is of great significance to search for effective methods to improve the quality of infrared images.
Image enhancement algorithms can be roughly divided into spatial-domain based algorithms, transform-domain algorithms, and learning based algorithms. Spatial-domain based algorithms enhances the image at the gray level; typical algorithms include histogram equalization [30]. Transform-domain algorithms transform the spatial domain image into the frequency domain [31], such as wavelet [32]. In recent years, deep learning technology has been developed rapidly and applied to image enhancement, such as deep bilateral learning [33], deep photo enhancer [34], and scale-recurrent network [35]. Traditional algorithms based on spatial-domain and transform domain are usually based on a priori knowledge or experience, setting some parameters for image enhancement. Learning based algorithms establish the model and enhance the images through a lot of learning and training. The enhancement result has a great relationship with the accuracy of the model and the number of samples.
Histogram equalization algorithm, as the basis of image enhancement algorithm, has the advantages of simple implementation and remarkable effect, thus it has been widely used. However, the traditional histogram equalization algorithm has the defect of reducing contrast, thus many scholars have improved it accordingly. Kim [30] proposed a BBHE (Brightness preserving Bi-Histogram Equalization) algorithm, which takes the average brightness of the image as the threshold. The image is decomposed into two sub-graphs, which are processed with histogram equalization, respectively. After that, the image is merged to maintain the brightness characteristics of the original image to a certain extent. Shajy [36] used RMSHE (Recursive Mean-Separate Histogram Equalization) to enhance medical images and obtain good results. The [37] used the minimum mean variance constraint before and after bi-histogram equalization to determine the gray scale threshold, making the contrast enhancement effect visually appear natural. Tang [38] proposed a bi-histogram equalization using modified histogram bins method to segment images according to their median brightness to achieve the retention of average brightness. Ashiba [39] proposed adaptive histogram equalization with contrast limitation to enhance the infrared image. However, the histogram equalization algorithm still has the following defects: (1) the number of gray levels decrease, the image information entropy decreases, and local details are missing; (2) the edge is not enhanced; and (3) the average gray value is fixed.
In this paper, an improved PSO algorithm is proposed and applied to infrared image enhancement. Firstly, a new exponential center symmetry inertia weight function is constructed to make the inertia weight coefficient change with the number of iterations and the current position of particles. The global search ability is increased in the early stage of the search, and the local search ability is strengthened in the late stage of the search, so as to achieve the balance between local search and global search. Then, a local optimal solution jumping strategy is introduced into the PSO algorithm. We call the new PSO algorithm EXPSO. A new infrared image enhancement method combining the advantages of bi-histogram equalization algorithm and dual-domain image decomposition algorithm is proposed. The fitness function is constructed by using five image evaluation indexes to search for the optimal parameters, and the EXPSO algorithm is used to optimize the parameters to obtain a better image enhancement effect.
The main contributions of this paper are as follows: 1. A new inertia weight function of PSO algorithm is constructed to make the weight coefficient change with the number of iterations and the current position of particles. Global search ability is increased in the early stage of search, and local search ability is strengthened in the late stage of search, so as to achieve the balance between local search and global search. 2. The mechanism of jumping out of the local optimal solution is introduced into the PSO to avoid the algorithm falling into a local optimal solution. 3. A new infrared image enhancement technology is proposed, which combines the advantages of bi-histogram algorithm and dual-domain image decomposition to increase the contrast of the enhanced image without losing the image details.
The rest of the paper is structured as follows. Section 2 introduces the improved PSO algorithm. An infrared image enhancement algorithm based on bi-histogram equalization and dual-domain image decomposition is proposed in Section 3. Experiments are presented in Section 4, including verifying the performance of the PSO algorithm and the effect of the proposed image enhancement algorithm.

Particle Swarm Optimization
PSO was proposed by Kennedy [4] and is widely used. In the PSO algorithm, the current position of the particle is a candidate solution to the corresponding optimization problem, and the particle has two properties: position and velocity. Let the position of the ith particle of the population be After h iterations, the optimal position of the individual is The optimal position of the group is The update formula of position and velocity can be expressed as follows: where c 1 and c 2 are learning factors, while r 1 and r 2 are random numbers between 0 and 1.

Exponential Center Symmetry Inertia Weight Function
The inertia weight factor was proposed by Shi [40]. The inertia weight factor of traditional PSO algorithm is fixed. If its value is too large, the convergence speed will slow down; if its value is too small, it easily falls into a local optimal solution. The way we think about it is that, in the early stage of the search, by setting a large weight, the algorithm has strong global search ability and guarantees the particle traverses the entire space, while, in the late stage of the search, using a small inertia weight factor strengthens the local search ability and increases the speed of convergence, which can significantly improve the performance of the algorithm. Therefore, this paper uses the current iteration depth and fitness value to construct the function of inertia coefficient to optimize the PSO algorithm.
First, the function based on iteration depth is constructed as follows: where h max denotes the maximum number of iterations set. It can be seen that the function is a monotone decreasing function of [−1, 1]. Then, the function based on the fitness is constructed as follows: where f it max and f it min stand for the maximum and minimum of the current calculated fitness, respectively. Their values are constantly updating as the particle search proceeds and their initial values are f it max = f it and f it min = 0; when h > 2, f it max and f it min are updated. Then, the weight coefficient function is constructed based on s 1 (•) and s 2 (•) as follows: where σ 1 and σ 2 are constants that control the change rate of w. At the beginning of iteration, the weight coefficient is larger to enhance the global search ability of the algorithm; at the end of iteration, the weight coefficient is smaller to enhance the local search ability of the algorithm, so as to accelerate the convergence speed of the algorithm and avoid falling into the local optimal solution. The relationship between weight coefficient and iteration depth transformation is shown in Figure 1.

Local Optimal Solution Jumping Strategy
We introduce a mutation factor to construct the optimal solution jumping strategy. If the particle state is the same for m consecutive iterations, the mutation factor is introduced and tested to see whether the mutation factor makes the fitness function better. If the mutation is better, the mutation is retained; otherwise, the mutation is deleted. The mutation factor is expressed as: where h k is the depth of iteration when immersed in a local optimal solution. ξ is the step length and it is defined as follows: where u ∼ N 0, σ 2 u , v ∼ N (0, 1) and σ u is defined as follows: The particle jumping process is shown in Figure 2. The figure shows that the small step and large step occur alternately during the process, which can help the particle jump out of local optimal solutions.

EXPSO Algorithm Flow
The flow of EXPSO algorithm is shown in Algorithm 1.

Algorithm 1 Pseudo code of EXPSO.
Initialize the parameters(X max , X min , D, m, v min , v max , c 1 , c 2 , N) Initialize the particle swarm positions Calculate the fitness of each particle while Iter<Iter max do Updata the Inertia weight factor use Equation (7) Calculate the fitness of each new particle Get p bset and x best if p bset stays the same for m consecutive generations then Update x use Equation (8) Calculate the fitness of each new particle if p bsetnew > p bset then Replace x and p bset end if end if Updata p bset and x best Iter = Iter + 1 end while

Image Enhancement Method
The idea of image enhancement in this paper is to improve the image contrast by using the method of bi-histogram enhancement and improve the image edge details by using a dual-domain image decomposition method. The fitness function is constructed by combining the advantages of the two, and EXPSO is used to optimize the parameters to find the optimal parameters and obtain a better visual effect. The flow chart of the method is shown in Figure 3.

Contrast Enhancement Based on Bi-Histogram Equalization
The average brightness of the original image I is set as I m ∈ {I o , I 1 , · · · , I L−1 }. Setting it as a threshold, the image is decomposed into two sub-images I L and I U . Histogram equalization is carried out for the two sub-images, respectively, and then the processed sub-images are merged to get the output image. The process can be expressed as follows: where where p L (x) and p U (x) are cumulative probability functions of the two sub-images whose gray value is x, respectively. The traditional bi-histogram equalization algorithm uses the average brightness to segment the image. For the infrared image, the image is usually dark, which can easily cause obvious errors. Therefore, the proposed EXPSO algorithm is adopted in this paper to optimize the threshold X T . Section 3.3 details the specific optimization process.

Detail Enhancement Based on Dual-Domain Image Decomposition
In this paper, by referring to the ideas in the literature [41], the original image is decomposed into high and low frequency components by dual-domain image decomposition. This algorithm not only considers the spatial distance of the pixels in the neighborhood, but also considers the difference in the gray value of the pixels.
For pixel x, N x is defined as a window centered on x with radius r, and the bilateral kernel function inside is defined as follows: where σ s and γ are the spatial parameters of the kernel function and the pixel related parameters. σ 2 is the noise variance. The expression of dual-domain filter is: where I is the original image. The image is decomposed into low and high frequency components by dual-domain image decomposition. Texture features and details are distributed in the high frequency component.
Therefore, the detail texture can be highlighted by enhancing the high-frequency image. In this paper, a simple and effective method of linear amplification is used to enhance the detail, and its expression is as follows: f biout (I) = I outL + βI outH (16) where β is the enhancement factor. After bi-histogram equalization and dual-domain image decomposition enhancement, combined with the advantages of both, the final output enhanced image can be expressed as: where α is an adjustment factor, which was used to control the contribution proportion of bi-histogram equalization and dual-domain image decomposition. X is the output image. It can be seen from Equation (17) that there are six parameters to be determined. We next construct the fitness function and use EXPSO algorithm to optimize these parameters to obtain the final image.

Fitness Function
In this study, five commonly used image evaluation indexes were used to construct the fitness function: entropy, average gradient, contrast, Niqe, and Brisque.

(1) Information entropy
Information entropy is used to measure the information contained in the image. The higher the information entropy is, the richer the information contained in the image is and, to some extent, the better the image quality is. The calculation formula is as follows: (18) where P (x) is the probability of the occurrence of gray value x.

(2) Average gradient
The average gradient reflects the change of gray value in the edge region of the image, which can reflect the sharpness of the image and the retention ability of the detail texture. The calculation formula is as follows:

(3) Contrast
Contrast can reflect the strength of enhancement effect. Wu [42] put forward the definition of contrast in 2011, considering the histogram of image I has N nonzero entries. The calculation formula of contrast is: where x k is the gray level and p k is the probability of gray level x k .

(4) Niqe
Niqe is an unreferenced image quality evaluation algorithm proposed by Mittal et al. [43] in 2013. It evaluates the image quality according to the distance between the feature model parameters of the image to be evaluated and the pre-established model parameters. The evaluation value of Niqe algorithm is consistent with the result of human eye perception. The smaller is the Niqe value, the better is the image quality. In this article, N (X) represents the Niqe value of image X.

(5) Brisque
Brisque is a kind of natural scene statistics based on general reference image quality assessment model, using the local scene statistical model for the coefficient of normalized luminance quantization image quality. Various types of distortion samples are used to train the SVM model parameters and multiple corresponding hyperplanes, and not distortion types combined with different kinds of distortion . The corresponding probability quality score is finally calculated [44]. In this paper, B (X) represents the Brisque value of the image X.
Among them, the higher the information entropy is, the higher the contrast is, the higher the average gradient is, and the lower Niqe and Brisque are, the better the results is. Therefore, a multi-objective optimization model is constructed in this paper as follows: where H (X), A (X), C (X), N (X), and B (X) represent information entropy, average gradient, contrast, Niqe, and Brisque, respectively. The model is a multi-objective optimization problem. To simplify it, we normalize it into a single-objective optimization problem as follows: ε 1 + ε 2 + ε 3 + ε 4 + ε 5 = 1 (22) where I is the input image, ε i are the weight factors, and X is the output image. This model has only boundary constraints. The proposed EXPSO algorithm is used to minimize the function F, and each parameter is solved and substituted into Equation (17) to obtain the final enhanced image.

EXPSO Algorithm Performance Experiment
Six function optimization problems were used to test the performance of the proposed EXPSO algorithm. The functions are shown in Table 2. The dimension of the function is 30. The proposed algorithm was compared with PSO [4], HFPSO [45], GQPSO [46], and HCQPSO [47]. The results are shown in Figure 4. It can be seen that the EXPSO algorithm in this paper has certain advantages in convergence accuracy and convergence speed.

Infrared Image Enhancement Experiment
To verify the effectiveness of the proposed algorithm, state-of-the-art methods were selected, namely SRRM [48], BBHE [30], CLAHE [39], DPE [34], EFF [49], CRM [50], and JED [51], and publicly available datasets were used, namely OTCBVS Benchmark Dataset [52] and FIR Sequence Pedestrian Dataset [53]. Information entropy, Average gradient, Constrast, Niqe, and Brisque index were used as the objective evaluation factors. The experimental results are shown in Figure 5. It can be seen in the figure that the contrast of the original image is relatively weak. The image contrast is not significantly improved after processing by the algorithms show in Figure 5b,f-h. Figure 5d is the processing result of CLAHE algorithm, with good contrast, but details are lost. For example, the upper left corner of Img1 is too bright, resulting in details being lost, and the ground is too bright and the grass is too dark in Img2. Figure 5c,i presents good visual effects. It can be seen from Img1 and Img2 that the overall brightness of the algorithm in this paper is higher than that of the algorithm shown in Figure 5c. The algorithm in this paper can enhance the contrast while preserving the details and texture of the image.
The performance of each algorithm can be further seen from the objective evaluation factors. The results under the information entropy index are shown in Table 3. Under the information entropy index, our proposed algorithm achieved the best results. The results show that the algorithm in this paper did not lose the image information entropy, but increased the image information entropy, while the traditional BBHE algorithm reduced the image information entropy. Average gradient index results are shown in Table 4. In terms of average gradient, the algorithm proposed in this paper obtained the best results except Img1. Contrast index results are shown in Table 5. In contrast index, the algorithm in this paper greatly improved the contrast of the images. Our algorithm obtained the highest contrast. Niqe results are shown in Table 6. In terms of Niqe, the proposed algorithm worked best on all three images. Brisque results are shown in Table 7. In terms of Brisque, the proposed algorithm worked best on all three images. The objective evaluation factor also shows that the algorithm in this paper increases the contrast of the image while preserving the image information.  Algorithms Img1 Img2 Img3 Img4 Img5 Mean

Conclusions
In this paper, an improved PSO algorithm called EXPSO is proposed and applied to the infrared image enhancement. The new exponential center symmetry inertia weight function is constructed and the local optimal solution jumping mechanism is introduced to make the algorithm consider both global search and local search. A new image enhancement method is proposed based on the advantages of bi-histogram equalization algorithm and dual-domain image decomposition algorithm. The fitness function is constructed by using five kinds of image quality evaluation factors (information entropy, average gradient, contrast, Niqe, and Brisque), and the parameters are optimized by the EXPSO algorithm, so that the parameters are determined to enhance the image. Experiments were carried out to verify the effectiveness of the proposed EXPSO algorithm and the effect of the image enhancement method. Experimental results show that the EXPSO algorithm converges more quickly than the other four algorithms. In the image enhancement experiment, the proposed algorithm has good effect under five objective evaluation factors. The experimental results show that the proposed image enhancement method can not only improve the contrast of the image, but also preserve the details of the image.