A wildfire detection method, model and system based on spatiotemporal fusion features
UAVs collect video data, extract and fuse spatial features and time features, and identify wildfire levels. This solves the problem of high misrecognition rates in cloudy and foggy weather and achieves highly accurate wildfire detection without increasing sensor load.
Patent Information
- Application Number
- CN202311408677.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-26
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-10-26
AI Technical Summary
Existing UAV-based wildfire detection methods have a high misrecognition rate in cloudy and foggy weather, resulting in a high probability of false alarms, and the introduction of additional sensors will increase the load and cost.
A wildfire detection method based on spatio-temporal fusion features is used to collect video data through drones, extract spatial features and temporal features, and perform fusion processing to identify the occurrence of wildfires and their levels without introducing additional sensors.
It significantly reduces the probability of false alarms, improves the recognition accuracy of clouds and smoke, and can identify the level of wildfires based on smoke characteristics, providing an important reference for firefighting work.
Smart Images

Figure CN117671555B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of forest fire detection, and in particular to a forest fire detection method, model and system based on spatiotemporal fusion features. Background Art
[0002] Once a forest fire occurs, it will not only damage the forest itself and the animal ecosystem in it, but also threaten the safety of life and property of local residents. By detecting forest fires, measures can be taken early to prevent the expansion and spread of the fire. At the same time, rescue can be organized in time to protect the life and property safety of people in the affected areas.
[0003] The traditional method of detecting wildfires is to place cameras in the forest, and workers manually identify whether a fire has occurred by watching the video captured by the cameras. This traditional method of detecting wildfires requires a lot of manpower and is not intelligent enough. In recent years, drone technology has become increasingly mature, and a wildfire detection method based on drones has emerged.
[0004] See also Figure 1 , Figure 1 The figure is a flowchart of an existing method for detecting wildfires based on drones. Since drones cruise at a high altitude and are blocked by trees in the forest, drones can usually only capture the smoke generated by wildfires. Therefore, the existing method for detecting wildfires based on drones includes the following steps: S01, causing the drone to cruise over the forest and capture forest images; S02, using an image recognition algorithm to determine whether there is smoke in the forest image; S03, if there is smoke in the forest image, it is determined that a wildfire has occurred and an alarm program is initiated; S04, if there is no smoke in the forest image, it is determined that no wildfire has occurred and the drone continues to cruise.
[0005] The existing wildfire detection method based on drones has the following defects: in foggy weather, fog and smoke look very similar, and the image recognition algorithm in step S02 often misidentifies fog as smoke, and the probability of false alarm is very high. To address this defect, the existing technology usually introduces other sensors and combines the data of multiple sensors to determine whether a wildfire has occurred. However, the introduction of multiple sensors will make the load of the drone too large, which not only affects the stability of the drone's movement, but also increases the cost. Summary of the invention
[0006] Based on this, the purpose of the present invention is to provide a wildfire detection method, model and system based on spatiotemporal fusion features that significantly reduce the probability of false alarms and do not require the introduction of other sensors.
[0007] The present invention provides a wildfire detection method based on spatiotemporal fusion features, comprising the steps of: collecting video data through a drone; the video data comprises a plurality of image frames; using a wildfire detection model, identifying whether a wildfire occurs and the wildfire level according to the video data; wherein the wildfire detection model performs the following steps:
[0008] S1, extracting spatial features from image frames of the video data to obtain spatial features;
[0009] S2, extracting time features from the video data to obtain time features;
[0010] S3, fusing the spatial features and the temporal features to obtain fused classification features;
[0011] S4, obtaining a recognition result of whether a wildfire has occurred and a recognition result of the wildfire level based on the fused classification features.
[0012] The wildfire detection method based on spatiotemporal fusion features of the present invention does not introduce any additional sensors. By fusing spatial features and temporal features, it greatly improves the accuracy of identifying clouds and smoke, and overcomes the defects of the prior art. Furthermore, the present invention can further identify the level of wildfires based on the characteristics of smoke, providing an important reference for wildfire fighting. Furthermore, the present invention does not require any preprocessing and feature pre-extraction to extract time features. The original video data can be input into the model to output the recognition result, which not only retains the original features to the greatest extent, but also is easy to use.
[0013] Furthermore, the step S1 specifically includes:
[0014] S11, extracting shallow features of the image frame to obtain a shallow feature image;
[0015] S12, extracting intermediate layer features according to the shallow layer feature image to obtain an intermediate layer feature image;
[0016] S13, extracting deep features according to the intermediate layer feature image to obtain a deep layer feature image;
[0017] S141, performing matrix addition on the plurality of shallow feature images to obtain superimposed shallow features;
[0018] S142, performing convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features;
[0019] S143, performing matrix addition on the plurality of intermediate layer feature images and the MGP intermediate layer features to obtain a superimposed intermediate layer feature;
[0020] S144, performing convolution and pooling processing on the superimposed intermediate layer features to obtain MGP deep layer features;
[0021] S145, performing matrix addition on the plurality of deep feature images and the MGP deep features to obtain spatial features.
[0022] Furthermore, the step S11 specifically includes:
[0023] S111, performing a first convolution process on the image frame, with a convolution kernel size of 7*7 and a step size of 3, to obtain a first convolution feature image;
[0024] S112, performing a second convolution process on the first convolution feature image, with a convolution kernel size of 7*7 and a step size of 3, to obtain a second convolution feature image;
[0025] S113, performing pooling processing on the second convolution feature image, with a pooling window size of 2*2, to obtain a shallow feature image;
[0026] The step S12 specifically includes:
[0027] S121, performing a third convolution process on the shallow feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a third convolution feature image;
[0028] S122, performing a fourth convolution process on the third convolution feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a fourth convolution feature image;
[0029] S123, performing a second pooling process on the fourth convolution feature image, with a pooling window size of 2*2, to obtain an intermediate layer feature image;
[0030] The step S13 specifically includes:
[0031] S131, performing a fifth convolution process on the intermediate layer feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a fifth convolution feature image;
[0032] S132, performing a sixth convolution process on the fifth convolution feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a deep feature image.
[0033] Furthermore, the step S2 specifically includes:
[0034] S21, extracting time features from the video data to obtain a time feature image;
[0035] S22, performing convolution processing on the video data, with a convolution kernel size of 1*1, to obtain a seventh convolution feature image;
[0036] S23, performing matrix addition on the time feature image and the seventh convolution feature image to obtain a time feature;
[0037] Wherein, the step S21 is specifically as follows: extracting the temporal features of the video data through two mutually cascaded temporal feature extraction units; the temporal feature extraction unit comprises a cascaded dilated causal convolution layer, a weight normalization layer, an h-swish layer and a discard layer; the dilated causal convolution layer performs three dilated causal convolution processes with a convolution kernel size of 3 on the temporal series of the video data to obtain a temporal feature sequence; the dilation factors of the three dilated causal convolution processes are 1, 2 and 4 respectively; the weight normalization layer performs weight normalization on the temporal feature sequence to obtain a weight normalized temporal feature sequence; the h-swish layer multiplies the weight normalized temporal feature sequence by an h-swish activation function to obtain an activated temporal feature sequence; the h-swish activation function is:
[0038]
[0039] Furthermore, the step S3 specifically includes:
[0040] S31, converting the spatial feature into a spatial feature vector of a set dimension; converting the temporal feature into a temporal feature vector of a set dimension;
[0041] S32, concatenating the spatial feature vector and the temporal feature vector to obtain a fused feature vector;
[0042] S33, performing convolution processing on the fused feature vector to obtain a fused classification feature.
[0043] Furthermore, the step S4 specifically includes:
[0044] S41, outputting a recognition result of whether a wildfire has occurred according to the fused classification features;
[0045] S42: Outputting a wildfire grade recognition result based on the fused classification features.
[0046] Furthermore, the wildfire detection model is trained by the following training method:
[0047] ST1, collecting training data by using a drone; the training data includes first smoke video data and first cloud and fog video data;
[0048] ST2, segmenting the first smoke video data and the first cloud and fog video data to obtain second smoke video data and second cloud and fog video data with the same time length and the same number of frames;
[0049] ST3, labeling the second smoke video data and the second cloud and fog video data to obtain third smoke video data and third cloud and fog video data; the labels include category labels and wildfire grade labels;
[0050] ST4, input the third smoke video data and the third cloud and fog video data into the wildfire detection model; the wildfire detection model extracts and recognizes features of the third smoke video data and the third cloud and fog video data, and outputs a recognition result of whether a wildfire has occurred and a recognition result of the wildfire level;
[0051] ST5, comparing the identification result of whether a wildfire has occurred output by the wildfire detection model with the category labels corresponding to the third smoke video data and the third cloud and fog video data, and calculating a first loss function; comparing the wildfire level identification result output by the wildfire detection model with the wildfire level labels corresponding to the third smoke video data and the third cloud and fog video data, and calculating a second loss function;
[0052] ST6, calculating a final loss function according to the first loss function and the second loss function according to the set weights; transmitting the final loss function back to optimize the trainable parameters of the wildfire detection model;
[0053] ST7, repeat steps ST4-ST6 until the trainable parameters of the wildfire detection model converge, thereby obtaining a trained wildfire detection model.
[0054] Based on the same inventive concept, the present invention also provides a wildfire detection model based on spatiotemporal fusion features, which is used to extract and identify features of video data collected by drones, including:
[0055] A spatial feature extraction module, used to extract spatial features from image frames of the video data to obtain spatial features;
[0056] A time feature extraction module, used to extract time features from the video data to obtain time features;
[0057] A spatiotemporal feature fusion module is used to fuse the spatial features and temporal features to obtain fused classification features;
[0058] The classification and identification module is used to obtain the identification result of whether a wildfire has occurred and the identification result of the wildfire level based on the fused classification features.
[0059] Furthermore, the spatial feature extraction module specifically includes a cascaded first-level network, a second-level network, a third-level network and an MGP structure;
[0060] The first-level network is used to extract shallow features of the image frame to obtain a shallow feature image;
[0061] The second-level network is used to extract the intermediate layer features according to the shallow layer feature image to obtain the intermediate layer feature image;
[0062] The third-level network is used to extract deep features based on the intermediate-layer feature image to obtain a deep-layer feature image;
[0063] The MGP structure specifically includes a cascaded first matrix addition layer, a fourth-level network, a second matrix addition layer, a fifth-level network, and a third matrix addition layer;
[0064] The first matrix addition layer is used to perform matrix addition on the plurality of shallow feature images to obtain superimposed shallow features;
[0065] The fourth-level network is used to perform convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features;
[0066] The second matrix addition layer is used to perform matrix addition on the plurality of intermediate layer feature images and the MGP intermediate layer features to obtain superimposed intermediate layer features;
[0067] The fifth-level network is used to perform convolution and pooling processing on the superimposed intermediate layer features to obtain MGP deep features;
[0068] The third matrix addition layer is used to perform matrix addition on the multiple deep feature images and MGP deep features to obtain spatial features.
[0069] Based on the same inventive concept, the present invention also provides a wildfire detection system based on spatiotemporal fusion features, comprising a drone and an algorithm server; the drone collects video data and transmits the video data to the algorithm server; the video data comprises a plurality of image frames; the algorithm server, through a wildfire detection model, identifies whether a wildfire occurs and the wildfire level according to the video data;
[0070] The wildfire detection model performs the following steps:
[0071] S1, extracting spatial features from image frames of the video data to obtain spatial features;
[0072] S2, extracting time features from the video data to obtain time features;
[0073] S3, fusing the spatial features and the temporal features to obtain fused classification features;
[0074] S4, obtaining a recognition result of whether a wildfire has occurred and a recognition result of the wildfire level based on the fused classification features.
[0075] For better understanding and implementation, the present invention is described in detail below with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1 A schematic diagram of the flow of existing UAV-based wildfire detection methods;
[0077] Figure 2 It is a schematic diagram of a wildfire detection system based on spatiotemporal fusion features of the present invention;
[0078] Figure 3 It is a schematic diagram of a wildfire detection model based on spatiotemporal fusion features of the present invention;
[0079] Figure 4 It is a flow chart of the forest fire detection method based on spatiotemporal fusion features of the present invention;
[0080] Figure 5 A specific flow chart of step S1 of the wildfire detection method based on spatiotemporal fusion features of the present invention;
[0081] Figure 6 It is a structural schematic diagram of the time feature extraction module of the wildfire detection model of the present invention;
[0082] Figure 7 A schematic diagram of the structure of the dilated causal convolutional layer of the temporal feature extraction module of the wildfire detection model of the present invention;
[0083] Figure 8 It is a specific flow chart of step S3 and step S4 of the wildfire detection method based on spatiotemporal fusion features of the present invention;
[0084] Fig. 9 The flowchart of the training method of the wildfire detection model based on spatiotemporal fusion features of the present invention is shown. DETAILED DESCRIPTION
[0085] When the inventors were conducting wildfire detection, they found that the existing wildfire detection methods based on drones can basically operate normally in sunny weather, but in foggy weather, the false alarm probability of the existing wildfire detection methods based on drones is very high. The inventors studied the causes of false alarms and found that in foggy weather, the forest images taken by drones contain large areas of white clouds and fog. These white clouds and fog are very similar in appearance to the white smoke produced by wildfires. Even the human eye cannot accurately distinguish smoke and clouds based on a static image.
[0086] The inventors further considered the differences between smoke and clouds and found that the physical essence of smoke is small solid particles, while the physical essence of clouds and fog is liquid water vapor. Although both are white mist in appearance, there are great differences in their movement characteristics. In terms of morphological changes, when a wildfire occurs, the smoke is generated very quickly; because wildfires have great energy, the shape of the smoke will change greatly in a short period of time. Clouds and fog are formed by the liquefaction of water vapor. Under natural conditions, the ambient temperature does not change much in a short period of time. Therefore, the formation speed of clouds and fog is slow, and the shape will not change greatly in a short period of time. In terms of movement trajectory, the movement trajectory of wildfire smoke extends from the ignition point on the ground to the sky, and the higher the altitude, the larger the area where the smoke spreads. The movement trajectory of clouds and fog moves parallel to the wind direction, without a definite starting point.
[0087] Based on the above-mentioned difference between smoke and fog, the inventors imagined that: since the difference between smoke and fog mainly lies in the motion characteristics, if the motion characteristics can be fully extracted, smoke or fog can be identified more accurately. And the motion characteristics are reflected by both spatial characteristics and temporal characteristics. Therefore, the present invention enables the drone to shoot videos; on the one hand, the spatial characteristics of the video frames are extracted through the convolutional neural network, and on the other hand, the temporal characteristics of multiple video frames are extracted through the temporal convolutional neural network, and the spatiotemporal fusion characteristics formed by the fusion of temporal characteristics and spatial characteristics are used to identify whether a wildfire has occurred.
[0088] See also Figure 2 , Figure 2 The figure is a schematic diagram of the wildfire detection system based on spatiotemporal fusion features of the present invention. The wildfire detection system based on spatiotemporal fusion features of the present invention comprises a drone A and an algorithm server B; the drone A collects video data and transmits the video data to the algorithm server B; the video data comprises a number of image frames; the algorithm server B identifies whether a wildfire has occurred and the wildfire level according to the video data through the wildfire detection model M based on spatiotemporal fusion features of the present invention.
[0089] See also Figure 3 , Figure 4 , Figure 3 Schematic diagram of a wildfire detection model based on spatiotemporal fusion features of the present invention. Figure 4 The wildfire detection model M based on spatiotemporal fusion features of the present invention comprises a spatial feature extraction module 1, a temporal feature extraction module 2, a spatiotemporal feature fusion module 3 and a classification and identification module 4.
[0090] The spatial feature extraction module 1 is used to execute step S1: extracting spatial features from the image frames of the video data through a convolutional neural network to obtain spatial features.
[0091] The time feature extraction module 1 is used to execute step S2: extracting time features from the video data through a time convolutional neural network to obtain time features.
[0092] The spatiotemporal feature fusion module 3 is used to execute step S3: fusing the spatial features and temporal features to obtain fused classification features.
[0093] The classification and identification module 4 is used to execute step S4: obtaining an identification result of whether a wildfire has occurred and an identification result of the wildfire level according to the fused classification features through a fully connected neural network.
[0094] See also Figure 5 , Figure 5 The specific flow chart of step S1 of the method executed by the wildfire detection model is as follows: The spatial feature extraction module 1 comprises a cascaded first-level network 11, a second-level network 12, a third-level network 13 and an MGP structure 14.
[0095] The first-level network 11 is used to execute step S11: extract shallow features of the image frame to obtain a shallow feature image.
[0096] The second-level network 12 is used to execute step S12: extracting intermediate layer features according to the shallow layer feature image to obtain an intermediate layer feature image.
[0097] The third-level network 13 is used to execute step S13: extracting deep features according to the intermediate layer feature image to obtain a deep feature image.
[0098] Specifically, the first-level network 11 includes a first convolutional layer 111, a second convolutional layer 112 and a first pooling layer 113.
[0099] The first convolution layer 111 is used to execute step S111: perform a first convolution process on the image frame, with a convolution kernel size of 7*7 and a step size of 3, to obtain a first convolution feature image.
[0100] The second convolution layer 112 is used to execute step S112: perform a second convolution process on the first convolution feature image, with a convolution kernel size of 7*7 and a step size of 3, to obtain a second convolution feature image.
[0101] The first pooling layer 113 is used to execute step S113: perform pooling processing on the second convolution feature image, with a pooling window size of 2*2, to obtain a shallow feature image.
[0102] Specifically, the second-level network 12 includes a third convolutional layer 121, a fourth convolutional layer 122 and a second pooling layer 123.
[0103] The third convolution layer 121 is used to execute step S121: perform a third convolution process on the shallow feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a third convolution feature image.
[0104] The fourth convolution layer 122 is used to execute step S122: perform a fourth convolution process on the third convolution feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a fourth convolution feature image.
[0105] The second pooling layer 123 is used to execute step S123: perform a second pooling process on the fourth convolution feature image, with a pooling window size of 2*2, to obtain an intermediate layer feature image.
[0106] Specifically, the third-level network 13 includes a fifth convolutional layer 131 and a sixth convolutional layer 132 .
[0107] The fifth convolution layer 131 is used to execute step S131: perform a fifth convolution process on the intermediate layer feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a fifth convolution feature image.
[0108] The sixth convolution layer 132 is used to execute step S132: perform a sixth convolution process on the fifth convolution feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a deep feature image.
[0109] Since the original image resolution is large, the convolution kernels are designed to be of three different sizes to capture coarse and fine granularity spatial features.
[0110] The present invention uses a multilayer global pipeline (Multilayer Global Pipeline, MGP) to summarize the features extracted by the first level network 11, the second level network 12 and the third level network 13. The MGP structure 14 includes a cascaded first matrix addition layer 141, a fourth level network 142, a second matrix addition layer 143, a fifth level network 144 and a third matrix addition layer 145. The structure of the fourth level network 142 is the same as that of the second level network 12; the structure of the fifth level network 144 is the same as that of the third level network 13.
[0111] The first matrix addition layer 141 is used to execute step S141: matrix addition is performed on the shallow feature images extracted by the plurality of the first-level networks 11 to obtain superimposed shallow features.
[0112] The fourth-level network 142 is used to execute step S142: performing convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features.
[0113] The second matrix addition layer 143 is used to execute step S143: matrix addition is performed on the middle layer feature images and the MGP middle layer features extracted by the plurality of the second level networks 12 to obtain superimposed middle layer features.
[0114] The fifth-level network 144 is used to execute step S144: convolution and pooling are performed on the superimposed intermediate layer features to obtain MGP deep features.
[0115] The third matrix addition layer 145 is used to execute step S145: matrix addition is performed on the deep feature images and MGP deep features extracted by the plurality of the third-level networks 13 to obtain superimposed deep features; the superimposed deep features are the final spatial features.
[0116] See also Figure 6 , Figure 6 The schematic diagram of the structure of the temporal feature extraction module of the wildfire detection model is shown in FIG. The temporal feature extraction module 2 is an improved TCN network (Temporal Convolutional Network), including a temporal feature extraction layer 21 , a seventh convolution layer 22 and a fourth matrix addition layer 23 .
[0117] The time feature extraction layer 21 is used to execute step S21: extracting time features from the video data to obtain a time feature image.
[0118] The seventh convolution layer 22 is used to execute step S22: performing convolution processing on the video data, with a convolution kernel size of 1*1, to obtain a seventh convolution feature image.
[0119] The fourth matrix addition layer 23 is used to execute step S23: perform matrix addition on the time feature image and the seventh convolution feature image to obtain a final time feature.
[0120] Specifically, the temporal feature extraction layer 21 includes two mutually cascaded temporal feature extraction units, namely a first temporal feature extraction unit 211 and a second temporal feature extraction unit 212; each temporal feature extraction unit includes a cascaded dilated causal convolution layer, a weight normalization layer, an h-swish layer and a discard layer.
[0121] The dilated causal convolution layer is used to perform the step of performing dilated causal convolution processing on the time series of the video data three times with a convolution kernel size of 3 to obtain a time feature sequence. Figure 7 , Figure 7This is a schematic diagram of the structure of the dilated causal convolution layer of the present invention. Each dilated causal convolution layer includes a cascaded input layer Input, a first hidden layer Hidden1, a second hidden layer Hidden2 and an output layer Output. The input layer performs the first dilated causal convolution processing on the time series, and the dilation factor d1 is 1; the first hidden layer performs the second dilated causal convolution processing on the time series output by the input layer, and the dilation factor d2 is 2; the second hidden layer performs the third dilated causal convolution processing on the time series output by the first hidden layer, and the dilation factor d3 is 4; the output layer outputs the time feature sequence obtained by the processing of the second hidden layer. Since the convolution kernel size of each dilated causal convolution is 3, in the input layer, the first hidden layer, the second hidden layer and the output layer, the single element of the time series of each layer is calculated from the three elements of the time series of the previous layer.
[0122] The weight normalization layer is used to execute the step of: performing weight normalization processing on the time feature sequence to obtain a weight normalized time feature sequence. Adding a weight normalization layer can accelerate the convergence speed of the neural network.
[0123] The h-swish layer is used to perform the step of: multiplying the weight-normalized time feature sequence by the h-swish activation function to obtain an activated time feature sequence. The h-swish activation function is:
[0124] The present invention replaces the traditional ReLU function with the h-swish function. In the classification task, the swish function has better performance than the ReLU function, but the computational overhead of the swish function is large. The h-swish function used in the present invention can achieve better performance than the ReLU function without increasing the amount of computation.
[0125] The dropout layer is used to perform the step of randomly hiding some neurons according to a set probability during the training of the improved TCN network. Adding the dropout layer can effectively prevent overfitting.
[0126] See also Figure 8 , Figure 8 The specific flow chart of steps S3 and S4 of the method executed by the wildfire detection model. The feature fusion module 3 includes a horizontal pyramid mapping (HPM) unit 31, a splicing unit 32 and an eighth convolutional layer 33.
[0127] The horizontal pyramid mapping unit 31 is used to perform step S31: converting the spatial feature into a spatial feature vector of a set dimension; and converting the temporal feature into a temporal feature vector of a set dimension.
[0128] The splicing unit 32 is used to execute step S32: splicing the spatial feature vector and the temporal feature vector to obtain a fused feature vector.
[0129] The eighth convolutional layer 33 is used to execute step S33: performing convolution processing on the fused feature vector to obtain a final fused classification feature.
[0130] Specifically, the horizontal pyramid mapping unit 31 includes a spatial pyramid pooling (SPP) layer 311 and a first fully connected layer 312. The spatial pyramid pooling layer includes a plurality of pooling layers with different window sizes, which convert the spatial features or temporal features into feature images of the same dimension; the fully connected layer converts the feature image into a feature vector of a set dimension. In this embodiment, the horizontal pyramid mapping unit 31 converts the spatial features into an m-dimensional spatial feature vector; and converts the temporal features into an m-dimensional temporal feature vector. The splicing unit 32 splices the spatial feature vector and the temporal feature vector to obtain a 2m-dimensional fused feature vector.
[0131] The classification and identification module 4 includes a category fully connected layer 41 and a level fully connected layer 42 .
[0132] The category fully connected layer 41 is used to execute step S41: outputting a recognition result of whether a wildfire occurs according to the fused classification features.
[0133] The hierarchical fully connected layer 42 is used to execute step S42: output the wildfire level recognition result according to the fused classification features. The wildfire level recognition result includes five levels: 0, 1, 2, 3, and 4. If the wildfire level recognition result is 0, it means that no wildfire has occurred; if the wildfire level recognition result is 1, 2, 3, or 4, it means that a wildfire has occurred, and the higher the level, the more serious the wildfire.
[0134] See also Fig. 9 , Fig. 9 The flowchart of the training method of the wildfire detection model based on spatiotemporal fusion features of the present invention is shown in FIG. The wildfire detection model M based on spatiotemporal fusion features of the present invention is trained by the following training method:
[0135] ST1, obtain training data; the training data is collected by a drone, including first smoke video data and first cloud and fog video data under multiple viewing angles, multiple environments, and multiple weather conditions. The smoke video data includes smoke of multiple colors, multiple forms, and multiple motion trajectories. The cloud and fog video data includes clouds of multiple forms and multiple motion trajectories.
[0136] ST2, the first smoke video data and the first cloud video data are segmented to obtain second smoke video data and second cloud video data with the same time length and the same number of frames. In this embodiment, the time length of each second smoke video data or second cloud video data is 2 seconds, and each second includes 30 image frames, for a total of 60 image frames.
[0137] ST3, label the second smoke video data and the second fog and cloud video data to obtain third smoke video data and third fog and cloud video data; the labels include category labels and wildfire level labels. The category label of the second fog and cloud video data is 0, indicating that the category is fog and wildfire has not occurred; the category label of the second smoke video data is 1, indicating that the category is smoke and wildfire has occurred. The wildfire level label of the second fog and cloud video data is 0. The wildfire level label of the second smoke video data is 1, 2, 3 or 4; the darker the smoke color, the higher the wildfire level.
[0138] Specifically, if the smoke in the second smoke video data is blue smoke, the wildfire level label is 1. Blue smoke is the smoke produced by the residual fire after the open fire is extinguished, and generally does not re-ignite; in the firefighting mission, the area where the blue smoke is located is the place where firefighters take emergency shelter. From the perspective of the drone, it is mostly blue. However, the surface temperature in the area where the blue smoke is located is relatively high, and there may be residual fire, which should not be taken lightly. Therefore, the fire level corresponding to the blue smoke is marked as 1.
[0139] If the smoke in the second smoke video data is white smoke, the wildfire level label is 2. White smoke is a pale white smoke formed by the burning of areas with a small amount of combustibles such as weeds, dead branches and leaves, and wet grass ponds under the forest. It often occurs in forests with low canopy density. Since crown fires are generally not formed when white smoke appears, it is relatively simple to extinguish manually, so the fire level corresponding to white smoke is marked as level 2.
[0140] If the smoke in the second smoke video data is mixed smoke, the wildfire level label is 3. Mixed smoke is a black and white mixed smoke formed by the burning of trees and surface weeds, which often occurs in woods or valleys with low canopy density. Depending on the load of combustibles, it can also be subdivided into thick smoke or light smoke. If it is thick smoke and it is in a valley area, the terrain and vegetation conditions need to be considered when fighting, which is more difficult, so the fire level corresponding to the mixed smoke is marked as level 3.
[0141] If the smoke in the second smoke video data is black smoke, the wildfire level label is 4. Black smoke is formed by incomplete combustion in areas with a large amount of combustibles, and it often occurs in pine forests with high canopy density. When black smoke appears, a crown fire has generally formed, and the oil content of the trees is high, which is basically impossible to extinguish manually. Therefore, the fire level corresponding to black smoke is marked as the highest level 4.
[0142] ST4, input the third smoke video data and the third cloud and fog video data into the wildfire detection model M based on spatiotemporal fusion features of the present invention; the wildfire detection model M performs feature extraction and recognition on the third smoke video data and the third cloud and fog video data, and outputs a recognition result of whether a wildfire has occurred and a wildfire level recognition result.
[0143] ST5, compare the identification result of whether a wildfire has occurred output by the wildfire detection model with the category labels corresponding to the third smoke video data and the third cloud and fog video data, and calculate a first loss function; compare the wildfire level identification result output by the wildfire detection model with the wildfire level labels corresponding to the third smoke video data and the third cloud and fog video data, and calculate a second loss function. Specifically, the first loss function and the second loss function are both mean squared error loss functions (MSELoss).
[0144] ST6, according to the first loss function and the second loss function, calculate the final loss function according to the set weights; send back the final loss function to optimize the trainable parameters of the wildfire detection model. In this embodiment, the weight of the first loss function is 0.8, and the weight of the second loss function is 0.2, that is, the calculation formula of the final loss function is:
[0145] Loss fin =0.8·Loss1+0.2·Loss2, where Loss fin represents the final loss function, Loss1 represents the first loss function, and Loss2 represents the second loss function. Different weights are set for the first loss function and the second loss function because accurately identifying whether a wildfire has occurred has a higher priority than assessing the wildfire level. Setting a higher weight for the first loss function allows the wildfire detection model to focus more on distinguishing the categories of smoke / clouds, making the accuracy of identifying whether a wildfire has occurred higher.
[0146] ST7, repeat steps ST4-ST6 until the trainable parameters of the wildfire detection model converge, thereby obtaining a trained wildfire detection model.
[0147] The wildfire detection method, model and system based on spatiotemporal fusion features of the present invention do not introduce any additional sensors. By fusing spatial features and temporal features, the accuracy of identifying clouds and smoke is greatly improved, overcoming the defects of the prior art. Furthermore, the present invention can further identify the level of wildfires based on the characteristics of smoke, providing an important reference for wildfire fighting. Furthermore, the present invention does not require any preprocessing or feature pre-extraction to extract the temporal features of smoke / clouds. The original video data can be input into the model to output the recognition results, which not only retains the original features to the greatest extent, but is also easy to use.
[0148] Based on the same inventive concept, the present application also provides an electronic device, which may be a terminal device such as a server, a desktop computing device or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). The device includes one or more processors and a memory, wherein the processor is used to execute a program to implement the wildfire detection method based on spatiotemporal fusion features of the present invention; and the memory is used to store a computer program executable by the processor.
[0149] Based on the same inventive concept, the present application also provides a computer-readable storage medium, corresponding to the embodiment of the aforementioned wildfire detection method based on time-space fusion features, and the computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the wildfire detection method based on time-space fusion features recorded in any of the above embodiments.
[0150] The present application may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
[0151] The above-mentioned embodiments only express several implementation methods of the present invention, and the description is relatively specific and detailed, but it cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, several modifications and improvements can be made without departing from the concept of the present invention, and the present invention is also intended to include these modifications and modifications.
Claims
1. A forest fire detection method based on spatiotemporal fusion features, characterized in that: Includes steps: Collecting video data by using a drone; the video data includes a plurality of image frames; Using a wildfire detection model, identifying whether a wildfire has occurred and the wildfire level according to the video data; The wildfire detection model performs the following steps: S1, extracting spatial features from image frames of the video data to obtain spatial features; S2, extracting time features from the video data to obtain time features; S3, fusing the spatial features and the temporal features to obtain fused classification features; S4, obtaining a recognition result of whether a wildfire has occurred and a wildfire grade recognition result according to the fused classification features; Wherein, the step S1 specifically includes: S11, extracting shallow features of the image frame to obtain a shallow feature image; S12, extracting intermediate layer features according to the shallow layer feature image to obtain an intermediate layer feature image; S13, extracting deep features according to the intermediate layer feature image to obtain a deep layer feature image; S141, performing matrix addition on the plurality of shallow feature images to obtain superimposed shallow features; S142, performing convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features; S143, performing matrix addition on the plurality of intermediate layer feature images and the MGP intermediate layer features to obtain a superimposed intermediate layer feature; S144, performing convolution and pooling processing on the superimposed intermediate layer features to obtain MGP deep layer features; S145, performing matrix addition on the plurality of deep feature images and the MGP deep features to obtain spatial features; Wherein, the step S11 specifically includes: S111, performing a first convolution process on the image frame, with a convolution kernel size of 7*7 and a step size of 3, to obtain a first convolution feature image; S112, performing a second convolution process on the first convolution feature image, with a convolution kernel size of 7*7 and a step size of 3, to obtain a second convolution feature image; S113, performing pooling processing on the second convolution feature image, with a pooling window size of 2*2, to obtain a shallow feature image; The step S12 specifically includes: S121, performing a third convolution process on the shallow feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a third convolution feature image; S122, performing a fourth convolution process on the third convolution feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a fourth convolution feature image; S123, performing a second pooling process on the fourth convolution feature image, with a pooling window size of 2*2, to obtain an intermediate layer feature image; The step S13 specifically includes: S131, performing a fifth convolution process on the intermediate layer feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a fifth convolution feature image; S132, performing a sixth convolution process on the fifth convolution feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a deep feature image; Wherein, the step S2 specifically includes: S21, extracting time features from the video data to obtain a time feature image; S22, performing convolution processing on the video data, with a convolution kernel size of 1*1, to obtain a seventh convolution feature image; S23, performing matrix addition on the time feature image and the seventh convolution feature image to obtain a time feature; Wherein, the step S21 is specifically as follows: extracting the temporal features of the video data through two mutually cascaded temporal feature extraction units; the temporal feature extraction unit comprises a cascaded dilated causal convolution layer, a weight normalization layer, an h-swish layer and a discard layer; the dilated causal convolution layer performs three dilated causal convolution processes with a convolution kernel size of 3 on the temporal series of the video data to obtain a temporal feature sequence; the dilation factors of the three dilated causal convolution processes are 1, 2 and 4 respectively; the weight normalization layer performs weight normalization on the temporal feature sequence to obtain a weight normalized temporal feature sequence; the h-swish layer multiplies the weight normalized temporal feature sequence by an h-swish activation function to obtain an activated temporal feature sequence; the h-swish activation function is:
2. The method for detecting wildfires based on spatiotemporal fusion features according to claim 1, characterized in that: The step S3 specifically includes: S31, converting the spatial feature into a spatial feature vector of a set dimension; converting the temporal feature into a temporal feature vector of a set dimension; S32, concatenating the spatial feature vector and the temporal feature vector to obtain a fused feature vector; S33, performing convolution processing on the fused feature vector to obtain a fused classification feature.
3. The method for detecting wildfires based on spatiotemporal fusion features according to claim 2, characterized in that: The step S4 specifically includes: S41, outputting a recognition result of whether a wildfire has occurred according to the fused classification features; S42: Outputting a wildfire grade recognition result based on the fused classification features.
4. The method for detecting wildfires based on spatiotemporal fusion features according to claim 1, characterized in that: The mountain fire detection model is trained by the following training method: ST1, collecting training data by using a drone; the training data includes first smoke video data and first cloud and fog video data; ST2, segmenting the first smoke video data and the first cloud and fog video data to obtain second smoke video data and second cloud and fog video data with the same time length and the same number of frames; ST3, labeling the second smoke video data and the second cloud and fog video data to obtain third smoke video data and third cloud and fog video data; the labels include category labels and wildfire grade labels; ST4, input the third smoke video data and the third cloud and fog video data into the wildfire detection model; the wildfire detection model extracts and recognizes features of the third smoke video data and the third cloud and fog video data, and outputs a recognition result of whether a wildfire has occurred and a recognition result of the wildfire level; ST5, comparing the identification result of whether a wildfire has occurred output by the wildfire detection model with the category labels corresponding to the third smoke video data and the third cloud and fog video data, and calculating a first loss function; comparing the wildfire level identification result output by the wildfire detection model with the wildfire level labels corresponding to the third smoke video data and the third cloud and fog video data, and calculating a second loss function; ST6, calculating a final loss function according to the first loss function and the second loss function according to the set weights; transmitting the final loss function back to optimize the trainable parameters of the wildfire detection model; ST7, repeat steps ST4-ST6 until the trainable parameters of the wildfire detection model converge, thereby obtaining a trained wildfire detection model.
5. A wildfire detection device based on spatiotemporal fusion features, used for feature extraction and recognition of video data collected by drones, characterized in that: include: A spatial feature extraction module, used to extract spatial features from image frames of the video data to obtain spatial features; A time feature extraction module, used to extract time features from the video data to obtain time features; A spatiotemporal feature fusion module is used to fuse the spatial features and temporal features to obtain fused classification features; A classification and identification module, used to obtain an identification result of whether a wildfire has occurred and an identification result of the wildfire level according to the fused classification features; The spatial feature extraction module specifically includes a cascaded first-level network, a second-level network, a third-level network and an MGP structure; The first-level network is used to extract shallow features of the image frame to obtain a shallow feature image; The second-level network is used to extract the intermediate layer features according to the shallow layer feature image to obtain the intermediate layer feature image; The third-level network is used to extract deep features based on the intermediate-layer feature image to obtain a deep-layer feature image; The MGP structure specifically includes a cascaded first matrix addition layer, a fourth-level network, a second matrix addition layer, a fifth-level network, and a third matrix addition layer; The first matrix addition layer is used to perform matrix addition on the plurality of shallow feature images to obtain superimposed shallow features; The fourth-level network is used to perform convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features; The second matrix addition layer is used to perform matrix addition on the plurality of intermediate layer feature images and the MGP intermediate layer features to obtain superimposed intermediate layer features; The fifth-level network is used to perform convolution and pooling processing on the superimposed intermediate layer features to obtain MGP deep features; The third matrix addition layer is used to perform matrix addition on the plurality of deep feature images and the MGP deep features to obtain spatial features; The first-level network specifically includes a first convolutional layer, a second convolutional layer, and a first pooling layer; The first convolution layer is used to perform a first convolution process on the image frame, with a convolution kernel size of 7*7 and a step size of 3, to obtain a first convolution feature image; The second convolution layer is used to perform a second convolution process on the first convolution feature image, with a convolution kernel size of 7*7 and a step size of 3, to obtain a second convolution feature image; The first pooling layer is used to perform pooling processing on the second convolution feature image, and the pooling window size is 2*2 to obtain a shallow feature image; The second-level network specifically includes a third convolutional layer, a fourth convolutional layer and a second pooling layer; The third convolution layer is used to perform a third convolution process on the shallow feature image, with a convolution kernel size of 5*5 and a step size of 2 to obtain a third convolution feature image; The fourth convolution layer is used to perform a fourth convolution process on the third convolution feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a fourth convolution feature image; The second pooling layer is used to perform a second pooling process on the fourth convolution feature image, where the pooling window size is 2*2, to obtain an intermediate layer feature image; The third-level network specifically includes a fifth convolutional layer and a sixth convolutional layer; The fifth convolution layer is used to perform a fifth convolution process on the intermediate layer feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a fifth convolution feature image; The sixth convolution layer is used to perform a sixth convolution process on the fifth convolution feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a deep feature image; Wherein, the time feature extraction module includes a time feature extraction layer, a seventh convolution layer and a fourth matrix addition layer; The time feature extraction layer is used to extract the time features of the video data to obtain a time feature image; The seventh convolution layer is used to perform convolution processing on the video data, with a convolution kernel size of 1*1, to obtain a seventh convolution feature image; The fourth matrix addition layer is used to perform matrix addition on the time feature image and the seventh convolution feature image to obtain the time feature; Among them, the time feature extraction layer extracts the time features of the video data to obtain a time feature image, which specifically includes: extracting the time features of the video data through two mutually cascaded time feature extraction units; the time feature extraction unit includes a cascaded expansion causal convolution layer, a weight normalization layer, an h-swish layer and a discard layer; the expansion causal convolution layer performs three expansion causal convolution processes with a convolution kernel size of 3 on the time series of the video data to obtain a time feature sequence; the expansion factors of the three expansion causal convolution processes are 1, 2 and 4 respectively; the weight normalization layer performs weight normalization on the time feature sequence to obtain a weight normalized time feature sequence; the h-swish layer multiplies the weight normalized time feature sequence by the h-swish activation function to obtain an activated time feature sequence; the h-swish activation function is:
6. A forest fire detection system based on spatiotemporal fusion features, characterized in that: Including drones and algorithm servers; The drone collects video data and transmits the video data to the algorithm server; the video data includes a plurality of image frames; the algorithm server identifies whether a wildfire occurs and the wildfire level according to the video data through a wildfire detection model; The wildfire detection model performs the following steps: S1, extracting spatial features from image frames of the video data to obtain spatial features; S2, extracting time features from the video data to obtain time features; S3, fusing the spatial features and the temporal features to obtain fused classification features; S4, obtaining a recognition result of whether a wildfire has occurred and a wildfire grade recognition result according to the fused classification features; Wherein, the step S1 specifically includes: S11, extracting shallow features of the image frame to obtain a shallow feature image; S12, extracting intermediate layer features according to the shallow layer feature image to obtain an intermediate layer feature image; S13, extracting deep features according to the intermediate layer feature image to obtain a deep layer feature image; S141, performing matrix addition on the plurality of shallow feature images to obtain superimposed shallow features; S142, performing convolution and pooling processing on the superimposed shallow layer features to obtain MGP intermediate layer features; S143, performing matrix addition on the plurality of intermediate layer feature images and the MGP intermediate layer features to obtain a superimposed intermediate layer feature; S144, performing convolution and pooling processing on the superimposed intermediate layer features to obtain MGP deep layer features; S145, performing matrix addition on the plurality of deep feature images and the MGP deep features to obtain spatial features; Wherein, the step S11 specifically includes: S111, performing a first convolution process on the image frame, with a convolution kernel size of 7*7 and a step size of 3, to obtain a first convolution feature image; S112, performing a second convolution process on the first convolution feature image, with a convolution kernel size of 7*7 and a step size of 3, to obtain a second convolution feature image; S113, performing pooling processing on the second convolution feature image, with a pooling window size of 2*2, to obtain a shallow feature image; The step S12 specifically includes: S121, performing a third convolution process on the shallow feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a third convolution feature image; S122, performing a fourth convolution process on the third convolution feature image, with a convolution kernel size of 5*5 and a step size of 2, to obtain a fourth convolution feature image; S123, performing a second pooling process on the fourth convolution feature image, with a pooling window size of 2*2, to obtain an intermediate layer feature image; The step S13 specifically includes: S131, performing a fifth convolution process on the intermediate layer feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a fifth convolution feature image; S132, performing a sixth convolution process on the fifth convolution feature image, with a convolution kernel size of 3*3 and a step size of 1, to obtain a deep feature image; Wherein, the step S2 specifically includes: S21, extracting time features from the video data to obtain a time feature image; S22, performing convolution processing on the video data, with a convolution kernel size of 1*1, to obtain a seventh convolution feature image; S23, performing matrix addition on the time feature image and the seventh convolution feature image to obtain a time feature; Wherein, the step S21 is specifically as follows: extracting the temporal features of the video data through two mutually cascaded temporal feature extraction units; the temporal feature extraction unit comprises a cascaded dilated causal convolution layer, a weight normalization layer, an h-swish layer and a discard layer; the dilated causal convolution layer performs three dilated causal convolution processes with a convolution kernel size of 3 on the temporal series of the video data to obtain a temporal feature sequence; the dilation factors of the three dilated causal convolution processes are 1, 2 and 4 respectively; the weight normalization layer performs weight normalization on the temporal feature sequence to obtain a weight normalized temporal feature sequence; the h-swish layer multiplies the weight normalized temporal feature sequence by an h-swish activation function to obtain an activated temporal feature sequence; the h-swish activation function is:
