Fire identification method, system, equipment, medium and product
By introducing a cross-scale fire feature module into the fire recognition model, the problem of difficulty in distinguishing smoke and flame features in complex fire scenes is solved, and a higher fire recognition accuracy is achieved.
Patent Information
- Application Number
- CN202411814472.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-18
AI Technical Summary
Existing deep learning-based fire detection methods have low recognition accuracy in complex fire scenes, making it difficult to effectively distinguish the characteristics of smoke and flames.
A fire recognition method is adopted to identify the fire images to be identified through the trained fire recognition model. The model includes a convolutional layer, a pooling layer, a cross-scale fire feature module, a global pooling layer and a fully connected layer. The cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
Through multi-scale and cross-channel feature interaction, the information interaction between local and global fire characteristics is improved, and the recognition accuracy of fires in complex scenarios is significantly improved.
Smart Images

Figure CN119649144A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of fire detection, and in particular to a fire identification method, system, equipment, medium and product. Background Art
[0002] The deep learning-based methods in related technologies have limited ability to classify complex fire scenes. Complex fire scenes often contain interference factors such as dust that is similar to smoke in texture level, and light and sunlight that are similar to flames in color level. The extraction of significant and distinguishing features of smoke and flames is still challenging. Therefore, the accuracy of fire identification is low when facing complex fire scenes. Summary of the invention
[0003] The purpose of this application is to provide a fire identification method, system, device, medium and product that can improve the accuracy of fire identification in complex scenes.
[0004] To achieve the above objectives, this application provides the following solutions:
[0005] In a first aspect, the present application provides a fire identification method, comprising:
[0006] Acquire a fire image to be identified in a fire scene;
[0007] The fire image to be identified is input into a trained fire identification model for fire identification to obtain a fire identification result, wherein the fire identification result includes the presence of smoke in the fire image, the presence of flame in the fire image, and the absence of fire in the fire image; wherein the fire identification model includes a first convolutional layer, a maximum pooling layer, a cross-scale fire feature module, a second convolutional layer, a global pooling layer, and a fully connected layer stacked in sequence; and the cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
[0008] In a second aspect, the present application provides a fire identification system, comprising:
[0009] An acquisition module is used for fire images to be identified in fire scenes;
[0010] The fire recognition module is used to input the fire image to be recognized into a trained fire recognition model to perform fire recognition to obtain a fire recognition result, wherein the fire recognition result includes the presence of smoke in the fire image, the presence of flames in the fire image, and the absence of fire in the fire image; wherein the fire recognition model includes a first convolution layer, a maximum pooling layer, a cross-scale fire feature module, a second convolution layer, a global pooling layer, and a fully connected layer stacked in sequence; and the cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
[0011] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-mentioned fire identification method.
[0012] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the above-mentioned fire identification method when executed by a processor.
[0013] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements the above-mentioned fire identification method when executed by a processor.
[0014] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0015] The present application provides a fire identification method, system, device, medium and product, which uses a fire identification model to perform fire identification on a fire image to be identified, and uses a cross-scale fire feature module in the fire identification model to perform multi-scale and cross-channel interaction on features in the fire image, so as to more effectively realize the fire information interaction between local and global fire features and improve the fire identification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 This is an application environment diagram of a fire identification method in an embodiment of the present application;
[0018] Figure 2 A flowchart of a fire identification method provided in one embodiment of the present application;
[0019] Figure 3 1 is a structural diagram of a first unit block, a second unit block and a third unit block in an embodiment of the present application; wherein (a) is a structural diagram of the first unit block, (b) is a structural diagram of the second unit block, and (c) is a structural diagram of the third unit block;
[0020] Figure 4 Schematic diagram of performance comparison of fire identification model in this application at different resolutions on data sets;
[0021] Figure 5 A schematic diagram of functional modules of a fire identification system provided in one embodiment of the present application;
[0022] Figure 6 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0024] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0025] The fire identification method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, or it can be integrated on the server 104, or it can be placed on the cloud or other servers. The terminal 102 can send the fire image to be identified to the server 104. After the server 104 receives the fire image to be identified, the server 104 uses the trained fire recognition model to perform fire recognition on the fire image to be identified to obtain a fire recognition result. The server 104 can feed back the obtained fire recognition result to the terminal 102. In addition, in some embodiments, the fire recognition method can also be implemented by the server 104 or the terminal 102 alone, such as the terminal 102 can directly process the fire image to be identified, or the server 104 can obtain the fire image to be identified from the data storage system and process the fire image to be identified.
[0026] The terminal 102 may be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, etc. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers, or may be a cloud server.
[0027] In an exemplary embodiment, Figure 2 As shown, a fire identification method is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 The server 104 in the example is used as an example to illustrate, including the following steps 201 to 202. Among them:
[0028] Step 201: Acquire a fire image to be identified in a fire scene.
[0029] Step 202: input the fire image to be identified into a trained fire identification model to perform fire identification to obtain a fire identification result, wherein the fire identification result includes smoke in the fire image, flame in the fire image, and no fire in the fire image.
[0030] The fire recognition model includes a first convolutional layer, a maximum pooling layer, a cross-scale fire feature module, a second convolutional layer, a global pooling layer, and a fully connected layer stacked in sequence. The cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module, as shown in Table 1.
[0031] Table 1
[0032]
[0033]
[0034] The depth feature extraction module includes two first unit blocks and two second unit blocks. The multi-scale feature interaction module includes one first unit block and one third unit block. Figure 3 As shown in (a) of FIG. , the first unit block includes a channel segmentation operator, two 1×1 convolutional layers and a 3×3 depth-separable convolutional layer; Figure 3 As shown in (b) of FIG. , the second unit block includes three 1×1 convolutional layers and two 3×3 depth-separable convolutional layers; Figure 3 As shown in (c), the third unit block includes two 1×1 convolutional layers, a 3×3 depth-separable convolutional layer and a pyramid squeeze attention module.
[0035] The first unit block uses the channel splitting operator to maintain a large number of equally wide channels without dense convolutions or too many groupings. First, in the initial stage, the channel splitting operator divides the input fire feature map (C channels) into two branches with C-C' channels and C' channels. Secondly, according to the principle that network fragmentation will reduce parallelism, the network fragmentation is ensured to be as small as possible. Among them, one branch does not process the input fire feature map, and the other branch includes two 1×1 convolutional layers and a 3×3 depth-separable convolutional layer, which can retain information while reducing computational complexity. Thirdly, the results of the two branches are spliced, so that for the convolutional layer, the number of input and output channels is the same. Finally, channel shuffling is used to ensure that the information of the two branches interacts. The output after channel shuffling is used as the output of the first unit block.
[0036] The second unit block needs to spatially downsample the input fire feature map. There is no channel splitting operator in the second unit block. Its left branch uses two convolution layers, specifically a 3×3 depth-separable convolution layer with a stride of 2 and a 1×1 convolution layer. The right branch is two 1×1 convolution layers and a 3×3 depth-separable convolution layer. The depth-separable convolution step of the right branch is 2, and the number of output channels of the second unit block becomes twice the number of input channels. Specifically, first, the left branch extracts features through two convolution layers. The left branch includes a 3×3 depth-separable convolution layer with a stride of 2 and a 1×1 convolution layer with a reduced number of channels to retain key information while reducing the spatial size of the feature map. Secondly, the right branch uses three convolution operations with the same number of channels to keep the same number of channels and reduce computational complexity. The right branch includes 1×1 convolution, a 3×3 depth-separable convolution with a stride of 2, and a 1×1 convolution. Thirdly, the results of the two branches are spliced to keep the number of input and output channels the same. This design can effectively perform spatial downsampling when the step size is 2, while maintaining the number of channels and improving the network's expressiveness. Finally, channel shuffling is used to ensure information interaction between the two branches, and the output after channel shuffling is used as the output of the second unit block.
[0037] The right branch of the third unit block includes two 1×1 convolutional layers, a 3×3 depthwise separable convolutional layer, and a pyramid squeeze attention module (PSA). This module is designed to utilize the cross-scale attention mechanism to enhance the adaptive extraction of key fire features and the semantic interaction of information at different scales. Compared with the downsampling module without the PSA module, the downsampling module with the PSA module replaces the 3×3 depthwise separable convolution and 1×1 convolution with a stride of 2 in the right numerator of the second unit block with the PSA module, and the other parts remain unchanged; the left branch of the third unit block is the same as the left branch of the second unit block.
[0038] In an exemplary embodiment, the pyramid squeeze attention module includes a squeeze pyramid concatenation module (Squeeze Pyramid Concat, SPC) and a squeeze excitation attention module (Squeeze Excitation Attention, SE).
[0039] The SPC module is the key operator of the PSA module for mining multi-scale features of fire. It mines the spatial information of the input fire feature map in the form of multiple branches, thereby capturing richer feature location information. The multi-scale parallel processing method explores the fire feature map containing a single type of kernel, deepens the understanding of the intrinsic fire semantic characteristics of the fire image, and at the same time, multiple convolution kernels of different scales are used to generate fire feature maps with different scales, further enriching the semantic expression of fire-related features.
[0040] The SE module mines the attention information of fire feature maps of different scales to form channel attention weights, thereby emphasizing key features and suppressing non-key features; then, the obtained channel attention weights are calibrated through the normalization function, and the calibrated weights of multi-scale channels are generated; finally, the element-wise product operation is used to combine the calibrated weights with the fire feature map mapping of the corresponding size to generate a refined fire feature map with richer multi-scale feature information, namely, the cross-scale interaction feature of fire.
[0041] By implementing the above steps 201 to 202, the present application can improve the accuracy of fire recognition in complex scenes.
[0042] In an exemplary embodiment, step 202 specifically includes steps 301 to 304:
[0043] Step 301: input the fire image to be identified into the first convolution layer and the maximum pooling layer for feature extraction to obtain a fire feature map.
[0044] Step 302: Input the fire feature map into the depth feature extraction module to perform depth feature extraction to obtain a depth fire feature map.
[0045] Step 303: input the deep fire feature map into the multi-scale feature interaction module to perform multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map.
[0046] Step 304: input the cross-scale fire feature map into the second convolutional layer, the global pooling layer and the fully connected layer in sequence for classification and recognition to obtain a fire recognition result.
[0047] In an exemplary embodiment, step 303 specifically includes steps 401 and 402:
[0048] Step 401: input the deep fire feature map into the second unit block to extract key fire features to obtain key fire features.
[0049] Step 402: The key fire features are input into the third unit block for multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map.
[0050] In an exemplary embodiment, step 402 specifically includes steps 501 to 506 .
[0051] Step 501 : The key fire features are sequentially input into a 3×3 depthwise separable convolutional layer and a 1×1 convolutional layer to obtain a depthwise key fire feature map.
[0052] In step 502, the key fire features are sequentially input into a 1×1 convolution layer and a squeezed pyramid splicing module to perform multiple sets of convolution feature extraction to obtain fire feature maps of different scales.
[0053] Get the key fire features obtained in step 401 C is the number of channels, H is the height, and W is the width. It is split into S feature maps with the same number of channels. In this application, S=4 is taken as an example. The mathematical representation is as follows:
[0054]
[0055] Secondly, for each feature map X i The spatial information of the fire is used for feature extraction. In the PSA module, the convolution kernel size of each branch increases successively, and the multi-scale fire spatial feature information is learned. The fire semantic interaction between channels is established in a local manner, and the convolution kernel is selected using the group convolution method. At the same time, a new rule is defined for group size selection to ensure that the model parameters are not increased. The relationship between the multi-scale kernel size and the group size can be expressed as follows:
[0056]
[0057] Among them, K is the kernel size and G is the group size. Therefore, the multi-scale feature map generation function is:
[0058] F i =Conv(X i ,K i ×K i ,G i ),i=0,1,2,…,S-1;
[0059] Among them, Conv represents the convolution operation, K i =2×(i+1)+1 represents the i-th kernel size, G i represents the size of the i-th group, F i Represents fire feature maps with different scales. Then, a cascade method is used to obtain a multi-scale fire feature map after multi-scale interaction:
[0060] F=Cat([F0,F1,…,F S-1 ]);
[0061] Among them, F is the multi-scale fire feature map after semantic interaction, and Cat represents the serial splicing operation.
[0062] Step 503: Input the fire characteristic map of each scale into the squeeze-stimulation attention module to extract attention information, and obtain the attention weight corresponding to the fire characteristic map of each scale.
[0063] The attention weights of fire feature maps of different scales are obtained. This process can be obtained by the following formula:
[0064] Z i =SE(F i ),i=0,1,2,…,S-1;
[0065] in, The SE module captures different attention weights from the fire feature map. In this way, the semantic information of fires at different scales can be effectively integrated, and more accurate pixel-level attention can be provided for fire salient features.
[0066] Step 504: calibrate the attention weight using a normalization function to obtain a calibrated weight.
[0067] In order to perform semantic interaction between different fire attention information while maintaining the original channel attention weights, the fire information of the cross dimension is further integrated. Therefore, the fire attention weights of multi-scale channels can be obtained by the concatenation method shown in the following formula:
[0068]
[0069] in, is the connection operator and Z is the multi-scale fire attention weight.
[0070] att i =softmax(Z i );
[0071] Among them, att i is the calibrated attention weight and softmax() is the activation function.
[0072] Then, cross-channel soft attention is used to select different spatial scales. The soft attention weight can be calculated by the following formula:
[0073]
[0074] Among them, att represents the multi-scale channel weight of the fire after attention interaction, that is, the soft attention weight.
[0075] Step 505 , performing an element-wise multiplication operation on the calibrated weights and the fire feature map of the corresponding scale to obtain a cross-scale interaction feature of the fire.
[0076] The calibrated attention weight att i and the feature map F of the corresponding scale i Multiplication
[0077] Y i =Fi ⊙att i ,i=1,2,…,S-1;
[0078] Among them, ⊙ represents the corresponding pixel multiplication at the channel level, Y i Represents the resulting cross-scale interaction characteristics of the initial fire.
[0079] The initial fire cross-scale interaction features after the initial cross-scale interaction are obtained using the concatenation operator. The concatenation operator can completely preserve the fire semantics without destroying the original fire feature information. Therefore, the fire cross-scale interaction features are expressed as follows:
[0080] X′ psa =Cat([Y0,Y1,…,Y S-1 ]);
[0081] Among them, X' psa represents the cross-scale interaction characteristics of fire, and Cat represents the serial splicing operation.
[0082] Step 506: splice the fire cross-scale interaction feature and the deep key fire feature map to obtain the cross-scale fire feature map.
[0083] The fire cross-scale interaction features and the deep key fire feature map obtained by the two branches are obtained respectively, and the cross-scale interaction features of the fire after splicing and channel disruption are obtained to obtain the cross-scale fire feature map X psa , which contains a lot of effective information about fire. Due to the existence of the cross-scale attention PSA module and various convolution operations, X psa The image includes the structure and edge details, color, shape of the fire target, and a full representation of the fire semantic information.
[0084] The PSA module introduced in this application can integrate fire spatial information of multiple scales and cross-channel attention mechanism into each feature group, so it can achieve more effective fire information interaction between local and global fire features.
[0085] The cross-scale fire feature map X psa It is passed to the classification recognition module consisting of the second convolutional layer, the global pooling layer and the fully connected layer. Then, the softmax layer is used to classify the enhanced image features into corresponding labels. The process is expressed as follows:
[0086]
[0087] Among them, FC represents the fully connected operation, softmax represents the probability conversion operation, and Conv represents the convolution operation.
[0088] In an exemplary embodiment, the training process of the fire identification model includes steps 601 to 603:
[0089] Step 601, constructing a training set, which includes fire sample images and corresponding category labels, and the category labels include smoke, fire, and neutral; neutral means that there is no fire in the fire sample image.
[0090] Private dataset Our_flame_smoke: This dataset is a self-constructed dataset. Through a combination of self-designed fire experiments and online collection, a total of 5,900 fire sample images were obtained. This dataset mainly consists of indoor fire scenes, and a small part is outdoor fire scenes. These fire sample images contain a series of challenging scenes, and the interference sources include colored targets, floating clouds, occlusions, and reflected light and shadows.
[0091] Public dataset FLAME: This dataset is a sample of fire images taken by drone during the burning of piled debris in the pine forest of Arizona. The captured video is divided into 47,992 frames, including 30,155 flame images and 17,837 neutral images.
[0092] Public dataset DeepQuestAI: This dataset covers indoor / outdoor environments. Smoke contains different types of smoke colors, while fire includes targets that look like fire. There are 3,000 flame images in total, including 1,000 fire sample images each in the three categories of smoke, flame, and neutral.
[0093] A part of the fire sample images are selected from the above different data sets as training sets. The distribution of the data sets is shown in Table 2.
[0094] Table 2
[0095]
[0096] Step 602: Input the fire sample image into the fire recognition model to obtain the predicted category of the fire.
[0097] Step 603, calculating the loss according to the predicted category and the category label corresponding to the fire sample image, optimizing the parameters of the fire recognition model according to the loss until the loss reaches a preset range, and obtaining a trained fire recognition model.
[0098] The experiment was deployed on a computer with an NVIDIA GeForce RTX 3090 GPU and a video memory size of 32G, and the Pytorch deep learning framework was used for modeling. In the experiment, the size of the fire sample images was set to 224*224 after data augmentation operations (such as scaling, cropping, and completion). On the three datasets of Our_flame_smoke, FLAME, and DeepQuestAI, the batch sizes were 8, 32, and 20, respectively, and the learning rates were 8e-3, 1e-2, and 1e-3, respectively. The Adam optimizer was used, and the loss function used the cross entropy loss function, which is mathematically expressed as follows:
[0099]
[0100] in, is the loss, y j is the category label of the jth category, is the predicted category of the jth category, and N is the number of fire image categories.
[0101] This application evaluates performance from three aspects: recognition accuracy, model complexity, and inference speed. The measurement indicators of recognition accuracy are precision (Precision, Pre), recall (Recall, Rec), and accuracy (Accuracy, Acc); the measurement indicators of model complexity are parameters (Parameters, Params) and floating point operations (Floating Point Operations, FLOPs); the measurement indicator of inference speed is the number of frames processed per second (Frames Per Second, FPS) by the model.
[0102] Table 3 is a performance comparison of the fire recognition model of the present application and other methods on the Our_flame_smoke dataset. Table 4 is a performance comparison of the fire recognition model of the present application and other methods on the FLAME dataset. Table 5 is a performance comparison of the fire recognition model of the present application and other methods on the DeepQuestAI dataset. Table 6 is the ablation experiment results of the fire recognition model of the present application on three datasets. The three indicators Pre, Rec and Acc in Tables 3, 4 and 5 are all expressed as percentages. The bold in the table indicates the optimal indicator value, and the underline indicates the suboptimal indicator value. The values in brackets indicate the improvement of the corresponding model over the baseline optimal model.
[0103] Other methods include k-nearest neighbor (KNN), support vector machine (SVM), naive Bayes classifier (NB), visual geometry group network (VggNet16, 16 represents the depth of its convolutional neural network), residual network (ResNet34, 34 means that the depth of the residual network is 34), compression network (Squeeze Network, SqueezeNet), mobile network (MobileNetworkVersion2, MobileNetV2), shuffle network (ShuffleNetworkVersion 2, ShuffleNetV2), efficient network (EfficientNetwork Base0, EfficientNet_b0, b0 refers to the basic version), sliding window converter (Swin Transformer, Swin-Transformer), new convolutional neural network (ConvolutionalNext small, ConvNeXt_s), dual fire attention network (DualFireAttention Network, DFAN), dynamic perceptron Dynamic Perceiver.
[0104] Table 3
[0105]
[0106] Table 4
[0107]
[0108]
[0109] Table 5
[0110]
[0111] In terms of recognition accuracy, on the Our_flame_smoke dataset, the fire recognition model in this application performs above 99.85% in Pre, Rec, and Acc indicators, which is more than 0.1% higher than the suboptimal indicator. On the Flame dataset, the fire recognition model in this application performs above 81.80% in Pre, Rec, and Acc indicators, which are 3.71%, 5.38%, and 4.81% higher than the suboptimal indicators, respectively. On the DeepQuestAI dataset, the fire recognition model in this application is the best in the Pre indicator, 0.02% higher than the swing-transformer model, and is comparable to the swing-transformer model in Rec and Acc indicators. The experimental results show that the fire recognition model in this application has strong robustness in the case of tree occlusion and small flames, and is not easily disturbed by the complexity of the environment and misjudgment.
[0112] In terms of model complexity, the fire recognition model in this application is the best overall. The fire recognition model in this application has the second lowest number of Params, which is only 1 / 2 times that of the smallest SqueezeNet model, and the FLOPs value is only 1 / 5 of that of the SqueezeNet model. The FLOPs of the fire recognition model in this application is 8M lower than the second-ranked shuffleetV2 model, while the Params are only 87% of the latter. Combining the Params and FLOPs indicators, the fire recognition model in this application has the lowest model complexity and can be deployed on resource-constrained devices.
[0113] In terms of model inference speed, the fire recognition model in this application ranks fourth on the three data sets, processing 439, 462, and 456 fire sample images per second, respectively. Although the VggNet16 model FPS ranks first, 2.6 times higher than the fire recognition model in this application, its model complexity is more than 130 times higher than the fire recognition model in this application, and its recognition accuracy on the three data sets is 1.19%, 23.7%, and 12% lower than that of the fire recognition model in this application, respectively.
[0114] The above experimental results show that the fire recognition model in this application achieves the best balance between accuracy, speed and resource cost, and can be deployed on resource-constrained or edge devices to achieve real-time detection and rapid alarm of fire images.
[0115] This application conducts an ablation study on the PSA module used to demonstrate its ability to capture significant features and semantic interactions. Only the PSA module in the fire recognition model in this application is deleted. The ablation experimental results of the fire recognition model in this application on three datasets are shown in Table 6.
[0116] Table 6
[0117]
[0118] The following conclusions can be drawn from observation:
[0119] Obviously, on the three data sets, the fire recognition model in this application achieves the highest performance in the three indicators of recognition accuracy. Specifically, on the Our_flame_smoke data set, the fire recognition model in this application outperforms the fire recognition model with the PSA module removed by 0.11% in the Acc indicator; on the FLAME data set, the fire recognition model in this application outperforms the fire recognition model with the PSA module removed by 5.05% in the Rec indicator; on the DeepQuestAI data set, compared with the fire recognition model with the PSA module removed, the fire recognition model in this application improves the Pre metric by 0.38%. It can be seen that adding the PSA module to the backbone network can significantly improve the model's key feature extraction capabilities and cross-scale feature interaction capabilities, thereby improving the accuracy of fire recognition.
[0120] The method proposed in this application is robust and adaptable to images of different resolutions. Figure 4 The performance of the fire recognition model in this application is shown in 16 resolution tests on the Our_flame_smoke dataset. Since the image resolutions in the FLAME and DeepQuestAI datasets are inconsistent, the resolution test is only performed on the Our_flame_smoke dataset. The following conclusions can be drawn from the observations.
[0121] At a resolution of 1920*1080, the fire recognition model has the highest recognition accuracy, which is consistent with the resolution when the fire recognition model was trained. When the resolution is increased to 1.5 to 3 times the original, the recognition accuracy of the fire recognition model only decreases by 0.2%. On the contrary, when the resolution is reduced to 1 / 6 to 2 / 3 of the original, the recognition accuracy decreases by a minimum of 0.1% and a maximum of 0.23%, indicating that the accuracy of the fire recognition model remains relatively stable. At present, the image resolutions collected by monitoring equipment are mostly 1280*720 and 1920*1080, generally not less than 320*108. Therefore, the fire recognition model of the present application is adaptable and generalizable to fire images to be identified with multiple resolutions collected by monitoring equipment, and can quickly and accurately realize fire detection in both low-resolution and high-resolution fire images.
[0122] Table 7
[0123] Resolution Pre(%) Rec(%) Acc(%) Resolution Pre(%) Rec(%) Acc(%) 5760*3240(3×) 99.80 99.77 99.78 480*270(1 / 4×) 99.57 99.57 99.57 4800*2700(2.5×) 99.80 99.77 99.78 384*216(1 / 4×) 99.67 99.67 99.68 3840*2160(2×) 99.70 99.67 99.68 320*180(1 / 5×) 99.70 99.67 99.68 2880*1620(1.5×) 99.70 99.67 99.68 240*135(1 / 8×) 95.65 93.98 94.69 1920*1080(1×) 99.90 99.90 99.89 192*108(1 / 10×) 92.11 88.01 89.26 1280*720(2 / 3×) 99.80 99.77 99.78 160*90(1 / 12×) 90.23 83.66 85.03 960*540(1 / 2×) 99.80 99.77 99.78 128*72(1 / 15×) 87.77 77.88 79.07 640*360(1 / 3×) 99.60 99.54 99.57 96*54(1 / 20×) 82.13 58.57 58.24
[0124] In order to solve the dual problems of difficulty in accurate fire identification due to the high similarity of interference sources such as smoke, flames, dust, light and shadow, and difficulty in real-time fire detection due to the quantization of existing models, the fire identification method of this application reduces model parameters without affecting the accuracy of fire identification through a lightweight design of grouped convolution and channel shuffle, thus achieving real-time fire detection in resource-constrained environments. The cross-scale attention adaptive recalibration of channel attention weights promotes the interaction of multi-scale fire features and realizes the distinction between smoke, flames and similar features (such as dust particles and light and shadow). The above experiments show that the fire identification model parameters in the method proposed in this application are only 1.1M, the fire identification accuracy is as high as 99.89%, 462 images are processed per second, and it is robust to images of different resolutions.
[0125] Based on the same inventive concept, the embodiment of the present application also provides a fire identification system for implementing the fire identification method involved above. The implementation scheme for solving the problem provided by the system is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more fire identification system embodiments provided below can refer to the limitations on the fire identification method above, and will not be repeated here.
[0126] In an exemplary embodiment, Figure 5 As shown, a fire identification system is provided, comprising:
[0127] The acquisition module 51 is used to acquire a fire image to be identified in a fire scene.
[0128] The fire recognition module 52 is used to input the fire image to be recognized into a trained fire recognition model to perform fire recognition to obtain a fire recognition result, wherein the fire recognition result includes the presence of smoke in the fire image, the presence of flames in the fire image, and the absence of fire in the fire image; wherein the fire recognition model includes a first convolution layer, a maximum pooling layer, a cross-scale fire feature module, a second convolution layer, a global pooling layer, and a fully connected layer stacked in sequence; and the cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
[0129] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 6As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store fire images to be identified. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a fire identification method is implemented.
[0130] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0131] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the above method is implemented when the processor executes the computer program.
[0132] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and the computer program implements the above method when executed by a processor.
[0133] In an exemplary embodiment, a computer program product is provided, including a computer program, which implements the above method when executed by a processor.
[0134] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0135] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0136] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0137] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0138] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A fire identification method, characterized in that: The fire identification method comprises: Acquire a fire image to be identified in a fire scene; The fire image to be identified is input into a trained fire identification model for fire identification to obtain a fire identification result, wherein the fire identification result includes the presence of smoke in the fire image, the presence of flame in the fire image, and the absence of fire in the fire image; wherein the fire identification model includes a first convolutional layer, a maximum pooling layer, a cross-scale fire feature module, a second convolutional layer, a global pooling layer, and a fully connected layer stacked in sequence; and the cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
2. The fire identification method according to claim 1, characterized in that: The deep feature extraction module includes two first unit blocks and two second unit blocks, the first unit block includes a channel segmentation operator, two 1×1 convolutional layers and one 3×3 depth-separable convolutional layer, and the second unit block includes three 1×1 convolutional layers and two 3×3 depth-separable convolutional layers; The multi-scale feature interaction module includes a second unit block and a third unit block, and the third unit block includes two 1×1 convolutional layers, a 3×3 depth-separable convolutional layer and a pyramid squeezing attention module.
3. The fire identification method according to claim 2, characterized in that: Inputting the fire image to be identified into a trained fire identification model to perform fire identification to obtain a fire identification result, specifically including: Inputting the fire image to be identified into the first convolution layer and the maximum pooling layer for feature extraction to obtain a fire feature map; Inputting the fire characteristic map into the depth feature extraction module to perform depth feature extraction to obtain a depth fire characteristic map; Inputting the deep fire feature map into the multi-scale feature interaction module to perform multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map; The cross-scale fire feature map is sequentially input into the second convolutional layer, the global pooling layer and the fully connected layer for classification and recognition to obtain a fire recognition result.
4. The fire identification method according to claim 3, characterized in that: The deep fire feature map is input into the multi-scale feature interaction module for multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map, specifically including: Inputting the deep fire feature map into the second unit block to extract key fire features to obtain key fire features; The key fire features are input into the third unit block for multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map.
5. The fire identification method according to claim 4, characterized in that: The pyramid squeeze attention module includes a squeeze pyramid splicing module and a squeeze incentive attention module. The key fire features are input into the third unit block for multi-scale feature extraction and multi-scale channel calibration to obtain a cross-scale fire feature map, specifically including: Inputting the key fire features into a 3×3 depthwise separable convolutional layer and a 1×1 convolutional layer in sequence to obtain a depthwise key fire feature map with a reduced number of channels; The key fire features are sequentially input into a 1×1 convolution layer and a squeezed pyramid splicing module to perform multiple sets of convolution feature extraction to obtain fire feature maps of different scales; Inputting the fire characteristic map of each scale into the squeeze incentive attention module to extract attention information, and obtaining the attention weight corresponding to the fire characteristic map of each scale; Calibrate the attention weight using a normalization function to obtain a calibrated weight; Performing an element-wise multiplication operation on the calibrated weights and the fire feature map of the corresponding scale to obtain a cross-scale interaction feature of the fire; The cross-scale fire feature map is obtained by splicing the fire cross-scale interaction feature and the deep key fire feature map.
6. The fire identification method according to claim 1, characterized in that: The training process of the fire identification model includes: Construct a training set, which includes fire sample images and corresponding category labels. The category labels include smoke, fire, and neutral. Neutral means that there is no fire in the fire sample image. Input the fire sample images into the fire recognition model to obtain the predicted category of the fire; The loss is calculated according to the predicted category and the category label corresponding to the fire sample image, and the parameters of the fire recognition model are optimized according to the loss until the loss reaches a preset range, thereby obtaining a trained fire recognition model.
7. A fire identification system, characterized in that: The fire identification system comprises: An acquisition module, used for acquiring a fire image to be identified in a fire scene; The fire recognition module is used to input the fire image to be recognized into a trained fire recognition model to perform fire recognition to obtain a fire recognition result, wherein the fire recognition result includes the presence of smoke in the fire image, the presence of flames in the fire image, and the absence of fire in the fire image; wherein the fire recognition model includes a first convolution layer, a maximum pooling layer, a cross-scale fire feature module, a second convolution layer, a global pooling layer, and a fully connected layer stacked in sequence; and the cross-scale fire feature module includes a deep feature extraction module and a multi-scale feature interaction module.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the fire identification method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the fire identification method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the fire identification method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Forestry fire monitoring method based on super-resolution image processing
CN120997771A