A flame and smoke detection method based on improved YOLO11
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG UNIV OF SCI & TECH
- Filing Date
- 2026-05-20
- Publication Date
- 2026-08-07
AI Technical Summary
[0004]但现有目标检测方法在复杂环境下的早期火焰与烟雾检测任务中仍然存在较明显不足
本发明针对现有火焰与烟雾检测方法在复杂场景中存在的小目标特征易丢失、烟雾边界模糊、背景干扰强以及火焰与烟雾类别差异难以统一建模等问题,对YOLO11模型的下采样结构、特征融合方式和检测头结构进行协同改进,从而提高模型在早期火灾、无人机远距离视角和复杂背景条件下的检测准确性与鲁棒性。
Smart Images

Figure CN122530869A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fire and smoke monitoring technology, and in particular to a flame and smoke detection method based on an improved YOLO11. Background Technology
[0002] Fire monitoring and early warning are important research areas in forest protection, industrial safety, urban fire fighting, and drone inspection. Compared with the later stages of a fire, flames and smoke targets in the early stages are usually smaller in scale and have weaker features. If they can be identified in the early stages, it will help to issue early warning information as soon as possible, thereby reducing casualties and property losses and improving the efficiency of fire prevention and control.
[0003] Current fire monitoring methods mainly include manual inspection, fixed sensor monitoring, and image-based video monitoring. Manual inspection relies on human experience and has limited continuity and coverage; while fixed sensors can achieve continuous monitoring in local areas, they are easily limited by deployment conditions, monitoring range, and false alarm / missed alarm issues. With the development of computer vision and deep learning technologies, image-based automatic flame and smoke detection methods have gradually become an important technical approach. Among them, single-stage target detection methods, represented by YOLO, are widely used due to their fast detection speed and convenient end-to-end implementation.
[0004] However, existing target detection methods still have significant shortcomings in early-stage flame and smoke detection tasks in complex environments. First, early-stage flame and smoke targets occupy relatively few pixels in images, especially from a long-range UAV perspective, where the proportion of small targets is high, leading to the easy loss of shallow features during downsampling and affecting detection accuracy. Second, smoke targets are typically semi-transparent, have blurred boundaries, and diffuse shapes, making them easily confused with the background under complex backgrounds, cloud and fog interference, or changing lighting conditions, resulting in false positives or false negatives. Third, flames and smoke differ significantly in scale distribution and appearance features; using a unified detection head for simultaneous modeling makes it difficult to fully accommodate the discrimination needs of different targets at different feature layers.
[0005] Furthermore, to improve the detection performance of small and weakly characterized targets, existing methods often require the introduction of more complex network structures, leading to an increase in the number of parameters and computational costs, which is detrimental to deployment and application in UAV platforms, edge devices, or real-time fire monitoring scenarios. Therefore, how to improve the detection performance of flame and smoke targets, especially small targets and weakly defined targets in the early stages, in complex environments while keeping the overall model complexity under control has become an urgent technical problem to be solved in this field. Summary of the Invention
[0006] To address the problems existing in the prior art, the purpose of this invention is to propose a flame and smoke detection method based on an improved YOLO11. By improving the downsampling structure, feature fusion method, and detection head structure, the method enhances the model's ability to extract features, perform multi-scale fusion, and classify flame and smoke targets in complex backgrounds.
[0007] To achieve the above objectives, the present invention provides the following solution: A flame and smoke detection method based on an improved YOLO11 includes: An image of the target to be detected is acquired, and the image is input into an improved YOLO11 model to obtain the detection result. The improved YOLO11 model is trained using a training set, which includes the original target image and flame and smoke labels. The improved YOLO11 model includes: replacing the conventional downsampling layer in the backbone network with a detail-context co-sampling module, reconstructing the feature interaction unit in the feature fusion network using a dynamic dual-feature fusion module, and replacing the original unified classification detection head with a shared regression and asymmetric classification module.
[0008] Optionally, the detail-context co-sampling module includes: The local detail unit is used to perform a pixel unshuffle operation on the input feature map with a target downsampling factor to rearrange adjacent target spatial regions to the channel dimension, obtain rearranged features, and generate local detail branch output features through a mapping function composed of the first target convolution, BatchNorm and SiLU. The context unit is used to map the input feature map to the intermediate channel dimension using the second target convolution, to extract and downsample information in the spatial dimension using a spatial feature extraction operator, to mix and recombine information between different channels using a channel information recombination operator, and to further encode the recombined features using a spatial feature extraction operator to generate context branch output features. The feature fusion unit is used to concatenate the local detail branch output features and the context branch output features in the channel dimension to form a combined feature containing structural and semantic information. The combined feature is then reintegrated using a target fusion convolution, and the number of channels is mapped back to the target output dimension to obtain the main branch output features. The residual unit is used to spatially downsample the input feature map through max pooling and align the channels through a third target convolution to obtain the residual branch output features. The downsampling unit is used to add the main branch output features and the residual branch output features element by element to obtain the downsampling result.
[0009] Optionally, the dynamic dual-feature fusion module includes: The feature partitioning unit is used to partition the input features and obtain two sets of features; The dynamic dual-feature fusion unit is used to concatenate the two features in the channel dimension to obtain joint features, perform global average pooling on the joint features, and generate a channel-level dynamic weight matrix through the fourth target convolution mapping and the Sigmoid activation function. The joint features are recalibrated channel by channel using the channel-level dynamic weight matrix and compressed back to the original channel dimension through dimensionality reduction convolution to obtain the purified channel fusion features. The spatial response maps are extracted from the input features and the transformed features using the fifth convolution, and after element-wise summation and Sigmoid normalization, a spatial weight mask for emphasizing salient regions is generated. The spatial weight mask is applied to the channel fusion feature to obtain the fusion output feature.
[0010] Optionally, obtaining the channel fusion features includes: ; in, This is a channel-level dynamic weight matrix. and These represent the weight generation mapping matrix and the channel compression mapping matrix, respectively. Represents element-wise multiplication of the feature dimension. The characteristics of the purified channel fusion.
[0011] Optionally, generating the spatial weight mask includes: ; in, and To generate two independent operators for spatial response mapping, For input features, To transform features, For Sigmoid normalization, This is a spatial weight mask used to emphasize salient regions.
[0012] Optionally, obtaining the fused output features includes: ; in, To fuse output features, For spatial weight masks used to emphasize salient regions, The characteristics of the purified channel fusion.
[0013] Optionally, the shared regression and asymmetric classification module includes: A shared regression and asymmetric classification unit is used to retain the regression branch in the original unified classification detection head, output the regression output features at the target scale, and remove the original unified classification branch. The shared local classification mapping function is used to extract the local classification features of the input features in each scale layer. The local detail-sensitive branch and the context semantic-sensitive branch are set up to map the features of layers P3 and P4 and layers P4 and P5 respectively. Then, they are concatenated and fused at a uniform scale to obtain the first target feature and the second target feature. Strong classification heads and weak classification heads are set in the local detail sensitive branch and the context semantic sensitive branch, respectively, so as to perform classification prediction through the local classification features, the first target feature and the second target feature, and obtain different classification output features; The different classification output features are concatenated along the channel dimension and then concatenated with the regression output features at the target scale along the channel dimension to obtain the detection result.
[0014] Optionally, setting a strong classification head and a weak classification head in the local detail-sensitive branch and the context semantic-sensitive branch respectively includes: In the local detail-sensitive branch, the output terminal for outputting the first local classification feature and the second local classification feature adopts a first weak classification head, and the output terminal for outputting the third local classification feature adopts a first strong classification head. Meanwhile, in the context semantic-sensitive branch, the output terminal for outputting the first local classification feature adopts a second weak classification head, and the output terminal for outputting the second local classification feature and the third local classification feature adopts a second strong classification head.
[0015] Optionally, obtaining the different classification output features includes: ; ; in, and These represent the local detail-sensitive path and the context-semantic sensitive path respectively in the first... Context gain coefficients at various scales are used to adjust the injection intensity of category context at different scales. and This represents the classification bias term for the corresponding category at different scales, used to encode the category-scale prior. This means adjusting the contextual features to a spatial resolution consistent with the local features at the current scale.
[0016] The beneficial effects of this invention are as follows: This invention addresses the problems of existing flame and smoke detection methods in complex scenarios, such as the easy loss of small target features, blurred smoke boundaries, strong background interference, and difficulty in uniformly modeling differences between flame and smoke categories. It makes synergistic improvements to the downsampling structure, feature fusion method, and detection head structure of the YOLO11 model, thereby improving the model's detection accuracy and robustness in early fires, long-distance views from UAVs, and complex background conditions.
[0017] On the one hand, this invention replaces the conventional downsampling layer with a detail-context co-sampling module, enabling the model to better preserve local edges, textures, and small-scale structural information while reducing feature map resolution, and enhancing contextual semantic expression capabilities. This reduces feature loss during downsampling for early-stage small flames, thin smoke, and distant weak targets, improving the model's ability to perceive small and weak targets.
[0018] On the other hand, this invention adaptively fuses features from different sources and at different levels through a dynamic dual-feature fusion module. This enables the model to enhance effective flame and smoke features based on channel importance and spatial saliency, while suppressing interference from complex backgrounds, clouds, lighting changes, and smoke-like regions. This improves feature representation in cases of blurred smoke target boundaries and diffused morphology, reducing the probability of false positives and false negatives.
[0019] Meanwhile, this invention uses shared regression and asymmetric classification modules to differentiate the scale distribution and apparent feature differences of flames and smoke, enabling different scale feature layers to focus on local detail information and contextual semantic information respectively. This alleviates the problem that a unified detection head cannot simultaneously handle small-scale flame targets, diffuse smoke targets, and large-scale contextual targets, improving the classification and discrimination capabilities for targets of different categories and scales.
[0020] Furthermore, while improving detection performance, this invention maintains model complexity within a relatively controllable range through structural designs such as shared regression, dynamic weighted fusion, and depthwise convolution and pointwise convolution. This facilitates deployment and application in scenarios such as UAV inspection, edge devices, and real-time fire monitoring. In summary, this invention can effectively improve the accuracy, recall, and stability of flame and smoke detection in complex environments, demonstrating significant practical application value. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a schematic diagram of a flame and smoke detection method based on an improved YOLO11 according to an embodiment of the present invention; Figure 2 The diagram shows the structure and key operators of the DCCD module in an embodiment of the present invention; (a) is a structural diagram of the DCCD module in an embodiment of the present invention, (b) is a spatial feature extraction operator, and (c) is a channel feature extraction operator. Figure 3 This is a structural diagram of the key operator DFF in an embodiment of the present invention; Figure 4 The following is a comparison of the detection results of the embodiments of the present invention: (a) is the detection result of YOLO11n, and (b) is the detection result based on the improved YOLO11 model. Detailed Implementation
[0023] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0024] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0025] like Figure 1 As shown, this embodiment discloses a flame and smoke detection method based on an improved YOLO11 model, comprising: acquiring an image of the target to be detected; inputting the image of the target to be detected into an improved YOLO11 model to obtain detection results; the improved YOLO11 model is trained using a training set; the training set includes: the original target image and flame and smoke labels; the improved YOLO11 model includes: replacing the conventional downsampling layer in the backbone network with a detail-context co-sampling module, reconstructing the feature interaction unit in the feature fusion network using a dynamic dual-feature fusion module, and replacing the original unified classification detection head with a shared regression and asymmetric classification module.
[0026] Specifically, this embodiment discloses a flame and smoke detection method based on an improved YOLO11, comprising the following improvements: A detail-context co-sampling module (DCCD) is set in the backbone network to retain local detail information of small targets and enhance contextual representation capabilities during downsampling; a dynamic dual-feature fusion module (DDFM) is set in the feature fusion network to enhance cross-scale feature interaction capabilities through dynamic weighting of the channel and spatial domains; and a shared regression and asymmetric classification module (SACD) is set in the detection head to perform differentiated classification modeling based on the response differences of flames and smoke at different scale feature layers. Experimental results show that, compared with the baseline model YOLO11n, the method of this invention improves mAP@0.5 and mAP@0.5:0.95 by 2.3 percentage points and 4.4 percentage points, respectively, reaching 90.1% and 66.9%, thereby improving the flame and smoke detection performance in complex environments while maintaining overall controllable model complexity. More specifically: Step 1: Data Collection and Preprocessing: To compensate for the shortcomings of single public datasets in terms of scene coverage, small target samples, and UAV perspective, this invention integrates four public datasets: BoWFire, FLAME, FASDD_UAV, and Smoke_segmentation, and performs targeted processing. Specifically, all images from the BoWFire dataset are retained to utilize its complex backgrounds and interference samples; for the FLAME dataset, which originates from UAV videos, a sparse sampling method of extracting one image every 54 frames is adopted to reduce spatiotemporal redundancy; for the FASDD_UAV dataset, only images with target bounding boxes smaller than 35 pixels are retained to enhance the model's ability to perceive small, weak targets in the early stages; and the Smoke_segmentation dataset is introduced to supplement smoke scenes. After image selection, the missing bounding boxes of the images are manually annotated by an annotation device, and all samples are standardized, cleaned, and annotated. After processing, 4178 valid images are obtained and divided into training, validation, and test sets according to a preset ratio for subsequent model training and performance evaluation.
[0027] Step 2: Improved YOLO11 Network Structure: The training device constructs an object detection network using YOLO11n as the baseline framework. The network includes at least a backbone network, a feature fusion network (Neck), and a head. In this invention, DCCD replaces the conventional downsampling layers in the backbone network, DDFM reconstructs the feature interaction units in the Neck, and SACD replaces the original unified classification head. This three-stage structural modification allows for targeted optimization in the shallow detail preservation, mid-layer dynamic fusion, and final classification stages. The overall network structure is as follows: Figure 1 As shown.
[0028] Step 3: Detail-Context Co-sampling Module (DCCD): In small target detection tasks such as flames and smoke, targets are typically small in scale and have complex backgrounds. While traditional stride-based convolution downsampling can quickly compress feature map resolution and expand the receptive field, it also easily leads to the loss of local structure and contour information in the early feature encoding stage, thus affecting subsequent feature extraction and detection prediction. To alleviate this problem, this invention proposes the Detail-Context Co-sampling Module (DCCD) and uses it to replace the conventional downsampling layer in the backbone network, providing a more complete local structure representation for the subsequent Neck stage. DCCD consists of local detail branches, context branches, and residual connections with transformations, as shown in the specific structure below. Figure 2 As shown in (a).
[0029] 1) Local detail branches: The local detail branch aims to preserve local detail information in the input features as much as possible, protecting the features and edges of small-scale objects. Given an input feature map... This branch first uses a downsampling factor of The PixelUnshuffle operation will move adjacent pixels to the next 100 pixels. Spatial regions are rearranged to the channel dimension, achieving resolution compression while avoiding the direct loss of local information. Compared to traditional stride convolution, this spatial-to-channel rearrangement method is more effective in preserving the local edge responses of flame targets and the local contour information of smoke targets. Subsequently, the rearranged features are processed by... Mapping function composed of convolution, BatchNorm, and SiLU The process of generating local detail representations can be represented as follows: ; in, This indicates the PixelUnshuffle operation. This represents the output features of local detail branches.
[0030] 2) Context branches: The context branch is used to enhance semantic expressiveness during downsampling, thereby improving the model's robust representation capabilities in complex contexts. This branch first utilizes... Convolution maps the input feature map to intermediate channel dimensions to reduce subsequent computational overhead. Subsequently, a spatial feature extraction operator is used to extract and downsample information in the spatial dimension. This operator can... Channel-wise spatial convolution is implemented, and its structure is as follows: Figure 2 As shown in (b). Next, a channel information recombination operator is used to mix and recombine information from different channels. This operator can... Channel mapping convolution is implemented, and its structure is as follows: Figure 2As shown in (c). To further enhance the context modeling capability, a spatial feature extraction operator is introduced again to further encode the recombined features. Therefore, the output of the context branch can be denoted as: ; in, Indicates by the preceding The context encoding function is composed of convolution, spatial feature extraction operators, channel information recombination operators, and subsequent spatial feature extraction operators. This indicates the output features of the context branch.
[0031] 3) Feature fusion: The outputs of the local detail branch and the context branch are first concatenated along the channel dimension to form a combined feature containing both structural and semantic information. Then, a... The fusion convolution reintegrates the two types of features and maps the number of channels back to the target output dimension, resulting in the main branch output: ; in, Indicates channel splicing. Represents the fusion mapping function, The main branch outputs features.
[0032] To mitigate the loss of original feature information during downsampling, this invention incorporates a transform-type residual branch within the DCCD module. Since the DCCD module replaces the conventional downsampling layer in the backbone network, its main branch output may differ from the input feature map in spatial size and channel dimension, making direct identity residual connection unsuitable. Therefore, the transform-type residual branch uses the input feature map X of the DCCD module as input, first performing spatial downsampling through max pooling to preserve the stronger local responses in the input features; subsequently... Convolution performs channel alignment, ensuring that the residual branch output has the same spatial size and number of channels as the main branch output. Let the residual branch output be... That is, the downsampling result of the DCCD module is obtained. : ; In summary, DCCD improves the quality of feature representation while completing downsampling through a collaborative design that preserves local details and supplements contextual information, providing more discriminative input features for the subsequent Neck stage.
[0033] Step 4: Dynamic Dual Feature Fusion Module (DDFM): In object detection networks, the Neck stage plays a crucial role in multi-scale feature interaction and fusion, and its output quality directly affects the classification and localization performance of subsequent detection heads. Although the original feature interaction unit of YOLO11 can improve representation capabilities through branch interaction and feature aggregation, its internal feature fusion still mainly relies on static element-wise addition to complete residual connections. For targets such as flames and smoke that are easily affected by background interference, this direct addition method is difficult to adaptively adjust the contribution of preserved features and transformed features according to the feature content, thus limiting the fusion effect of mid-level features. To address this issue, inspired by the Dynamic Feature Fusion (DFF) mechanism, this invention designs a Dynamic Dual Feature Fusion Module (DDFM) and uses it to reconstruct the feature interaction unit of the Neck stage. While maintaining the cross-stage local structure, the static residual addition method inside the original Bottleneck is replaced with a Dynamic Dual Feature Fusion Unit, enabling the Bottleneck input features and convolutional transformation features to be adaptively fused through dynamic calibration in the channel domain and spatial domain.
[0034] To maintain the network's efficient feature extraction capabilities, DDFM adopts a multi-branch parallel extraction framework based on the Cross-Stage Partial (CSP) concept. This module first divides the input features along the channel dimension into two parts: one path directly retains the cross-stage identity mapping; the other path enters the core feature extraction branch. In this branch, DDFM retains Bottleneck's convolutional transformation framework, but replaces the original static residual connections with dynamic dual-feature fusion units (DFFs). Finally, the two feature paths are concatenated and aggregated at the end. This overall structural design not only retains the inherent advantages of efficient feature extraction in multi-branch architectures, but also, through reasonable feature flow splitting, allows the internal dynamic fusion mechanism to more flexibly control the interaction process of multiple feature paths, thus defining the overall structure of the DDFM module.
[0035] Specifically, let the input feature of the DDFM module be X. First, the input feature X undergoes channel adjustment through input convolution mapping to obtain intermediate features; then, the intermediate features are divided into two paths along the channel dimension. One path serves as a cross-stage retention branch, directly passed to the end of the module; the other path serves as a core feature extraction branch, input into the Bottleneck structure for convolution transformation and dynamic feature interaction. In a preferred embodiment, the channel division method is to divide the channel in half along the channel dimension.
[0036] In the core feature extraction branch, let the retained features input to Bottleneck be... The features after the inner convolution transformation are denoted as When the shortcut connection condition is met, the two features will undergo deep collaboration through a dual dynamic selection mechanism in both the channel and spatial domains. This part is called Dynamic Feature Fusion (DFF), and its specific process is as follows: Figure 3 The aforementioned. The shortcut connection conditions include: enabling shortcut connections, and... and They have the same spatial dimensions and number of channels, meaning they can meet the size requirements for element-wise fusion. If the shortcut connection condition is not met, then convolutional transformation features are used. This serves as the output feature of the Bottleneck.
[0037] First, the two feature streams are concatenated along the channel dimension to construct a joint feature representation. : ; Subsequently, the module enters the channel-level dynamic calibration phase. This is to obtain joint features. The channel-level global context information is used to perform global average pooling (GAP) on it, and through... Convolutional mapping and Sigmoid activation function Generate channel-level dynamic weight matrix This weight is used for joint features. Perform channel-by-channel recalibration, followed by dimensionality reduction convolution to compress it back to the original channel dimension. The purified channel fusion characteristics were obtained. : ; ; in, and These represent the weight generation mapping matrix and the channel compression mapping matrix, respectively. This represents element-wise multiplication of the feature dimension.
[0038] Next, the module enters the spatial-level dynamic calibration stage. To highlight the target region with a strong response on the two-dimensional plane, the network utilizes... Convolution from original input features and transformation features Spatial response maps are extracted independently from each other. These two spatial response maps are then element-wise summed and normalized using Sigmoid to generate a spatial weight mask used to emphasize salient regions. : ; in, and Two independent operators are used to generate the spatial response mapping. Finally, the obtained spatial mask is... Channel fusion features acting on the front Dynamic fusion output features in the core feature extraction branch : ; To complete the overall feature aggregation of the DDFM module, the dynamically fused output feature Y is concatenated with the output features of the aforementioned cross-stage retention branch along the channel dimension, and then integrated using a terminal convolution aggregation function to obtain the final output feature of the DDFM module. This process can be represented as follows: in, This indicates that the output features of the branch are preserved across stages, and Concat[;] indicates concatenation of channel dimensions. This represents the terminal convolution aggregation function. This represents the final output characteristic of the DDFM module.
[0039] Through the above-described dynamic calibration process from channel to space, DDFM can adaptively adjust the importance of features from different sources during feature fusion, thereby reducing the ineffective response superposition caused by direct addition and enhancing the discriminative expression of mid-layer features in the Neck stage.
[0040] Step 5: Shared Regression and Asymmetric Classification Detection Head (SACD): At the end of the object detection network, the detection head is responsible for decoding multi-scale features into bounding box coordinates and class prediction results. The YOLO11 native Detect head is a completely decoupled head, employing a unified classification and regression branch across all scale feature layers. While it has good versatility, its classification modeling method uses isomorphic processing for different categories and scales, making it difficult to fully adapt to the scale distribution and appearance feature differences of multiple objects in this self-built dataset. For smaller-scale targets with stronger local discriminative information, it is more suitable to use texture information in high-resolution feature layers for classification; while for relatively larger-scale targets with more blurred boundaries, it is more suitable to combine contextual and semantic information from mid-to-high-level features for modeling. Therefore, if a unified classification head is still used to model the three layers of features in the same way, the advantageous information of different types of targets at different scales cannot be fully utilized, thus limiting the classification and discriminative capabilities of the detection head. To address this issue, this invention proposes a selective detection head with shared regression and asymmetric classification. While preserving the original regression path, it reorganizes the modeling method of classification branches according to the response differences of different types of targets on multi-scale feature layers, so that different targets can obtain more complete classification representation on more matching feature layers.
[0041] Specifically, this invention retains the regression branch in the original Detect header. , making the first Boundary box regression at each scale level still follows the original prediction logic, namely: ; in, Indicates the first Input features of each scale layer This represents the regression output features at the corresponding scale. Simultaneously, the original unified classification branch is removed, and a selective classification path oriented towards small-scale and large-scale targets is reconstructed. The three scale feature layers output to the detector head after the improved YOLO11 model passes through the backbone network and the Neck feature fusion network are denoted as P3, P4, and P5, respectively, corresponding to the input features of the 1st, 2nd, and 3rd scale layers. , and Among them, P3 has high spatial resolution and is suitable for expressing local texture, edge and detail information of small-scale targets; P4 has both spatial detail and semantic information; P5 has stronger high-level semantic expression capability and is suitable for expressing larger-scale targets and their contextual information.
[0042] In the classification path, firstly, for each scale layer, a shared local classification mapping function is used. Extracting local classification features: ; in, Indicates the first This design allows different categories to share basic local representations at the same scale first, and then perform differentiated classification modeling based on category requirements in subsequent stages.
[0043] Building upon this, the present invention further constructs category context features. For branches sensitive to local details, the local classification features corresponding to P3 and P4 are utilized. and Perform separately After mapping, features are obtained by concatenation and fusion at a uniform scale. For context-sensitive branches, the local classification features corresponding to P4 and P5 are used. and Perform the same processing to obtain features This design does not presuppose that a certain scale layer is naturally only suitable for a certain category. Instead, it enhances the local discriminative information and contextual semantic information by constructing two different cross-layer contexts, thereby improving the adaptability of the classification branch to category differences.
[0044] To avoid applying the same level of classification strength to targets across all scales, this invention employs an asymmetric allocation of "strong classifier head - weak classifier head." The strong classifier head receives both local features and category context features, which are then output after convolutional interaction; the weak classifier head relies solely on local features to perform lightweight predictions. Let the strong classifier head be denoted as... Weak classification head is recorded as The local detail-sensitive branch uses a strong classification head on P3 and P4, and a weak classification head on P5; correspondingly, the context-semantic-sensitive branch uses a weak classification head on P3, and a strong classification head on P4 and P5. Therefore, the classification output of the target at each scale can be written as follows: ; ; in, and These represent the local detail-sensitive path and the context-semantic sensitive path respectively in the first... The context gain coefficients at each scale are used to adjust the injection strength of the category context at different scales; and This represents the classification bias term for the corresponding category at different scales, used to encode the category-scale prior. Here, This means adjusting the contextual features to a spatial resolution consistent with the local features at the current scale.
[0045] After obtaining the outputs of two category-specific paths, this invention concatenates them according to the channel dimension to form the first... Classification output at each scale: ; And further with the shared regression branch output The data is spliced along the channel dimension to obtain the final detection head output: ; Thus, the proposed detection head achieves differentiated classification modeling for different scales while maintaining the stability of the original regression path.
[0046] This invention utilizes Python 3.9 and the PyTorch 2.7.0 deep learning framework for model building, training, and testing. The experimental environment is a Linux Ubuntu 22.04 LTS operating system. The hardware platform includes an Intel Xeon W5-3435X processor and an NVIDIA RTX A6000 graphics processor.
[0047] During training, the input image size was set to 640×640, the batch size to 8, and the total number of training epochs to 350. The optimizer used was the stochastic gradient descent (SGD) optimizer, with an initial learning rate of 0.01, a momentum coefficient of 0.937, and a weight decay coefficient of 0.0005. These parameter settings ensured training stability while improving the model's generalization ability to detect flames and smoke targets in complex scenes.
[0048] To comprehensively evaluate the detection performance and deployment cost of the proposed method, this invention uses mAP@0.5, mAP@0.5:0.95, Precision, Recall, Parameters, and GFLOPs as evaluation metrics. Here, mAP@0.5 represents the average precision at an IoU threshold of 0.5, and mAP@0.5:0.95 represents the average precision at IoU thresholds ranging from 0.5 to 0.95 with a step size of 0.05. Precision and Recall characterize the accuracy of the model's prediction results and its target detection capability, respectively. Parameters and GFLOPs measure the model parameter scale and theoretical computational complexity, respectively. These metrics allow for a comprehensive evaluation of the application effect of this invention in flame and smoke detection tasks from multiple aspects, including detection accuracy, model complexity, and operational efficiency. Experimental data on the self-built dataset of this invention are shown in Table 1.
[0049] Table 1. Experimental results of module ablation and combination on the self-built dataset. Where A represents DCCD, B represents DDFM, and C represents SACD; bold indicates the optimal value of the column.
[0050] like Figure 4 As shown in (a)-(b), the experimental results demonstrate that on the self-built flame and smoke detection dataset, the model's detection performance improved compared to the baseline YOLO11n after introducing DCCD, DDFM, or SACD individually, indicating the effectiveness of each module. Furthermore, as the modules were gradually combined according to the actual construction path, the model performance further improved. Specifically, when DCCD and DDFM were used together, mAP@0.5 and mAP@0.5:0.95 reached 89.3% and 66.5%, respectively. When SACD was further introduced, the mAP@0.5 and mAP@0.5:0.95 of DSA-YOLO reached 90.1% and 66.9%, respectively, representing improvements of 2.3 and 4.4 percentage points compared to the baseline model, indicating that the modules had a good synergistic gain effect.
[0051] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made to the technical solutions of the present invention by those skilled in the art without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A flame and smoke detection method based on an improved YOLOv11, characterized in that, include: Acquire an image of the target to be detected, input the image of the target to be detected into the improved YOLO11 model, and obtain the detection result; The improved YOLO11 model is obtained by training a training set, which includes: the original target image and flame and smoke labels; The improved YOLO11 model includes: replacing the conventional downsampling layer in the backbone network with a detail-context co-sampling module, reconstructing the feature interaction unit in the feature fusion network using a dynamic dual-feature fusion module, and replacing the original unified classification detection head with a shared regression and asymmetric classification module.
2. The flame and smoke detection method based on the improved YOLO11 according to claim 1, characterized in that, The detailed-context collaborative downsampling module includes: The local detail unit is used to perform a pixel unshuffle operation on the input feature map with a target downsampling factor to rearrange adjacent target spatial regions to the channel dimension, obtain rearranged features, and generate local detail branch output features through a mapping function composed of the first target convolution, BatchNorm and SiLU. The context unit is used to map the input feature map to the intermediate channel dimension using the second target convolution, to extract and downsample information in the spatial dimension using a spatial feature extraction operator, to mix and recombine information between different channels using a channel information recombination operator, and to further encode the recombined features using a spatial feature extraction operator to generate context branch output features. The feature fusion unit is used to concatenate the local detail branch output features and the context branch output features in the channel dimension to form a combined feature containing structural and semantic information. The combined feature is then reintegrated using a target fusion convolution, and the number of channels is mapped back to the target output dimension to obtain the main branch output features. The residual unit is used to spatially downsample the input feature map through max pooling and align the channels through a third target convolution to obtain the residual branch output features. The downsampling unit is used to add the main branch output features and the residual branch output features element by element to obtain the downsampling result.
3. The flame and smoke detection method based on the improved YOLO11 according to claim 1, characterized in that, The dynamic dual-feature fusion module includes: The feature partitioning unit is used to partition the input features and obtain two sets of features; The dynamic dual-feature fusion unit is used to concatenate the two features in the channel dimension to obtain joint features, perform global average pooling on the joint features, and generate a channel-level dynamic weight matrix through the fourth target convolution mapping and the Sigmoid activation function. The joint features are recalibrated channel by channel using the channel-level dynamic weight matrix and compressed back to the original channel dimension through dimensionality reduction convolution to obtain the purified channel fusion features. The spatial response maps are extracted from the input features and the transformed features using the fifth convolution, and after element-wise summation and Sigmoid normalization, a spatial weight mask for emphasizing salient regions is generated. The spatial weight mask is applied to the channel fusion feature to obtain the fusion output feature.
4. The flame and smoke detection method based on the improved YOLO11 according to claim 3, characterized in that, The channel fusion features obtained include: ; in, This is a channel-level dynamic weight matrix. and These represent the weight generation mapping matrix and the channel compression mapping matrix, respectively. Represents element-wise multiplication of the feature dimension. The characteristics of the purified channel fusion.
5. The flame and smoke detection method based on the improved YOLO11 according to claim 3, characterized in that, Generating the spatial weight mask includes: ; in, and To generate two independent operators for spatial response mapping, For input features, To transform features, For Sigmoid normalization, This is a spatial weight mask used to emphasize salient regions.
6. The flame and smoke detection method based on the improved YOLO11 according to claim 3, characterized in that, Obtaining the fused output features includes: ; in, To fuse output features, For spatial weight masks used to emphasize salient regions, The characteristics of the purified channel fusion.
7. The flame and smoke detection method based on the improved YOLO11 according to claim 1, characterized in that, The shared regression and asymmetric classification module includes: A shared regression and asymmetric classification unit is used to retain the regression branch in the original unified classification detection head, output the regression output features at the target scale, and remove the original unified classification branch. The shared local classification mapping function is used to extract the local classification features of the input features in each scale layer. The local detail-sensitive branch and the context semantic-sensitive branch are set up to map the features of layers P3 and P4 and layers P4 and P5 respectively. Then, they are concatenated and fused at a uniform scale to obtain the first target feature and the second target feature. Strong classification heads and weak classification heads are set in the local detail sensitive branch and the context semantic sensitive branch, respectively, so as to perform classification prediction through the local classification features, the first target feature and the second target feature, and obtain different classification output features; The different classification output features are concatenated along the channel dimension and then concatenated with the regression output features at the target scale along the channel dimension to obtain the detection result.
8. The flame and smoke detection method based on the improved YOLO11 according to claim 7, characterized in that, Setting strong and weak classification heads in the local detail-sensitive branch and the context semantic-sensitive branch respectively includes: In the local detail-sensitive branch, the output terminal for outputting the first local classification feature and the second local classification feature adopts a first weak classification head, and the output terminal for outputting the third local classification feature adopts a first strong classification head. Meanwhile, in the context semantic-sensitive branch, the output terminal for outputting the first local classification feature adopts a second weak classification head, and the output terminal for outputting the second local classification feature and the third local classification feature adopts a second strong classification head.
9. The flame and smoke detection method based on the improved YOLO11 according to claim 7, characterized in that, Obtaining the different classification output features includes: ; ; in, and These represent the local detail-sensitive path and the context-semantic sensitive path respectively in the first... Context gain coefficients at various scales are used to adjust the injection intensity of category context at different scales. and This represents the classification bias term for the corresponding category at different scales, used to encode the category-scale prior. This means adjusting the contextual features to a spatial resolution consistent with the local features at the current scale.