A multi-scene fire detection method based on deep learning
By combining the feature extraction module, residual channel attention module, and Inception module, along with the cross-entropy loss function and Adam optimizer, the problem of large parameter volume and slow inference speed in multi-scenario fire detection is solved, achieving fast and accurate small flame detection and improving the practicality and response efficiency of fire detection.
Patent Information
- Application Number
- CN202411767425.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2044-12-04
AI Technical Summary
Existing network models suffer from large parameter counts and slow inference speed in multi-scenario, small-flame fire detection, and lack effective fire detection methods.
The image is downsampled and feature extracted multiple times using a feature extraction module, a residual channel attention module, and an Inception module. A random deactivation layer is used to enhance the generalization ability. The model is trained using a cross-entropy loss function and an Adam optimizer, and then deployed to a computing device for fire detection.
It achieves fire detection with small parameters and fast inference speed, and can accurately detect small flames in a variety of scenarios, improving the practicality and response efficiency of detection and timely detection of fire hazards.
Smart Images

Figure CN119693620B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fire detection technology, and more specifically, to a multi-scenario fire detection method based on deep learning. Background Technology
[0002] Fire detection is a crucial aspect of fire safety, and timely detection in the early stages of a fire is essential for its control. Fires occur in diverse scenarios, including daytime forest fires, indoor and outdoor building fires, nighttime forest fires, vehicle fires, and ship fires. With the development of artificial intelligence, deep learning-based neural network models have achieved excellent performance in various applications, significantly improving detection accuracy. In deep learning neural network detection models based on real-time camera images, the effective flame features of the input image are key to detection. Existing network models lack application in multi-scene, small-flame fire detection, and suffer from large parameter counts and slow inference speeds. Therefore, a deep learning-based multi-scene fire detection method is needed to address these issues. Summary of the Invention
[0003] This invention provides a multi-scene fire detection method based on deep learning. It acquires images of the detection scene using a camera and feeds these images into a deep learning neural network model for inference. The inference result determines whether a fire has occurred. The proposed neural network model incorporates a feature extraction module, a residual channel attention module, and an Inception module. These modules sequentially downsample and extract features from the image to be detected, obtaining first, second, third, and fourth feature vectors. A random deactivation layer is added to the output of the fourth feature vector to enhance the generalization ability of the method. Fire information in the image is obtained through feature analysis of the randomly deactivated feature vectors. This network model features a small number of parameters, fast inference speed, and can detect fires in various scenarios, showing good performance even in detecting small flames.
[0004] According to the present invention, a multi-scenario fire detection method based on deep learning includes the following steps:
[0005] I. Preparation of multi-scenario fire dataset;
[0006] II. Detection Network Model Design;
[0007] III. Testing the training of network model weight parameters;
[0008] IV. Deployment of Detection Network Model and Fire Detection.
[0009] As a preferred option, step one specifically involves:
[0010] Create a multi-scenario fire dataset for training the network model. Randomly divide the images into three datasets at a ratio of 53%, 27%, and 20%, named the training set, validation set, and test set, respectively. The training and validation sets are used to train the network model parameters, while the test set is used to evaluate the detection quality of the network model.
[0011] As a preferred option, step two specifically involves:
[0012] A high-precision multi-scene fire detection network model is proposed, consisting of an input image, a feature extraction module, a residual channel attention module, an Inception feature extraction module, a max pooling layer, an average pooling layer, a random deactivation layer, and a fully connected layer. In the network model, the input image is a 3-channel image data tensor with a width and height of 224×224. In the feature extraction module, the input tensor features are expanded to 192×56×56. The max pooling module downsamples the tensor to 192×28×28. A residual channel attention block is used to enhance fire detection performance. The Inception feature extraction-A module extracts fire features, expanding the one-dimensional data size of the tensor to 480. The max pooling module downsamples the tensor to 480×14×14. The Inception feature extraction-B module extracts fire features again, expanding the one-dimensional data size of the tensor to 896. The max pooling module downsamples the tensor to 896×7×7. The Inception Feature Extraction-C module is used to extract fire features, expanding the one-dimensional data size of the tensor to 1024. An average pooling module is then used to downsample the tensor to 1024×1×1. A random deactivation layer is used to improve the model's generalization ability. Finally, a fully connected layer is used to classify the network model results to obtain the probability of fire versus non-fire.
[0013] The feature extraction module used in this invention effectively enhances the features of the small flame at the boundary of the convolution operation. Specifically, the input feature map is set as matrix I, with a size of 224×224, where I(i,j) represents the pixel in the i-th row and j-th column, and each pixel is represented by three RGB values. t1 Let I be the matrix after column transformation. t2 This is the matrix after row operations. The rolling feature map is the input feature map matrix I after row operations. t1 Transformation and I t2 The feature map obtained after transformation. t1 The formula for calculating the transformation is:
[0014]
[0015] I t2 The formula for calculating the transformation is:
[0016]
[0017] Through the above transformation operations, this method can transfer more features of the input image to the network model. During network model training, more ideal model weight parameters can be obtained, leading to better test results. Specifically, a scrolling operation is performed on the feature map of the input image: the bottom two rows of pixel data are scrolled to the top, and then the right two columns of pixel data are scrolled to the left, thus creating a scrolling feature map. The feature extraction module uses a 4×4 convolution kernel with a stride of 4 to convolve the input image feature map and the scrolling feature map. Then, the convolution results of the input feature map and the scrolling feature map are concatenated along the first dimension to obtain the final output feature map.
[0018] The residual channel attention block used in this invention can focus on fire-related features in the network model, enhancing the representation of fire features in the network model. Specifically, the residual channel attention block consists of a 3×3 convolutional kernel, a GELU activation function, a channel attention module (CA module), and residual connections. The channel attention module consists of a global average pooling layer GloAvgPool, a 1×1 convolutional kernel, a GELU activation function, a 1×1 convolutional kernel, and a Sigmoid activation function. The input data X of the channel attention module is a C×H×W tensor. First, the input data is processed by global pooling (F... GAP The operation X compresses the data dimension to C×1×1. GAP The expression is:
[0019]
[0020] Each channel is composed of F GAP z is calculated using global pooling. c Where H and W are the height and width of the input tensor, x c (i,j) represents the pixel values in the i-th row and j-th column.
[0021] Using a linear function F D Reduce the channel size C of the input data C×1×1 to The dimension is obtained The tensor, and using the linear function F U Bundle The tensor is increased to C×1×1. This process can take the channel attention information of the tensor as input, i.e., the channel factor S. C Its calculation expression is:
[0022] S C =F U (F D (z c ))
[0023] Finally, by X and S C The dot product yields the output data X', whose expression is:
[0024] X′=S C ·X
[0025] The Inception feature extraction method used in this invention consists of four branches, which can acquire feature information in the channel direction. These branches include a 1×1 convolution branch, two 1×1 convolution-3×3 convolution branches, and a 3×3 max pooling-1×1 convolution branch. The input data is concatenated through the convolution results of the four branches to produce the output data.
[0026] As a preferred option, step three specifically involves:
[0027] The model training in this invention uses the cross-entropy loss function as the loss function to measure the difference between the model's prediction and the true label. By using the Adam optimizer to update the neural network parameters based on the gradient information of the loss function, the model converges to a better parameter value more quickly. The expression for the cross-entropy loss function is:
[0028]
[0029] Where y represents the true label, y∈{0,1}. This represents the probability predicted by the model.
[0030] During actual training, the network model is iteratively trained using both the training and validation sets. Throughout the training process, the loss function is continuously monitored until it converges to near zero, at which point training is terminated. After training is complete, the optimal network weights are selected from the entire training process for subsequent testing.
[0031] Furthermore, the accuracy (Acc) of the selected network model is evaluated to determine whether it meets the requirements of practical applications. Accuracy is calculated using a specific expression, which is:
[0032]
[0033] Wherein, TP is the number of positive samples correctly predicted as positive, TN is the number of negative samples correctly predicted as negative, FP is the number of negative samples incorrectly predicted as positive, and FN is the number of positive samples incorrectly predicted as negative.
[0034] As a preferred option, step four specifically involves:
[0035] After training and testing in step three, the detection network model designed in step two yields high-accuracy model weight parameters. The detection network model designed in step two and the trained weight parameters from step three are then converted and quantized using conversion and quantization tools provided by the computing power device. The converted and quantized model is then deployed to the computing power device. A camera is connected to the computing power device with the deployed detection network model. The computing power device reads images from the camera, preprocesses the images, and then transmits them to the detection network model for inference. By comparing the accuracy of the inference result with a preset fire accuracy threshold, it is determined whether the accuracy of the current inference result is greater than the preset fire accuracy threshold. If it is greater than the threshold, an alarm operation is executed.
[0036] The beneficial effects of this invention are as follows: First, by using a feature extraction module, a residual channel attention module, and an Inception module to perform multiple downsampling and feature extraction on the image to be detected, and then performing feature analysis on the feature vectors after random deactivation, fire information in the image to be detected can be effectively obtained, thereby accurately determining whether a fire has occurred. Second, the constructed network model has a small number of parameters and a fast inference speed, and can be widely applied to fire detection in various scenarios such as forests, indoor and outdoor buildings, vehicles, and ships, greatly improving the practicality and versatility of the detection method and fully meeting the diverse fire detection needs of various scenarios. Third, it overcomes the shortcomings of existing network models with large number of parameters and slow inference speed, significantly accelerating the detection inference process while ensuring detection accuracy, enabling timely detection of fire situations and significantly improving response efficiency. In addition, it performs excellently in small flame detection, effectively solving the problem of insufficient small flame feature extraction capability in the early stages of fires in various scenarios, which is conducive to timely detection of hidden dangers when small flames first appear, winning more valuable time for fire prevention and control. At the same time, by adding a random deactivation layer to the fourth feature vector output, the generalization ability of the method is effectively enhanced, enabling it to play a role in fire detection in various scenarios. Finally, by using a specific cross-entropy loss function and the Adam optimizer to train the model, the model can be quickly converged to optimal parameter values. Furthermore, by employing reasonable dataset partitioning and accuracy evaluation methods, the detection quality of the network model can be effectively evaluated, ensuring that it can meet the needs of practical applications. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the method proposed in this invention.
[0038] Figure 2 This is a diagram of the multi-scenario fire detection network structure of the method proposed in this invention.
[0039] Figure 3 This is a schematic diagram of the feature extraction module of the method proposed in this invention.
[0040] Figure 4This is a schematic diagram of the residual channel attention module of the method proposed in this invention.
[0041] Figure 5 This is a schematic diagram of the channel attention mechanism of the method proposed in this invention.
[0042] Figure 6 This is a schematic diagram of the Inception feature extraction module of the method proposed in this invention. Detailed Implementation
[0043] The present invention will now be described in further detail with reference to the accompanying drawings.
[0044] This embodiment provides a multi-scenario fire detection method based on deep learning, such as... Figure 1 As shown, it includes the following steps:
[0045] 1. Preparation of multi-scenario fire dataset: Create a multi-scenario fire dataset for training the network model;
[0046] Specifically, the dataset includes 15,000 fire images and 15,000 non-fire images. The images input to the fire detection neural network model designed in this invention have a width and height of 224×224, so the images in the dataset need to be resized to 224×224. The image processing steps are as follows: First, convert all images to 3-channel RGB mode. Second, resize the images to N×224 or 224×N, where N is greater than or equal to 224. Then, crop the dataset images to 224×224, and manually check the images in the dataset that contain fire features to ensure that the images input to the neural network model have fire characteristics. The 15,000 fire images and 15,000 non-fire images in the dataset are randomly divided into three datasets according to the ratios of 8000 / 15000, 4000 / 15000, and 3000 / 15000, named the training set, validation set, and test set, respectively. The training set and validation set are used to train the network model parameters, and the test set is used to evaluate the detection quality of the network model.
[0047] II. Detection Network Model Design: A high-precision multi-scenario fire detection network model is constructed. The specific structure of this network model is as follows:
[0048] like Figure 2As shown, it includes an input image, a feature extraction module, a residual channel attention module, an Inception feature extraction module, a max pooling layer, an average pooling layer, a random deactivation layer, and a fully connected layer. The input image is presented as a 3-channel image data tensor with a width and height of 224×224. In the feature extraction module, the operation flow is as follows: the features of the input tensor are expanded and transformed into a 192×56×56 data format. Subsequently, the tensor is downsampled using the max pooling module, transforming it into a 192×28×28 tensor. Based on this, a residual channel attention block is introduced to enhance the performance of fire detection.
[0049] Next, the Inception Feature Extraction-A module is used to extract fire features, expanding the one-dimensional data size of the tensor to 480. Then, the tensor is downsampled again using the max pooling module, making it a 480×14×14 tensor. Then, the Inception Feature Extraction-B module is used to further extract fire features, expanding the one-dimensional data size of the tensor to 896. Subsequently, the tensor is downsampled using the max pooling module, making it an 896×7×7 tensor. Then, the Inception Feature Extraction-C module is used to extract fire features, expanding the one-dimensional data size of the tensor to 1024. Then, the tensor is downsampled using the average pooling module, resulting in a 1024×1×1 tensor. Finally, a random deactivation layer is used to improve the model's generalization ability. Finally, a fully connected layer is used to classify the network model's results, thereby obtaining the probability results of fire and non-fire situations.
[0050] Detailed Description of the Feature Extraction Module: The feature extraction module effectively enhances the features of the small flame at the boundary of the convolution operation. Specifically, let the input feature map be matrix I, with a size of 224×224, where I(i,j) represents the pixel in the i-th row and j-th column, and each pixel is represented by three RGB values. t1 Let I be the matrix after column transformation. t2 This is the matrix after row operations. The so-called rolling feature map is the input feature map matrix I undergoing row operations sequentially. t1 Transformation and I t2 The feature map obtained after transformation. t1 The formula for calculating the transformation is:
[0051]
[0052] I t2 The formula for calculating the transformation is:
[0053]
[0054] Through the above transformation operations, this method can transfer more features of the input image to the network model. During network model training, more ideal model weight parameters can be obtained, leading to better test results. For example... Figure 3 As shown, the specific implementation is as follows: a scrolling operation is performed on the feature map of the input image, that is, the pixel data of the bottom two rows are scrolled to the top position, and then the pixel data of the right two columns are scrolled to the left position, thus completing the creation of the scrolling feature map. The feature extraction module uses a 4×4 convolution kernel with a stride of 4 to perform convolution processing on the input image feature map and the scrolling feature map, and then concatenates the convolution results of the input feature map and the scrolling feature map according to the first dimension to finally obtain the output feature map.
[0055] Detailed Description of Residual Channel Attention Blocks: The residual channel attention blocks used in this invention play a crucial role in the entire network model system. They can accurately focus on the relevant features of fire, thereby significantly enhancing the network model's ability to express and present fire features. The residual channel attention blocks are as follows: Figure 4 As shown in (a), the residual channel attention block is specifically composed of a 3×3 convolution kernel, a GELU activation function, a channel attention module (CA module), and residual connections. The channel attention module is as follows: Figure 4 As shown in (b), the internal structure includes a global average pooling layer GloAvgPool, a 1×1 convolutional kernel, a GELU activation function, a 1×1 convolutional kernel, and a Sigmoid activation function. A schematic diagram of the channel attention module is shown below. Figure 5 As shown, specifically, when the channel attention module receives input data X (which is in C×H×W tensor form), it first performs global pooling (F) in the spatial dimension. GAP The operation is used to compress X, reducing the original C×H×W data dimension to a C×1×1 data format. GAP The specific expression for the operation is:
[0056]
[0057] In this expression, H and W represent the height and width of the input tensor, respectively, while x c (i,j) represents the pixel value in the i-th row and j-th column. Through this global pooling operation, each channel can be pooled according to F... GAP The corresponding value is calculated.
[0058] Subsequently, using the linear function F D Reduce the channel size C of the input data (C×1×1 with C channels) to Thus, the dimension is obtained. The tensor. Then, using the linear function F U This The tensor is then increased to C×1×1. During this process, the channel attention information of the input tensor, i.e., the channel factor S, can be effectively extracted. C Its calculation expression is:
[0059] S C =F U (F D (z c ))
[0060] Finally, the original input data X and the channel factor S are compared. C Perform a dot product operation to obtain the output data X', whose expression is:
[0061] X′=S C ·X
[0062] Through the above series of operations, the residual channel attention block can effectively enhance the network model's ability to capture and represent fire features, thereby improving the performance and accuracy of the entire fire detection network model.
[0063] Detailed explanation of the Inception feature extraction module: (e.g.) Figure 6 As shown, the Inception feature extraction module used in this invention exhibits a specific structural composition. It is mainly constructed from four different branches, each playing a unique role in the entire feature extraction process, collaboratively achieving effective acquisition of channel-direction feature information. One branch is a 1×1 convolution branch, which performs a preliminary 1×1 convolution operation on the input data to extract specific local feature information. The other two branches both employ a combination of 1×1 and 3×3 convolutions; that is, 1×1 convolution is first used to transform the dimensionality of the input data or perform preliminary feature filtering, and then 3×3 convolution is used to further explore the feature details in the data, thereby enriching the dimension and depth of feature extraction from different perspectives. Another branch is a 3×3 max pooling-1×1 convolution branch. This branch first uses 3×3 max pooling to pool the input data to reduce the spatial resolution of the data, reduce computational load, and retain the main feature information, and then uses 1×1 convolution to further extract and integrate the pooling results.
[0064] In actual operation, input data flows into these four branches, where corresponding convolution or pooling operations are performed. Finally, the convolution results from these four branches are connected and combined according to specific concatenation rules to form the final output data. Through this multi-branch structure and concatenated output design, the Inception feature extraction module can fully utilize the advantages of different convolution operations to comprehensively and accurately acquire rich feature information in the channel directions, providing more accurate and comprehensive feature data support for the entire fire detection network model, thereby effectively improving the model's ability to identify and judge fire features.
[0065] III. Testing the training of network model weight parameters. Specific strategies and methods are used in the model training phase, as detailed below:
[0066] Cross-entropy loss function is chosen as the key metric to measure the difference between the model's predicted results and the true labels. During training, the Adam optimizer updates the neural network parameters based on the gradient information generated by the loss function. This approach enables the model to converge to a relatively optimal parameter value more efficiently. The mathematical expression of the cross-entropy loss function is:
[0067]
[0068] Where y represents the actual label, and its value is limited to the set {0,1}. This indicates the probability predicted by the model.
[0069] During actual training, the network model is iteratively trained using both the training and validation sets. Throughout the training process, the loss function is continuously monitored until it converges and approaches zero, at which point the training process is terminated. After training is complete, the optimal network weights are selected from the entire training process for subsequent testing.
[0070] Furthermore, a test set is used to evaluate the accuracy (Acc) of the selected network model to determine whether it meets the application requirements. The accuracy is calculated using a specific expression, which is:
[0071]
[0072] Here, TP represents the number of positive samples correctly predicted as positive, TN represents the number of negative samples correctly predicted as negative, FP represents the number of negative samples incorrectly predicted as positive, and FN represents the number of positive samples incorrectly predicted as negative. Calculating this metric allows for accurate evaluation of the network model's performance in fire detection tasks, providing a strong basis for model optimization and improvement, and ensuring the model's reliability and effectiveness in real-world applications.
[0073] IV. Deployment of Detection Network Model and Fire Detection.
[0074] First, after training and testing in step three, the detection network model designed in step two yields model weight parameters with high accuracy. Next, the detection network model designed in step two and the weight parameters obtained in step three are transformed and quantized using conversion and quantization tools provided by the computing power equipment. After transformation and quantization, the processed model is deployed on the computing power equipment, thereby constructing a complete fire detection operating environment.
[0075] Subsequently, a connection is established between the camera and the computing power device that has deployed the detection network model. Once the connection is successful, the computing power device can read real-time image data from the camera. After acquiring the image data, the computing power device performs a series of preprocessing operations on the image to ensure that the format and quality of the image data meet the input requirements of the detection network model. After preprocessing, the image data is transmitted to the detection network model, thereby initiating the model's inference process.
[0076] After the reasoning process is complete, the system automatically compares the accuracy of the fire model's reasoning results with the preset fire accuracy threshold. This comparison accurately determines whether the accuracy of the current reasoning result exceeds the preset fire accuracy threshold. If the system determines that the accuracy of the current reasoning result is greater than the preset fire accuracy threshold, it will immediately trigger an alarm to promptly notify relevant personnel or the system of a fire risk. This buys valuable time for fire prevention and control, improving the overall efficiency and effectiveness of fire detection and response.
[0077] The embodiments described above are merely preferred embodiments for fully illustrating the present invention, and the scope of protection of the present invention is not limited thereto. Equivalent substitutions or modifications made by those skilled in the art based on the invention are all within the scope of protection of the present invention. The scope of protection of the present invention is determined by the claims.
Claims
1. A multi-scenario fire detection method based on deep learning, characterized in that: Includes the following steps: I. Preparation of multi-scenario fire dataset; II. Detection Network Model Design; III. Testing the training of network model weight parameters; IV. Deployment of Detection Network Model and Fire Detection; Step two specifically involves: The network model consists of an input image, a feature extraction module, a residual channel attention module, an Inception feature extraction module, a max pooling layer, an average pooling layer, a random deactivation layer, and a fully connected layer, wherein: The input image is a 3-channel image data tensor with a width and height of 224×224; The feature extraction module is implemented as follows: Let the input feature map be matrix I, with a size of 224×224, where I(i,j) represents the pixel in the i-th row and j-th column, and each pixel is represented by three RGB values. t1 Let I be the matrix after column transformation. t2 The matrix after row transformation is the rolling feature map, which is the input feature map matrix I after row transformation. t1 Transformation and I t2 The feature map obtained after transformation, I t1 The formula for calculating the transformation is: I t2 The formula for calculating the transformation is: The feature map of the input image is scrolled, with the bottom two rows of pixel data scrolled to the top and the right two columns of pixel data scrolled to the left to obtain a scrolling feature map. The input image feature map and the scrolling feature map are then convolved using a 4×4 convolution kernel with a stride of 4. The convolution results of the input feature map and the scrolling feature map are then concatenated along the first dimension to obtain the output feature map. This effectively enhances the features of the small flame at the convolution operation boundary and passes more features of the input image to the network model. The residual channel attention module consists of a 3×3 convolutional kernel, a GELU activation function, a channel attention module, and residual connections. The channel attention module itself comprises a global average pooling layer, a 1×1 convolutional kernel, a GELU activation function, a 1×1 convolutional kernel, and a Sigmoid activation function. Its operation is as follows: The input data X of the channel attention module is a C×H×W tensor. First, the input data is processed by a global pooling layer F in the spatial dimension. GAP Operation compression X compresses the data dimension to C×1×1 data, F GAP The expression is: Each channel is composed of F GAP z is calculated using global pooling. c Where H and W are the height and width of the input tensor, x c (i,j) represents the pixel values in the i-th row and j-th column, using a linear function F. D Reduce the channel size C of the input data C×1×1 to The dimension is obtained The tensor, and using the linear function F U Bundle The tensor is raised to C×1×1. In this process, the channel attention information of the input tensor, i.e., the channel factor S, can be effectively extracted. C Its calculation expression is: S C =F U (F D (z c )) Finally, the original input data X and the channel factor S are compared. C Performing a dot product operation yields the output data X', whose expression is: X′=S C ·X The Inception feature extraction module consists of four branches: a 1×1 convolution branch, two 1×1-3×3 convolution branches, and a 3×3 max pooling-1×1 convolution branch. The input data is concatenated through the convolution results of the four branches to obtain the feature information of the fire scene.
2. The multi-scenario fire detection method based on deep learning according to claim 1, characterized in that: Step one specifically involves: Create a multi-scenario fire dataset for training the network model. Randomly divide the images into three datasets at a ratio of 53%, 27%, and 20%, respectively, and name them the training set, validation set, and test set.
3. The multi-scenario fire detection method based on deep learning according to claim 1, characterized in that: Step three specifically involves: The cross-entropy loss function is used as the loss function to measure the difference between the model's predicted results and the true labels. The expression for the cross-entropy loss function is: Where y represents the true label, y∈{0,1}. Indicates the model's predicted probability. By using the Adam optimizer to update the parameters of the neural network based on the gradient information of the loss function, the model can converge to a better parameter value more quickly. The network model is iteratively trained using the training and validation sets until the loss function converges to near zero. At this point, the training of the network model is terminated, and the best network weights from the training are selected for testing.
4. The multi-scenario fire detection method based on deep learning according to claim 1, characterized in that: Step four specifically involves: After training and testing in step three, the detection network model designed in step two can obtain network weight parameters with high accuracy. The detection network model designed in step two and the weight parameters trained in step three are deployed to the computing power device. A camera is connected to the computing power device with the deployed detection network model and fire detection weight parameters. The computing power device reads images from the camera, preprocesses the images, and transmits them to the detection network model for inference. By comparing the accuracy of the inference result with the preset fire accuracy threshold, an alarm operation is executed when the accuracy of the inference result is greater than the preset fire accuracy threshold.