A Fire Detection Algorithm Based on Tchebichef Moment Invariants and PSO-SVM

: Automatic ﬁre detection, which can detect and raise the alarm for ﬁre early, is expected to help reduce the loss of life and property as much as possible. Due to its advantages over traditional methods, image processing technology has been applied gradually in ﬁre detection. In this paper, a novel algorithm is proposed to achieve ﬁre image detection, combined with Tchebichef (sometimes referred to as Chebyshev) moment invariants (TMIs) and particle swarm optimization-support vector machine (PSO-SVM). According to the correlation between geometric moments and Tchebichef moments, the translation, rotation, and scaling (TRS) invariants of Tchebichef moments are obtained ﬁrst. Then, the TMIs of candidate images are calculated to construct feature vectors. To gain the best detection performance, a PSO-SVM model is proposed, where the kernel parameter and penalty factor of support vector machine (SVM) are optimized by particle swarm optimization (PSO). Then, the PSO-SVM model is utilized to identify the ﬁre images. Compared with algorithms based on Hu moment invariants (HMIs) and Zernike moment invariants (ZMIs), the experimental results show that the proposed algorithm can improve the detection accuracy, achieving the highest detection rate of 98.18%. Moreover, it still exhibits the best performance even if the size of the training sample set is small and the images are transformed by TRS.


Introduction
Fire has played a significant role in promoting the progress of human civilization.However, without proper management, it is also one of the major disasters causing huge loss of human lives and property all over the world.Therefore, it is essential to propose a reliable and effective algorithm to detect and raise the alarm for fire as soon as possible.
Traditional detection algorithms usually use heat sensors, thermocouples, or ionization sensors to detect fire, through detecting temperature and smoke particles [1].In the past few years, Siemens launched a FDT221 fire detector.It is equipped with two redundant heat sensors, which monitor rooms in which a temperature rise is expected in case of fire.Mircom also launched the MIX-200 series of intelligent sensors for residential applications, equipped with photoelectric smoke detectors and electronic thermistors.Although these sensors may work efficiently in some particular cases, they suffer from large propagation delays of smoke and temperature, resulting in the increase of fire detection latency.Other algorithms, based on beam or aspirated smoke detectors, have been used to attempt to reduce the detection latency.Still, they cannot solve the practical problem completely [2].Moreover, all of the abovementioned sensors require being in close proximity to the fire.Optical sensors have the advantages of long detection distance and fast response.However, as point detectors, their detection area is limited.These traditional algorithms do not detect the fire itself directly, therefore they are not always reliable.
Fire image detection is a relative novel technology based on video cameras, detecting the fire through the intelligent analysis of images with advanced algorithms.Compared with traditional sensors, the advantages of video cameras are listed as follows.First of all, video cameras can avoid detection latency to a great extent.They can also monitor a larger area as volume detectors, and are adaptable to outdoor locations, where traditional sensors are difficult to place.Finally, with the increasing concern of security, more and more surveillance cameras have been installed for various security applications, providing a convenient way to embed fire image detection into existing systems.
Research on fire image detection mainly focuses on two missions: feature extraction and state detection.For the former, there have been several studies highlighting a set of features for fire detection, such as color, flickering, motion, and edge blurring.Among them, color is considered as one of the most important clues.Li et al. [3] developed computer algorithms to segment the fire zone in the HSV (hue, saturation, value) color space and discover the correspondence points of image pairs, deciding the location, size, and propagation of the fire.A method based on the RGB (red, green, blue) color model and the difference between two consecutive potential fire masks was proposed in Reference [4], which indicated whether the potential region was a fire or fire-like object.The other color models such as YCbCr and CIE Lab were also used for fire pixel classification [5,6].The analysis of fire-colored moving pixels in consecutive frames contributes to raising the alarm.Furthermore, some extra clues such as spatial difference and temporal changes are also involved.Habibo glu et al. [7] used the color, spatial, and temporal information and divided the video into spatiotemporal blocks, extracting covariance-based features from these blocks to detect fire.Borges et al. [8] presented a probabilistic model for color-based fire detection to extract the features of candidate fire regions, including area size, boundary roughness, skewness, and surface coarseness.Unfortunately, color information and their derived descriptors are not reliable enough to perform fire detection.Due to the poor robustness in handling false alarm sources, they are affected easily by fire-colored objects, such as red flags, setting sun, lighting, and so on.Besides, some color spaces have the disadvantage of illumination dependence.In other words, the changes of illumination in the image have a negative effect on the fire pixel classification rules.Xu et al. [9] proposed a method for automatic fire smoke detection based on image visual features.This was achieved by extracting the static and dynamic features of fire smoke, including growth, disorder, frequent flicker in boundaries, self-similarity, and local wavelet energy.In Reference [10], a statistical analysis was carried out to detect smoke, using the idea that smoke is characterized by a grayish color with different illuminations.However, these smoke-based fire detection methods can give false alarms if proper consideration is not taken into account.Great challenges are yet to be overcome, such as dealing with smoke produced by cigarettes or friendly smoke.Several researchers have theoretically investigated the Gaussian mixture model [11,12] and optical flow method [13,14], which are suitable for fire image detection.However, these methods also have some drawbacks, such as relying on a background frame and requiring huge computational resources.From the above discussion, there is no doubt that a novel and effective algorithm for the feature extraction of fire images is needed.
As for state detection, artificial neural network (ANN) has been widely used for fire image detection, which is a special case of neural computation [15][16][17].It applies historical data and has strong robustness of data analysis, achieving a better detection rate than the conventional algorithms.Nevertheless, the negative aspects of over-fitting, slow convergence rate, and becoming easily trapped in the local optimal solution are also obvious.Support vector machine (SVM) is a machine learning method based on statistical theory, which was first put forward by Vapnik [18].It can overcome the dimensionality disaster and guarantee that the local and global optimal solution are exactly the same.SVM minimizes the upper bound of the generalization error based on structural risk minimization (SRM) and considers the empirical risk minimization (ERM) simultaneously, having a better generalization performance than ANN [19][20][21][22].Meanwhile, it has a smaller demand for samples [23,24].
Many studies have been published concerning the state classification of fire with SVM [25][26][27][28], but little attention has been focused on how to select its parameters.It is well known that the performance of SVM greatly depends on its parameters.However, due to the lack of theoretical guidance, the choice of the parameters mostly relies on experience and manual selection in practical applications, which is troublesome and time-consuming [29][30][31].In order to improve the fire detection performance and work efficiency, it is necessary to apply an effective and intelligent method to obtain the optimal parameters of SVM.In this paper, a novel fire image detection algorithm is proposed through combining Tchebichef moment invariants (TMIs) and particle swarm optimization-support vector machine (PSO-SVM).Firstly, the translation, rotation, and scaling (TRS) invariants of Tchebichef moments are obtained in terms of the geometric moments.Then, the features of candidate images are extracted by calculating their TMIs to form feature vectors.To gain the best performance of fire detection, a PSO-SVM model is built with the feature vectors of the training sample set, to which the PSO is applied to search the best kernel parameter and penalty factor of SVM.Afterwards, the PSO-SVM model is used to detect the fire images of the testing sample set.To evaluate the performance of the proposed algorithm, a comparison with the algorithms based on HMIs and ZMIs is also performed.Finally, the experimental results show that the proposed algorithm can improve the detection accuracy, achieving the highest detection rate of 98.18%.Moreover, it continues to exhibit the best performance even if the size of the training sample set is small and the images are transformed by TRS, proving its effectiveness and feasibility.
The remainder of this paper is structured as follows: Section 2 provides a brief introduction to Tchebichef moments.In Section 3, the translation, rotation, and scale invariants of Tchebichef moments are obtained, which contributes to form the feature vectors.Section 4 describes how to construct an SVM and introduces the basic principle of particle swarm optimization and the optimization procedure for SVM parameters.The process of fire image detection based on an PSO-SVM model is also presented.Section 5 describes the experiments conducted to demonstrate the performance of the proposed algorithm.Results of the experiments are also discussed in detail.Finally, the conclusions are stated in Section 6.

Tchebichef Moments
Moments are scalar quantities used to characterize a function and to capture its significant features.Moments have been widely used for description of the shape of a probability density function and in classic rigid-body mechanics to measure the mass distribution of a body [32].Similarly, an image can be considered as any piece-wise continuous real function f (x, y) of two variables defined on a compact support D ⊂ R × R and having a finite nonzero integral.From the mathematical point of view, image moments are equivalent to the projection of an image onto a polynomial basis.Therefore, the general moment G pq of an image is defined as: where p, q are non-negative integers; p + q is called the order of the moment, and ψ pq (x, y) is a polynomial basis function defined on D.
For a digital image, the integral in Equation ( 1) is usually approximated by discrete summation.On an N × N image coordinate space, the moment integral can be expressed in the following discrete domain: where 0 ≤ p, q, x, y ≤ N − 1.
Image moments are region-based descriptors.Depending on the polynomial basis used, we can recognize various image moments.In the same way, Tchebichef moments of order p + q on an image of size N × N pixels are defined using the following polynomial basis function: where t p (x), t q (y) are the discrete orthogonal Tchebichef polynomials.The discrete orthogonal Tchebichef polynomials t p (x) of order p and length N are defined as in Reference [33]: It can be observed that the value of t p (x) given by Equation (4) grows as N p , which is not suitable for defining moments [34].To ensure the numerical stability of higher order functions, a scaled version of Tchebichef polynomials is proposed as follows [35]: where the squared-norm ρ(p, N) is given by: Above all, for an N × N image f (x, y), the Tchebichef moments T pq of order p + q are defined as:

Feature Extraction Based on TMIs
Translation, rotation, and scaling are the important transformations of spatial coordinates.In order to guarantee that the fire images can be recognized correctly and steadily, regardless of their position and orientation in the scene and the fire-to-camera distance, the Tchebichef moment invariants with respect to TRS are proposed to extract the features of images in this paper.

Tchebichef Polynomials Expansion
From Equations ( 4) and ( 5), the scaled discrete orthogonal Tchebichef polynomials t p (x) can be expanded into a power series as [35]: where the coefficient C(p, k) is given by: Furthermore, using the Stirling numbers of the first kind s 1 (k, i), the Pochhammer symbol (x) k can be expressed as: where s 1 (k, i) satisfy the following recurrence relations: Substituting Equation (10) into Equation ( 8), the scaled Tchebichef polynomials t p (x) can be rewritten as: where

Tchebichef Moment Invariants
Equation (12) shows the correlation between scaled Tchebichef polynomials and the power series, which is helpful in expressing the Tchebichef moments as a linear combination of geometric moments.Substituting Equation ( 12) into Equation ( 7), the Tchebichef moments T pq can be expressed as: where m ij is the geometric moment of order i + j, defined as: Here, the translation, rotation, and scaling invariants of Tchebichef moments can be obtained by using the corresponding invariants of geometric moments.Invariants to translation can be achieved by shifting the coordinate origin to the image centroid.In the case of geometric moments, the central geometric moment µ ij of order i + j is defined as [36]: where (x 0 , y 0 ) denotes the image centroid given by: Then, rotation invariants are obtained by transforming the Cartesian coordinate system into the inertia principal axes system.According to the geometrical properties of cross-section in the mechanics of materials, the transformational relation is expressed as follows: where α is the rotation angle of the original image given by: Algorithms 2018, 11, 79 Here, it can be easily verified that the value of α given in Equation ( 18) is limited to [−45 • , 45 • ].In this paper, the modified version proposed in Reference [36] is used to obtain the exact angle α in the range of 0 • to 360 • .
Under the transformation given by Equation ( 17), the central moment of order i + j is modified as: which holds invariant to image translation and rotation.Furthermore, scaling invariants of µ ij are accomplished by the proper normalization of each moment.In theory, any nonzero moment can be invoked as a normalizing factor.Generally, a proper power of µ 00 is used to normalize µ ij .Hence, the normalized central geometric moment ν ij of order i + j is defined as: where r = (i + j + 2)/2.From the above, by replacing the geometric moments m ij on the right-hand side of Equation ( 13) with ν ij , the translation and rotation invariants of Tchebichef moments T pq are obtained, as shown in the following expression: Observe that, when an image is scaled, the coefficients B(i) and B(j) are also scaled according to the scaling factor.Hence, it is reasonable to normalize the T pq using the size of the image.For an N × N image, the zero-order of T pq is obtained by using Equation ( 21), as follows: From Equation (22), it can be seen that all of the Tchebichef moment invariants will be scaled if they are divided by T 00 , which is affected by the scaling of an image.Finally, the proposed translation, rotation, and scale invariants of Tchebichef moments are expressed as follows: T 00 (23)

Feature Extraction
Using Equation ( 23), any order TMIs of candidate images can be calculated.In practical application, the selected moment invariants are generally of finite order, such as Since T 01 and T 10 have nothing to do with the image content, the feature extraction of every candidate image will start from the second order of TMIs, forming a feature vector as shown in the following expression: 4. Particle Swarm Optimization-Support Vector Machine (PSO-SVM)

Support Vector Machine (SVM)
SVM is a supervised learning method based on the statistical learning theory and principle of structural risk minimization.Compared with neural network learning, SVM can solve the problems of over-fitting and local optimum.It can learn in high-dimensional feature spaces and obtain excellent learning performance with limited training samples.Therefore, SVM is particularly suitable for detecting whether the candidate area is on fire or not.
As for the SVM, the training samples include several consecutive images of the candidate area.The training sample set D t can be expressed as follows: where V i is the input feature vector of an image to train the SVM classifier; y i is either −1 or +1, indicating that the training sample belongs to a fire or non-fire image; and n is the size of the training sample set.
In the d-dimensional space, the essential problem of SVM is to find a hyper-plane to divide the training samples into two different classes.In the case of non-linear classification, the input vector V i needs to be mapped into a very high-dimensional feature space by non-linear mapping θ(V i ).Afterwards, they can become linearly classified, as shown in Figure 1, just like achieving the non-linear classification algorithm in the relative original space.The hyper-plane can be denoted by: in which every sample is subjected to: where w is the weight coefficient and b is the offset coefficient.According to Equation ( 28), the purpose is obviously a convex optimization problem.For the convenience of calculations, Equation ( 28) can be substituted into Lagrangian's dual formulation, as shown in the following expression [18,37]: where i β is the Lagrange multiplier corresponding to every training sample and The sample is the support vector for which ≠ 0 i β , lying on one of the two hyper-planes: ( ) To deal with the nonlinear SVM problem easily, a kernel function satisfying the Mercer's condition is introduced to map the data into a high dimensional space.( ) in the feature space [37].As a result, the first one in Equation As shown in Figure 1, the margin between different classes can be derived as 2/ w .The optimal separating hyper-plane is that which separates the different classes with the maximal margin.It is easy to check that the maximum of 2/ w is equivalent to the minimum of w 2 /2.Considering the case in which the training sample set D t cannot be separated without error, the purpose of SVM can be described as: where C is the penalty factor of error classification; ξ is the slack variable; and ξ ≥ 0.
According to Equation ( 28), the purpose is obviously a convex optimization problem.For the convenience of calculations, Equation ( 28) can be substituted into Lagrangian's dual formulation, as shown in the following expression [18,37]: where β i is the Lagrange multiplier corresponding to every training sample and β i ≥ 0. The sample is the support vector for which β i = 0, lying on one of the two hyper-planes: To deal with the nonlinear SVM problem easily, a kernel function satisfying the Mercer's condition is introduced to map the data into a high dimensional space.K V i , V j denotes the kernel function, and K V i , V j = θ(V i ) T θ V j in the feature space [37].As a result, the first one in Equation ( 29) is modified as: Assuming that the obtained optimal solution of the above equation is β * i , then the optimal coefficients w * and b * of the hyper-plane are calculated as: where θ(V h ) and θ(V l ) are a pair of support vectors belonging to different classes.Hence, the corresponding decision function f (V) is expressed as follows [38]: whose output is the result of fire image detection.
In addition, as kernel function is the key technology of SVM, its selection will affect the learning ability and generalization ability of the model directly.At present, there have been several kernel functions available: polynomial kernel, sigmoid kernel, linear kernel, and radial basis function (RBF) kernel.Among them, the RBF kernel has the advantage of low computational complexity.Therefore, it is adopted as the kernel function for SVM in this paper and denoted by: where τ is the kernel parameter to measure the width of RBF and τ > 0; x, x ∈ R d .

Particle Swarm Optimization for SVM Parameters
From Equations ( 29), (32), and (33), it is clear that the value selections of kernel parameter τ and penalty factor C have an effect on the detection result.If these parameters are excessively large, the detection accuracy rate will be very high in the training sample set, but very low in the testing sample set.On the contrary, if they are disproportionately small, the detection accuracy rate will be too low to satisfy, making the model useless.
PSO is a population-based global optimization algorithm from the simulation of birds feeding on behavior, proposed by Kennedy and Eberhart [39][40][41][42][43][44].Owing to its advantageous characteristic of high efficiency, robustness, and easy implementation with code, the PSO algorithm is applied to optimize the parameters of SVM in this paper, combined with K-fold cross-validation.
In the PSO algorithm, the particle swarm is initialized by a population of particles, which are generated with random positions and velocities.The fitness value of particles are calculated with an objective function.Then, every particle updates its velocity and position dynamically with the personal-best value and global-best value.As a result, the global-best position is obtained by simply adjusting the position of every particle, according to its own personal-best value as well as neighboring particles.
In the s-dimensional space, the i-th (i = 1, 2, • • • , s) particle's position vector and velocity vector can be indicated as Then, the PSO algorithm can be described by the following equations: where v is (t) is the previous velocity, which is limited in the range of [−v max , v max ]; P is (t) is the individual-best position obtained for now; P gs (t) is the global-best position obtained for now; ω is the inertia weight value controlling the effect of the previous velocity on the current one; c 1 and c 2 are the acceleration coefficients; r 1 (t) and r 2 (t) are two independent pseudo-random numbers which are uniformly distributed in the range of [0, 1].The flow diagram of PSO-SVM model construction is illustrated in Figure 2, and the process of optimizing the SVM parameters with PSO is described as follows: Step 1. Initialize particle and set PSO parameters.Generate the initial particles at random, which are composed of the SVM parameters τ and C.Then, set the PSO parameters, including the size of population s, maximum number of iterations t max , inertia weight ω, and acceleration coefficients c 1 , c 2 .
Step 2. Fitness calculation.Evaluate the fitness value of every particle, which is the average classification accuracy of K-fold cross-validation.Take the current particle as its individual-best point and regard the particle with maximal fitness value as the global-best point.
Step 3. Update.Every particle's velocity and position are updated by Equations ( 34) and (35), respectively.Evaluate the fitness of every current particle and compare the fitness value with that of the individual-best point and that of the global-best point.If the current value is better, update the particle with the current value as its individual-best point or global-best point.Step 4. Check stopping criteria.If the maximum number of iterations is attained, the evolutionary process will stop.Otherwise, proceed to Step 3. Step 5. Determine parameters.When the maximum number of iterations is attained and the stopping criteria is satisfied, the values of optimal parameters τ and C are finally obtained.Then, the training and verification procedure is ended, and the PSO-SVM model is constructed.
Step 4. Check stopping criteria.If the maximum number of iterations is attained, the evolutionary process will stop.Otherwise, proceed to Step 3. Step 5. Determine parameters.When the maximum number of iterations is attained and the stopping criteria is satisfied, the values of optimal parameters τ and C are finally obtained.Then, the training and verification procedure is ended, and the PSO-SVM model is constructed.

Process of Fire Image Detection Based on the PSO-SVM Model
Combining the abovementioned contents, the flow diagram of fire image detection based on the PSO-SVM model is shown in Figure 3.
The process is described as follows.First, collect a series of candidate images using a video camera and divide the collected images into the training sample set and testing sample set.Then, calculate the Tchebichef moment invariants pq T  of every candidate image and select some of them to construct its feature vector i V .Next, train the SVM with the feature vectors of the training sample set and optimize the SVM parameters by using PSO.Afterwards, the training sample set is input into the SVM with optimal parameters once again, contributing to the PSO-SVM model.Finally, the

Process of Fire Image Detection Based on the PSO-SVM Model
Combining the abovementioned contents, the flow diagram of fire image detection based on the PSO-SVM model is shown in Figure 3.
The process is described as follows.First, collect a series of candidate images using a video camera and divide the collected images into the training sample set and testing sample set.Then, calculate the Tchebichef moment invariants T pq of every candidate image and select some of them to construct its feature vector V i .Next, train the SVM with the feature vectors of the training sample set and optimize the SVM parameters by using PSO.Afterwards, the training sample set is input into the SVM with optimal parameters once again, contributing to the PSO-SVM model.Finally, the feature vectors of the testing sample set are input into the PSO-SVM model to predict their belonging labels, achieving the fire image detection.
To fully examine the performance of the PSO-SVM model, the detection rate Acc is used as the evaluation criteria, as shown in the following expression: where TP is the amount of the correctly predicted fire images; TN is the amount of the correctly predicted non-fire images; FP is the amount of fire images that are incorrectly predicted as non-fire images; and FN is the amount of non-fire images that are incorrectly predicted as fire images.
where TP is the amount of the correctly predicted fire images; TN is the amount of the correctly predicted non-fire images; FP is the amount of fire images that are incorrectly predicted as non-fire images; and FN is the amount of non-fire images that are incorrectly predicted as fire images.

Experimental Setup
To collect a series of candidate images, a video camera was utilized to monitor the burning fire for a period of time.Normal heptane was used as fuel for the fire.A cauldron was used as the burner, which was about 700 mm in diameter and 22 mm deep.The fire-to-camera distance was about 3 m.There were 100 candidate images, with dimensions of 388 × 320.Among them, the 1st~60th images exhibited the stable burning of fire, as shown in Figure 4a-c; the 61st~93rd images showed the initial extinguishing of fire, as shown in Figure 4d-f; and the 94th~100th images contained the final extinguishing of fire, as shown in Figure 4g-i.It was observed that some images with initial extinguishing still contained some information about the unstable burning of fire, which were similar to those with stable burning.On the contrary, the images with final extinguishing were quite different from those with stable burning, which should be detected easily.However, in order to better evaluate the algorithm performance, the difficulty of detection should be increased.Thus, in our experiments, the first 60 candidate images were regarded as fire images and the rest were regarded as non-fire images.Moreover, according to the different experimental requirements, the candidate images could be divided into various training sample sets and testing sample sets correspondingly.
There were 100 candidate images, with dimensions of 388 × 320.Among them, the 1st~60th images exhibited the stable burning of fire, as shown in Figures 4a-c; the 61st~93rd images showed the initial extinguishing of fire, as shown in Figures 4d-f; and the 94th~100th images contained the final extinguishing of fire, as shown in Figures 4g-i.It was observed that some images with initial extinguishing still contained some information about the unstable burning of fire, which were similar to those with stable burning.On the contrary, the images with final extinguishing were quite different from those with stable burning, which should be detected easily.However, in order to better evaluate the algorithm performance, the difficulty of detection should be increased.Thus, in our experiments, the first 60 candidate images were regarded as fire images and the rest were regarded as non-fire images.Moreover, according to the different experimental requirements, the candidate images could be divided into various training sample sets and testing sample sets correspondingly.At first, the candidate images were converted into grayscale images.In the process of feature vector construction, selecting the Tchebichef moment invariants of proper orders is very important, as this has an effect on the accuracy of detection results.Considering the detection performance and running time of the experimental confirmation, the feature vector i V used in this paper is shown as follows:  At first, the candidate images were converted into grayscale images.In the process of feature vector construction, selecting the Tchebichef moment invariants of proper orders is very important, as this has an effect on the accuracy of detection results.Considering the detection performance and running time of the experimental confirmation, the feature vector V i used in this paper is shown as follows: During the optimization process, the initialization parameters of PSO, such as the size of population, maximum number of iterations, inertia weight, and acceleration coefficients, were set as follows: s = 20, t max = 100, ω = 1, c 1 = c 2 = 1.49618.For the cross-validation, the K-fold method was performed with a K value of 3. The related parameters of τ and C for the RBF kernel function were varied in the arbitrarily fixed range of [0.1, 100].The above initialization parameters are given in Table 1.In addition, all of the experiments were implemented by Matlab 2013b and performed on a Windows 7 Ultimate operation system under the 2.4 GHz Intel Core i5 processor with 8 G RAM.

Results and Discussion
In the first experiment, 25 fire images and 20 non-fire images were randomly selected as the training sample set used to construct the PSO-SVM model.Meanwhile, the remaining 55 images were considered as the testing sample set and used to confirm the model accuracy.Then, the TMIs of the candidate images were calculated to form the feature vectors according to Equation (37).The Tchebichef moment invariants of candidate images in Figure 4 are given in Table 2. Next, the feature vectors of the training sample set were input into the SVM, and the best values of the SVM parameters were sought by the PSO algorithm.As shown in Figure 5, the optimal parameters were obtained: τ = 1.6620,C = 60.5028.With the optimal parameters, the training sample set was input into the SVM to obtain the PSO-SVM model.Finally, the feature vectors of the testing sample set were input into the PSO-SVM model to detect fire images.To evaluate the performance of the proposed algorithm, a comparison with the algorithms based on HMIs and ZMIs were also carried out.The results of the first experiment are given in Table 3.It can be seen from Table 3 that the detection rate of HMIs, which are derived from nonorthogonal polynomials, is the lowest (89.09%).On the contrary, the detection rate of TMIs derived from discrete orthogonal polynomials is the highest (98.18%).Although there is a false identification using the proposed algorithm, the results of fire detection do not depend on a single image, but rather continuous images in practical application.In addition, combined with Figure 5 and Table 3, the effectiveness of the PSO-SVM model was confirmed by that fact that it obtained the best performance and the highest rate of detection.
In the second experiment, the size of the training sample set was modified to observe its effect on the detection rate.There were 10, 15, 20, and 25 fire images and 5, 10, 15, and 20 non-fire images randomly selected.As a result, there were four training sample sets formed, whose sizes were 15, 25, 35, and 45, respectively.Meanwhile, the rest of candidate images composed four corresponding testing sample sets.In the same way, the comparison of the algorithms based on HMIs, ZMIs, and TMIs was performed.The PSO-SVM model was implemented to predict the belonging labels of the testing sample sets.The result of the second experiment can be observed in Figure 6.
When the size of the training sample set is small, the description of candidate images is not accurate enough that the detection rates all reach their respective lowest points.However, with the increase in the size of the training sample set, the description and the classification boundary become more and more accurate, which contributes to the increasing trend of the detection rates.Finally, all of the detection rates reach their respective maximums.According to Figure 6, we can see that when the size of the training sample set is 15, the detection rate of the algorithm based on HMIs is only 58.82%, and that of the algorithm based on ZMIs is also only 75.29%.In contrast, the detection rate of the proposed algorithm based on TMIs is 82.35% at this point.Furthermore, when the size increases from 15 to 45, the proposed algorithm has the highest detection rate and the smallest fluctuation in the detection rate throughout the different experiments.In conclusion, the results show that the proposed algorithm is more reliable, and can maintain the highest recognition rate even when the size of the training sample set is small.
In the third experiment, the performance of the proposed method in the TRS sample set was illustrated.First, the images shown in Figure 4  It can be seen from Table 3 that the detection rate of HMIs, which are derived from non-orthogonal polynomials, is the lowest (89.09%).On the contrary, the detection rate of TMIs derived from discrete orthogonal polynomials is the highest (98.18%).Although there is a false identification using the proposed algorithm, the results of fire detection do not depend on a single image, but rather continuous images in practical application.In addition, combined with Figure 5 and Table 3, the effectiveness of the PSO-SVM model was confirmed by that fact that it obtained the best performance and the highest rate of detection.
In the second experiment, the size of the training sample set was modified to observe its effect on the detection rate.There were 10, 15, 20, and 25 fire images and 5, 10, 15, and 20 non-fire images randomly selected.As a result, there were four training sample sets formed, whose sizes were 15, 25, 35, and 45, respectively.Meanwhile, the rest of candidate images composed four corresponding testing sample sets.In the same way, the comparison of the algorithms based on HMIs, ZMIs, and TMIs was performed.The PSO-SVM model was implemented to predict the belonging labels of the testing sample sets.The result of the second experiment can be observed in Figure 6.When the size of the training sample set is small, the description of candidate images is not accurate enough that the detection rates all reach their respective lowest points.However, with the increase in the size of the training sample set, the description and the classification boundary become more and more accurate, which contributes to the increasing trend of the detection rates.Finally, all of the detection rates reach their respective maximums.According to Figure 6, we can see that when the size of the training sample set is 15, the detection rate of the algorithm based on HMIs is only 58.82%, and that of the algorithm based on ZMIs is also only 75.29%.In contrast, the detection rate of the proposed algorithm based on TMIs is 82.35% at this point.Furthermore, when the size increases from 15 to 45, the proposed algorithm has the highest detection rate and the smallest fluctuation in the detection rate throughout the different experiments.In conclusion, the results show that the proposed algorithm is more reliable, and can maintain the highest recognition rate even when the size of the training sample set is small.
In the third experiment, the performance of the proposed method in the TRS sample set was illustrated.First, the images shown in Figure 4  The training sample set consisted of nine fire images and 18 non-fire images, which were randomly selected from the TRS sample set.The remaining 36 images were considered as the testing sample set.The following table gives the values of Tchebichef moment invariants of images in Figure 7.It can be seen from Table 4 that the feature vector is invariant to translation, rotation, and scaling.Similarly, a comparison of the methods based on HMIs, ZMIs, and TMIs was also performed in the third experiment.The results are given in Table 5.Compared with the first experiment, there was some decline in all of the detection rates.As seen from the data for different moments, the detection rate of HMIs declined the most (8.53%), and the detection rate of TMIs experienced the least (0.96%).However, the method based on TMIs still achieved the highest recognition rate (97.22%) among the three methods, with only one false identification.In addition, only its detection rate exceeded 95%.Here, it is worth noting that the polynomial basis functions of Hu moments have the simplest expression form, but they are not orthogonal polynomials.Due to the redundant information, the feature extraction based on HMIs has a poor capability of describing the target, resulting in a low recognition rate.On the other side, although the Zernike radial polynomials are orthogonal, they are in the continuous domain of image coordinate space.Their implementation involves numerical approximations, which has an impact on the orthogonal property.Besides, the Zernike radial polynomials are defined inside the unit circle.Their application also requires an appropriate transformation of the image coordinate space, increasing the computational complexity.On the contrary, the Tchebichef polynomials are orthogonal in the discrete domain of the image coordinate space, defining the corresponding moments directly on the image coordinate space and involving no numerical approximation.These advantages make them superior to the Hu moments and Zernike moments, and thus they present the best performance in terms of image description.
In a word, the proposed algorithm based on TMIs and the PSO-SVM model can achieve fire image detection accurately, which has advantages over algorithms based on HMIs and ZMIs.The effectiveness and feasibility of the proposed algorithm are also confirmed.

Conclusions
In this paper, a novel algorithm for fire image detection based on TMIs and the PSO-SVM model is proposed.The TRS invariants of Tchebichef moments are obtained by the correlation between geometric moments and Tchebichef moments.Then, the TMIs of candidate images are applied to form the feature vectors, which effectively avoid the discretization error of continuous orthogonal moment and redundant information.To improve the performance and detection rate, a PSO-SVM model is also proposed, in which the PSO is applied to optimize the SVM parameters.The experimental results show that the detection rate of TMIs is higher than those of HMIs and ZMIs, up to 98.18%.Even if the size of the training sample set is small and the images are transformed by TRS, the algorithm based on TMIs maintains the best detection performance.Therefore, the proposed algorithm is expected to have wide application in fire image detection.

Figure 1 .
Figure 1.The schematic diagram of support vector machine (SVM) classification.

Figure 2 .
Figure 2. The flow diagram of particle swarm optimization-support vector machine (PSO-SVM) model construction.

Figure 2 .
Figure 2. The flow diagram of particle swarm optimization-support vector machine (PSO-SVM) model construction.

Figure 3 .
Figure 3.The flow diagram of fire image detection based on the PSO-SVM model.

Figure 3 .
Figure 3.The flow diagram of fire image detection based on the PSO-SVM model.

Figure 4 .
Figure 4. Candidate images: (a-c) stable burning of fire; (d-f) initial extinguishing of fire; (g-i) final extinguishing of fire.

Figure 4 .
Figure 4. Candidate images: (a-c) stable burning of fire; (d-f) initial extinguishing of fire; (g-i) final extinguishing of fire.

Figure 5 .
Figure 5.The fitness curve of particle swarm optimization.

Figure 5 .
Figure 5.The fitness curve of particle swarm optimization.

Algorithms 2018 ,
11, x 15 of 19 rotated by angles 15 ±  , and scaled with scaling factors of 0.8~1.2 with 0.2 increments.Finally, a TRS sample set was obtained, including 63 (9 × 7) images.The images transformed by TRS of Figure 4a are shown in Figure 7.

Figure 6 .
Figure 6.Effect of training dataset size on recognition rate.Figure 6.Effect of training dataset size on recognition rate.

Figure 6 .
Figure 6.Effect of training dataset size on recognition rate.Figure 6.Effect of training dataset size on recognition rate.

Figure 6 .Figure 7 .
Figure 6.Effect of training dataset size on recognition rate.
were selected as the temporary sample set.Then, each image of the temporary sample set was translated with translation vectors [−70, −50] and [50, 70], rotated by angles ±15 • , and scaled with scaling factors of 0.8~1.2 with 0.2 increments.Finally, a TRS sample set was obtained, including 63 (9 × 7) images.The images transformed by TRS of Figure 4a are shown in Figure 7.

Table 1 .
The initialization parameters of PSO.

Table 2 .
Tchebichef moment invariants of the candidate images in Figure4.

Table 3 .
Detection rate of the testing sample set in the first experiment.

Table 3 .
Detection rate of the testing sample set in the first experiment.

Table 4 .
Tchebichef moment invariants of the images in Figure7.

Table 5 .
Detection rate of the testing sample set in the third experiment.