Smoke detection method fusing UniRepLKNet and AFNet

By integrating the network structure of UniRepLKNet and AFNet in the smoke detection method, the problems of low accuracy and insufficient robustness of the existing smoke detection methods are solved, and higher detection accuracy and effective detection of multi-scale targets are achieved.

CN119399428APending Publication Date: 2025-02-07HUAIYIN INSTITUTE OF TECHNOLOGY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411410070.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-10
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing smoke detection methods have problems with low accuracy and insufficient robustness, especially in different scenarios and cameras.

Method used

Using a smoke detection method that integrates UniRepLKNet and AFNet, the Backbone backbone network of the YOLOv8 network is replaced by UniRepLKNet_SCAB, and the SegNext_Attention attention mechanism module is added to the backbone network, improving the Neck part to AFNet network structure, including C2f_MACGB module, SSFF module and TFE module to improve the accuracy and performance of the model.

Benefits of technology

It significantly improves the accuracy and robustness of smoke detection, especially when dealing with objects of different sizes and multi-scale targets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119399428A_ABST
    Figure CN119399428A_ABST
Patent Text Reader

Abstract

The invention discloses a smoke detection method fusing UniRepLKNet (UniRepLKNet) and AFNet (Amplified Factor Net). Comprising the steps that a smoke data set is acquired and preprocessed, and the preprocessed image data set is divided into a training set and a test set; the method comprises the following steps: taking YOLOv8 as a basic network, and introducing a backbone network UniRepLKNetSCAB to replace an original backbone; the method comprises the following steps of: constructing a smoke target detection model, adding a SegNextAttention attention framework structure, reconstructing a check part, introducing a brand new AdaptiveFusion Net (AFNet) model structure, and introducing a MixedAttention ContextGuideBlock (MACGB Block) mixed attention mechanism to improve a C2f module, so as to construct the smoke target detection model; and detecting a smoke image by using the improved yov8 network structure as a smoke target detection model. Compared with the prior art, the detection accuracy of the smoke image is improved, and the precision and performance of the network model are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology and relates to a smoke detection method integrating UniRepLKNet and AFNet. Background Art

[0002] Smoke recognition is a technology that uses computer vision technology to detect and identify whether there is smoke in surveillance or images in different scenes and under different cameras. Since smoke often accompanies fire, smoke detection plays a significant role in urban public safety. With the development of cities, a large number of cameras are widely used in factories, shopping malls, schools and other crowded public places. Smoke recognition, as a key component in the field of surveillance research, plays a very important role.

[0003] At present, the smoke recognition training methods mainly include traditional methods and methods based on deep learning. Traditional image processing methods can extract a large amount of image information such as texture, wavelet, color, etc. from images, and perform smoke detection on this basis. Smoke detection methods are generally divided into five stages, namely input, preprocessing, feature selection, smoke detection and recognition, and output results. Smoke detection includes methods based on smoke motion characteristics, methods based on smoke static characteristics, and methods based on smoke frequency characteristics. With the continuous deepening of the research and application of convolutional neural networks in image classification, it has also achieved a lot of results in smoke detection. Since convolutional neural networks can automatically obtain the most suitable features for classification in smoke images, coupled with the use of a large number of samples for training and continuous optimization of the model, the smoke detection effect can be improved.

[0004] There are many successful application examples of deep learning algorithms in the field of target detection. Many scholars have proposed smoke detection algorithms based on deep learning, which can have good detection performance in specific real-world scenarios, but have problems such as insufficient accuracy and insufficient robustness. Summary of the invention

[0005] Purpose of the invention: In view of the problems pointed out in the background technology, the present invention discloses a smoke detection method integrating UniRepLKNet and AFNet to solve the technical problem of low smoke detection accuracy.

[0006] Technical solution: The present invention discloses a smoke detection method integrating UniRepLKNet and AFNet, comprising the following steps:

[0007] Step 1: Obtain a training dataset of smoke images taken from different cameras, annotate the smoke images, and establish a smoke image dataset;

[0008] Step 2: Taking the yolov8 network structure as the benchmark network, introduce the large core convolutional neural network architecture UniRepLKNet_SCAB to replace the original backbone network; the UniRepLKNet_SCAB includes a 5-layer UniRepLKNet, and modify the SE module in the LarK Block in the 5-layer UniRepLKNet to a SCAB module; at the same time, add the SegNext_Attention framework structure to the backbone network;

[0009] Step 3: In the neck part of the yolov8 network structure, replace it with the AFNet network structure, including the C2f_MACGB module, the scale sequence feature fusion SSFF module, and the triple feature encoder TFE module, to obtain the improved smoke detection model; the C2f_MACGB module replaces the Bottleneck Block of C2f with the MACGBlock module; the MACGBlock module includes a 1x1 convolution module, a context-guided module ContextGuidedBlock, and a mixed attention module MixedAttention;

[0010] Step 4: Train the improved smoke detection model and input the smoke image to be detected and identified into the trained smoke detection model for detection.

[0011] Furthermore, each layer of the UniRepLKNet includes four stages, the first stage is SamK Block, the second stage is LarK Block, the fourth stage is LarK Block, and the third stage is a combination of SamK Block and LarK Block, and each stage is connected by 3*3 convolution downsampling with a step size of 2;

[0012] The LarK Block consists of a DilatedReparam Block, a SCAB module, a feedforward network FFN and a batch normalization layer BN. The difference between SamKBlock and LarK Block is that SamK Block uses a 3*3 depth separation convolution to replace the dilated reparam block of the former.

[0013] The SCAB module consists of a spatial attention module SAM and a channel attention module CA.

[0014] Furthermore, the SegNext_Attention designs a multi-scale convolutional attention MSCA module to pay more precise attention to the region of interest. MSCA is written as:

[0015]

[0016] Among them, F represents the input element, Att and Out are the attention map and output respectively. It is an element-by-element matrix multiplication operation. DW-Conv stands for deep convolution. Scale i , i∈{0,1,2,3} represents the i-th branch; Scale0 is the identity connection. In each branch, two depth-wise strip convolutions are used to approximate the standard depth-wise convolution with a large kernel.

[0017] Furthermore, the specific process of the AFNet network structure is as follows:

[0018] The first UniRepLKNet from the backbone network is taken as layer 0 and numbered sequentially;

[0019] First, the feature map output by the 6th layer SegNext_Attention enters the 7th layer Conv convolution layer to reduce the amount of calculation, and the 2nd layer UniRepLKNet output enters the 8th layer Conv convolution layer to reduce the amount of calculation. Then the 9th layer TFE module receives the output tensors of the 3rd, 7th and 8th layers to perform upsampling and interpolation operations, and then enters the 10th layer C2f_MACGB module for feature extraction and fusion;

[0020] The 11th Conv convolution layer receives the feature map of the 10th layer to reduce the amount of calculation, and then the 12th Conv convolution layer receives the output feature map of the 1st layer UniRepLKNet to reduce the amount of calculation. Then the 13th TFE module receives the output tensors of the 2nd, 11th and 12th layers to perform upsampling and interpolation operations, and then enters the 14th C2f_MACGB module for feature extraction and fusion;

[0021] Then the 15th Conv convolution layer receives the feature map of the 14th C2f_MACGB module to reduce the amount of calculation, and then the output features of the 11th layer and the 15th layer enter the 16th concat layer for splicing, and then enter the 17th C2f_MACGB module for feature extraction and fusion;

[0022] The 18th Conv convolutional layer receives the feature map of the previous layer to reduce the amount of calculation, and then enters the 19th SDI module together with the output features of the 7th layer for feature extraction and fusion. Then the 20th C2f_MACGB module receives the output feature map of the 19th layer to reduce the amount of calculation;

[0023] The 21st layer SSFF module receives the output tensors of three different scales from the 2nd, 3rd and 4th layers for feature fusion. Then the two input tensors from the 21st and 14th layers enter the 22nd layer for element-by-element addition. Finally, the 17th, 20th and 22nd layers are output to the Detect head at the head.

[0024] Furthermore, the processing process of the C2f_MACGB module is as follows: first input a feature map, then perform a convolution operation to divide the feature map into two parts, the two parts enter the MACGBlock module for processing respectively, then enter concat to connect the two parts to form a new feature map, and finally perform a convolution operation to output the feature map.

[0025] Furthermore, the MACGBlock module processing process is:

[0026] First, a feature map is input, and then the local features of the input feature map are extracted through a 1x1 convolution module, and then the context guidance module ContextGuidedBlock is entered. The context guidance module ContextGuidedBlock uses a 3x3 convolution layer to extract local features, and then uses a 3x3 dilated convolution layer to extract surrounding features. Finally, the local features and surrounding features are connected in the channel dimension to form a joint feature;

[0027] The local features extracted by the 1x1 convolution module are passed through the mixed attention module MixedAttention, which is composed of the spatial attention module of CBAM and the channel attention mechanism SE block;

[0028] The feature map processed by the mixed attention module MixedAttention and the joint features output by the context guidance module ContextGuidedBlock are connected in the channel dimension, and then the final feature map is output through two convolutions.

[0029] Beneficial effects:

[0030] Compared with the prior art, the present invention aims at the situation that the computing power of low-end devices is limited and the prediction accuracy is not high. In order to further improve the accuracy and performance of the network model, the present invention replaces the Backbone backbone network in the YOLOv8 network with the UniRepLKNet backbone network to achieve high accuracy, and adds the SegNext_Attention attention mechanism module after the backbone network to help the model better utilize global context information. The Neck part is modified to introduce a new AdaptiveFusionNet (AFNet) model structure. C2f is replaced by the C2f_MACGB module, which integrates the spatial attention module and the channel attention mechanism SE block of CBAM, and uses the SSFF module to provide richer and more detailed feature expressions, thereby improving the performance of the model when processing objects of different sizes. The triple feature encoder TFE module is used to perform a convolution process on the three feature maps of large, medium and small sizes and then splice them in the channel dimension, realizing the effective fusion of multi-scale features, thereby improving the model's detection and recognition capabilities for multi-scale targets. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is the overall flow chart of the present invention;

[0032] Figure 2 This is an overall structural diagram of a smoke detection method integrating UniRepLKNet and AFNet in the present invention;

[0033] Figure 3 SCAB module structure diagram of an embodiment of the present invention;

[0034] Figure 4 It is a structural diagram of the C2f_MACGB module of an embodiment of the present invention;

[0035] Figure 5 It is a structural diagram of a MACGBlock module according to an embodiment of the present invention;

[0036] Figure 6 It is a structural diagram of the UniRepLKNet_SCAB module of an embodiment of the present invention;

[0037] Figure 7 It is the structural diagram of TFE module;

[0038] Figure 8 This is a curve diagram of the improved network model training process of the present invention. DETAILED DESCRIPTION

[0039] The present invention is further described in detail below in conjunction with embodiments. The embodiments given are intended to illustrate the technical features and functional features of the method of the present invention, rather than to limit the scope of the present invention.

[0040] Step 1: The camera receives the video stream signal, captures the video stream signal into an image, preprocesses the image, and resizes the input image to 640×640 pixels. The data folder is datasets, which includes two subfolders, Images and Labels. Images stores the training images, and labels stores the xml files corresponding to the training images. 80% of the data is used as the training set, 10% of the data is used as the validation set, and 10% of the data is used as the test set. The training set image path is saved in the train folder, and the test set image path is saved in the test folder.

[0041] Step 2: Build a smoke detection network based on YOLOv8, such as Figure 2 As shown, it includes Backbone module, Neck module and Head module. The backbone network module integrates the large core convolutional neural network UniRepLKNet_SCAB for inter-channel communication and spatial aggregation, and uses a small core with expansion for reparameterization. A new convolutional attention framework SegNext_Attention is introduced to help the model better utilize global context information. The AFNet module is introduced, which is a fusion of the C2f_MACGB module, the scale sequence feature fusion (SSFF) module, the triple feature encoder (TFE) module and the channel and position attention mechanism (CPAM). These features together improve the accuracy of the model.

[0042] The specific steps are as follows:

[0043] Step 2.1: Input the preprocessed image to the backbone part of the network model. The input image passes through the UniRepLKNet_SCAB module.

[0044] The UniRepLKNet_SCAB model includes a 5-layer UniRepLKNet. The SE module in the LarKBlock block in the 5-layer UniRepLKNet is modified to a SCAB module, which significantly improves the performance while maintaining a low inference cost. Its structure is as follows: Figure 6 As shown. The model has four stages in total. The first stage uses SamKBlock, the second stage uses LarK Block, the fourth stage uses LarK Block, and the third stage uses a combination of SamK Block and LarK Block. Each stage uses a 3*3 convolution with a stride of 2 to downsample and connect.

[0045] LarK Block consists of a Dilated Reparam Block, a SCAB module, a feedforward network FFN and a batch normalization layer BN; the difference between SamK Block and LarK Block is that SamK Block uses 3*3 depth separation convolution to replace the former's dilated reparam block Dilated Reparam Block.

[0046] The UniRepLKNet_SCAB model uses the SCAB (SpatialChannelAttentionBlock) module to provide finer-grained and more comprehensive feature processing capabilities. The SCAB module structure is as follows: Figure 3 As shown in the figure. The SCAB module is mainly composed of the spatial attention module SAM (SpatialAttention Mechanism) and the channel attention module CA (ChannelAttention). SAM is mainly used to improve the model's ability to pay attention to spatial areas in the image, helping the model to automatically pay attention to important areas in the image. The spatial attention mechanism enhances the response to specific areas by generating spatial attention maps, thereby improving the performance of the model. CA is a commonly used channel attention mechanism used to improve the expression ability of channel features in convolutional neural networks (CNN). It highlights important channel features by dynamically adjusting the weights of different channels, thereby improving the performance of the model. Through this design, UniRepLKNet_SCAB effectively improves the depth and feature extraction capabilities of the model without increasing the computational cost, making it perform well in various downstream tasks.

[0047] Step 2.2: Then enter the SPPF module (Spatial Pyramid Pooling) to aggregate features at multiple scales.

[0048] Step 2.3: Finally, introduce the SegNext_Attention module in the Backbone part to help the model better utilize global context information.

[0049] The SegNext_Attention module is an attention mechanism designed to improve image segmentation performance. This module achieves more precise attention to the region of interest by designing a multi-scale convolutional attention MSCA module. The MSCA module consists of three key parts: first, deep convolution, which is used to aggregate local information to capture the detailed features of the target area; second, multi-branch deep strip convolution, which is used to capture multi-scale contextual information to better understand the environment around the target area; finally, 1×1 convolution, which is used to model the relationship between different channels and use its output as the attention weight to re-weigh the input of the MSCA module to pay more attention to important features. This design enables the SegNext_Attention module to perform well in image segmentation tasks, improve segmentation performance and effectively improve the accuracy of the region of interest. MSCA can be written as:

[0050]

[0051] Where F represents the input feature. Att and Out are the attention map and output respectively. is an element-by-element matrix multiplication operation. DW-Conv stands for depthwise convolution, and Scalei, i∈{0,1,2,3} represents the i-th branch. Scale0 is the identity connection. In each branch, two depthwise stripe convolutions are used to approximate the standard depthwise convolution with a large kernel.

[0052] Step 3: The present invention designs a new neck AFNet module, which integrates the C2f_MACGB module, the scale sequence feature fusion (SSFF) module, the triple feature encoder (TFE) module and the channel and position attention mechanism (CPAM) to form a new Neck network structure.

[0053] The module first enters the 7th Conv layer convolution layer from the feature map of the 6th layer to reduce the amount of calculation, and then continues to enter the 8th convolution layer from the 2nd layer to reduce the amount of calculation. Then the 9th layer TFE module receives the output tensors of the 3rd, 7th and 8th layers to perform upsampling and interpolation operations, and then enters the 10th layer C2f_MACGB module for feature extraction and fusion. The 11th layer Conv convolution layer receives the feature map of the previous layer to reduce the amount of calculation, and then the 12th layer Conv convolution layer receives the feature map of the 1st layer to reduce the amount of calculation, and then the 13th layer TFE module receives the output tensors of the 2nd, 11th and 12th layers to perform upsampling and interpolation operations, and then enters the 14th layer C2f_MACGB module for feature extraction and fusion. Then the 15th layer Conv convolution layer receives the feature map of the 14th layer to reduce the amount of calculation, and then the output features of the 11th layer and the 15th layer enter the 16th layer concat layer for splicing, and then enter the 17th layer C2f_MACGB module for feature extraction and fusion. Then, the 18th Conv convolution layer receives the feature map of the previous layer to reduce the amount of calculation, and then enters the 19th SDI module together with the output features of the 7th layer for feature extraction and fusion. Then the 20th C2f_MACGB module receives the output feature map of the 19th layer to reduce the amount of calculation. Then the 21st SSFF module receives the output tensors of three different scales of the 2nd, 3rd and 4th layers for feature fusion, and then the two input tensors of the 21st and 14th layers enter the 22nd layer for element-by-element addition. Finally, the 17th, 20th and 22nd layers are output to the Detect head of the head.

[0054] The core of the C2f_MACGB module is to replace the Bottleneck Block in the initial C2f with a new MACGBlock (MixedAttentionContextGuidedBlock). The C2f_MACGB module structure is as follows: Figure 4 As shown in the figure, a feature map is first input, and then a convolution operation is performed to divide the feature map into two parts. The two parts enter the MACGBlock module for processing, and then enter concat to connect the two parts to form a new feature map. Finally, a convolution operation is performed to output the feature map.

[0055] MACGBlock module such as Figure 5 As shown in the figure, first a feature map is input, and then the local features of the input feature map are extracted through a 1x1 convolution operation, and then the context-guided module ContextGuidedBlock is entered. The ContextGuidedBlock module mainly uses a 3x3 convolution layer for local feature extraction, and then uses a 3x3 dilated convolution layer for surrounding feature extraction. Finally, the local features and surrounding features are connected in the channel dimension to form a joint feature.

[0056] The local features extracted by the 1x1 convolution module are passed through the mixed attention module MixedAttention, which is mainly composed of the spatial attention module of CBAM and the channel attention mechanism SE block. The spatial attention module of CBAM performs global maximum pooling and global average pooling on the input feature map, then connects the two pooling results in the channel dimension, and then performs a 7x7 convolution operation, and finally obtains the spatial attention map through Sigmoid activation. SE block: compresses each channel through global average pooling, then learns the channel weights through two fully connected layers, and finally re-weights each channel through Sigmoid activation.

[0057] The feature map processed by the mixed attention module MixedAttention and the joint features output by the context guidance module ContextGuidedBlock are connected in the channel dimension, and then the final feature map is output through two convolutions.

[0058] The core function of the scale sequence feature fusion SSFF module is to enhance the neural network's ability to extract features of different scales. By aggregating features from different levels of the network, the SSFF module can provide richer and more detailed feature expressions, thereby improving the model's performance when dealing with objects of different sizes. This fusion strategy is particularly suitable for tasks that require accurate positioning and identification of multi-scale objects in images. Through the SSFF module, the model can more effectively capture and understand the detailed information in the image, thereby significantly improving the overall detection and recognition performance. The scaled image as SSFF input can be obtained by the following formula.

[0059] F σ (w,h)=G σ (w,h)×f(w,h)

[0060]

[0061] Where F(w,h) represents a two-dimensional input image with a width of w and a height of h. σ (w,h) by using a two-dimensional Gaussian filter G σ (w,h) is generated by a series of convolution smoothing, where σ is a scaling parameter for the standard deviation of the 2D Gaussian filter used for convolution.

[0062] The Triple Feature Encoder (TFE) module is an innovative feature fusion mechanism designed to enhance the effectiveness of feature extraction and fusion. Figure 7is the structure of the TFE module. The module first adjusts the number of feature channels to make it consistent with the main scale features. When processing large-scale feature maps, the number of channels is adjusted to 1C through convolution processing, and a hybrid structure of maximum pooling and average pooling is used for downsampling, thereby retaining the effectiveness and diversity of high-resolution features. For small-scale feature maps, the TFE module uses convolution processing to adjust the number of channels and upsamples through the nearest neighbor interpolation method to maintain the richness of local features of low-resolution images and prevent the loss of small target feature information. Finally, the three feature maps of large, medium and small sizes are convolved once and then spliced ​​in the channel dimension, realizing the effective fusion of multi-scale features, thereby improving the model's detection and recognition capabilities for multi-scale targets. The formula is shown below.

[0063] F TFE =Concat(F l ,F m ,F s )

[0064] where F TFE Represents the feature map output by the TFE module. l 、F m and F s Represent large, medium and small size feature maps respectively. FTFE is generated by connecting Fl, Fm and Fs in series. TFE Resolution and F m The number of channels is the same as that of F m Three times.

[0065] The 19-layer SDI (Semantic and Detail Infusion) module is a key component in the UNetV2 model. The function of the SDI module is to apply spatial and channel attention mechanisms to process the features generated by the encoder, integrating local spatial information and global channel information. The module fuses high-level features (containing more semantic information) with low-level features (capturing finer details) through the Hadamard product operation to enhance the semantics and details of the features. The processed refined features are passed to the decoder for image segmentation. The SDI module can be seamlessly integrated into any encoder-decoder network, significantly improving the segmentation performance while maintaining computational and memory efficiency. The SDI module implements its functions through the following key steps: First, through upsampling, the SDI module increases the size of the feature map of the lower level to match the size of the current level. This process introduces more detail information and ensures the retention of high-resolution details. Second, in the identity mapping step, the feature map is passed directly without any modification to maintain the integrity of the original feature information. Then, through downsampling, the SDI module reduces the size of the high-level feature map to match the size of the current level, thereby introducing higher-level semantic information and enhancing global semantic understanding. Finally, the spatial and channel attention mechanism is applied to process the features, integrating local spatial information and global channel information to enhance the accuracy and robustness of feature expression. Through these steps, the SDI module effectively integrates multi-level feature information, retains detail information, and integrates global semantic information, thereby significantly improving the performance of image segmentation tasks.

[0066] Step 4: Input the training set image data in the smoke detection dataset into the improved network model in steps 2 and 3 for training. Save the model parameters with the highest accuracy on the validation set during the training process and name the file best.pt.

[0067] The experimental environment of the present invention is configured to use the Windows 10 operating system, use the NVIDIA GeForce RTX 3050 graphics card, and use the PyTorch deep learning framework. The specific configuration is shown in Table 1 below:

[0068] Table 1 Experimental environment configuration table

[0069]

[0070] The training set image data in the smoke detection dataset is input into the improved network model, and GPU training is used to set the parameters of the improved network model. The number of training rounds is 200, the momentum is 0.937, the initial learning rate is 0.01, the minimum learning rate is 0.0001, the weight decay coefficient is 0.00005, the SGD optimizer is used, and the batch size is 16. During the model training process, the model parameters with the best accuracy will be saved and named best.pt.

[0071] Figure 8 The figure shows the curve of the changes of various indicators during the 200 rounds of model training. After the model training is completed, the Precision of smoke in the validation set reaches 84.3%, and the mAP reaches 73.6%; compared with the original YOLOv8n, the algorithm in this paper improves the Precision of steel surface defects by 3.2%, and the mAP by 3.5%; Recall (recall rate) is improved by 10.8%. . Precision represents the accuracy of the model, and the larger the index, the better the model recognition effect; mAP represents the quality of the model in all categories, and the larger the index, the better the model network performance. The algorithm index comparison table is shown in Table 2, which proves the feasibility of the algorithm of the present invention.

[0072] Table 2 Comparison of experimental results of different models

[0073]

[0074] The above embodiments are only for illustrating the technical concept and features of the present invention, and their purpose is to enable people familiar with the technology to understand the content of the present invention and implement it accordingly, and they cannot be used to limit the protection scope of the present invention. Any equivalent transformation or modification made according to the spirit of the present invention should be included in the protection scope of the present invention.

Claims

1. A smoke detection method integrating UniRepLKNet and AFNet, characterized in that: The steps include: Step 1: Obtain a training dataset of smoke images taken from different cameras, annotate the smoke images, and establish a smoke image dataset; Step 2: Taking the yolov8 network structure as the benchmark network, introduce the large core convolutional neural network architecture UniRepLKNet_SCAB to replace the original backbone network; the UniRepLKNet_SCAB includes a 5-layer UniRepLKNet, and modify the SE module in the LarK Block in the 5-layer UniRepLKNet to a SCAB module; at the same time, add the SegNext_Attention framework structure to the backbone network; Step 3: In the neck part of the yolov8 network structure, replace it with the AFNet network structure, including the C2f_MACGB module, the scale sequence feature fusion SSFF module, and the triple feature encoder TFE module, to obtain the improved smoke detection model; the C2f_MACGB module replaces the Bottleneck Block of C2f with the MACGBlock module; the MACGBlock module includes a 1x1 convolution module, a context-guided module ContextGuidedBlock, and a mixed attention module MixedAttention; Step 4: Train the improved smoke detection model and input the smoke image to be detected and identified into the trained smoke detection model for detection.

2. According to the smoke detection method integrating UniRepLKNet and AFNet according to claim 1, it is characterized in that: Each layer of UniRepLKNet consists of four stages, the first stage is SamKBlock, the second stage is LarK Block, the fourth stage is LarK Block, and the third stage is a combination of SamK Block and LarK Block. Each stage is connected by 3*3 convolution downsampling with a step size of 2; The LarK Block consists of a DilatedReparam Block, a SCAB module, a feedforward network FFN and a batch normalization layer BN. The difference between SamKBlock and LarK Block is that SamK Block uses a 3*3 depth separation convolution to replace the dilated reparam block of the former. The SCAB module consists of a spatial attention module SAM and a channel attention module CA.

3. The smoke detection method integrating UniRepLKNet and AFNet according to claim 1, characterized in that: The SegNext_Attention designs a multi-scale convolutional attention MSCA module to pay more precise attention to the region of interest. MSCA is written as: Among them, F represents the input element, Att and Out are the attention map and output respectively. It is an element-by-element matrix multiplication operation. DW-Conv stands for deep convolution. Scale i , i∈{0,1,2,3} represents the i-th branch; Scale0 is the identity connection. In each branch, two depth-wise strip convolutions are used to approximate the standard depth-wise convolution with a large kernel.

4. The smoke detection method integrating UniRepLKNet and AFNet according to claim 1, characterized in that: The specific process of the AFNet network structure is as follows: The first UniRepLKNet from the backbone network is taken as layer 0 and numbered sequentially; First, the feature map output by the 6th layer SegNext_Attention enters the 7th layer Conv convolution layer to reduce the amount of calculation, and the 2nd layer UniRepLKNet output enters the 8th layer Conv convolution layer to reduce the amount of calculation. Then the 9th layer TFE module receives the output tensors of the 3rd, 7th and 8th layers to perform upsampling and interpolation operations, and then enters the 10th layer C2f_MACGB module for feature extraction and fusion; The 11th Conv convolution layer receives the feature map of the 10th layer to reduce the amount of calculation, and then the 12th Conv convolution layer receives the output feature map of the 1st layer UniRepLKNet to reduce the amount of calculation. Then the 13th TFE module receives the output tensors of the 2nd, 11th and 12th layers to perform upsampling and interpolation operations, and then enters the 14th C2f_MACGB module for feature extraction and fusion; Then the 15th Conv convolution layer receives the feature map of the 14th C2f_MACGB module to reduce the amount of calculation, and then the output features of the 11th layer and the 15th layer enter the 16th concat layer for splicing, and then enter the 17th C2f_MACGB module for feature extraction and fusion; The 18th Conv convolutional layer receives the feature map of the previous layer to reduce the amount of calculation, and then enters the 19th SDI module together with the output features of the 7th layer for feature extraction and fusion. Then the 20th C2f_MACGB module receives the output feature map of the 19th layer to reduce the amount of calculation; The 21st layer SSFF module receives the output tensors of three different scales from the 2nd, 3rd and 4th layers for feature fusion. Then the two input tensors from the 21st and 14th layers enter the 22nd layer for element-by-element addition. Finally, the 17th, 20th and 22nd layers are output to the Detect head at the head.

5. The smoke detection method integrating UniRepLKNet and AFNet according to claim 4, characterized in that: The processing process of the C2f_MACGB module is as follows: first input a feature map, then perform a convolution operation to divide the feature map into two parts, the two parts enter the MACGBlock module for processing respectively, then enter concat to connect the two parts to form a new feature map, and finally perform a convolution operation to output the feature map.

6. The smoke detection method integrating UniRepLKNet and AFNet according to claim 5, characterized in that: The MACGBlock module processing process is: First, a feature map is input, and then the local features of the input feature map are extracted through a 1x1 convolution module, and then the context guidance module ContextGuidedBlock is entered. The context guidance module ContextGuidedBlock uses a 3x3 convolution layer to extract local features, and then uses a 3x3 dilated convolution layer to extract surrounding features. Finally, the local features and surrounding features are connected in the channel dimension to form a joint feature; The local features extracted by the 1x1 convolution module are passed through the mixed attention module MixedAttention, which is composed of the spatial attention module of CBAM and the channel attention mechanism SE block; The feature map processed by the mixed attention module MixedAttention and the joint features output by the context guidance module ContextGuidedBlock are connected in the channel dimension, and then the final feature map is output through two convolutions.

Citation Information

Cited By

  • Cross-modal smoke shielding human body identification method and device based on double-engine cooperation

    CN121170846A

  • Cross-modal smoke-occluded human recognition method and device based on dual-engine cooperation

    CN121170846B