Fire Detection and Recognition Optimization Based on Virtual Reality Video Image

Fire detection technology based on video images can avoid many flaws in conventional methods and detect fires. To achieve this, the support vector machine (SVM) method in machine learning theory has unique advantages, while rough set (RS) theory and SVM complement each other in application. Thus, a new classifier could be created by organically combining these methods to identify fires and provide fire warnings, yielding excellent noise suppression and promotion. Therefore, in this study, an RS is used as the front-end system for the SVM method, yielding improved performance than only SVM. Recognition time is reduced, and recognition efficiency is improved. Experiments show that the RS-SVM classifier model based on parameter optimization proposed in this paper mitigates deficiencies in overfitting and determining local extremum with excellent reliability and stability, and enhances the forecast accuracy of fires. The method also reduces false fire-detection alarms and uses fire feature selection in virtual reality (VR) video images and fire detection and recognition.


I. INTRODUCTION
Accidental fire is a natural disaster that seriously threatens public safety. In recent years, accidental fire has frequently occurred in many places, including superstores, communities and forests, yielding huge losses to production and human life. After several decades of development, virtual reality technology has matured quickly and has changed people's lifestyles by being widely applied in many fields [1]. For example, VR technology has been used to manage accidental fire in industry, agriculture, hospitals, aviation, aerospace, and firefighting. Thus, virtual fire environment technology has become integral to future fire protection. Due to their detection principles or system structures, traditional fire detectors, which include temperature detectors, smog detectors and optical detectors, usually have inherent defects or application restrictions. Because flames and smog have specific colors, textures, shapes and other image features, people have begun to consider using computer visual features to improve the efficiency of fire detection (e.g., video flame detection technology based on image processing). In most The associate editor coordinating the review of this manuscript and approving it for publication was Zhihan Lv . fire scenes, flames and smog exist [2], [3]. Fire detection technology based on video images recognizes flames or smog in video images and then implements real-time monitoring of fire scenes. This noncontact technique requires a computer to process imagery and discriminates suspicious targets that appear in the video images by studying and extracting visual features of flames or smog [4]. A support vector machine that uses the principle of structural risk minimization can solve problems that have a small sample, a high dimensionality, and a local extremum perfectly while avoiding overfitting, overdimensionality and other problems of conventional neural networks. SVM is an effective tool for classification and recognition. Many successful applications in classification, recognition, and regression prediction are based on SVM [5], [6]. To enhance the reliability and stability of a fire detection system, SVM has been studied and developed for the field of fire detection. SVM is built upon statistical learning theory and has a strong learning ability, adaptability, and a high classification accuracy [7]. Rough set theory approximately describes uncertain and inaccurate knowledge compared to known knowledge within a database, works well in processing large amounts of data, and removes redundant information. Therefore, this study investigates an VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ image processing technology that uses both SVM and RS, and develops a fire flame image recognition method based on the RS-SVM classifier model. The contributions of this study include the following: • The research background of fire detection technology and the development status of video fire detection are presented, and the problems of conventional fire detection and recognition methods are discussed.
• RS is combined with SVM to create an RS-SVM classification model. Dimension reduction on the input vectors is achieved (si.e., even feature variables of the classifier with two attribute reduction algorithms), redundant information is removed, and the reduced results are input into the classifier model for classification.
• As the selection of kernel parameters strongly affect the classification and recognition ability of SVM, this paper investigates kernel parameter selection and analyzes the impact of the model built by kernel parameter optimization method on the flame image recognition rate.
• As indicated in the experiment, the combination of the attribute reduction algorithm in RS theory with SVM can eliminate redundant attributes in condition attributes to a very large extent. The application of the fire flame recognition method based on parameteroptimized SVM in this paper solves the problems of traditional fire flame image detection methods and yields reliable and stable performance with improved fire prediction accuracy.
The remainder of this paper is organized as follows. Section 2 discusses related works, and the standard SVM are outlined in Section 3. Feature training recognition based on the RS-SVM classifier is presented in Section 4. Section 5 shows the experimental test results, and Section 6 concludes the paper with a summary and proposed directions for future research.

II. RELATED WORK
VR technology has been an important part of research, development and application since the 1990s. VR technology builds a realistic virtual environment using a computer, and supports its users to feel this virtual environment with natural skills [8]. VR technology has been introduced into firefighting as a new training method. Researchers aim to describe how to prevent fire accidents quickly and effectively to safeguard human life and property, and minimize losses and damages. From this point of view, the research of fire flame image recognition is important and has marked practical value. Fire forecast based on digital image processing technology can effectively improve forecasting accuracy, reduce forecasting time, and provide more fire information. In the early stages of fire accidents, features including a larger flaming area, a wobbling fire edge, an irregular flame shape and overall flame movement tend to occur. These features make fire detection with imagery possible. Thus, many scholars have studied fire recognition methods, but fire detection can still be improved [9], [10]. In practical applications, many problems are studied due to some restrictions. The existing fire dataset is too small, and there is no large-scale video fire detection dataset. The dataset should also be continuously updated based on practical usage scenarios. Fire detection will be affected by fire-like objects (e.g., automobile taillights, streetlamps at night) and the rising and setting Sun. Different types of fires, such as a solid fire, a gas fire, and a charged fire, vary greatly in their imagery, making it more difficult to effectively extract key information in fire images [11]. Existing fire detection research based on videos detects motion regions and only excludes the disturbance of static fire-like objects, which also tends to extract the static features of fires. Thus, the dynamic features of fires are rarely considered. The above problems have made improving fire detection challenging [12], [13].
Video fire detection technology mainly monitors the flames or smoke generated by combustion. However, flame, especially visible burning flame, is an inevitable outcome of combustion, while smoke is only a gasification phenomenon of light and heat; thus, smoke may not be generated by combustion [14]. Color information is a key factor in fire detection, and the existing mature color models include RGB and YCBCR. Flame has more significant and stable features than smoke to fire detection; thus, studies have focused mainly on how to recognize fires based on flame features [15]. Turgay, a Turkish scholar, integrated the RGB color model with the normalization method and determined the pixel counts of early flame digital images in the planes of R-B, B-G and G-R. This method can detect early fires but requires complex computations [16]. Healey and others proposed to collect videos and flame color features with high-speed cameras and extract suspicious flame regions. Yamagishi and Yamaguchi extracted the fluctuations of outward flames based on time sequences and then recognized flames using the features of the Fourier frequency domain and neural networks [13], [17]. An American scholar named Phillips proposed an image mask based on artificial learning to determine the proper threshold of a digital fire flame image in its early stage using Gaussian filter. He then analyzed this information using a Boolean detection function and then further reduced the impact of moving objects through the brightness difference and differential of digital fire images in its early stage [18]. Lin proposed an intelligent fire detection algorithm based on image processing. This algorithm comprehensively considered the dynamic and static features of accidental fires, captured moving regions, extracted features including the area and perimeter of the candidate regions, and used shape features such as irregular polygons and circles for fire detection [19]. Schultze and others proposed to obtain flame features using a spectrogram and sonogram based on the characteristic that flames flicker and move upwards, and monitored the motion direction of flame. Toreyin and others analyzed the change of the inner color of a flame using a spatial wavelet and described the dynamic state of the flame using a Markov model [20]. Habiboglu and others used a covariance matrix and SVM to recognize flame. Marbach, a Swiss scholar, analyzed a time-domain accumulated matrix and the brightness of early fire flame digital images to build a model of flame flickering in the frequency domain using wavelet analysis and Fourier transform [21]. Xie Rongquan used a BP neural network algorithm to calculate and detect the formation laws and signal features of fire images, including RGB color features, energy, stability and other texture features as well as the fire's perimeter, area and number of pointed corners and other shape features [22]. Fire recognition with conventional image processing restricts recognition accuracy due to its sensitivity to feature extraction quality.

III. STANDARD SUPPORT VECTOR MACHINE
SVM uses the principle of structural risk minimization as its theoretical foundation. This theory selects the subset of the function and the discrimination function in this subset to minimize risk and ensure that the small error classifier obtained by finite training samples yield small test errors with independent test sets [23]. SVM operates as follows: 1a) in a linearly separable case, SVM searches for the optimal classification hyperplanes of two classes of samples in the original space; 1b) in a linearly inseparable case, SVM adds a slack variable to the analysis and maps the samples in a low-dimension input space into a high-dimension attribute space via nonlinear mapping to make it linear, making it possible to analyze the nonlinearity of samples using linear algorithms and search for the optimal classification hyperplane in this feature space [24]; 2) SVM then uses the principle of structured risk minimization to construct the optimal classification hyperplane in the attribute space to make the classifier obtain the global optimum and the expected risk in the entire sample space meet a certain upper bound at a certain probability [25], [26].
In nonlinear problems, both the optimization object function and the classification function only involve the inner product (x · x i ) between training samples. Assume that the nonlinear mapping : R d → H maps the samples in the input space into high-dimension feature space H . When constructing the optimal hyperplane in the feature space H , the training algorithm only uses the dot product in the space, i.e., ϕ(x i ) · ϕ(x j ), without the appearance of ϕ(x i ) alone. Thus, a function K is found to meet: Only the inner product computation is required in highdimension space, and such an operation can be realized with the function in the original space. According to related functional theories, the function corresponds to the inner product of a certain transformation space as long as one kind of kernel function K (x i · x j ) satisfies the Mercer condition. Therefore, in the optimal hyperplane, the use of the proper inner product function K (x i · x j ) can achieve linear classification after a certain nonlinear transform without increasing computational complexity. In summary, SVM maps the input vector into a high-dimension feature space using certain preselected nonlinear mappings and then constructs the optimal classification hyperplane. The SVM classification function is similar to that of a neural network, and the output is the linear combination of the middle nodes and every middle node corresponds to a support vector [27], [28].
For any a symmetric function k x, x , its sufficient and necessary condition for inner product computation in a certain feature space is that for any ϕ (x) = 0 and ϕ 2 (x) dx < ∞: Thus, seeking the optimal classification plane in a highdimension space can transform the inner product computation in a high-dimension space into the function operation in low-dimension space through the proper function k x i , x j to solve nonlinear classification problems without affecting computational complexity. The equation is as follows: The corresponding decision function to the optimal classification plane is: k x i , x j is the kernel function. The introduction of the kernel function has solved high-dimension problems perfectly and converts the inner product computation in a high-dimension space into the function operation in a low-dimension space. If different inner product kernel functions are selected, different SVMs will be constructed, and different algorithms will be created. Currently, the following three types of kernel functions have been studied most [29], [30].

A. POLYNOMIAL KERNEL FUNCTION
Polynomial kernel functions are a type of global kernel function that can map a low-dimension input space to a highdimension feature space and allow distant data points to affect the value of the kernel function [31]. A larger parameter d yields a higher mapping dimension, a lower deviation, and a higher variance. Additionally, if overfitting is more likely, the calculation will be more complex. Therefore, it is not suitable to select a dimension that is too high, and the most suitable dimension must pass cross validation. Polynomial kernel functions are suitable for orthogonal normalized (vector orthogonal and modulus 1) data: where q is the degree of the polynomial, which yields a q-order polynomial classifier [32].
The SVM obtained is a radial basis classifier, which fundamentally differs from traditional radial basis function methods as follows. The center of every basis function corresponds to a support vector, which is automatically determined by the algorithm along with the output weights [33]. The inner product function in the form of a radial basis is similar to the characteristics of human vision and is frequently used in practice. However, the selection of a different S parameter value will result in different corresponding classification planes [34], [35].
Currently, the SVM algorithm is a multilayered perception network that contains a hidden layer. The weight and number of nodes in the hidden layer of the network are automatically determined by the algorithm instead of being determined by experience, as in conventional perception networks. This algorithm does not exhibit the local minimum problem that is common to neural networks. Among common kernel functions, the most frequently used are the polynomial and radial basis kernel functions. Apart from these kernel functions, there are the exponential radial basis kernel function, the wavelet kernel function and other kernel functions, which are less frequently used [36], [37].

IV. FEATURE TRAINING RECOGNITION BASED ON RS-SVM CLASSIFIER
The RS-SVM classifier first selects the proper kernel function and maps the training samples in low-dimension space into high-dimension feature space via nonlinear mapping [38], [39]. The classifier then seeks the optimal hyperplane in the high-dimension space, and the linear classification plane obtained in the high-dimension space corresponds to the nonlinear classification plane in the lowdimension space [40]. The algorithm achieves the optimal binary classification using limited samples. Among them, (x 1 , y 1 ), (x 2 , y 2 ), (x i , y i ) are flame and nonflame training samples, where x i ∈ R n is n-dimension samples and y i ∈ {0, 1} is training tag. w T ϕ(x i ) + b = 0 is the optimal classification plane searched. The two classes are separated by maximizing the distance of two classes of samples. To simplify computations, the optimization below is conducted: Constraint condition: Transform it into a two-state problem: Find the value of α i , and then seek the coefficient w and the threshold b of the classification plane. Finally, seek the optimal classification function: In a nonlinear case, map the samples through the kernel function into the high-dimension space to convert it into a linear distribution, making it a linear problem: where K (x i · x j ) is the kernel function. The specific implementation steps of this algorithm are as follows and are shown in Figure 1: (1) Construct a fire experimental data bank. Collect video images of fires and interferents, extract 7 feature variables of suspected fire regions in the image; and construct the data bank.
(2) Based on the results of Step (1), construct the feature classification table, and then perform discrete processing to the continuous attribute value of the fire sample set.
(3) Use attribute reduction algorithms based on the discernibility matrix and attribute significance to perform attribute reduction on fire information system and obtain the corresponding kernel attributes and two minimal decision tables, respectively.   (4) Determine the kernel function and its parameters, and train the classifier model using the kernel attributes obtained as the input vector.
(5) Detect the fire testing sample set with the well-trained SVM and analyze the recognition results.

V. EXPERIMENT AND RESULT ANALYSIS A. ANALYSIS OF FIRE FLAME FEATURES
The essence of image-based fire detection is the study of the manifestation of fire in an image, which requires judging different physical phenomena that can be divided into different recognition methods. In different recognition methods, VOLUME 8, 2020  different criteria can be used to judge whether a fire is present. Currently, many criteria are used, including the sharp angle criterion (edge feature), the area criterion, the shape change criterion, the flame flicker frequency criterion, the position criterion, and the roundness criterion. Image features of flame are typically divided into static features, such as color features, edge irregular features, height change features, and sharp angle features; and dynamic features, such as area growth features, correlation features and edge flicker features. Edge change is an important feature of flame images. For example, consider the 30 images that have been collected and contain flames; note that 20 images do not have flames. A comparative analysis of the color distribution of flame pixels in these images with that of the pixels of such interference sources as bright light and high temperature is shown in Fig. 2 and Fig. 3. The colors of the flame pixels in the image of RGB space exhibit the following characteristics: (1) The color distribution of the flame pixels has the following features: In which, R(x, y), G(x, y), B(x, y) are the component values of three primary colors of pixel (x, y) in RGB model respectively; K is the total pixels of this flame image; and R mean is the mean component value of primary colors of all pixels in this flame image.
(2) The components of three primary colors of flame images satisfy the following condition: , y) > 200, G(x, y) < 200, B(x, y) < 100 (15) The pixels from the upper left corner of the image to the right are processed in succession. If there is no pixel in the right side of the image, that pixel is made black. All pixels of this image are investigated using this S-shape method. If 60% pixels meet the following characteristics: y) > B(x, y) and R(x, y) > 200, G(x, y) < 200, B(x, y) < 100 (16) Then this connected region can be deemed as flame.
Flame feature extraction on two RGB images was performed using this method, and the results are shown in Fig. 4.
As shown in Fig. 4, the flame model feature maps of two RGB images coincide with the flames in the original images and can describe the size and shape of flames. Thus, the above-discussed relationship between RGB components is valid.

B. ANALYSIS OF FIRE SMOG FEATURES
Flame burning is usually accompanied by smoke, which includes many feature parameters. Using only a smoke color model algorithm to discriminate images is insufficient; other features must also be extracted. The early smoke from combustion is usually steel-gray in color, and the numerical value of its three primary colors R, G and B are basically the same. The value range of H can be used to discriminate the fire region in the image.
In a smog color model, a comparison must be made between the pixels that satisfy the condition of parameter α within the range of [0, 20] and the benchmark pixel to determine the similarity of the color distance in the HIS model.
Let pixel y meet the requirements, and let the three component value of its HIS model be h, i, s, respectively. Let the spatial distance between two pixels x, y be D. Then: In equation (17), the equations of V 1 , V 2 , V 3 are: As suggested in Fig. 5, this method can detect smoke in an image and determine the basic smoke contour.

C. SVM KERNEL FUNCTION AND SELECTION OF ITS PARAMETERS
The proposed algorithm can analyze videos and single image frames, and determines the difference between an image and a benchmark image, creating a difference image. The algorithm then integrates flame feature extraction and proceeds with color verification and area threshold detection on the difference image obtained. To select an SVM kernel function, experiments are performed on SVM classifiers built by a nonlinear transformation with the polynomial kernel function, the radial basis function and the Sigmoid kernel function. The algorithm trains the SVM classifier using three kernel functions with different parameters. Compared with the other two classifiers, the radial basis kernel function classifier exhibits better stability, higher recognition accuracy and smaller fluctuation. Thus, this study uses the radial basis kernel function with a kernel width of σ = 0.3. The classification error and generalized performance of the SVM is related to the penalty factor C. A larger penalty factor yields higher accuracy but lower generalized performance. Although a lower C can enhance generalization, accuracy cannot be guaranteed. When recognizing flame, a change in C does not strongly impact the SVM classifier. Based on experimentation, this study uses 120 as the value of C. Fig. 6-Fig. 9 show experimental flame images with smoke. As shown in the experimental results, the proposed algorithm can determine the flame contours. As shown in the comparison results with 5 typical edge detection operators, the algorithm performs better than other operators.

D. EXPERIMENT RESULT AND ANALYSIS
SVM can only accept input data passively and cannot determine the spatial dimensions of input information. If there is too much input data, training of the classifier will be slow. However, rough set theory can begin with the data itself, find the internal relationships, remove redundant data, reduce the input data volume, and accelerate training. This algorithm first denoises the image sequences obtained by framing, filters the mixed noises in the image and then extracts suspected flame regions and 7 feature variables within those regions, including three static features (the R-G area-component ratio, circularity, and the number of pointed corners) and four dynamic features (area change rate, correlation coefficient, similarity and overall mobility characteristics). The algorithm then extracts the geometric and texture features of the flames while also calculating similarity, area change rate, circularity, correlation coefficient, overall mobility characteristics, R-G area-component ratio and number of pointed corners with F 1 ∼ F 7 . The algorithm lastly selects and fuses these 7 features based on the SVM.
The following equation represents the criterion of flame recognition and the flame recognition rate, R: where TP is the probability that a flame is accurately recognized, FN is the probability that a flame is deemed as nonflame, TN is the probability that a nonflame is judged as nonflame, and PN is the probability that a nonflame is seen as flame. Table 1 shows that the flame recognition rate from highest to lowest is produced by the following parameters: R-G areacomponent ratio > circularity > number of pointed corners > overall mobility characteristics > similarity > area change rate > correlation coefficient. The flame recognition rate R by correlation coefficient and area change rate is too low, as is the TP of similarity; thus, these features are dropped. This study thus uses the R-G area-component ratio, circularity, pointed corner and overall mobility characteristics for feature fusion.
The SVM is a classifier that can be used in linear and nonlinear transformations. Nonlinear kernel functions include the Sigmoid, radial basis function (RBF) and polynomial kernel functions. The feature vector group of circularity, pointed corner and LBP texture is used as an input to the SVM for classification. Table 2 shows that the polynomial kernel function yields the highest TP, but its TN is low. Additionally, the RBF kernel function yields a high TP and TN. Overall, the RBF kernel function yields good classification; thus, the RBF kernel function is chosen. The RBF function exhibits strong locality, which can map a sample to a higher dimensional space. The kernel function has better performance for both large and small samples, and its parameters are lower than those of the polynomial kernel function; thus, the RBF kernel function is preferred in most cases. There are many factors that affect the classification and recognition performance of the SVM. This paper has studied the impact of kernel functions on classification and recognition performance, which is also significantly affected by the use of different kernel functions. A mixed kernel function is also an important research topic; however, the selection, construction and parameter optimization of mixed kernel functions must still be improved.

VI. CONCLUSION
With the recent rapid development of computer graphics and hardware, VR technology has entered a relatively mature application state and has been widely applied in fire detection. Image-type fire flame recognition methods are unconventional for early fire flame recognition. This study has investigated image-type fire flame recognition using a support vector machine and rough set theory. In practical applications, the RS method is sensitive to noise and poor in fault tolerance and generalization, while SVM has strong antinoise capability and generalization performance. This paper has presented an RS-SVM fire flame recognition algorithm and designed a classifier of fire flame image recognition. By building a model with SVM, the parameters of which have been optimized, this study used more feature variables as criteria, represented the static and dynamic features of flames, selected and extracted the most effective feature subsets, fused the features of fire flame images extracted, and reduced required training to recognize and extract flame regions.
The experimental results show that the proposed fire flame recognition strategy yields a high recognition rate, a fast recognition speed, excellent robustness, and a wide range of application.