A fire video image detection method and device based on an improved YOLOv8 model

By improving the Slim-neck structure, MSCA, and LSOH of the YOLOv8 model, and combining them with data augmentation strategies, the problem of insufficient fire detection accuracy was solved, enabling earlier and smarter fire alarm capabilities that can adapt to complex indoor environments.

CN121305440BActive Publication Date: 2026-04-07CHINA IPPR INT ENG CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-20
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing video-based fire detection methods are not accurate enough for detecting small flames in the early stages. Traditional smoke and heat detectors have high false alarm rates or response delays, making them difficult to accurately identify fires in complex indoor environments.

Method used

An improved YOLOv8 model is adopted, replacing the neck network with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA) and a lightweight small target detection head (LSOH), and combining offline and online data augmentation strategies to improve the accuracy and response speed of fire video image detection.

Benefits of technology

It significantly improves the accuracy and response speed of fire detection, enabling earlier and smarter fire alarms, adapting to complex indoor environments, and providing timely detection and early warning capabilities for indoor fires.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121305440B_ABST
    Figure CN121305440B_ABST
Patent Text Reader

Abstract

The application discloses a fire video image detection method and device based on an improved YOLOv8 model, which comprises the following steps: simulating a fire scene and acquiring dynamic process images of fire generation and diffusion in real time, pre-processing key frame images extracted from the dynamic process to generate a first data set, training an improved YOLOv8 model by using the first data set, wherein the improved YOLOv8 model comprises replacing a neck network of an original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism MSCA and adding a lightweight small target detection head LSOH, and detecting to-be-detected fire images by using the trained improved YOLOv8 model. The improved YOLOv8 model is superior to a traditional smoke fire detector in terms of detection precision and response speed, and has earlier and more intelligent fire early warning and alarm capabilities.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of fire detection, in particular to a fire video image detection method and device based on an improved YOLOv8 model. BACKGROUND

[0002] Indoor fires have characteristics such as dry environment, closed space, and good oxygen supply conditions, which make the fire spread rapidly, the smoke concentration is high, and it is easy to cause casualties and property losses. Especially the smoke produced by the fire not only blocks the line of sight, but also contains a large amount of toxic gas, which poses a serious challenge to personnel escape and rescue work. Therefore, it is of great significance to study efficient and rapid early fire detection technology. The false alarm rate of traditional smoke fire detectors is as high as 75% to 99%, and the response delay of temperature fire detectors exists, which are difficult to adapt to complex scenes and other problems, and are difficult to perform the task of accurate fire identification in variable indoor environments.

[0003] In order to overcome the shortcomings of traditional detectors, fire detection technology based on computer vision has emerged. This kind of technology uses surveillance cameras to achieve large-scale, non-contact fire monitoring and can provide intuitive fire information. However, the existing video-based fire detection method still has insufficient early small target flame detection accuracy, so it is necessary to improve the early fire detection rate and accuracy. SUMMARY

[0004] In view of the deficiencies in the prior art, the present application provides a fire video image detection method and device based on an improved YOLOv8 model and a storage medium, which uses an improved YOLOv8 model for fire detection, improving detection accuracy and response speed.

[0005] To achieve the above purpose, the present application provides a fire video image detection method based on an improved YOLOv8 model, which comprises: simulating a fire scene and obtaining dynamic process images of fire smoke and flame generation and diffusion in real time, preprocessing the key frame images extracted from the dynamic process images to generate a first data set; training an improved YOLOv8 model using the first data set, the improved YOLOv8 model including replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism MSCA, and adding a lightweight small target detection head LSOH; and detecting the fire smoke and flame images to be detected using the trained improved YOLOv8 model.

[0006] The improved YOLOv8 model is used to detect the fire smoke and flame images to be detected, and the trained improved YOLOv8 model is deployed as a fire detection model to a target detection platform, and the target detection platform detects and identifies real-time collected video images by using the fire detection model.

[0007] The dynamic process images of fire smoke and flame generation and diffusion are obtained in real time by simulating the fire scene, and the image acquisition device is placed at different angles or different positions to obtain the dynamic process images under different shielding conditions by using the image acquisition device.

[0008] The pre-processing is a combination of offline data enhancement and online data enhancement.

[0009] The input of the multi-scale cross-attention mechanism MSCA is the feature map F output by the Slim-neck structure, and the multi-scale cross-attention mechanism MSCA is introduced, which includes three parallel depth separable convolution branches that extract different scale fire features in the feature map F, including: a first branch that uses a first scale depth separable convolution to extract small-scale detailed features from the feature map F and outputs a first fine-grained feature map F_s; a second branch that uses a second scale depth separable convolution to extract medium-scale morphological features from the feature map F and outputs a first medium-grained feature map F_m; and a third branch that uses a third scale depth separable convolution to extract large-scale semantic features from the feature map F and outputs a first coarse-grained feature map F_l, wherein the first fine-grained feature map F_s, the first medium-grained feature map F_m and the first coarse-grained feature map F_l have the same dimensions, the first scale is smaller than the second scale, and the second scale is smaller than the third scale; and each branch is followed by batch normalization and a first activation function for post-processing.

[0010] The introduced multi-scale cross-attention mechanism (MSCA) further includes: establishing cross-scale dynamic associations between channels through a lightweight Transformer encoder layer, comprising: performing global average pooling on the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l to generate three sets of channel descriptors: G_s, G_m, and G_l; concatenating the three sets of channel descriptors along the channel dimension to form a cross-scale channel vector G; inputting the cross-scale channel vector G into the lightweight Transformer encoder layer; and splitting the output of the lightweight Transformer encoder layer by channel to generate three sets of optimized channel weights W_s, W_m, and W_l, which are then multiplied channel-by-channel with the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l to generate a second fine-grained feature map F_s', a second medium-grained feature map F_m', and a second coarse-grained feature map F_l', respectively.

[0011] The lightweight small target detection head LSOH comprises: a feature input layer, which selects the high-resolution feature map F_shallow output by the first VoV-GSCSP module in the Slim-neck structure as input, and the high-resolution feature map F_shallow has been processed by the multi-scale cross-attention mechanism MSCA; a multi-branch feature enhancement module, which uses three parallel lightweight convolutional branches to specifically enhance the high-resolution feature map F_shallow to generate an enhanced feature map F_enhanced; and a prediction output layer, which uses two first-scale depthwise separable convolutions to refine the enhanced feature map F_enhanced, inputs the refined features into the multi-task prediction head, generates multi-branch prediction results, performs dynamic anchor box adaptation on the regression branch in the multi-branch prediction results, and decodes it into the final detection box.

[0012] The method of using three parallel lightweight convolutional branches to specifically enhance the high-resolution feature map F_shallow to generate an enhanced feature map F_enhanced further includes: edge contour enhancement, which uses a first-scale depthwise separable convolution to enhance the edge contours of small targets in the high-resolution feature map F_shallow; local texture enhancement, which uses a second-scale depthwise separable convolution to capture the local textures of small targets in the high-resolution feature map F_shallow; and channel attention enhancement, which sequentially performs global average pooling and two-stage 1×1 convolutions on the high-resolution feature map F_shallow to generate channel weights, and multiplies the channel weights with the high-resolution feature map F_shallow channel by channel.

[0013] The multi-task prediction head includes: a classification branch, which outputs the binary classification probabilities of flame and smoke; a regression branch, which outputs the bounding box coordinate offset; and a confidence branch, which outputs the probability of the target's existence.

[0014] On the other hand, the present invention also provides a fire video image detection device based on an improved YOLOv8 model. The fire video image detection method based on the improved YOLOv8 model described above includes: a data acquisition module, used to simulate a fire scene and acquire dynamic process images of the generation and spread of fire smoke and flames in real time; extracting keyframe images from the dynamic process images and performing preprocessing to generate a first dataset; a training module, used to train an improved YOLOv8 model using the first dataset; the improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH); and a detection module, used to detect fire smoke and flame images to be detected using the trained improved YOLOv8 model.

[0015] The detection module further includes a deployment unit, used to deploy the trained improved YOLOv8 model as a fire detection model to the target detection platform, wherein the target detection platform uses the fire detection model to detect and identify real-time acquired fire video images.

[0016] In another aspect, the present invention also provides a detection platform for a fire early warning system, including the fire video image detection device based on the improved YOLOv8 model as described above.

[0017] Furthermore, the present invention also provides a fire early warning system performance evaluation platform, comprising: a test data generation module, used to play a preset standard test video sequence to the monitoring area of ​​the fire early warning system to be evaluated; a benchmark detection module, integrating the aforementioned detection platform for fire early warning systems, used to synchronously analyze and detect the standard test video sequence, generate and record benchmark detection results, the benchmark detection results including the occurrence time, location, category and confidence level of the fire target; an acquisition module, communicatively connected to the fire early warning system to be evaluated, used to collect and record alarm events and alarm times generated by the fire early warning system to be evaluated during the test in real time; an analysis and comparison module, communicatively connected to the benchmark detection module and the acquisition module respectively, used to compare the alarm events with the benchmark detection results, and calculate one or more performance evaluation indicators based on the comparison results; and a report generation module, connected to the analysis and comparison module, used to receive the performance evaluation indicators and automatically generate a structured performance evaluation report.

[0018] Finally, the present invention also provides a computer-readable storage medium for storing a computer program that, when executed by a processor, implements the fire video image detection method based on the improved YOLOv8 model described above.

[0019] As can be seen from the above solutions, the advantages of the present invention are:

[0020] The improved YOLOv8 model proposed in this invention outperforms traditional detection devices in terms of detection accuracy and response speed, and has earlier and more intelligent alarm capabilities, providing an effective new approach for the timely detection and early warning of indoor fires. Attached Figure Description

[0021] Figure 1 This is a flowchart of the fire video image detection method based on the improved YOLOv8 model of the present invention;

[0022] Figure 2 for Figure 1 Flowchart of step S20;

[0023] Figure 3 for Figure 2 Flowchart of step S200;

[0024] Figure 4 for Figure 2 Flowchart of step S201;

[0025] Figure 5A The graph shows a comparison of the training results of the improved YOLOv8 model and the original YOLOv8 model when the evaluation metric is mAP.

[0026] Figure 5B The graph shows a comparison of the training results of the improved YOLOv8 model and the original YOLOv8 model when the evaluation metric is mAP50 - 95.

[0027] Figure 5C This is a comparison curve of the training results of the improved YOLOv8 model of this invention and the original YOLOv8 model when the evaluation metric is Precision.

[0028] Figure 5D The graph shows a comparison of the training results of the improved YOLOv8 model and the original YOLOv8 model when Recall is the evaluation metric.

[0029] Figure 6A and Figure 6B The images show the results of fire detection in the first fire scenario, using the improved YOLOv8 model of this invention and the original YOLOv8 model, respectively.

[0030] Figure 6Cand Figure 6D The images show the results of fire detection in the second fire scenario, using the improved YOLOv8 model of this invention and the original YOLOv8 model, respectively.

[0031] Figure 6E and Figure 6F The images show the results of fire detection in the third fire scenario, using the improved YOLOv8 model of this invention and the original YOLOv8 model, respectively.

[0032] Figure 6G and Figure 6H The images show the results of fire detection in the fourth fire scenario, using the improved YOLOv8 model of this invention and the original YOLOv8 model, respectively.

[0033] Figure 6I and Figure 6J The images show the results of fire detection in the fifth fire scenario, using the improved YOLOv8 model of this invention and the original YOLOv8 model, respectively.

[0034] Figure 7 This is a structural diagram of the fire video image detection device based on the improved YOLOv8 model of the present invention;

[0035] Figure 8 This is a structural diagram of the detection platform for a fire early warning system provided by the present invention;

[0036] Figure 9 for Figure 8 Structure diagram of the results management module;

[0037] Figure 10 This is a structural diagram of the fire early warning system performance evaluation platform provided by the present invention;

[0038] In the attached figures, the following labels are used: 1-Fire video image detection method; 2-Fire video image detection device; 20-Data acquisition module; 21-Training module; 22-Detection module; 220-Deployment unit; 3-Detection platform; 30-Graphical user interface module; 31-Data loading module; 32-Model management module; 33-Result management module; 330-Result export unit; 331-Task control unit; 4-Fire early warning system performance; 40-Test data generation module; 41-Benchmark detection module; 42-Acquisition module; 43-Analysis and comparison module; 44-Report generation module; S10~S30, S200, S201, S2000~S2003, S2010~S2013-Steps. Detailed Implementation

[0039] The technical solution of the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments to further understand the purpose, solution and effect of the present invention, but it is not intended to limit the scope of protection of the appended claims.

[0040] References to "embodiment," "another embodiment," "this embodiment," etc., in the specification refer to embodiments that may include specific features, structures, or characteristics, but not every embodiment must include these specific features, structures, or characteristics. Furthermore, such expressions do not refer to the same embodiment. Moreover, when describing specific features, structures, or characteristics in conjunction with embodiments, whether or not explicitly described, it is indicated that incorporating such features, structures, or characteristics into other embodiments is within the knowledge of those skilled in the art.

[0041] In recent years, vision-based fire video image detection methods using improved YOLOv8 models have become a research hotspot. By acquiring image information in real time through surveillance cameras and combining it with deep learning models such as convolutional neural networks (CNNs), spatial and textural features of flames and smoke can be effectively extracted, enabling rapid fire identification. These methods not only offer faster response times but also enable area localization, providing a new approach for early fire warning.

[0042] Among numerous target detection algorithms, the YOLO (You Only Look Once) series is widely used in fire detection tasks in video surveillance scenarios due to its superior real-time performance and detection accuracy. However, the standard YOLO model still suffers from insufficient detection accuracy in complex environments such as small-scale flames, low-contrast smoke, and occlusion interference. Therefore, this invention proposes an improvement based on the YOLOv8 model to enhance its ability to identify fire targets, and verifies this improvement on an indoor fire simulation platform. This exploration examines the feasibility and effectiveness of computer vision-based fire detection models in early fire identification, aiming to construct a more intelligent and efficient fire monitoring technology.

[0043] This invention proposes an improved YOLOv8n model. By introducing three core improvements, it significantly improves detection accuracy while minimizing computational cost, parameter count, and model size.

[0044] In the neck network, the design framework of the original YOLOv8 is broken through, and a Slim-neck feature fusion network is adopted to replace the traditional structure. GSConv convolutional technology and the VoV-GSCSP module are introduced to replace the original C2f module in the neck. GSConv's shuffling strategy balances global and local feature extraction capabilities, while VoV-GSCSP's one-time aggregation idea reduces information redundancy, thus improving feature fusion efficiency while reducing the number of parameters. Based on this, the neck network embeds a multi-scale cross-attention mechanism (MSCA). The scale decomposition module (3 parallel depthwise separable convolutions) splits features into fine, medium, and coarse granularities. A cross-scale channel interaction module (shared Transformer encoder) establishes inter-scale channel correlations, and a spatial-scale fusion module generates an attention map that fuses multi-scale information, further enhancing the ability to capture the correlation of multi-scale fire features.

[0045] The Head section, based on the original YOLOv8 decoupled head structure (separation of classification head and detection head) and Anchor-Free detection concept, adds a lightweight small target detection head (LSOH): it selects the high-resolution feature map of the first VoV-GSCSP output of Slim-neck as input, and enhances the edge and texture features of small targets through 3 parallel lightweight convolution branches (including microchannel attention MCA). Combined with the anchor box design that dynamically adapts to the size of small targets (adapting from 10×10 to 32×32 pixels), it improves the detection accuracy of early low-density smoke and small flames.

[0046] Among the above improvements, Slim-neck achieves lightweight and efficient feature fusion, MSCA strengthens multi-scale feature correlation, and LSOH specifically addresses the problem of missed detection of small targets. The synergistic effect of these three technologies enables the improved YOLOv8 to achieve dual optimization of accuracy and efficiency in indoor fire detection scenarios.

[0047] Figure 1 A flowchart of a fire video image detection method 1 based on an improved YOLOv8 model provided in an embodiment of the present invention includes:

[0048] S10: Simulate a fire scenario and acquire dynamic process images of the generation and spread of fire smoke and flames in real time. Extract key frame images from the dynamic process images and perform preprocessing to generate the first dataset.

[0049] S20: Train the improved YOLOv8 model using the first dataset;

[0050] S30: Detect the smoke and flame images of the fire to be detected using a trained improved YOLOv8 model.

[0051] In step S10,

[0052] To achieve efficient training and performance verification of fire smoke and flame detection, this embodiment constructed a high-quality first dataset. The experimental environment was a safety-modified indoor warehouse, measuring 12m × 10m, classified as a medium-risk (Level II) location. Multiple sensors, including smoke detectors, flame detectors, and heat detectors, were installed throughout the experiment to ensure safety. The scenario setup simulated a typical warehouse environment, including shelves, cardboard boxes, plastic products, and wooden materials, to realistically recreate the actual fire situation. A total of 32 physical combustion tests were conducted under 4 fire source locations, 4 ignition methods, and 2 types of combustible materials. The 4 fire source locations were directly below the nozzle, near the nozzle, between two nozzles, and between four nozzles. The 4 ignition methods were cigarette butt ignition, electric spark ignition, electric heating wire ignition, and welding slag ignition. The 25kg of wood chips and a standard combustible material were used. The dataset covers two typical smoke types: white smoke and black smoke. White smoke is generated by burning wet paper and plastic materials, mainly simulating the thin smoke in the low-temperature incomplete combustion stage, which spreads quickly and irregularly. Black smoke is generated by burning rubber and oily substances, simulating the thick smoke in the high-temperature complete combustion stage, which is characterized by high density, slow diffusion, and severe obstruction.

[0053] To ensure the accuracy and scientific validity of the data, multiple sets of repeated tests were conducted for each working condition, with ceiling clearance heights set at 3m and 6m respectively. During the experiments, data such as temperature measured by thermocouples and gas concentration measured by gas sensors were collected, and the alarm times of various fire detectors were recorded. Video recording: The experiments were documented with photos and videos. A camera with a manually adjustable aperture was used, adjusted to prevent automatic aperture closure due to fire brightness (at least 50% open). The camera bracket was adjusted so that the camera lens was approximately 900mm above the ground. Throughout the experiments, high-definition video equipment was used to record the entire fire scene, and to simulate different obstruction conditions, the camera (i.e., the image acquisition device) was placed at different angles and positions for filming.

[0054] Specifically, the camera placement was designed around the smoke generation-diffusion-detector triggering process within the warehouse space, and was adjusted using two ceiling clearance heights of 3m and 6m. At ground level, the camera was positioned 900mm above the ground, distributed along the warehouse's 12m long axis and 10m short axis in the middle of the aisles (the warehouse center and the midpoints of both aisles). At semi-high altitude, the camera was positioned 1.5-2m above the ground and fixed to a bracket. The high-altitude auxiliary position was adjusted according to the clearance height: 2.8m above the ground at 3m clearance and 5.8m above the ground at 6m clearance, close to the ceiling without obstructing the detectors, supplementing the top-view data.

[0055] For horizontal shooting, keep the lens axis parallel to the ground. For low-angle shooting, tilt the lens down 15°-45° to focus on the fire source and surrounding area. For high-angle shooting, tilt the lens up 60°.

[0056] The occlusion simulation is based on real-world items in a warehouse setting, avoiding the introduction of atypical obstructions to ensure data authenticity. Partial occlusion involves placing a single cardboard box in front of the lens, obscuring 1 / 4 to 1 / 2 of the frame (not completely obscuring flames and smoke), simulating common scenarios where people or goods temporarily obstruct the camera. Penetrating occlusion involves pointing the lens at a 0.5m wide gap between two rows of cardboard boxes, stacking 3-5 boxes with tiny gaps within the gap, simulating the diffusion of smoke through the gaps between goods, and collecting the characteristics of thin smoke from a non-direct field of view.

[0057] Subsequently, keyframe images were selected as data samples using a frame extraction method. The first dataset includes 16,000 valid images, including 8,300 flame images, 4,200 smoke images, and 3,500 images containing both flames and smoke, providing a rich training and validation data foundation for the YOLOv8 model of this invention.

[0058] To improve the efficiency and accuracy of model training, this embodiment employs a dual strategy combining offline data augmentation and online data augmentation to preprocess the fire detection dataset (i.e., the first dataset). Offline data augmentation refers to preprocessing the raw image data before model training begins. By expanding the sample size of the dataset, it enhances the model's adaptability to different scenarios (i.e., generalization ability). Specific implementation methods include mirror flipping, shear transformation, noise injection, and brightness adjustment.

[0059] Online data augmentation dynamically generates augmented samples during real-time model training. It employs Mosaic data augmentation technology, which involves randomly scaling and arranging images during training to synthesize entirely new training samples. Building upon this, further processing steps such as random rotation and color jitter are integrated to effectively simulate the realities of multi-scale targets and their coexistence in complex fire scenarios, thereby enhancing the model's generalization performance.

[0060] Table 1 Experimental Training Environment

[0061]

[0062] All experiments in this embodiment were conducted in the host environment shown in Table 1. Training parameter settings: the optimizer was selected as SGD (Stochastic Gradient Descent), the momentum parameter was 0.937, the initial learning rate was set to 0.001, the epochs were 300, the batch size was 32, the close_mosaic was 0, and the workers were 8.

[0063] In step S20,

[0064] The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH).

[0065] In the standard YOLOv8 model, many standard convolutions and C2f modules are used to improve accuracy. However, this increases the number of model parameters and reduces speed. To reduce the model's weight, depthwise separable convolutions and ShuffleNet were proposed, effectively addressing the computational cost of standard convolutions. However, these lightweight detection methods often sacrifice detection accuracy. GSConv combines standard convolutions (SC), depthwise separable convolutions (DSC), and the Shuffle operation, saving computational costs compared to standard convolutions. To enhance the model's overall capabilities, this embodiment replaces the neck network of the YOLOv8 model with a Slim-neck structure, reducing the number of model parameters while maintaining feature extraction capabilities.

[0066] The core of Slim-neck lies in the combined application of the lightweight convolutional technique GSConv and the lightweight structure VoV-GSCSP, achieving efficient feature fusion while maintaining the model's lightweight nature. GSConv consists of standard convolution (SC), depth-wise separable convolution (DSC), and concatenation and channel shuffling operations. GSConv's computational cost is approximately 50% of that of standard convolution, but its learning ability is comparable. GSConv's structural design aims to balance speed and accuracy. Its working mechanism is as follows: the input feature map (with c1 channels) is processed simultaneously by standard convolution (SC) and depth-wise separable convolution (DSC). Standard convolution focuses on extracting global features, while depth-wise separable convolution (DSC) leverages its efficient computational characteristics to process local features. Both types of convolution output feature channels with a total number of c2 / 2. Subsequently, a feature channel shuffling technique, known as a shuffling strategy, is employed to process the output features of the two convolutions. By exchanging local feature information on different channels, the global feature information extracted by the standard convolution is evenly distributed into the output features of the depthwise separable convolution, thereby achieving effective fusion of global and local features. Finally, the fused features are further processed by GSConv to output a feature map with c2 channels. This structure retains the global feature extraction capability of the standard convolution while leveraging the efficiency of the depthwise separable convolution, significantly reducing computational costs.

[0067] The VoV-GSCSP module combines the GS Bottleneck module with the one-time aggregation approach to achieve fast and efficient feature integration. The GS Bottleneck module, composed of GSConv convolutions, enhances the network's non-linear representation through efficient feature transfer capabilities, improving feature abstraction and discriminative power. The one-time aggregation approach differs from traditional multi-stage aggregation; it directly integrates feature maps at different stages of the network, avoiding information redundancy in traditional multi-stage aggregation. The input features are processed separately by standard convolutions and the GS Bottleneck module, then fused through a Concat operation (sembrittlement) and residual connections (+), ultimately outputting a feature map with C2 channels. This aggregation method accelerates information flow and improves feature fusion efficiency. Through the synergistic effect of GSConv and VoV-GSCSP, the Slim-neck feature fusion network can efficiently integrate feature information from different levels while reducing the number of parameters, providing better feature support for subsequent object detection.

[0068] The multi-scale cross-attention mechanism (MSCA) is structurally designed around the correlation of multi-scale fire features. Its complete logical chain starts with the scale decomposition of features, proceeds through cross-scale information interaction, and finally achieves enhanced fusion of multi-dimensional features. Specifically, the input of MSCA is the feature map F (with dimensions C×H×W, where C is the number of channels, and H and W are the height and width of the feature map) output by the VoV-GSCSP module in the Slim-neck structure.

[0069] like Figure 2 and Figure 3 As shown, step S20 further includes: S200: using three parallel depthwise separable convolutional branches to extract fire features at different scales from the feature map F, including:

[0070] S2000: The first branch uses the first-scale depthwise separable convolution to extract small-scale detailed features from the feature map F, and outputs the first fine-grained feature map F_s;

[0071] S2001: The second branch uses the second-scale depthwise separable convolution to extract medium-scale morphological features from the feature map F, and outputs the first medium-granularity feature map F_m.

[0072] S2002: The third branch uses the third-scale depthwise separable convolution to extract large-scale semantic features from the feature map F, and outputs the first coarse-grained feature map F_l.

[0073] S2003: Each branch is followed by batch normalization and post-processing using the first activation function.

[0074] Among them, the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l have the same dimension, the first scale is smaller than the second scale, and the second scale is smaller than the third scale.

[0075] Specifically, the scale decomposition module is the foundation of MSCA. This module employs three parallel depthwise separable convolutional branches, each designed to consider the scale characteristics of fire features: The first branch uses 3×3 (i.e., the first scale) depthwise separable convolutions (composed of 3×3 depthwise convolutions + 1×1 pointwise convolutions). The depthwise convolutions perform spatial convolutions on each channel individually (3×3 kernel, stride 1, padding 1), preserving small-scale details such as flame edge texture and smoke particles. The pointwise convolutions are responsible for channel dimension integration, outputting the first fine-grained feature F_s (dimensions C×H×W); The second branch uses 5×5 (i.e., the second scale) depthwise separable convolutions, expanding the receptive field to 11×11, outputting the first medium-grained feature F_m (dimensions C×H×W), focusing on capturing medium-scale morphological features such as flame outlines and smoke flow direction; The third branch uses 7×7 (i.e., the third scale). The depthwise separable convolution has a receptive field of 15×15 and outputs a first coarse-grained feature F_l (dimensions C×H×W), focusing on large-scale information such as the global distribution of fire and its spatial relationship with shelves / walls. Each branch (including the first, second, and third branches) is followed by a BN layer (batch normalization) and a SiLU activation function (i.e., the first activation function), which ensures the stability of the feature distribution and enhances the feature representation ability through nonlinear transformation.

[0076] like Figure 2 and Figure 4 As shown, step S20 further includes: S201: Establishing cross-scale dynamic correlations between channels through a lightweight Transformer encoder layer, including:

[0077] S2010: Perform global average pooling on the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l to generate three sets of channel descriptors: G_s, G_m, and G_l;

[0078] S2011: Concatenate the three sets of channel descriptors along the channel dimension to form a cross-scale channel vector G;

[0079] S2012: Input the scale-spanning channel vector G into the lightweight Transformer encoder layer;

[0080] S2013: The output of the lightweight Transformer encoder layer is split into channels to generate three sets of optimized channel weights W_s, W_m, and W_l. These weights are then multiplied channel-by-channel with the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l to generate the second fine-grained feature map F_s', the second medium-grained feature map F_m', and the second coarse-grained feature map F_l', respectively.

[0081] Specifically, the cross-scale channel interaction module of MSCA is used to establish dynamic associations between feature channels at different scales. This allows the channel weights of small-scale features to be guided by large-scale semantics, while the channel weights of large-scale features are modified by small-scale details. First, global average pooling (GAP) is performed on the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l respectively, compressing the spatial information of each channel into a scalar, resulting in three sets of channel descriptors: G_s (C×1×1), G_m (C×1×1), and G_l (C×1×1). These descriptors can be regarded as preliminary representations of the importance of channels at each scale. The three sets of descriptors are then concatenated along the channel dimension to form a cross-scale channel vector G (3C×1×1), which is then input into a lightweight Transformer encoder layer. This encoder contains two sub-layers: a multi-head self-attention (MHA) layer and a feedforward network (FFN). The MHA layer employs an 8-head attention mechanism, splitting G into eight sub-vectors of dimension 3C / 8. It captures the correlation between channels at different scales by calculating the matrix product of query (Q), key (K), and value (V) (Q=K=V=G, and the attention weight matrix is ​​softmax (QK^T / √d_k), where d_k=3C / 8). The FFN layer consists of two 1×1 convolutions (with 3C×2 channels in the middle and GELU activation function) to perform a non-linear transformation on the attention output, enhancing feature representation.

[0082] After the Transformer encoder layer output is split into channels by the spatial-scale fusion module, three sets of optimized channel weights W_s, W_m, and W_l (all C×1×1) are obtained. These weights are then multiplied channel-by-channel with the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l, respectively, to complete the cross-scale optimization of the channel dimension. This results in the second fine-grained feature map F_s' for detail enhancement, the second medium-grained feature map F_m' for morphological optimization, and the second coarse-grained feature map F_l' for semantic correction.

[0083] The lightweight small target detection head LSOH comprises a feature input layer, a multi-branch feature enhancement module, and a prediction output layer. The feature input layer uses the high-resolution feature map F_shallow output from the first VoV-GSCSP module in the Slim-neck structure as input. The high-resolution feature map F_shallow has been processed by the multi-scale cross-attention mechanism MSCA. The multi-branch feature enhancement module uses three parallel lightweight convolutional branches to specifically enhance the high-resolution feature map F_shallow, generating an enhanced feature map F_enhanced. The prediction output layer uses two first-scale depthwise separable convolutions on the enhanced feature map F_enhanced to refine its features. The refined features are then input into the multi-task prediction head to generate multi-branch prediction results. Dynamic anchor box adaptation is performed on the regression branches in the multi-branch prediction results, and the results are decoded into the final detection boxes.

[0084] The method of using three parallel lightweight convolutional branches to specifically enhance the high-resolution feature map F_shallow to generate an enhanced feature map F_enhanced also includes:

[0085] Edge contour enhancement: The edge contours of small targets in the high-resolution feature map F_shallow are enhanced by first-scale depthwise separable convolution.

[0086] Local texture enhancement utilizes second-scale depthwise separable convolution to capture local textures of small targets in the high-resolution feature map F_shallow;

[0087] Channel attention enhancement involves sequentially performing global average pooling and two-stage 1×1 convolutions on the high-resolution feature map F_shallow to generate channel weights, and then multiplying the channel weights with the high-resolution feature map F_shallow channel by channel.

[0088] The multi-task prediction head includes: a classification branch, which outputs the binary classification probabilities of flame and smoke; a regression branch, which outputs the bounding box coordinate offset; and a confidence branch, which outputs the probability of the target's existence.

[0089] Specifically, the Lightweight Small Object Detection Head (LSOH) was designed to address the urgent need for early detection of small targets (such as match flames of about 10×10 pixels, short-circuit sparks of about 5×5 pixels, and low-density smoke) in indoor fire detection. Existing detection heads suffer from high false negative rates for these small targets due to deficiencies in high-resolution feature utilization, small target feature enhancement, and anchor box adaptation. This new detection head is specifically designed to address these issues based on the Slim-neck feature fusion network and the MSCA attention mechanism, in order to achieve accurate detection of small targets in early fires.

[0090] The LSOH structure begins with a feature input layer, which selects the high-resolution feature map (denoted as F_shallow) output by the first VoV-GSCSP module in the Slim-neck as input. This high-resolution feature map F_shallow has dimensions of C / 2×2H×2W (where C is the number of feature channels output by the backbone network, and H and W are the height and width of the feature map output by the backbone network), and its resolution is 1 / 4 of the original input image. It is the feature layer in the network that retains the richest details of small targets, and this feature map has been processed by the MSCA attention mechanism, integrating medium and large-scale semantic information (such as global features of "flame" and "smoke"), providing a dual foundation of "details + semantics" for small target detection.

[0091] Next is the multi-branch feature enhancement module, which uses three parallel lightweight convolutional branches to specifically enhance F_shallow: edge contour enhancement, which sequentially uses a 1×1 convolution (number of channels C / 4) and a 3×3 depthwise separable convolution (stride 1, padding 1) to extract edge contour features of small objects (such as the irregular edges of sparks). The 1×1 convolution is used for channel dimensionality reduction to reduce computation, and the 3×3 depthwise separable convolution preserves local edge information through channel-wise spatial convolution; local texture enhancement, which sequentially uses a 1×1 convolution (number of channels C / 4) and a 5×5 depthwise separable convolution (stride 1, padding 2) to focus on capturing local texture features of small objects (such as the particle texture of smoke). The larger receptive field of the 5×5 convolution can cover the overall texture distribution of small objects, and the depthwise separable design ensures computational efficiency; and channel attention enhancement, which introduces micro-channel attention (MCA). First, global average pooling is performed on F_shallow to obtain C / 2×1×1 The channel descriptors are then processed by 1×1 convolutions (C / 8 channels, SiLU activation function) and 1×1 convolutions (C / 2 channels, Sigmoid activation function) to generate channel weights. Finally, the channel weights are multiplied by F_shallow channel by channel to enhance the response of key channels such as "flame highlights" and "smoke grayscale" and suppress background interference. The output features of the three branches are concatenated along the channel dimension (total number of channels is C / 4 + C / 4 + C / 2 = C), compressed to C / 2 channels by 1×1 convolution, and then activated by SiLU to obtain the enhanced feature F_enhanced.

[0092] Finally, the prediction output layer employs a "feature pyramid + dynamic anchor box" design. F_enhanced undergoes two 3×3 depthwise separable convolutions (interspersed with BN layers and SiLU activation) to further refine features and generate a predicted feature map (dimension C / 2×2H×2W). The output layer contains three parallel 1×1 convolutions: a classification branch outputting the binary classification probabilities of "flame" and "smoke"; a regression branch outputting the bounding box coordinate offset (relative to the preset anchor box); and a confidence branch outputting the probability of the target's existence. The anchor boxes utilize a dynamic adaptation strategy. For small targets ranging from 10×10 to 32×32 pixels, three preset aspect ratios (1:1.5, 1:1, 1.5:1) are used. When the input image resolution is 640×640, the anchor box sizes are set to 16×12, 20×20, and 12×16, and the anchor box size scales proportionally with the input image resolution to ensure matching the scale characteristics of the small target.

[0093] Compared to the original YOLOv8 model, the improved YOLOv8 model of this invention achieves a 4.7 percentage point increase in accuracy, with Map@0.5 and mAP@0.5:0.95 metrics improving by 1.7 and 5 percentage points respectively. Floating-point computation is reduced by 13.4%, and the number of parameters is reduced by 6.4%, demonstrating significant optimization effects, as detailed below: Evaluation metrics:

[0094] This invention uses precision (P), recall (R), and average precision (mAP) as evaluation metrics for the model. Furthermore, the model size and computational cost are evaluated based on the number of parameters and floating-point computation. The calculation formulas are shown in equations (1)-(4):

[0095] (1),

[0096] (2),

[0097] (3),

[0098] (4),

[0099] Where TP is the number of samples that are actually positive but are predicted as positive; FP is the number of samples that are actually negative but are predicted as positive; and FN is the number of samples that are actually positive but are predicted as negative. AP represents the area enclosed by the curve and a coordinate system with precision P on the vertical axis and recall R on the horizontal axis; M represents the number of classes in the dataset. N(p) is the total number of images processed; and T(p) is the total time spent processing images.

[0100] Comparative analysis of training results:

[0101] During the 300 training rounds, the training results of the improved model and the original model are as follows: Figures 5A to 5D As shown in the four sets of training curves (mAP, mAP50-95, Precision, Recall), the improved YOLOv8n model outperforms the original model in all aspects of fire detection tasks. The improved model achieves significant improvements in localization accuracy, detection precision, and task coverage, while accelerating the training process and effectively enhancing detection performance in real-world indoor fire scenarios.

[0102] Ablation experiment:

[0103] To further verify the effectiveness of the improved model in fire detection, ablation experiments were conducted using YOLOv8n as the baseline model and different combinations of the MSCA attention mechanism, the Slim-neck module, and the LSOH small target detection head. Precision, recall, mAP50, mAP50-95, number of parameters, and floating-point computation were used as evaluation criteria. The experimental results are shown in Table 2 below.

[0104] Table 2 Ablation Test Results

[0105]

[0106] The experimental steps and procedures for simulating an indoor experimental environment are as follows:

[0107] (1) A total of 32 working conditions were tested for 4 types of fire source locations, 4 types of ignition methods, and 2 types of combustibles. In order to ensure the accuracy and scientific nature of the data, three sets of repeated tests were conducted for each type. The net height of the test ceiling was 3m-6m.

[0108] (2) Before the test, close one side of the roller shutter door and open the other side as the air inlet. The test instruments and equipment are arranged as described above. Two minutes before ignition, turn on the equipment, measure the ambient temperature and record it.

[0109] (3) Before the test begins, fill the pipeline with water and adjust the pressure so that the sprinklers at the most unfavorable point can also meet the water spraying requirements. Prepare fire extinguishing equipment outside the test hall in advance to prevent the fire from spreading out of the test hall out of control, and arrange relevant personnel to do a good job of test record keeping.

[0110] (4) Data Recording: Automatically measure and record the following data: Collect data such as temperature measured by thermocouples and gas concentration measured by gas sensors, and record the alarm times of various fire detectors;

[0111] (5) Video Recording: The experiment shall be recorded with photographs and videos. A timer displaying the "run time" shall be included in all video recordings, with a time accuracy of 1 second. Integration of the timer with the camera is permitted. The timer shall remain clearly visible throughout the experiment. A camera with a manually adjustable aperture shall be used, adjusted to prevent automatic aperture closure due to fire brightness (at least 50% open). The camera mount shall be adjusted so that the camera lens is approximately 900 mm from the ground.

[0112] (6) Organize the data and process the results;

[0113] (7) Change the working conditions, adjust the position of the instruments and equipment, and repeat the above steps to conduct the test.

[0114] like Figures 6A to 6JThe figures show the fire detection performance of the improved YOLOv8 model and the original YOLOv8 model under different real-world fire scenarios (i.e., fire scenarios 1 to 5). The fire scenarios 1 through 5 vary in flame size, smoke, location, and lighting. In the figures, "fire 0.61" indicates a confidence level of 0.61 for the detected flame, and "smoke 0.51" indicates a confidence level of 0.51 for the detected smoke. The figures demonstrate that in real-world indoor fire detection, the improved YOLOv8 model exhibits higher accuracy and better detection performance.

[0115] Table 3 Comparison of response times of different detection methods under different experimental scenarios

[0116]

[0117] Under simulated smoldering fire conditions, the improved YOLOv8 model had an average response time of 226 seconds in an indoor space at a height of 3 meters and 237 seconds in a space at a height of 6 meters. The overall response time is relatively long because the initial stage of a smoldering fire lacks obvious open flame characteristics, presenting as low-concentration, low-contrast smoke. Especially in high-altitude environments, the smoke spreads further and the smoke density in the image is lower, increasing the difficulty of detection. Compared to traditional smoke detectors, which typically require a long time to accumulate smoke before triggering an alarm, the improved YOLOv8 model of this invention can complete identification in the early stages of smoldering, demonstrating a certain response advantage.

[0118] Under simulated open flame fire conditions, the improved YOLOv8 model exhibits significantly enhanced response efficiency. Experimental results show that the average response time is 39 seconds at a height of 3m and 45 seconds at a height of 6m, significantly shorter than under smoldering conditions. Open flames possess more prominent characteristics—high brightness, dynamic changes, and a distinct color difference (orange-red flame)—making them easier to detect and identify. Furthermore, the spatial height has a relatively small impact on open flame detection, with a response time difference of only 6 seconds, indicating that the visual representation of flames in space is relatively stable, demonstrating the strong spatial robustness of the improved YOLOv8 model.

[0119] Comparing the detection performance of smoldering and open flame fires, the improved YOLOv8 model showed a significantly shorter response time to open flames compared to smoldering conditions, resulting in faster and more reliable detection. While its detection of smoldering smoke was relatively slower, it was still faster than traditional smoke detectors. Room height had some impact on detection performance, but the overall error was small, indicating that the improved YOLOv8 model is suitable for indoor environments with varying ceiling heights and room volumes.

[0120] In smoldering fire scenarios, the flames are inconspicuous and the temperature rises slowly, primarily manifested as slow smoke accumulation. Therefore, the early detection capabilities of fire detection systems are crucial. Experimental results show that the improved YOLOv8 model has an average response time of 231.5 seconds under smoldering conditions, significantly earlier than the average response times of the three traditional detectors: smoke detectors (255.5 seconds), flame detectors (416.5 seconds), and heat detectors (359 seconds). Flame and heat detectors, lacking sufficient detectable flame features and heat accumulation, exhibit severely delayed responses. The improved YOLOv8 model, by recognizing subtle smoke features in images, detects smoldering signs earlier, fully demonstrating its advantage in concealed fires.

[0121] In open-flame fire scenarios, where the fire spreads rapidly and has visible flames, this invention demonstrates a significant advantage in response speed. Under open-flame conditions, the average response time is 42 seconds, far superior to the 299 seconds of smoke detectors, the 381 seconds of flame detectors, and the 418 seconds of heat detectors. The improved YOLOv8 model rapidly extracts and identifies the dynamic features of flames in continuous frame images, quickly issuing early warnings and ensuring timely response before the fire spreads further.

[0122] In summary, in smoldering fires dominated by smoke or open flame fires with prominent flame characteristics, the fire video image detection method based on the improved YOLOv8 model of this invention demonstrates highly efficient and stable early identification capabilities, far superior to traditional sensing-type detectors. This provides more intelligent and efficient technical support for practical indoor fire early warning systems.

[0123] In some embodiments, step S30 further includes deploying the trained, improved YOLOv8 model as a fire detection model to the target detection platform, which uses the fire detection model to detect and identify real-time acquired fire video images. The target detection platform is a fire detection platform built on PyQt5 or a mobile computing device.

[0124] In practical testing, this invention can build a fire detection platform based on PyQt5. This platform supports user-uploaded images, videos, and camera streams for detection, and displays the detection results in real time. It also provides functions for importing and initializing training models, adjusting thresholds, and exporting detection results. The main functions and operation flow of this fire detection platform are as follows:

[0125] (1) Importing and initializing the training model

[0126] Users can first import their pre-trained, improved YOLOv8 models. The platform supports various mainstream model formats (such as TensorFlow or PyTorch). After importing, the platform will display basic information about the improved YOLOv8 model (such as model name, version, file size, etc.) and automatically initialize the improved YOLOv8 model, preparing it for subsequent detection tasks. The import and initialization process is completed through the file selection box in the UI interface. Users only need to click the "Import Model" button, select the appropriate model file, and the system will automatically complete the loading.

[0127] (2) Confidence level and IoU threshold adjustment

[0128] To optimize detection results, the platform allows users to customize the confidence and intersection-over-union (IoU) thresholds. Users can adjust these thresholds using sliders or numerical input boxes. Real-time feedback on user adjustments is displayed on the UI, ensuring that each change takes effect immediately and facilitating comparative testing under different parameter configurations. The confidence threshold controls whether a target is considered present, while the IoU threshold filters out results with overlapping detection boxes.

[0129] (3) Image, video and camera detection

[0130] The platform supports three types of data input: still images, video files, and real-time camera video streams. Users can select a single image for smoke detection using the "Upload Image" button; or upload a video file using the "Upload Video" button. The platform will then detect the smoke frame by frame and output the detection results for each frame in real time. For camera detection, the platform will capture the camera video stream in real time, perform smoke detection, and display the results in real time.

[0131] Image detection: After the image is uploaded, the platform preprocesses it and performs smoke detection through model inference. The detection results are visualized on the image using border markers, labels, and confidence values.

[0132] Video detection: After a user uploads a video, the platform processes the video frame by frame, detects the smoke in each frame, and displays the detection results in real time through dynamically updated selection boxes and labels.

[0133] Camera detection: Users can select a camera connected to their computer for real-time detection. The platform will acquire the video stream from the camera and perform real-time smoke detection and result display.

[0134] (4) Visualization and display of test results

[0135] Whether it's image, video, or camera detection, the platform displays real-time detection results in the UI. Each detected target is marked with a bounding box, displaying the target's category (smoke), location (coordinates), and confidence score. The detection execution time (inference time) is also shown, allowing users to understand the detection performance. Detection results can be exported to CSV, JSON, or other file formats via right-click or the corresponding button for subsequent analysis and archiving.

[0136] (5) List of detected targets and their location information

[0137] After each detection, the platform automatically updates a "Detected Target List," listing all detected targets, including their location coordinates, confidence scores, and categories. Users can view all detected targets through this list and examine individual targets in detail. The target list provides users with a very intuitive way to view detection results, helping them quickly locate targets of interest.

[0138] (6) Inference time and performance demonstration

[0139] To help users evaluate the platform's performance, it displays the inference time after each detection. Whether it's image detection, frame-by-frame video detection, or real-time camera stream detection, the platform can show the inference time for each task in the UI. This feature provides users with an intuitive understanding of the platform's performance, helping them determine whether the platform meets their real-time processing needs.

[0140] (7) Exporting test results and ending the test

[0141] After the detection is complete, users can use the "Export Results" function provided by the platform to save the detection results as a file. Supported formats include CSV (listing the location information, confidence level, etc. of each target) and JSON (structured storage of detection information). In addition, users can also click the "End Detection" button at any time to terminate the current detection task, clear the previous detection results, and prepare for a new task.

[0142] Built with PyQt5, this platform combines image, video, and real-time camera stream smoke detection, providing efficient and intuitive detection and result management functions. Users can import custom models, adjust detection parameters, view and export detection results. The platform's design fully considers user experience and operational smoothness, providing a comprehensive and efficient detection platform for fire detection.

[0143] In practical testing, this invention can also deploy the trained, improved YOLOv8 model as a fire detection model on a mobile computing device. The mobile computing device can be, for example, a robot. The robot can be a fixed robot or a mobile robot, and may include a robot body, a control unit, a memory, and an image acquisition device.

[0144] Specifically, the image acquisition device is mounted on the robot body and is used to acquire video images of the real environment during the application phase of the fire detection model. The embedded system of the memory stores a trained, improved YOLOv8 model (i.e., the fire detection model). The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH). The control unit communicates with the image acquisition device and the memory. The control unit is configured to: perform real-time analysis of the video images using the fire detection model to detect flames or smoke; and execute predetermined response actions when flames or smoke are detected.

[0145] The aforementioned predetermined response actions include:

[0146] Alarm actions: such as the sound and light alarm of the robot body issuing an alarm, or sending alarm information to a remote monitoring center (such as the platform in the method embodiment) via wireless communication;

[0147] Movement avoidance maneuvers: such as controlling the movement mechanism to move the robot in the opposite direction of the fire or to a preset safe area;

[0148] Linkage control actions: such as sending signals to the building management system to start the sprinkler system or shut down the ventilation ducts; etc.

[0149] The following are apparatus embodiments corresponding to the above method embodiments. This embodiment can be implemented in conjunction with the above embodiments. The relevant technical details mentioned in the above embodiments remain valid in this embodiment, and will not be repeated here to reduce repetition. Correspondingly, the relevant technical details mentioned in this embodiment can also be applied to the above embodiments.

[0150] like Figure 7 As shown, a fire video image detection device 2 based on an improved YOLOv8 model, provided in another embodiment of the present invention, employs the aforementioned fire video image detection method 1 based on an improved YOLOv8 model, and includes:

[0151] Data acquisition module 10 is used to simulate fire scenarios and acquire dynamic process images of fire smoke and flame generation and diffusion in real time. After extracting key frame images from the dynamic process images, it performs preprocessing to generate the first dataset.

[0152] Training module 11 is used to train an improved YOLOv8 model using the first dataset. The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH).

[0153] Detection module 12 is used to detect smoke and flame images of fires to be detected using a trained improved YOLOv8 model;

[0154] The deployment unit 120 is used to deploy the trained and improved YOLOv8 model as a fire detection model to the target detection platform. The target detection platform uses the fire detection model to detect and identify real-time acquired video images.

[0155] The data acquisition module 10 is used to acquire training data during the development phase of the fire detection model by deploying one or more cameras at different locations in the simulated fire environment.

[0156] The target detection platform is a fire detection platform or mobile computing device built on PyQt5. The mobile computing device is, for example, a robot, which can be a fixed robot or a mobile robot, and includes a robot body, a control unit, a memory, and an image acquisition device.

[0157] Specifically, the image acquisition device is mounted on the robot body and is used to acquire video images of the real environment during the application phase of the fire detection model. It is not the same as the data acquisition module 10. The memory stores a trained, improved YOLOv8 model (i.e., the fire detection model). The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH). The control unit is communicatively connected to the image acquisition device and the memory. The control unit is configured to: perform real-time analysis of the video images using the fire detection model to detect flames or smoke; and execute a predetermined response action when flames or smoke are detected.

[0158] This fire video image detection device 2 can store images of detected fire smoke and flames and upload them to the system to continuously update the fire dataset, gradually building a real-time fire scene data dataset, and thus optimizing the fire detection model. Each fire can be identified based on the latest fire detection model, improving identification efficiency, providing earlier fire alarms, preventing false alarms, and increasing identification accuracy. Based on this, a comprehensive big data fire identification system will be gradually built, automatically constructing intelligent fire detectors.

[0159] Furthermore, those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the fire video image detection device 2 can be referred to the corresponding process in the aforementioned embodiment of the fire video image detection method 1, and will not be repeated here.

[0160] like Figure 8 As shown, another embodiment of the present invention also provides a detection platform 3 for a fire early warning system. The detection platform 3 includes a graphical user interface module 30, a data loading module 31, a model management module 32, and a result management module 33 that are interconnected.

[0161] The graphical user interface module 30 provides a user interface and displays detection results. For example, it is built using PyQt5, and the main interface is divided into:

[0162] The control panel area includes function buttons such as "Import Model", "Upload Image", "Upload Video", "Connect Camera", "Export Results", and "End Detection", as well as real-time adjustment sliders and numerical input boxes for confidence threshold and IoU threshold.

[0163] Display area: Used to display in real time the input source to be detected (image / video / camera stream) and a visualization of the detection results (bounding box, class label, confidence score).

[0164] Information display area: includes "Detection Target List" (lists all detected target information in tabular form) and "Performance Monitoring Panel" (displays performance metrics such as inference time and frame rate in real time).

[0165] The data loading module 31 is configured to: respond to the "upload image" operation by loading static image files (supporting formats such as .jpg and .png) through the system file dialog box; respond to the "upload video" operation by loading video files (supporting formats such as .mp4 and .avi) and parsing them into a frame sequence; and respond to the "connect camera" operation by establishing a connection with a local USB camera or network RTSP video stream through the OpenCV library to obtain real-time video stream data.

[0166] The model management module 32 integrates the aforementioned fire video image detection device 2 and provides: Model import function: Users can select the locally stored pre-trained model weight file (supporting PyTorch's .pt format) through the "Import Model" button, automatically complete the model loading and initialization, and display the basic information of the model; Parameter adjustment interface: The confidence threshold and IoU threshold adjusted by the user through the interface are transmitted to the underlying detection model in real time, dynamically affecting the generation of detection results.

[0167] like Figure 9As shown, the result management module 33 also includes a result export unit 330 and a task control unit 331. When the user triggers the "Export Results" function, the result export unit 330 collects all target information (including target category, bounding box coordinates, confidence level, and timestamp) identified in the current detection task, converts it into structured data format, and exports it as a local file. The structured data format includes CSV and JSON formats. When the user clicks the "End Detection" button, the task control unit 331 terminates the current detection task and clears the generated detection results, so that the detection platform 3 is ready to execute a new detection task.

[0168] like Figure 10 As shown, another embodiment of the present invention also provides a fire early warning system performance evaluation platform 4, including a test data generation module 40, a benchmark detection module 41, a data acquisition module 42, an analysis and comparison module 43, and a report generation module 44.

[0169] The test data generation module 40 consists, for example, a high-brightness industrial display screen and a built-in standard test video library. During testing, the display screen is placed directly in front of the camera of the fire warning system to be evaluated, and a standard video sequence containing various fire scenarios (such as initial smoke, open flame, interference scenarios, etc.) is played.

[0170] The benchmark testing module 41 is, for example, a high-performance industrial computer, which integrates and runs the aforementioned testing platform 3. This computer receives video signals synchronously output to the industrial display screen via a video capture card. This means that the benchmark testing module 41 and the fire early warning system to be evaluated "see" the exact same image, thus ensuring the fairness of the evaluation.

[0171] The acquisition module 42 is equipped with multiple physical interfaces (such as RS-232, RJ45, and Wi-Fi modules) to adapt to fire warning systems from different manufacturers. This acquisition module 42 captures all alarm signals and precise timestamps in real time by parsing the communication protocol of the fire warning system or reading its alarm logs.

[0172] The analysis and comparison module 43 runs on an industrial computer, receiving the "benchmark truth value" from the benchmark detection module 41 and the "results of the system under test" from the acquisition module 42. It automatically calculates performance evaluation metrics using time alignment and event matching algorithms. These performance evaluation metrics include detection accuracy, false alarm rate, and average response latency.

[0173] The report generation module 44 fills the above performance indicators into a preset template, generates a detailed PDF evaluation report, and exports it via USB interface or sends it directly to the administrator's email address via the network.

[0174] The beneficial effects of this embodiment are as follows: This fire early warning system performance evaluation platform 4 automates, standardizes, and quantifies the evaluation process, overcoming the problems of strong subjectivity and low efficiency in traditional manual evaluation. It provides fire protection product quality inspection departments, R&D institutions, and large users with an authoritative and efficient third-party evaluation tool, significantly improving the product quality and reliability level of the fire early warning industry.

[0175] Another embodiment of the present invention discloses a computer storage medium storing computer-executable instructions. When the computer-executable instructions are loaded and executed by a processor, they implement step 1 of the fire video image detection method disclosed in any of the foregoing embodiments, such as... Figure 1 The steps are shown.

[0176] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims, and all of these forms fall within the scope of protection of the present invention.

Claims

1. A fire video image detection method based on an improved YOLOv8 model, characterized in that, include: Simulate a fire scenario and acquire dynamic process images of the generation and spread of fire smoke and flames in real time. Extract key frame images from the dynamic process images and perform preprocessing to generate the first dataset. The improved YOLOv8 model is trained using the first dataset. The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH). The trained improved YOLOv8 model is used to detect smoke and flame images of fires to be detected; The input to the multi-scale cross-attention mechanism (MSCA) is the feature map F output by the Slim-neck structure. The introduction of the MSCA mechanism includes: employing three parallel depthwise separable convolutional branches to extract fire features at different scales from the feature map F, including: The first branch uses a first-scale depthwise separable convolution to extract small-scale detailed features from the feature map F, and outputs a first fine-grained feature map F_s; The second branch uses a second-scale depthwise separable convolution to extract mid-scale morphological features from the feature map F, and outputs a first mid-granularity feature map F_m. The third branch uses a third-scale depthwise separable convolution to extract large-scale semantic features from the feature map F, outputting a first coarse-grained feature map F_l, wherein the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l have the same dimension, the first scale is smaller than the second scale, and the second scale is smaller than the third scale. Each branch is followed by batch normalization and post-processing using a first activation function, which is the SiLU activation function. The introduced multi-scale cross-attention mechanism (MSCA) also includes: establishing cross-scale dynamic correlations between channels through a lightweight Transformer encoder layer, including: The first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l are respectively subjected to global average pooling to generate three sets of channel descriptors: G_s, G_m, and G_l. The three sets of channel descriptors are concatenated along the channel dimension to form a cross-scale channel vector G; The cross-scale channel vector G is input into the lightweight Transformer encoder layer; The output of the lightweight Transformer encoder layer is split into channels to generate three sets of optimized channel weights W_s, W_m, and W_l. These weights are then multiplied channel-by-channel with the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l, respectively, to generate the second fine-grained feature map F_s', the second medium-grained feature map F_m', and the second coarse-grained feature map F_l'. The lightweight small target detection head LSOH includes: The feature input layer selects the high-resolution feature map F_shallow output by the first VoV-GSCSP module in the Slim-neck structure as input. The high-resolution feature map F_shallow has been processed by the multi-scale cross-attention mechanism MSCA. The multi-branch feature enhancement module uses three parallel lightweight convolutional branches to perform targeted enhancement on the high-resolution feature map F_shallow, generating an enhanced feature map F_enhanced; The prediction output layer performs feature extraction on the enhanced feature map F_enhanced by two first-scale depthwise separable convolutions. The extracted features are input into the multi-task prediction head to generate multi-branch prediction results. Dynamic anchor box adaptation is performed on the regression branch in the multi-branch prediction results, and the result is decoded into the final detection box.

2. The fire video image detection method based on the improved YOLOv8 model according to claim 1, characterized in that, The step of using the trained improved YOLOv8 model to detect smoke and flame images of a fire to be detected further includes: deploying the trained improved YOLOv8 model as a fire detection model to a target detection platform, wherein the target detection platform uses the fire detection model to detect and identify real-time acquired fire video images.

3. The fire video image detection method based on the improved YOLOv8 model according to claim 1, characterized in that, The simulated fire scenario and real-time acquisition of dynamic images of the generation and spread of fire smoke and flames also includes: The image acquisition device is placed at different angles or positions to simulate different occlusion conditions, and the dynamic process image is obtained using the image acquisition device.

4. The fire video image detection method based on the improved YOLOv8 model according to claim 1, characterized in that, The preprocessing method combines offline and online data augmentation.

5. The fire video image detection method based on the improved YOLOv8 model according to claim 1, characterized in that, The method of using three parallel lightweight convolutional branches to specifically enhance the high-resolution feature map F_shallow to generate an enhanced feature map F_enhanced also includes: Edge contour enhancement: The edge contours of small targets in the high-resolution feature map F_shallow are enhanced by first-scale depthwise separable convolution. Local texture enhancement utilizes second-scale depthwise separable convolution to capture local textures of small targets in the high-resolution feature map F_shallow; Channel attention enhancement involves sequentially performing global average pooling and two-stage 1×1 convolutions on the high-resolution feature map F_shallow to generate channel weights, and then multiplying the channel weights with the high-resolution feature map F_shallow channel by channel.

6. The fire video image detection method based on the improved YOLOv8 model according to claim 1, characterized in that, The multi-task prediction head includes: The classification branch outputs the binary classification probabilities of smoke and flame. The regression branch outputs the bounding box coordinate offset. The confidence branch outputs the probability that the target exists.

7. A fire video image detection device based on an improved YOLOv8 model, characterized in that, The fire video image detection method based on the improved YOLOv8 model as described in any one of claims 1 to 6 includes: The data acquisition module is used to simulate fire scenarios and acquire dynamic process images of fire smoke and flame generation and diffusion in real time. After extracting key frame images from the dynamic process images, it performs preprocessing to generate the first dataset. The training module is used to train an improved YOLOv8 model using the first dataset. The improved YOLOv8 model includes replacing the neck network of the original YOLOv8 model with a Slim-neck structure, introducing a multi-scale cross-attention mechanism (MSCA), and adding a lightweight small target detection head (LSOH). The detection module is used to detect smoke and flame images of a fire to be detected using the trained improved YOLOv8 model; The input to the multi-scale cross-attention mechanism (MSCA) is the feature map F output by the Slim-neck structure. The introduction of the MSCA mechanism includes: employing three parallel depthwise separable convolutional branches to extract fire features at different scales from the feature map F, including: The first branch uses a first-scale depthwise separable convolution to extract small-scale detailed features from the feature map F, and outputs a first fine-grained feature map F_s; The second branch uses a second-scale depthwise separable convolution to extract mid-scale morphological features from the feature map F, and outputs a first mid-granularity feature map F_m. The third branch uses a third-scale depthwise separable convolution to extract large-scale semantic features from the feature map F, outputting a first coarse-grained feature map F_l, wherein the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l have the same dimension, the first scale is smaller than the second scale, and the second scale is smaller than the third scale. Each branch is followed by batch normalization and post-processing using a first activation function, which is the SiLU activation function. The introduced multi-scale cross-attention mechanism (MSCA) also includes: establishing cross-scale dynamic correlations between channels through a lightweight Transformer encoder layer, including: The first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l are respectively subjected to global average pooling to generate three sets of channel descriptors: G_s, G_m, and G_l. The three sets of channel descriptors are concatenated along the channel dimension to form a cross-scale channel vector G; The cross-scale channel vector G is input into the lightweight Transformer encoder layer; The output of the lightweight Transformer encoder layer is split into channels to generate three sets of optimized channel weights W_s, W_m, and W_l. These weights are then multiplied channel-by-channel with the first fine-grained feature map F_s, the first medium-grained feature map F_m, and the first coarse-grained feature map F_l, respectively, to generate the second fine-grained feature map F_s', the second medium-grained feature map F_m', and the second coarse-grained feature map F_l'. The lightweight small target detection head LSOH includes: The feature input layer selects the high-resolution feature map F_shallow output by the first VoV-GSCSP module in the Slim-neck structure as input. The high-resolution feature map F_shallow has been processed by the multi-scale cross-attention mechanism MSCA. The multi-branch feature enhancement module uses three parallel lightweight convolutional branches to perform targeted enhancement on the high-resolution feature map F_shallow, generating an enhanced feature map F_enhanced; The prediction output layer performs feature extraction on the enhanced feature map F_enhanced by two first-scale depthwise separable convolutions. The extracted features are input into the multi-task prediction head to generate multi-branch prediction results. Dynamic anchor box adaptation is performed on the regression branch in the multi-branch prediction results, and the result is decoded into the final detection box.

8. The fire video image detection device based on the improved YOLOv8 model according to claim 7, characterized in that, The detection module also includes: The deployment unit is used to deploy the trained improved YOLOv8 model as a fire detection model to the target detection platform, which uses the fire detection model to detect and identify real-time acquired fire video images.

9. A detection platform for a fire early warning system, characterized in that, Includes the fire video image detection device based on the improved YOLOv8 model as described in claim 7 or 8.

10. A performance evaluation platform for a fire early warning system, characterized in that, include: The test data generation module is used to play a preset standard test video sequence to the monitoring area of ​​the fire early warning system to be evaluated; The benchmark detection module integrates the detection platform for fire early warning systems as described in claim 9, which is used to synchronously analyze and detect the standard test video sequence, generate and record benchmark detection results, and the benchmark detection results include the occurrence time, location, category and confidence level of the fire target; The data acquisition module is communicatively connected to the fire early warning system to be evaluated, and is used to collect and record alarm events and alarm times generated by the fire early warning system to be evaluated during the test in real time. The analysis and comparison module is communicatively connected to the benchmark detection module and the acquisition module, respectively, and is used to compare the alarm event with the benchmark detection result, and calculate one or more performance evaluation indicators based on the comparison result; The report generation module, connected to the analysis and comparison module, is used to receive the performance evaluation indicators and automatically generate a structured performance evaluation report.

11. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the fire video image detection method based on the improved YOLOv8 model as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Improved YOLOv5 fire detection method and device integrated with adjustable coordinate residual attention

    CN115457428A

  • Mask detection device and method based on improved YOLOv8

    CN117975534A