A smoke and fire detection method based on enhanced YOLO algorithm
Patent Information
- Application Number
- CN202610774486.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-01
- Publication Date
- 2026-08-18
AI Technical Summary
[0005]本发明的目的是提供一种基于增强YOLO算法的烟雾和火灾检测方法,通过对YOLO算法的特征提取模块、特征融合模块、损失函数、样本优化策略进行创新性设计,解决现有方法对早期烟雾漏检率高、火灾误检率高、复杂环境适应性差、小目标检测效果不佳的问题,实现烟雾和火灾的精准、实时检测
本发明设计融合时空特征的混合数据增强策略,针对烟雾流动性、火灾动态性特点,实现动态纹理增强、多尺度自适应裁剪等处理,解决传统数据增强导致的特征失真问题,同时提升小目标样本和复杂环境样本的利用率,为模型训练提供高质量样本支撑;
Smart Images

Figure CN122598071A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fire safety detection technology, specifically to a smoke and fire detection method based on the enhanced YOLO algorithm. Background Technology
[0002] Fire is a major disaster threatening human life, property, and the ecological environment. Timely detection of early smoke and fire is crucial to curbing the spread of fire and reducing disaster losses. Traditional smoke and fire detection methods are mainly divided into two categories: one is sensor-based detection methods, which have drawbacks such as limited detection range, susceptibility to environmental interference, response delay, and inability to locate the fire, especially in open environments where their applicability is extremely poor; the other is traditional computer vision-based detection methods, which extract artificial features such as color, texture, and shape from images and combine them with classifiers to achieve detection. However, these methods have weak adaptability to complex environments, and their detection accuracy and real-time performance are insufficient to meet the needs of practical applications.
[0003] In recent years, deep learning-based target detection algorithms have been increasingly applied to smoke and fire detection due to their advantages of end-to-end detection, strong real-time performance, and high detection accuracy. However, existing detection methods based on the YOLO algorithm still have the following shortcomings: First, smoke is mobile, diffuse, and irregular in shape, and early smoke has low concentration and light color, with high similarity to the environmental background, resulting in insufficient feature extraction ability of the algorithm for early smoke and a high false negative rate; Second, the color and shape of fire flames change with the burning material and combustion stage, and are easily interfered with by environmental factors such as strong light and shadow, limiting the algorithm's ability to distinguish flame features and making false detections easy; Third, the feature fusion mechanism of the traditional YOLO algorithm is imperfect, making it difficult to fully utilize feature information at different scales, resulting in poor detection performance for small target smoke and distant fires; Fourth, the algorithm lacks robustness in complex environments, and its detection performance fluctuates greatly.
[0004] Therefore, designing an enhanced YOLO algorithm smoke and fire detection method that is innovative, takes into account detection accuracy, real-time performance, and environmental adaptability has become an urgent technical problem to be solved. Summary of the Invention
[0005] The purpose of this invention is to provide a smoke and fire detection method based on the enhanced YOLO algorithm. By innovatively designing the feature extraction module, feature fusion module, loss function, and sample optimization strategy of the YOLO algorithm, this invention solves the problems of high false negative rate of early smoke detection, high false positive rate of fire detection, poor adaptability to complex environments, and poor detection effect of small targets in existing methods, thereby achieving accurate and real-time detection of smoke and fire.
[0006] To solve the above-mentioned technical problems, the technical solution provided by the present invention is: a smoke and fire detection method based on the enhanced YOLO algorithm, comprising the following steps: Step 1: Construct a multi-scenario sample dataset of smoke and fire, and perform innovative data augmentation processing. 1.1 Sample Collection and Labeling: Smoke images, fire images, and interference images were collected from different indoor and outdoor scenes and under different environmental conditions to ensure that the samples covered different smoke concentrations and different stages of fire combustion, with a sample size of no less than 10,000 images. The LabelImg tool was used to label the samples, with the labeling categories being "smoke" and "fire". The labeling format adopted the txt format of the YOLO algorithm standard, clearly defining the target bounding box coordinates and category labels to construct the initial sample dataset.
[0007] 1.2 Innovative Data Augmentation: Based on the characteristics of smoke and fire, a hybrid data augmentation strategy integrating spatiotemporal features is designed to avoid feature distortion caused by traditional data augmentation. Specifically, this includes: (1) Dynamic texture enhancement: Based on the fluidity characteristics of smoke, dynamic texture perturbation is applied to the smoke sample. By randomly adjusting the pixel grayscale value and contrast of the smoke area, the texture changes during the smoke diffusion process are simulated. At the same time, the core texture features of the smoke are preserved to avoid confusion with interference after enhancement. (2) Multi-scale adaptive cropping: Based on the size of smoke and fire targets in the sample, the cropping ratio is adaptively adjusted to target and crop small target smoke and distant fire samples, thereby increasing the feature ratio of small target samples and solving the problem of poor detection effect of small targets; (3) Environmental adaptive perturbation: Simulate complex environments such as low light, rain, and fog, randomly adjust the brightness of the samples, add Gaussian noise, and fog the samples. At the same time, introduce environmental feature labels to enable the model to learn the feature differences of smoke and fire in different environments and improve the model's environmental adaptability. (4) Cross-scene sample fusion: Smoke and fire samples from different scenes are fused and spliced with environmental background samples to simulate the coexistence of smoke, fire and complex background in real scenes and enhance the model’s anti-interference ability against complex backgrounds. 1.3 Dataset partitioning: The enhanced sample dataset is divided into training set, validation set and test set in a ratio of 7:2:1 for model training, validation and performance testing.
[0008] Step 2: Design the enhanced YOLO algorithm network structure Based on the YOLO algorithm, an enhanced network structure is constructed, comprising a "feature extraction module, a feature enhancement and fusion module, and a detection head module," as detailed below: 2.1 Feature Extraction Module: An improved CSP-GELAN structure is adopted as the backbone network to replace the traditional YOLO CSPDarknet or C2f module. Specifically, the improvements are as follows: a dynamic channel adjustment mechanism is added to the cross-stage connections of the GELAN module to adaptively adjust the weights of each channel according to the feature complexity of the input samples, thereby enhancing the ability to extract weak features of smoke and fire; at the same time, an improved BatchNorm layer is added after each convolutional layer of the backbone network, introducing an adaptive momentum adjustment factor to improve the stability and convergence speed of model training and avoid gradient vanishing or gradient exploding problems.
[0009] 2.2 Feature Enhancement and Fusion Module: A "bidirectional cross-scale feature enhancement + multimodal fusion" structure is designed to address the problems of scale information loss and low feature utilization in traditional feature fusion. Specifically, it includes: (1) Bidirectional cross-scale feature enhancement unit: Construct bidirectional feature transfer paths from top to bottom and from bottom to top, transfer high-level semantic features from top to bottom and low-level detail features from bottom to top; Add attention enhancement unit to each path, and highlight the core features of smoke and fire and suppress background interference features by calculating the channel attention and spatial attention weights of the feature map. (2) Multimodal feature fusion unit: The texture features of smoke, the spectral features of fire and the spatial features of the image are fused together. The weights of the three features are dynamically adjusted through a learnable gating mechanism to achieve complementarity of different features and improve the model’s ability to distinguish between smoke and fire. (3) Feature Refinement Unit: The fused feature map is refined by convolution. 1×1 convolution is used to reduce the feature dimension and reduce the amount of computation. At the same time, 3×3 convolution is used to enhance the continuity of features and avoid information distortion in the feature fusion process.
[0010] 2.3 Detection Head Module: An improved Anchor-Free detection head is adopted to replace the traditional YOLO Anchor-Based detection head, avoiding the hyperparameter dependency and poor adaptability issues caused by Anchor box settings. The detection head is divided into three scales, corresponding to small target smoke, medium-sized smoke / fire, and large target fire, respectively. Each detection head simultaneously outputs the bounding box coordinates, class probability, and confidence score of the target. A dynamic threshold adjustment unit is added to the output layer of the detection head to adaptively adjust the confidence threshold according to the environmental feature labels of the sample, reducing false detections and false negatives in complex environments.
[0011] Step 3: Design an innovative loss function To address the unique characteristics of smoke and fire detection, a hybrid loss function integrating category loss, localization loss, and confidence loss is designed to resolve issues such as imbalanced positive and negative samples and low bounding box regression accuracy. The details are as follows: ;in, , , These are the weight coefficients for the category loss, localization loss, and confidence loss, respectively, which are adaptively adjusted according to the training process (initial values are set to 1.0, 1.5, and 0.8, respectively). (1) Class loss An improved Varifocal Loss is adopted, which introduces a class weight factor. The loss weights of the two classes of samples are dynamically adjusted according to the proportion of smoke and fire samples. At the same time, higher loss weights are assigned to high-quality positive samples to solve the training bias caused by class imbalance and differences in sample quality. (2) Positioning loss : Design an improved ShapeIoU Loss, which adds shape constraint factors for smoke and fire targets on the basis of traditional CIoU Loss. It optimizes the accuracy of bounding box regression and accelerates the model convergence speed by taking into account the irregular shape of smoke and the dynamic deformation of fire flames. (3) Confidence loss We employ cross-entropy loss with fusion focus loss and introduce a hard sample mining mechanism to automatically mine hard samples during training, thereby improving the model's ability to detect hard samples while suppressing interference from background samples.
[0012] Step 4: Model Training and Optimization 4.1 Training parameter settings: Input the enhanced training set from step 1 into the enhanced YOLO network designed in step 2, set the initial learning rate to 0.001, and adopt the cosine annealing learning rate decay strategy to avoid overfitting; set the batch size to 16, the training epochs to 100, and adopt the adaptive momentum optimizer to adaptively adjust the momentum parameters according to the gradient changes of the model training to improve training efficiency. 4.2 Phased Training Strategy: A two-stage training approach of "coarse training - fine tuning" is adopted. In the first stage, a larger learning rate is used to focus on training the model's ability to extract core features of smoke and fire, without introducing difficult sample mining. In the second stage, the learning rate is reduced and the difficult sample mining mechanism is enabled to focus on optimizing the model's detection accuracy for weak smoke, distant fires, and targets in complex environments. 4.3 Model Optimization: During training, the model's detection accuracy (mAP), false negative rate, false positive rate, and inference speed are monitored in real time using the validation set. When the model's performance on the validation set does not improve for 5 consecutive epochs, early stopping is adopted to stop training and avoid overfitting. At the same time, the model parameters are optimized through gradient pruning, weight regularization, and other methods to improve the model's generalization ability. After training is completed, the model with the best performance is saved as the final detection model.
[0013] Step 5: Real-time detection and early warning of smoke and fire 5.1 Real-time image acquisition: Real-time acquisition of scene images through surveillance cameras, conversion of acquired images to RGB format, adjustment of image size to 640×640, and simultaneous image preprocessing to remove redundant information in the image; 5.2 Model Inference Detection: The preprocessed image is input into the enhanced YOLO detection model trained in step 4. The model extracts features, fuses features, and infers from the detection head, outputting the bounding box coordinates, category, and confidence score of the target. Based on the confidence threshold output by the dynamic threshold adjustment unit of the detection head, valid detection results are selected and invalid detections are excluded. 5.3 Multi-level early warning: Based on the category and confidence level of the detection results, a three-level early warning mechanism is set up: (1) Level 1 warning (suspected smoke): When a smoke target is detected with a confidence level between 0.5 and 0.7, the system issues a warning to remind staff to conduct manual verification; (2) Level II warning (confirmed smoke): When a smoke target is detected with a confidence level ≥ 0.7, the system issues an audible and visual warning, and records the location, time and concentration of the smoke (calculated based on the confidence level), and pushes the warning information to relevant personnel; (3) Level 3 warning (fire): When a fire target (including smoke and fire coexisting) is detected, with a confidence level ≥ 0.6, the system issues an emergency audible and visual warning and automatically triggers the emergency linkage mechanism (such as starting the fire alarm system, shutting down relevant equipment, and pushing emergency instructions to the fire department). At the same time, it tracks the fire spread trend in real time and records the fire development process. 5.4 Results Feedback and Updates: Detection results and early warning information are stored in the database. The detection data is analyzed regularly. If false detections or missed detections occur, the corresponding samples are added to the training set to incrementally train the model, continuously optimize model performance, and improve detection accuracy.
[0014] The advantages of this invention compared to the prior art are: This invention designs a hybrid data augmentation strategy that integrates spatiotemporal features. Targeting the characteristics of smoke mobility and fire dynamics, it achieves dynamic texture enhancement, multi-scale adaptive cropping, and other processing to solve the feature distortion problem caused by traditional data augmentation. At the same time, it improves the utilization rate of small target samples and complex environment samples, and provides high-quality sample support for model training. This invention constructs an improved CSP-GELAN backbone network, incorporating a dynamic channel adjustment mechanism to enhance weak feature extraction capabilities; it designs a "bidirectional cross-scale feature enhancement + multimodal fusion" module to fully integrate high-level semantic features with low-level detail features, while also fusing texture, spectral, and spatial multimodal features to improve the model's ability to distinguish between smoke and fire; and it employs an improved Anchor-Free detection head to avoid anchor box hyperparameter dependence and improve detection adaptability. This invention designs a hybrid loss function that integrates improved Varifocal Loss, ShapeIoU Loss, and focus cross-entropy loss to solve the problems of imbalanced positive and negative samples, low bounding box regression accuracy, and poor detection performance of difficult samples, thereby accelerating model convergence and improving detection accuracy. This invention uses environmental adaptive data augmentation and dynamic threshold adjustment to enable the model to maintain stable detection performance in complex environments such as low light, rain, fog, and strong light. It is suitable for various indoor and outdoor scenarios and has a wide range of applications. This invention designs a three-level early warning mechanism, which combines confidence level to achieve three levels of early warning: suspected, confirmed, and emergency. At the same time, it triggers emergency response, which buys time for fire safety emergency response and reduces disaster losses. The enhanced YOLO network structure of this invention can be flexibly adapted to different types of monitoring equipment, while supporting incremental training. It can continuously optimize model performance according to changes in actual application scenarios, and has good scalability and practicality. Attached Figure Description
[0015] Figure 1 This is a flowchart of a smoke and fire detection method based on the enhanced YOLO algorithm according to the present invention. Detailed Implementation
[0016] Various exemplary embodiments of the present invention will now be described in detail with reference to the accompanying drawings. It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps set forth in these embodiments do not limit the scope of the present invention.
[0017] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0018] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, such techniques, methods, and equipment should be considered part of the specification.
[0019] In all examples shown and discussed herein, any specific values should be interpreted as merely exemplary and not as limitations. Therefore, other examples of exemplary embodiments may have different values.
[0020] The following detailed description, in conjunction with the accompanying drawings, illustrates a smoke and fire detection method based on the enhanced YOLO algorithm of the present invention.
[0021] Combined with appendix Figure 1 The specific implementation process of the smoke and fire detection method based on the enhanced YOLO algorithm of the present invention is as follows: A smoke and fire detection method based on the enhanced YOLO algorithm, characterized by the following steps: Step 1: Construct a multi-scenario sample dataset of smoke and fire, and perform innovative data augmentation processing. 1.1 Sample Collection and Labeling Collect images from various indoor and outdoor scenes, including factories, warehouses, forests, residential buildings, high-rise buildings, and tunnels; images under different environmental conditions, such as normal lighting, low lighting, rain, fog, strong light, and smoke in shadow; fire images, including images with both flames and smoke; and interfering images, such as clouds, dust, steam, lights, and red objects, which are prone to misjudgment. Ensure that the samples cover different concentrations of smoke and different stages of fire combustion, with a sample size of no less than 10,000 images. Use the LabelImg tool to label the samples, with the label categories being "smoke" and "fire". The label format adopts the YOLO algorithm standard txt format, clearly defining the target bounding box coordinates and category labels to construct the initial sample dataset.
[0022] 1.2 Innovative Data Enhancement To address the unique characteristics of smoke and fire, a hybrid data augmentation strategy incorporating spatiotemporal features is designed to avoid feature distortion caused by traditional data augmentation. This strategy includes: (1) Dynamic texture enhancement: Based on the fluidity characteristics of smoke, dynamic texture perturbation is applied to the smoke sample. By randomly adjusting the pixel grayscale value and contrast of the smoke area, the texture changes during the smoke diffusion process are simulated. At the same time, the core texture features of the smoke are preserved to avoid confusion with interference after enhancement. (2) Multi-scale adaptive cropping: Based on the size of smoke and fire targets in the sample, the cropping ratio is adaptively adjusted to target and crop small target smoke and distant fire samples, thereby increasing the feature ratio of small target samples and solving the problem of poor detection effect of small targets; (3) Environmental adaptive perturbation: Simulate complex environments such as low light, rain, and fog, randomly adjust the brightness of the samples, add Gaussian noise, and fog the samples. At the same time, introduce environmental feature labels to enable the model to learn the feature differences of smoke and fire in different environments and improve the model's environmental adaptability. (4) Cross-scene sample fusion: Smoke and fire samples from different scenes are fused and spliced with environmental background samples to simulate the coexistence of smoke, fire and complex background in real scenes and enhance the model’s ability to resist interference from complex backgrounds.
[0023] 1.3 Dataset Partitioning The enhanced sample dataset was divided into training, validation, and test sets in a 7:2:1 ratio for model training, validation, and performance testing.
[0024] Step 2: Design the enhanced YOLO algorithm network structure Based on the YOLO algorithm, an enhanced network structure is constructed, comprising a "feature extraction module, a feature enhancement and fusion module, and a detection head module," as detailed below: 2.1 Feature Extraction Module An improved CSP-GELAN structure is adopted as the backbone network to replace the traditional YOLO CSPDarknet or C2f modules. Specifically, the improvements are as follows: a dynamic channel adjustment mechanism is added to the cross-stage connections of the GELAN module to adaptively adjust the weights of each channel according to the feature complexity of the input samples, thereby enhancing the ability to extract weak features of smoke and fire; at the same time, an improved BatchNorm layer is added after each convolutional layer of the backbone network, introducing an adaptive momentum adjustment factor to improve the stability and convergence speed of model training and avoid gradient vanishing or gradient exploding problems.
[0025] 2.2 Feature Enhancement and Fusion Module The design incorporates a "bidirectional cross-scale feature enhancement + multimodal fusion" structure to address the issues of scale information loss and low feature utilization in traditional feature fusion. Specifically, this includes: (1) Bidirectional cross-scale feature enhancement unit: Construct bidirectional feature transfer paths from top to bottom and from bottom to top. High-level semantic features (used to identify the categories of smoke and fire) are transferred from top to bottom, and low-level detailed features are transferred from bottom to top. Attention enhancement units are added to each path. By calculating the channel attention and spatial attention weights of the feature map, the core features of smoke and fire are highlighted and background interference features are suppressed. (2) Multimodal feature fusion unit: The texture features of smoke, the spectral features of fire, and the spatial features of the image are fused together. The weights of the three features are dynamically adjusted through a learnable gating mechanism. The fusion formula is as follows: ; in, , , The weights are learnable and adaptively adjusted by the gating network. Texture features representing smoke, Indicates the spectral characteristics of a fire. This formula represents the spatial features of an image, and through this formula, different features are complemented to improve the model's ability to distinguish between smoke and fire. (3) Feature Refinement Unit: The fused feature map is refined by convolution. 1×1 convolution is used to reduce the feature dimension and reduce the amount of computation. At the same time, 3×3 convolution is used to enhance the continuity of features and avoid information distortion in the feature fusion process.
[0026] 2.3 Detection Head Module An improved Anchor-Free detection head is adopted to replace the traditional YOLO Anchor-Based detection head, avoiding the hyperparameter dependency and poor adaptability issues caused by Anchor box settings. The detection head is divided into three scales, corresponding to small target smoke, medium-sized smoke / fire, and large target fire, respectively. Each detection head simultaneously outputs the bounding box coordinates, class probability, and confidence score of the target. A dynamic threshold adjustment unit is added to the output layer of the detection head to adaptively adjust the confidence threshold according to the environmental feature labels of the sample, reducing false detections and false negatives in complex environments.
[0027] Step 3: Design an innovative loss function To address the unique characteristics of smoke and fire detection, a hybrid loss function integrating category loss, localization loss, and confidence loss is designed to resolve issues such as imbalanced positive and negative samples and low bounding box regression accuracy. The expression for the hybrid loss function is as follows: ; in, , , The weight coefficients for the category loss, localization loss, and confidence loss are respectively adjusted adaptively according to the training process, with initial values set to 1.0, 1.5, and 0.8, respectively; the specific design of each loss component is as follows: (1) Class loss An improved Varifocal Loss model is adopted, introducing a class weight factor to dynamically adjust the loss weights of the two classes of samples based on the proportion of smoke and fire samples. Higher loss weights are assigned to high-quality positive samples to address training bias caused by class imbalance and differences in sample quality. The expression for the improved Varifocal Loss is as follows: ; in, The total number of samples, For the first The class weight factor for each sample, For the first The predicted probability of the class of each sample. This is the focusing coefficient, used to adjust the weighting of high-quality positive samples; (2) Positioning loss This paper designs an improved ShapeIoU Loss model. Building upon the traditional CIoU Loss, it adds shape constraint factors for smoke and fire targets. Addressing the irregular shapes of smoke and the dynamic deformation of fire flames, it optimizes the accuracy of bounding box regression and accelerates model convergence. The expression for the traditional CIoU Loss is: ; ; in, The intersection-union ratio (IU) of the predicted bounding box and the ground truth bounding box. Let Euclidean distance be the squared distance between the center point of the predicted bounding box and the center point of the ground truth bounding box. Let be the diagonal length of the smallest bounding rectangle that encloses the predicted bounding box and the ground truth bounding box. As a balance factor, This represents the aspect ratio difference between the predicted and ground truth bounding boxes. Based on this, a shape constraint factor is introduced. The expression for the improved ShapeIoU Loss is as follows: ; ; in, For shape constraint weights, The attenuation coefficient is... The shape difference value between the predicted box and the true box is used to constrain the regression accuracy of irregular shapes of smoke and fire targets. (3) Confidence loss This approach employs a cross-entropy loss method that integrates focus loss and introduces a hard sample mining mechanism. This mechanism automatically identifies hard samples during training (such as faint smoke, distant fires, and occluded targets), improving the model's ability to detect hard samples while suppressing interference from background samples. The expression is as follows: ; in, For the first The confidence label for each sample (1 for positive samples and 0 for negative samples). For the first Confidence prediction value for each sample, This is the focusing coefficient, used to increase the loss weight for difficult samples.
[0028] Step 4: Model Training and Optimization 4.1 Training Parameter Settings Input the enhanced training set from step 1 into the enhanced YOLO network designed in step 2, set the initial learning rate to 0.001, and adopt the cosine annealing learning rate decay strategy. The expression for the cosine annealing learning rate is as follows: ; in, For the first Learning rate during rounds of training To minimize the learning rate, The initial learning rate is 0.001. For the current training round, The maximum number of training epochs is half (50), which helps avoid overfitting. The batch size is set to 16 and the number of training epochs is set to 100. An adaptive momentum optimizer (instead of the traditional SGD or Adam optimizer) is used to adaptively adjust the momentum parameters according to the gradient changes during model training, thereby improving training efficiency.
[0029] 4.2 Phased Training Strategy A two-stage training approach of "coarse training - fine tuning" is adopted. In the first stage (1-50 epochs), a large learning rate is used to focus on training the model's ability to extract core features of smoke and fire, without introducing difficult sample mining. In the second stage (51-100 epochs), the learning rate is reduced and the difficult sample mining mechanism is enabled to focus on optimizing the model's detection accuracy for weak smoke, distant fires, and targets in complex environments.
[0030] 4.3 Model Optimization During training, the model's detection accuracy (mAP), false negative rate, false positive rate, and inference speed are monitored in real time using the validation set. When the model's performance on the validation set does not improve for 5 consecutive epochs, early stopping is adopted to stop training and avoid overfitting. At the same time, the model parameters are optimized through gradient pruning, weight regularization, and other methods to improve the model's generalization ability. After training is completed, the model with the best performance is saved as the final detection model.
[0031] Step 5: Real-time detection and early warning of smoke and fire 5.1 Real-time Image Acquisition Scene images are captured in real time using surveillance cameras (fixed indoor and outdoor cameras, mobile inspection cameras, drone-mounted cameras, etc.). The captured images are converted to RGB format and resized to 640×640 (consistent with the model training input size). Simultaneously, image preprocessing (normalization and noise reduction) is performed to remove redundant information from the images. The normalization expression is as follows: ;in, These are the original pixel values of the image. The average pixel value of the training set images. The standard deviation of the pixels in the training set images. These are the normalized pixel values.
[0032] 5.2 Model Inference Detection The preprocessed image is input into the enhanced YOLO detection model trained in step 4. The model extracts features, fuses features, and infers from the detection head, outputting the bounding box coordinates, category (smoke / fire), and confidence level of the target. Based on the confidence threshold output by the dynamic threshold adjustment unit of the detection head, valid detection results (targets with confidence levels higher than the threshold) are selected, and invalid detections are excluded.
[0033] 5.3 Multi-level early warning Based on the category and confidence level of the test results, a three-level early warning mechanism is set up: (1) Level 1 warning (suspected smoke): When a smoke target is detected with a confidence level between 0.5 and 0.7, the system issues a warning to remind staff to conduct manual verification; (2) Level II warning (confirmed smoke): When a smoke target is detected with a confidence level ≥ 0.7, the system issues an audible and visual warning, and records the location, time and concentration of the smoke (calculated based on the confidence level), and pushes the warning information to relevant personnel; (3) Level 3 warning (fire): When a fire target (including smoke and fire coexisting) is detected, with a confidence level ≥ 0.6, the system issues an emergency audible and visual warning and automatically triggers the emergency linkage mechanism, such as activating the fire alarm system, shutting down relevant equipment, and pushing emergency instructions to the fire department. At the same time, it tracks the fire spread trend in real time and records the fire development process.
[0034] 5.4 Results Feedback and Updates The detection results and early warning information are stored in the database. The detection data is analyzed regularly. If false detections or missed detections occur, the corresponding samples are added to the training set to incrementally train the model, continuously optimize the model performance, and improve the detection accuracy.
[0035] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A smoke and fire detection method based on the enhanced YOLO algorithm, characterized in that: Includes the following steps: Step 1: Construct a multi-scenario sample dataset of smoke and fire, and perform hybrid data augmentation processing that integrates spatiotemporal features; Step 2: Design an enhanced YOLO algorithm network structure, including an improved CSP-GELAN feature extraction module, a bidirectional cross-scale feature enhancement + multimodal fusion feature enhancement and fusion module, and an improved Anchor-Free detection head module; Step 3: Design a hybrid loss function that integrates improved Varifocal Loss, ShapeIoU Loss, and focal cross-entropy loss; Step 4: Use a phased training strategy of coarse training and fine tuning to train and optimize the enhanced YOLO network to obtain the optimal detection model; Step 5: Real-time scene images are collected through monitoring equipment, preprocessed, and then input into the optimal detection model for inference. Based on the detection results, a three-level early warning is implemented, and the results are fed back and the model is updated incrementally.
2. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 1, characterized in that: In step 1, the hybrid data enhancement processing that integrates spatiotemporal features specifically includes four steps: dynamic texture enhancement, multi-scale adaptive cropping, environmental adaptive perturbation, and cross-scene sample fusion. The dynamic texture enhancement is used to simulate texture changes during the smoke diffusion process. The multi-scale adaptive cropping is used to increase the feature ratio of small target samples.
3. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 2, characterized in that: In step 2, the improved CSP-GELAN feature extraction module adds a dynamic channel adjustment mechanism to the cross-stage connection of the GELAN module to adaptively adjust the weights of each channel, and adds an improved BatchNorm layer after each convolution layer to introduce an adaptive momentum adjustment factor.
4. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 3, characterized in that: In step 2, the feature enhancement and fusion module includes a bidirectional cross-scale feature enhancement unit, a multimodal feature fusion unit, and a feature refinement unit; the multimodal feature fusion unit fuses the texture features of smoke, the spectral features of fire, and the spatial features of the image, and dynamically adjusts the weights of the three features through a learnable gating mechanism.
5. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 4, characterized in that: In step 2, the improved Anchor-Free detection head module is divided into three scales: small, medium, and large, corresponding to small target smoke, medium-sized smoke / fire, and large target fire, respectively. Furthermore, a dynamic threshold adjustment unit is added to the output layer of the detection head to adaptively adjust the confidence threshold based on environmental feature labels.
6. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 5, characterized in that: In step 3, the hybrid loss function is: ;in, , , These are adaptive weighting coefficients; To improve the Varifocal Loss, a class weight factor is introduced; To improve ShapeIoU Loss, shape constraint factors for smoke and fire targets are added; To integrate the cross-entropy loss with the focus loss, a hard sample mining mechanism is introduced.
7. A smoke and fire detection method based on the enhanced YOLO algorithm according to claim 6, characterized in that: In step 4, the coarse training-fine tuning phased training strategy includes: the first phase focuses on training the model's ability to extract core features of smoke and fire without introducing difficult sample mining; the second phase enables the difficult sample mining mechanism, focuses on optimizing the detection accuracy of difficult samples, and simultaneously adopts early stopping strategy, gradient pruning, and weight regularization to optimize the model.
8. The smoke and fire detection method based on the enhanced YOLO algorithm according to claim 7, characterized in that: In step 5, the three-level early warning mechanism is divided into suspected smoke, confirmed smoke, and fire according to the category and confidence level of the detected target. The three-level early warning automatically triggers the emergency linkage mechanism and pushes the early warning information to relevant personnel and departments.