# A Fire Detection Algorithm Based on Tchebichef Moment Invariants and PSO-SVM
## 5 Experiments
### 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: \(\tau=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. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Value** & **Range** & **Description** \\ \hline \(s\) & 20 & — & Size of population \\ \(t_{\text{max}}\) & 100 & — & Maximum number of iterations \\ \(\omega\) & 1 & — & Inertia weight \\ \(c_{1}\) & 1.49618 & — & Acceleration coefficient 1 \\ \(c_{2}\) & 1.49618 & — & Acceleration coefficient 2 \\ \(K\) & 3 & — & Fold number of cross-validation \\ \(\tau\) & — & [0.1, 100] & Kernel parameter of SVM \\ \(C\) & — & [0.1, 100] & Penalty parameter of SVM \\ \hline \hline \end{tabular}
\end{table} 
Table 1: The initialization parameters of PSO. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline
**Image** & \(\widetilde{\mathbf{T}}_{\mathbf{21}}\) & \(\widetilde{\mathbf{T}}_{\mathbf{22}}\) & \(\widetilde{\mathbf{T}}_{\mathbf{30}}\) & \(\widetilde{\mathbf{T}}_{\mathbf{40}}\) & \(\widetilde{\mathbf{T}}_{\mathbf{41}}\) & \(\widetilde{\mathbf{T}}_{\mathbf{50}}\) \\ \hline (a) & \(-5.9312\) & \(3.4247\) & \(-4.1861\) & \(9.1684\) & \(-9.2667\) & \(-4.4579\) \\ (b) & \(-5.9295\) & \(3.4353\) & \(-4.1804\) & \(9.1665\) & \(-9.2634\) & \(-4.4530\) \\ (c) & \(-5.9059\) & \(3.3894\) & \(-4.0997\) & \(9.1391\) & \(-9.2161\) & \(-4.3828\) \\ (d) & \(-5.3757\) & \(2.5663\) & \(-2.2898\) & \(8.5260\) & \(-8.1568\) & \(-2.8091\) \\ (e) & \(-5.5311\) & \(2.9393\) & \(-2.8203\) & \(8.7057\) & \(-8.4674\) & \(-3.2705\) \\ (f) & \(-5.7740\) & \(3.3193\) & \(-3.6496\) & \(8.9866\) & \(-8.9526\) & \(-3.9913\) \\ (g) & \(-5.5260\) & \(2.7327\) & \(-2.8028\) & \(8.6997\) & \(-8.4570\) & \(-3.2550\) \\ (h) & \(-5.1724\) & \(2.1677\) & \(-1.5957\) & \(8.2908\) & \(-7.7506\) & \(-2.2056\) \\ (i) & \(-5.5726\) & \(2.7335\) & \(-2.9621\) & \(8.7537\) & \(-8.5503\) & \(-3.3936\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Tchebichef moment invariants of the candidate images in Figure 4. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Parameter** & **Hu** & **Zernike** & **Tchebichef** \\ \hline Detection amount & 49 & 52 & 54 \\ Detection rate & 89.09\% & 94.55\% & 98.18\% \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Detection rate of the testing sample set in the first experiment. 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.