Forest fire identification method based on improved YOLOv11

By improving the convolutional layer, backbone network and loss function of the YOLOv11 model, combined with TensorRT hardware acceleration, the shortcomings in accuracy, positioning and response speed of the existing forest fire recognition methods are solved, and higher recognition accuracy and faster response speed are achieved, meeting the needs of real-time forest fire warning.

CN119723402APending Publication Date: 2025-03-28HARBIN UNIV OF SCI & TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411551973.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-01
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

The existing forest fire recognition method based on YOLOv11 has problems such as low accuracy, incomplete positioning and slow response when identifying smoke and flames, especially in poor performance when identifying complex backgrounds and small targets.

Method used

By improving the convolutional layer and pooling layer of the YOLOv11 model, the C3k2 module and loss function in the backbone network, the model's recognition accuracy of small targets and the accuracy of complex scenarios, and hardware acceleration is carried out through TensorRT to improve the model's response speed.

Benefits of technology

In scenarios with a long distance, small smoke concentration or small flame area, the recognition accuracy and positioning integrity are improved; the detection accuracy is improved in complex scenarios; at the same time, the calculation amount and memory usage of the model are reduced, the response speed is improved, and the requirements of real-time forest fire warning are met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119723402A_ABST
    Figure CN119723402A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of forest fire recognition, in particular to a forest fire recognition method based on improved YOLOv11. The method comprises the steps of establishing a forest fire image data set, improving a YOLOv11 model, training the model, accelerating and optimizing hardware and detecting forest fire in sequence. The recognition precision of a small target is improved by improving a convolutional layer and a pooling layer of the YOLOv11 model, and the detection precision and the positioning completeness are ensured under the conditions of long distance, low smoke concentration or small flame area; by improving a loss function in a YOLOv11 model, regression samples are widely concerned, and higher accuracy is achieved in a complex scene in which smoke and flames exist at the same time; the calculation amount is reduced by improving a C3k2 module in a YOLOv11 model backbone network, the model response speed is improved, hardware acceleration is carried out through TensorRT, and the forest fire detection precision and detection efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of forest fire recognition, and in particular to a forest fire recognition method based on improved YOLOv11. Background Art

[0002] Forest fire recognition is a technical means that uses video processing technology to monitor forest areas in real time and automatically identify fire conditions. The forest fire recognition system captures video images of forest areas through cameras, and uses image processing, computer vision, and artificial intelligence technologies to analyze and process images. The system can automatically identify features such as flames and smoke in the image, thereby achieving real-time monitoring and early warning of fire conditions.

[0003] YOLO (You Only Look Once) is a real-time target detection algorithm. Unlike traditional target detection methods, YOLO treats the target detection task as a single regression problem and directly predicts the bounding box and category probability from the input image. This method greatly improves the speed and accuracy of target detection. As the latest version of the YOLO algorithm, YOLOv11 can effectively identify fire and smoke in the forest through its model structure and optimization technology. For forest fire recognition, the forest fire recognition method based on YOLOv11 basically meets the needs, but there are still some shortcomings, as follows:

[0004] First, due to the limited forest fire recognition capability of the existing YOLOv11 model, the smoke recognition results are prone to low accuracy and incomplete positioning when the distance is far, the smoke concentration is small, or the flame area is small;

[0005] Second, the forest fire recognition method based on YOLOv11 is difficult to meet the high-precision requirements of the traditional forest fire recognition model in the complex background of the wild, especially when smoke and flames exist at the same time;

[0006] Third, since forest fire identification has real-time requirements, complex models will increase the complexity of calculations and the corresponding response time will be longer. Therefore, the forest fire identification model needs to have a faster response speed to meet the purpose of real-time warning.

[0007] Through the above analysis, it is found that the current forest fire recognition method based on YOLOv11 still has the shortcomings of insufficient detection accuracy, inaccurate positioning and slow response speed. Therefore, it is necessary to improve the existing YOLOv11 and design a forest fire recognition method based on improved YOLOv11. Summary of the invention

[0008] The purpose of the present invention is to propose a forest fire recognition method based on improved YOLOv11 in view of the shortcomings of the current forest fire recognition method based on YOLOv11, and improve the recognition accuracy of small targets by improving the convolution layer and the pooling layer of the YOLOv11 model, so as to ensure the detection accuracy and positioning integrity when the distance is far, the smoke concentration is small or the flame area is small; by improving the loss function in the YOLOv11 model, the regression samples are widely paid attention to, and the method has a higher accuracy rate in the complex scene where smoke and flame exist at the same time; by improving the C3k2 module in the backbone network of the YOLOv11 model, the amount of calculation is reduced, the model response speed is improved, and the hardware acceleration is performed through TensorRT, so as to improve the forest fire detection accuracy and detection efficiency.

[0009] The object of the present invention is achieved in that:

[0010] A forest fire recognition method based on improved YOLOv11 includes the following steps:

[0011] Step a, establishing a forest fire image dataset;

[0012] Step b, improving the YOLOv11 model, including: improving the convolution layer and pooling layer of the YOLOv11 model, improving the C3k2 module in the backbone network of the YOLOv11 model, and improving the loss function in the YOLOv11 model;

[0013] Step c, inputting the image data set into the improved YOLOv11 model for training, and obtaining a parameter file of the trained improved YOLOv11 model;

[0014] Step d: Use TensorRT for hardware acceleration optimization;

[0015] Step e: Use the trained improved YOLOv11 model to detect the forest fire video to obtain the detection results and the location information of the smoke and flames.

[0016] In the above-mentioned forest fire recognition method based on improved YOLOv11, step a is specifically: collecting forest fire videos and extracting them into images frame by frame, then resizing the images, and expanding the sample capacity by horizontally flipping them, and finally marking the smoke and flames in the images.

[0017] In the above-mentioned forest fire recognition method based on improved YOLOv11, in step b, the convolution layer and pooling layer of the improved YOLOv11 model are specifically: the stride convolution and pooling layer of the convolution layer in the YOLOv11 model are replaced by a space-to-depth layer and a non-stride convolution layer; the space-to-depth layer downsamples the feature map while retaining all information in the channel dimension. For any intermediate feature map X, the space-to-depth layer divides the intermediate feature map X into a series of sub-feature maps according to an appropriate ratio, and the sub-feature maps downsample the original intermediate feature map X, and then splice these sub-feature maps along the channel dimension to obtain a feature map X', wherein the spatial dimension of the feature map X' is reduced while the channel dimension increases by the square of the multiple of the spatial dimension reduction; the non-stride convolution layer converts the feature map X' by adding a non-stride convolution layer after the space-to-depth feature conversion layer, thereby retaining all discriminant feature information as much as possible.

[0018] The above-mentioned forest fire recognition method based on improved YOLOv11, in step b, the C3k2 module in the backbone network of the YOLOv11 model is specifically improved as follows: all C3k2 modules in the backbone network are deleted and replaced with shuffleNet v1 modules, and then a channel separation operation is introduced on the basis of the shuffleNet v1 module. The channel separation operation divides the channel of the feature map into two branches at the beginning of each unit, sets c'=c / 2, and divides the number of channels c of the input feature map into two parts, branch A and branch B; the branch A contains c-c' channels, and the branch B contains c' channels; the branch B is processed using a three-layer convolution operation, in which each layer has the same number of input and output channels to maintain a balance of channels; the branch A remains unchanged; the processed branch A and the branch B are connected to generate a new feature map; after the connection, a channel shuffle operation is used to realize information interaction; through the channel separation operation, the amount of calculation is reduced while ensuring accuracy, and the model calculation efficiency is improved.

[0019] The above-mentioned forest fire recognition method based on improved YOLOv11, in step b, improves the loss function in the YOLOv11 model by: improving the original loss parameters, introducing parameters d and u to adjust the attention to different regression samples, and the loss definition of the improved loss function is IoU'

[0020] L IoU' = -α(1-IoU) d ln(IoU) (u-IoU)

[0021] Where α is the balancing factor, IoU is the interaction ratio between the predicted box and the true box, d and u are adjustable parameters used to control the attention paid to different IoU values, ln is the logarithm operation with e as the base, and e is a constant;

[0022] The IoU' loss definition is applied to the bounding box regression loss function and combined with the GIoU loss function, DIoU loss function and CIoU loss function, according to the following formula:

[0023] L GIoU' = -α(1-GIoU) d ·ln(GIoU)·(u-GIoU)

[0024] L DIoU' = -α(1-DIoU) d ·ln(DIoU)·(u-DIoU)

[0025] L CIoU' = -α(1-CIoU) d ln(CIoU) (u-CIoU)

[0026] Get L GIoU' , L DIoU' and L CIoU' .

[0027] In the above-mentioned forest fire recognition method based on improved YOLOv11, the step d specifically includes:

[0028] Step d1, exporting the improved YOLOv11 model trained in step c from PyTorch as an ONNX file;

[0029] Step d2: Use TensorRT to parse the ONNX file, create a network definition, and perform layer fusion and weight quantization optimization operations;

[0030] Step d3, build the TensorRT engine;

[0031] Step d4, load the TensorRT engine and create an execution context;

[0032] Step d5, allocating memory buffers for input and output;

[0033] Step d6: Copy the input data to the GPU, perform inference, and copy the output results from the GPU back to the host.

[0034] Step d1 specifically includes:

[0035] Step d1-1, use torchvision.models to load the improved YOLOv11 model in step b, and set the improved YOLOv11 model to evaluation mode;

[0036] Step d1-2, create a random input tensor of shape (1,3,24,24);

[0037] Step d1-3, use torch.onnx.export to export the improved YOLOv11 model as an ONNX file named improved_YOLOv11.onnx.

[0038] Step d2 specifically includes:

[0039] Step d2-1, initialize the TensorRT logger;

[0040] Step d2-2, define a build_engine function, which receives the ONNX file path and input shape as parameters;

[0041] Step d2-3, inside the build_engine function, create the TensorRT builder, network, and parser;

[0042] Step d2-4, read and parse ONNX file;

[0043] Step d2-5, set the network input shape.

[0044] Step d5 specifically includes:

[0045] Step d5-1, define an allocate_buffers function, wherein the allocate_buffers function allocates input and output host and device memory;

[0046] Step d5-2: traverse all bindings of the engine, calculate the memory size of each binding, and allocate the corresponding host and device memory.

[0047] Step d6 specifically includes:

[0048] Step d6-1, define an infer function, wherein the infer function receives an execution context, a binding, an input, an output, and a stream as parameters;

[0049] Step d6-2, copy input data from the host to the device and perform inference asynchronously;

[0050] Step d6-3, copy the output data from the device back to the host and synchronize the CUDA stream to ensure that the inference is complete;

[0051] Step d6-4, create a random input data and copy it to the input buffer;

[0052] Step d6-5: Call the infer function to perform inference and print the output results.

[0053] The beneficial effects of the forest fire identification method based on improved YOLOv11 of the present invention are:

[0054] First, by replacing the strided convolution and pooling layers in the convolutional layers of the YOLOv11 model with space-to-depth layers and non-strided convolutional layers, the model has better performance when processing small targets and low-resolution images. In scenes with long distances, low smoke concentrations, and small flame areas, the recognition accuracy is improved, and smoke and flames can be recognized more accurately and completely.

[0055] Second, the improved loss function is used to focus on different regression samples. The IoU' loss function not only focuses on the bounding box regression of simple samples, but also pays more attention to the bounding box regression of difficult samples in the detection tasks with a high proportion of difficult samples, thereby improving the accuracy of the detector in complex sample detection, and having a higher accuracy in complex scenes where smoke and flames coexist;

[0056] Third, the C3k2 module in the backbone network of the YOLOv11 model was improved, and the shuffleNet v1 module that introduced the channel separation operation was used instead of channel division to build an efficient network. At the same time, TensorRT was used for hardware acceleration to reduce the computational complexity and memory usage of the model while ensuring accuracy, thereby improving the response speed of the model and meeting the requirements of real-time forest fire warning. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 The figure is a flow chart of the forest fire recognition method based on improved YOLOv11 of the present invention.

[0058] Figure 2 Comparison of the test results of the method of the present invention and the prior art in a scene with a long distance Figure 1 .

[0059] Figure 3 Comparison of the test results of the method of the present invention and the prior art in a scene with a long distance Figure 2 .

[0060] Figure 4 Comparison of test results between the method of the present invention and the prior art in a scene with low smoke concentration Figure 1 .

[0061] Figure 5 Comparison of test results between the method of the present invention and the prior art in a scene with low smoke concentration Figure 2 .

[0062] Figure 6 This is a comparison chart of the test results of the method of the present invention and the prior art in a scene with a small flame area.

[0063] Figure 7 It is a comparison chart of the test results of the method of the present invention and the prior art in a scene where smoke and flame areas exist simultaneously. DETAILED DESCRIPTION

[0064] The specific implementation modes of the present invention are further described in detail below with reference to the accompanying drawings. Specific implementation method 1

[0066] The following is a theoretical implementation of the forest fire recognition method based on the improved YOLOv11 of the present invention.

[0067] The forest fire recognition method based on improved YOLOv11 in this specific implementation method is as follows: Figure 1 As shown, the method includes the following steps: a. establishing a forest fire image dataset; b. improving the YOLOv11 model, including: improving the convolution layer and the pooling layer of the YOLOv11 model, improving the C3k2 module in the backbone network of the YOLOv11 model, and improving the loss function in the YOLOv11 model; c. inputting the image dataset into the improved YOLOv11 model for training to obtain a parameter file of the trained improved YOLOv11 model; d. using TensorRT for hardware acceleration optimization; and e. detecting the forest fire video to be detected by the trained improved YOLOv11 model to obtain the detection result and the location information of the smoke and the flame.

[0068] In the step a, establishing a forest fire image data set specifically includes: using Python language to extract the collected forest fire video frame by frame as pictures, and saving them in the data set, performing image preprocessing and sample amplification on the extracted pictures and the received forest fire images, the preprocessing and sample amplification include adjusting the size of the image, flipping the image horizontally, and annotating the smoke and flames in the image by a manual annotation method, the annotation content includes two types of smoke and flames, in the annotation process, removing low-quality data, duplicate data and wrongly annotated data, and dividing the data into a training set, a validation set and a test set in a ratio of 8:1:1;

[0069] In the step b, the specific improvement is to replace the stride convolution and pooling layer of the convolution layer in the YOLOv11 model with a space-to-depth layer and a non-stride convolution layer; the space-to-depth layer downsamples the feature map while retaining all information in the channel dimension. For any intermediate feature map X, the space-to-depth layer divides the intermediate feature map X into a series of sub-feature maps according to an appropriate ratio, and the sub-feature maps downsample the original intermediate feature map X. Then, these sub-feature maps are spliced ​​along the channel dimension to obtain a feature map X', and while the spatial dimension of the feature map X' is reduced, the channel dimension increases by the square of the reduction factor of the spatial dimension; the non-stride convolution layer converts the feature map X' by adding a non-stride convolution layer after the space-to-depth feature conversion layer, so as to retain all discriminant feature information as much as possible.

[0070] The step b of improving the C3k2 module in the backbone network of the YOLOv11 model is specifically as follows: all C3k2 modules in the backbone network are deleted and replaced with shuffleNet v1 modules, and then a channel separation operation is introduced based on the shuffleNet v1 module. At the beginning of each unit, the channel of the feature map is divided into two branches, c'=c / 2 is set, and the number of channels c of the input feature map is divided into two parts, branch A and branch B; branch A contains c-c' channels, and branch B contains c' channels; branch B is processed using a three-layer convolution operation, in which each layer has the same number of input and output channels to maintain a balance of channels; branch A remains unchanged; the processed branch A and branch B are connected to generate a new feature map; after the connection, a channel shuffle operation is used to realize information interaction; through the channel separation operation, the amount of calculation is reduced while ensuring accuracy, and the model calculation efficiency is improved.

[0071] The loss function in the improved YOLOv11 model in step b is specifically: improving the original loss parameters, introducing parameters d and u to adjust the attention to different regression samples, and the loss definition IoU' of the improved loss function:

[0072] L IoU' = -α(1-IoU) d ln(IoU) (u-IoU)

[0073] Where α is the balancing factor, IoU is the interaction ratio between the predicted box and the true box, d and u are adjustable parameters used to control the attention paid to different IoU values, ln is the logarithm operation with e as the base, and e is a constant;

[0074] The IoU' loss definition is applied to the bounding box regression loss function and combined with the GIoU loss function, DIoU loss function and CIoU loss function, according to the following formula:

[0075] L GIoU' = -α(1-GIoU) d ·ln(GIoU)·(u-GIoU)

[0076] L DIoU' = -α(1-DIoU) d ·ln(DIoU)·(u-DIoU)

[0077] L CIoU' = -α(1-CIoU) d ln(CIoU) (u-CIoU)

[0078] Get L GIoU' , L DIoU' and L CIoU' .

[0079] The step c uses the image data set in the step a to train the improved YOLOv11 model in the step b, and inputs the preprocessed image data set into the improved YOLOv11 model. The training set is used for model training, and the validation set is used to monitor the model performance during the training process. During the training process, the validation set is used to evaluate the model after each training of a certain number of batches (such as every 1000 batches). The loss value, precision and recall rate on the validation set are recorded. The hyperparameters are adjusted according to the performance of the validation set. The training is completed when the set training rounds are reached, and the trained improved YOLOv11 model is obtained. Finally, the model is tested with the test set, and each frame of the image in the test set is input into the model, and the detection results, including the identified flame and smoke positions, are recorded and output. Various performance indicators on the test set are calculated, including precision, recall, F1 score and mean average precision (mAP), to objectively evaluate the performance of the model.

[0080] The step d specifically comprises:

[0081] Step d1: Export the improved YOLOv11 model trained in step c from PyTorch as an ONNX file; specifically:

[0082] Step d1-1 uses torchvision.models to load the improved YOLOV11 model in step 2 and sets it to evaluation mode;

[0083] Step d1-2 creates a random input tensor of shape (1, 3, 24, 24);

[0084] Step d1-3 uses torch.onnx.export to export the model as an ONNX file named improved_YOLOv11.onnx.

[0085] Step d2: Use TensorRT to parse the ONNX file, create a network definition, and perform layer fusion and weight quantization optimization operations; specifically:

[0086] Step d2-1 initializes the TensorRT logger;

[0087] Step d2-2 defines a function build_engine, which receives the ONNX file path and input shape as parameters;

[0088] Step d2-3 creates the TensorRT builder, network, and parser inside the function;

[0089] Step d2-4 reads and parses the ONNX file;

[0090] Step d2-5 sets the network input shape.

[0091] Step d3, build the TensorRT engine;

[0092] Step d4, load the TensorRT engine and create an execution context;

[0093] Step d5: Allocate memory buffers for input and output; specifically:

[0094] Step d5-1 defines a function allocate_buffers, which allocates host and device memory for input and output;

[0095] Step d5-2 traverses all bindings of the engine, calculates the memory size of each binding, and allocates the corresponding host and device memory.

[0096] Step d6: copy the input data to the GPU, perform inference, and copy the output results from the GPU back to the host; specifically:

[0097] Step d6-1 defines a function infer that receives execution context, binding, input, output, and stream as parameters;

[0098] Step d6-2 copies the input data from the host to the device and performs inference asynchronously;

[0099] Step d6-3 copies the output data from the device back to the host and synchronizes the CUDA stream to ensure that the inference is complete;

[0100] Step d6-4 creates a random input data and copies it to the input buffer;

[0101] Step d6-5 calls the infer function to perform inference and prints the output results.

[0102] The step e specifically comprises:

[0103] Step e1: Input the forest fire video to be detected into the trained improved YOLOv11 model; specifically:

[0104] Step e1-1 loads the forest fire video to be detected from the storage device;

[0105] Step e1-2 uses a video decoder to decode the video into a series of frame images;

[0106] Step e1-3 extracts images from the video frame by frame and prepares to input them into the model for detection;

[0107] Step e2 uses the improved convolutional neural network to extract and fuse features of the forest fire video to be detected; specifically includes:

[0108] Step e2-1 inputs each frame of the image into the improved convolutional neural network (CNN) to extract high-level features of the image;

[0109] Step e2-2 extracts local features of the image by adding an improved SPD layer and a non-strided convolutional neural network, reducing the size of the feature map while retaining important information;

[0110] Step e2-3 performs feature fusion between different layers of the network to capture multi-scale feature information;

[0111] Step e3 generates a predicted bounding box through the improved lightweight backbone network. The bounding box includes the bounding box position, category name and confidence level. Specifically, it includes:

[0112] Step e3-1 uses the lightweight backbone network of the Shuffle_Block module to reduce the computational complexity and memory usage of the model;

[0113] Step e3-2 generates a predicted bounding box at the output layer of the backbone network;

[0114] Step e3-3 predicts the center coordinates and width and height of the bounding box;

[0115] Step e3-4 predicts the category of the object within the bounding box, such as "fire" or "smoke";

[0116] Step e3-5 predicts the confidence that the object in the bounding box belongs to a certain category;

[0117] Step e4 processes the bounding box to obtain smoke and flame information in the forest fire video; specifically includes:

[0118] Step e4-1 performs non-maximum suppression on the generated bounding boxes, removes redundant bounding boxes, and retains the bounding box with the highest confidence;

[0119] Step e4-2 sets a confidence threshold and filters out bounding boxes with confidence values ​​lower than the threshold to ensure the reliability of the detection results;

[0120] Step e4-3 outputs the processed bounding box information, including the location, category name, and confidence level of the bounding box;

[0121] Step e4-4 visualizes the detection results, marks the detected flames and smoke on the original video frame, and displays their positions and confidence levels. Specific implementation method 2

[0123] The following is an experimental verification implementation of the forest fire recognition method based on the improved YOLOv11 of the present invention.

[0124] In order to verify that the present invention has a more superior effect, the forest fire recognition method based on the improved YOLOv11 of the present invention is compared with the traditional forest fire recognition method based on YOLOv11, as follows:

[0125] Experiment 1: In a scene with a long distance, the improved model of the present invention is compared with the experimental structure of the original model to obtain a comparison chart, such as Figure 2 , Figure 3 As shown, Figure 2 The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on the improved YOLOv11 of the present invention. The recognition result of the traditional forest fire recognition method based on YOLOv11 did not detect the smoke in the scene with a long distance, and the recognition result of the forest fire recognition method based on the improved YOLOv11 of the present invention detected the smoke in the scene with a long distance and had a higher confidence rate. It can be concluded that the forest fire recognition method based on the improved YOLOv11 of the present invention has higher accuracy in recognizing smoke in the scene with a long distance than the traditional forest fire recognition method based on YOLOv11.

[0126] Figure 3The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention. In the recognition result of the traditional forest fire recognition method based on YOLOv11, the recognition result positioning of the smoke in the scene with a long distance is incomplete and the confidence rate is low. In the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention, the smoke recognition result positioning in the scene with a long distance is complete and the confidence rate is high. It can be concluded that the forest fire recognition method based on improved YOLOv11 of the present invention is more complete in the positioning of the smoke recognition result in the scene with a long distance than the traditional forest fire recognition method based on YOLOv11.

[0127] From the above experimental comparison results, it can be concluded that the forest fire recognition method based on the improved YOLOv11 of the present invention is more complete and has higher accuracy in smoke recognition result positioning in scenes with a long distance than the traditional forest fire recognition method based on YOLOv11.

[0128] Experiment 2: In a scene with low smoke concentration, the improved model of the present invention is compared with the experimental structure of the original model to obtain a comparison chart, such as Figure 4 , Figure 5 As shown, Figure 4 The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention. The recognition result of the traditional forest fire recognition method based on YOLOv11 only recognizes the flame, and does not detect the smoke with a lower concentration. The recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention successfully recognizes both the flame and the smoke with a lower concentration. It can be concluded that the forest fire recognition method based on improved YOLOv11 of the present invention has higher accuracy in recognizing smoke in scenes with low smoke concentrations than the traditional forest fire recognition method based on YOLOv11.

[0129] Figure 5 The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention. In the recognition result of the traditional forest fire recognition method based on YOLOv11, the recognition result positioning of the smoke is incomplete in the scene with low smoke concentration. In the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention, the smoke recognition result positioning in the smoke density scene is complete, and has a higher confidence rate than the recognition result of the traditional forest fire recognition method based on YOLOv11. It can be concluded that the forest fire recognition method based on improved YOLOv11 of the present invention is more complete in positioning the smoke recognition result in the scene with low smoke concentration, and has a higher confidence rate than the traditional forest fire recognition method based on YOLOv11.

[0130] From the above experimental comparison results, it can be concluded that the forest fire recognition method based on the improved YOLOv11 of the present invention is more complete and has higher accuracy in smoke recognition result positioning in scenes with low smoke concentration than the traditional forest fire recognition method based on YOLOv11.

[0131] Experiment 3: In a scenario with a small flame area, the improved model of the present invention is compared with the experimental structure of the original model to obtain a comparison chart, such as Figure 6 As shown, Figure 6 The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention. The recognition result of the traditional forest fire recognition method based on YOLOv11 only recognizes the flame on the left and the smoke on the right, and does not recognize the flame with a smaller area under the smoke on the right. The recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention not only recognizes the flame on the left but also recognizes the flame with a smaller area on the right, and recognizes the smoke on the right. Compared with the recognition results of the traditional forest fire recognition method based on YOLOv11, the recognition results of the smoke and flame have a higher confidence rate. It can be concluded that the forest fire recognition method based on improved YOLOv11 of the present invention has higher accuracy in recognizing flames in scenes with small flame areas than the traditional forest fire recognition method based on YOLOv11.

[0132] Experiment 4: In a scene where smoke and flame exist at the same time, the improved model of the present invention is compared with the experimental structure of the original model, and a comparison chart is obtained, as shown in FIG. Figure 7 As shown, Figure 7 The left side is the recognition result of the traditional forest fire recognition method based on YOLOv11, and the right side is the recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention. The recognition result of the traditional forest fire recognition method based on YOLOv11 only recognizes the smoke above, the flame at the lower left corner of the smoke and the flame below the smoke, and does not recognize the flame in the area of ​​​​the smoke. The recognition result of the forest fire recognition method based on improved YOLOv11 of the present invention not only recognizes the smoke above, the flame at the lower left corner of the smoke and the flame below the smoke, but also recognizes the flame in the smoke. Compared with the recognition results of the traditional forest fire recognition method based on YOLOv11, the recognition results of the smoke and flame have a higher confidence rate. It can be concluded that the forest fire recognition method based on improved YOLOv11 of the present invention has higher accuracy than the traditional forest fire recognition method based on YOLOv11 in the scene where smoke and flame exist at the same time.

[0133] In the above four experiments, the algorithm time was also monitored. The forest fire recognition method based on the improved YOLOv11 of the present invention took less time than the traditional forest fire recognition method based on YOLOv11. It can be concluded that the present invention improves the response speed of the model by reducing the calculation amount and memory usage of the model, thereby meeting the requirements of real-time forest fire warning.

[0134] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any modifications, equivalent substitutions and improvements made by any technician familiar with the technical field within the technical scope disclosed by the present invention and within the spirit and principles of the present invention should be covered within the protection scope of the present invention.

Claims

1. A forest fire recognition method based on improved YOLOv11, characterized in that: The following steps are involved: Step a, establishing a forest fire image dataset; Step b, improving the YOLOv11 model, including: improving the convolution layer and pooling layer of the YOLOv11 model, improving the C3k2 module in the backbone network of the YOLOv11 model, and improving the loss function in the YOLOv11 model; Step c, inputting the image data set into the improved YOLOv11 model for training, and obtaining a parameter file of the trained improved YOLOv11 model; Step d: Use TensorRT for hardware acceleration optimization; Step e: Use the trained improved YOLOv11 model to detect the forest fire video to obtain the detection results and the location information of the smoke and flames.

2. A forest fire identification method based on improved YOLOv11 according to claim 1, characterized in that: The step a specifically includes: collecting forest fire videos and extracting them into images frame by frame, then resizing the images, and expanding the sample capacity by horizontally flipping them, and finally marking the smoke and flames in the images.

3. A forest fire identification method based on improved YOLOv11 according to claim 1, characterized in that: In step b, the convolution layer and pooling layer of the YOLOv11 model are improved as follows: the stride convolution and pooling layer of the convolution layer in the YOLOv11 model are replaced by a space-to-depth layer and a non-stride convolution layer; the space-to-depth layer downsamples the feature map while retaining all information in the channel dimension. For any intermediate feature map X, the space-to-depth layer divides the intermediate feature map X into a series of sub-feature maps according to an appropriate ratio, and the sub-feature maps downsample the original intermediate feature map X, and then splice these sub-feature maps along the channel dimension to obtain a feature map X', wherein the spatial dimension of the feature map X' is reduced while the channel dimension increases by the square of the multiple of the spatial dimension reduction; the non-stride convolution layer converts the feature map X' by adding a non-stride convolution layer after the space-to-depth feature conversion layer, thereby retaining all discriminant feature information as much as possible.

4. The forest fire identification method based on improved YOLOv11 according to claim 1, characterized in that: In step b, the C3k2 module in the backbone network of the YOLOv11 model is improved as follows: all C3k2 modules in the backbone network are deleted and replaced with shuffleNet v1 modules, and then a channel separation operation is introduced based on the shuffleNet v1 module. The channel separation operation divides the channel of the feature map into two branches at the beginning of each unit, sets c'=c / 2, and divides the number of channels c of the input feature map into two parts, branch A and branch B; the branch A contains c-c' channels, and the branch B contains c' channels; the branch B is processed using a three-layer convolution operation, in which each layer has the same number of input and output channels to maintain a balance of channels; the branch A remains unchanged; the processed branch A and the branch B are connected to generate a new feature map; after the connection, a channel shuffle operation is used to realize information interaction; through the channel separation operation, the amount of calculation is reduced while ensuring accuracy, and the model calculation efficiency is improved.

5. The forest fire identification method based on improved YOLOv11 according to claim 1, characterized in that: In step b, the loss function in the YOLOv11 model is improved by: improving the original loss parameters, introducing parameters d and u to adjust the attention to different regression samples, and the loss definition of the improved loss function is IoU' L IoU' =-α(1-IoU) d ·ln(IoU)·(u-IoU) Where α is the balancing factor, IoU is the interaction ratio between the predicted box and the true box, d and u are adjustable parameters used to control the attention paid to different IoU values, ln is the logarithm operation with e as the base, and e is a constant; The IoU' loss definition is applied to the bounding box regression loss function and combined with the GIoU loss function, DIoU loss function and CIoU loss function, according to the following formula: L GIoU' =-α(1-GIoU) d ·ln(GIoU)·(u-GIoU) L DIoU' =-α(1-DIoU) d ·ln(DIoU)·(u-DIoU) L CIoU' =-α(1-CIoU) d ·ln(CIoU)·(u-CIoU) Get L GIoU' , L DIoU' and L CIoU' .

6. The forest fire identification method based on improved YOLOv11 according to claim 1, characterized in that: The step d specifically comprises: Step d1, exporting the improved YOLOv11 model trained in step c from PyTorch as an ONNX file; Step d2: Use TensorRT to parse the ONNX file, create a network definition, and perform layer fusion and weight quantization optimization operations; Step d3, build the TensorRT engine; Step d4, load the TensorRT engine and create an execution context; Step d5, allocating memory buffers for input and output; Step d6: Copy the input data to the GPU, perform inference, and copy the output results from the GPU back to the host.

7. The forest fire identification method based on improved YOLOv11 according to claim 6, characterized in that: Step d1 specifically includes: Step d1-1, use torchvision.models to load the improved YOLOv11 model in step b, and set the improved YOLOv11 model to evaluation mode; Step d1-2, create a random input tensor of shape (1,3,24,24); Step d1-3, use torch.onnx.export to export the improved YOLOv11 model as an ONNX file named improved_YOLOv11.onnx.

8. The forest fire identification method based on improved YOLOv11 according to claim 6, characterized in that: Step d2 specifically includes: Step d2-1, initialize the TensorRT logger; Step d2-2, define a build_engine function, which receives the ONNX file path and input shape as parameters; Step d2-3, inside the build_engine function, create the TensorRT builder, network, and parser; Step d2-4, read and parse ONNX file; Step d2-5, set the network input shape.

9. The forest fire identification method based on improved YOLOv11 according to claim 6, characterized in that: Step d5 specifically includes: Step d5-1, define an allocate_buffers function, wherein the allocate_buffers function allocates input and output host and device memory; Step d5-2: traverse all bindings of the engine, calculate the memory size of each binding, and allocate the corresponding host and device memory.

10. The forest fire identification method based on improved YOLOv11 according to claim 6, characterized in that: Step d6 specifically includes: Step d6-1, define an infer function, wherein the infer function receives an execution context, a binding, an input, an output, and a stream as parameters; Step d6-2, copy input data from the host to the device and perform inference asynchronously; Step d6-3, copy the output data from the device back to the host and synchronize the CUDA stream to ensure that the inference is complete; Step d6-4, create a random input data and copy it to the input buffer; Step d6-5: Call the infer function to perform inference and print the output results.

Citation Information

Cited By

  • Forest fire identification method based on image generation and staged training

    CN121053609A

  • A forest fire recognition method based on image generation and stage-by-stage training

    CN121053609B

  • Forest fire identification method, system and device based on edge calculation and medium

    CN121305379A