Light-weight flue gas detection method based on cross-level fusion reverse residual error
By designing a cross-level fusion reverse residual module in smoke detection, combined with the attention mechanism and reverse residual operation, the problems of low detection accuracy and large number of parameters in the existing technology are solved, and high-precision and fast detection is achieved. Smoke detection, suitable for industrial applications.
Patent Information
- Application Number
- CN202410821782.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-06
AI Technical Summary
The existing neural network has low detection accuracy, large number of parameters, and high computational cost in smoke detection, making it difficult to meet the needs of industrial applications in terms of real-time and rapidity.
A lightweight smoke detection method based on cross-level fusion reverse residual is designed. It combines expansion, filtering, attention mechanism and joint layer to form a cross-level fusion reverse residual module, using the reverse residual of MobileNetv2 and ResNet. Difference operations and jump connection operations improve low-frequency feature extraction capabilities and reduce computational costs.
It achieves high-precision and fast smoke detection, and reduces the parameter amount to 0.30M. It is suitable for small model deployment in the industrial field, improves the accuracy and stability of detection, and reduces delay.
Smart Images

Figure CN118608911A
Abstract
Description
Technical Field
[0001] The lightweight smoke detection network proposed by the present invention balances detection accuracy and memory usage, and constructs a high-precision lightweight industrial smoke detection model. The lightweight smoke detection network belongs to both the field of image processing and the field of artificial intelligence. Background Art
[0002] Image-based industrial smoke detection is of great significance in maintaining industrial safety and environmental protection. By real-time monitoring and analyzing the smoke conditions in industrial scenes, fire hazards can be discovered in a timely manner, fire early warning capabilities can be improved, and the possibility of fire accidents can be reduced. In addition, smoke detection can also evaluate the operating efficiency of environmental protection facilities, discover and control pollution sources, protect environmental quality, maintain ecological balance, and create a safer and healthier living and working environment for humans.
[0003] However, so far, smoke detection technology based on neural networks has not met the real-time and accurate requirements of this field. Existing neural networks still face problems such as low detection accuracy leading to false smoke warnings, large number of network parameters leading to difficulty in deployment on platforms with limited computing, and high computing costs leading to high latency and difficulty in meeting real-time requirements when dealing with smoke detection tasks. Based on the above problems, in the context of the great demand for lightweight networks and accurate detection, it is imperative to improve the actual application performance of industrial smoke detection technology. Summary of the invention
[0004] The lightweight smoke detection method based on cross-level fusion reverse residual proposed in the present invention uses an image whose content is unknown as input to detect the smoke condition on a single image. Compared with the existing methods, it can solve the problem that the low-frequency part has unclear information and is difficult to detect, and achieves the purpose of balancing the parameter quantity and detection accuracy at the same time, realizing industrial-grade fast and accurate smoke detection. Aiming at the low-frequency domain of large-area smoke blocks in smoke images and the complexity of the actual deployment model, the present invention is inspired by the reverse residual operation in MobileNetv2 and the skip connection operation in ResNet, and combines expansion, filtering, attention mechanism, joint, and fusion layers to form a cross-level fusion reverse residual module, and accordingly forms a lightweight smoke detection method, so as to better extract low-frequency features and realize efficient and accurate smoke detection.
[0005] The technical solution adopted by the present invention is a lightweight smoke detection method based on cross-level fusion reverse residual, and the implementation steps of the method are as follows:
[0006] (1) Cross-level fusion reverse residual module
[0007] First, we deeply understand the key features of smoke images in industrial scenarios, and based on this, we design a cross-level fusion reverse residual module that combines expansion, filtering, attention mechanism, combination and fusion at multiple levels, aiming to fully capture the actual complex features of smoke images. Among them: the expansion layer and the filtering layer are set to point-by-point convolution and depth convolution respectively to increase the dimension of the smoke feature map and reduce the computational cost, thereby improving the ability to extract smoke features; the attention mechanism is used to improve the representation ability of low-frequency channels in the feature map, selectively enhance useful features and suppress useless features, and effectively solve the problem of low-frequency component detection; the joint layer continues to use point-by-point convolution to create a linear combination of its result and the addition of the input smoke feature map of the entire module in the fusion layer, and introduces the skip connection operation in the residual network at the end of the core module. Since the reverse residual operation in MobileNetv2 is fused, that is, point-by-point convolution is added again after point-by-point convolution and depth-by-depth convolution, forming a module shape that looks opposite to the original residual in shape, the module is called a cross-level fusion reverse residual module.
[0008] The structure of the cross-level fusion reverse residual module is:
[0009] The W×H×N-sized smoke feature map is used as input to the first expansion layer, and is convolved point by point with a convolution kernel designed to be 1×1×αN, so that the dimension is increased to α times of the original, aiming to improve the recognition ability of smoke features. Its output enters the second filter layer for deep convolution with a convolution kernel size of 3×3×αN, aiming to reduce the computational cost. Since the low-frequency components of smoke images are difficult to detect, an attention module is introduced in the third layer to emphasize and enhance the key features in the smoke image, including global average pooling and feature recalibration process, that is, using 1×1×αN global pooling to map the filter layer output to obtain the scalar of each channel, in order to solve the channel dependency problem of the attention mechanism, and send it to the feature recalibration stage, that is, two consecutive fully connected layers, to specifically enhance the important features of the smoke image and suppress redundant features, thereby improving the accuracy and stability of smoke detection. Among them, the first fully connected layer uses a weight of 1×1×αN / r to reduce the dimension by a ratio of r, thereby extracting the key feature information of important channels. The second fully connected layer uses a weight of 1×1×αN to further strengthen the representation ability of these features, so as to enhance the extraction and recognition of smoke features. The purpose of using two fully connected layers is to enhance the feature weights of important channels by introducing more nonlinear functions. The result of this layer is multiplied by the result of the second layer feature map to obtain the final output of the generated attention module and sent to the fourth joint layer. In general, this attention mechanism module calculates the weights of each channel of the input feature map, multiplies it with the original feature map to obtain a new smoke feature map with important features emphasized, and effectively improves the recognition and monitoring capabilities of smoke emissions. The joint layer is designed as a convolutional layer of 1×1×N size, the purpose of which is to create a feature map of the original dimension size and add it in the fifth fusion layer. This design is to ensure that the model can fully integrate multi-layer feature information, thereby improving the comprehensive recognition capability of smoke features. Inspired by the residual network, the original input of the entire cross-level fusion reverse residual module and the output of the fourth layer are added in the fifth fusion layer, with the aim of transferring the information in the previous layer to the next layer without difference, effectively improving the model performance, and integrating more feature information without introducing additional parameters and computational costs, so that the present invention can more accurately identify and monitor flue gas emissions, providing strong support for environmental protection in industrial production.
[0010] According to calculations, compared with the classic convolutional layer, the cross-level fusion reverse residual module saves the following computational cost:
[0011]
[0012]
[0013] Among them, C1 is the parameter of the classic convolution module of the traditional smoke detection network, C2 is the parameter of the cross-level fusion reverse residual module in the present invention, N is the dimension of the input smoke image, D ω Enter the width of the input smoke image, D h is the length of the input smoke image, α is the multiple of the dimension of the output smoke image compared to the input smoke image, D k It is the length of the convolution kernel of the classic convolution module and the cross-level fusion reverse residual module in the present invention.
[0014] (2) Lightweight smoke detection network structure
[0015] The lightweight smoke detection network is built on the basis of the above core modules. The entire network structure is as follows: Figure 1 As shown in the figure. The network takes the smoke image as input. The first layer uses a 9×9×32 convolution module to obtain a larger receptive field of the input smoke image to facilitate the subsequent feature extraction of low-frequency components. The second, third, and fourth layers are designed as the same cross-level fusion reverse residual module: α is designed to be 2, the convolution kernel size of each expansion layer is 1×1×64, the convolution kernel size of the filter layer is 3×3×64, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×16, and the result is added to the input of this core module again through a joint layer with a convolution kernel size of 1×1×32. In addition to the attention mechanism module, each layer in each module is equipped with a batch normalization layer and a ReLU6 activation function. Inspired by ResNet, at the end of the fourth layer, the result is combined with the output feature map of the first layer to increase the dimension and fuse the information into a larger feature representation. The purpose is to allow information to propagate directly through the network without being disturbed by the multi-layer forward propagation process, thereby improving the network's representation ability and classification performance for input data. The fifth layer is a maximum pooling layer with a size of 2×2 and a stride of 2. The purpose is to reduce the size of the feature map, retain the main feature information and reduce the amount of calculation. Through a series of convolution and attention mechanisms, the key features in the smoke image are effectively identified and enhanced.
[0016] Then it is sent to the cross-level fusion reverse residual module of the sixth and seventh layers again and feature connection is performed again. Among them, α is 2, the convolution kernel size of each expansion layer is 1×1×128, the convolution kernel size of the filter layer is 3×3×128, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×32, and the result is added to the input of this core module through the joint layer with a convolution kernel size of 1×1×64 again. And at the end of the seventh layer, the result is combined with the output feature map of the fifth layer. The eighth layer is a maximum pooling layer with a size of 2×2 and a stride of 2.
[0017] Finally, the ninth and tenth layers enter the cross-level fusion reverse residual module, where α is 2, the convolution kernel size of each expansion layer is 1×1×256, the convolution kernel size of the filter layer is 3×3×256, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×64, and the result is added to the input of this core module again through the joint layer with a convolution kernel size of 1×1×128. At the end of the tenth layer, the result is combined with the output feature map of the eighth layer. The eleventh layer is a maximum pooling layer with a size of 2×2 and a step size of 2. After all the above feature extraction processes, the final result is output through the Softmax function of the 1×1×2 convolution kernel of the twelfth layer and the maximum pooling layer with a size of 2×2 and a step size of 2 in the thirteenth layer. The purpose is to reduce the number of model parameters while adapting to input images of different sizes, and obtain the final judgment result of whether the image contains smoke.
[0018] After testing experiments, the accuracy of smoke image detection of the present invention can reach 98.9%. The number of parameters is greatly reduced compared to traditional convolution, only 0.30M, which is more suitable for small model deployment in the industrial field and can better adapt to practical application scenarios that urgently need low latency, fast and accurate detection. The present invention is not only a network structure, but also an innovative solution designed for industrial smoke monitoring needs. By optimizing the feature extraction process and lightweight design, smoke images can be quickly and accurately identified and monitored, providing strong support for environmental protection and safe production in industrial production.
[0019] The creativity of the present invention is mainly reflected in:
[0020] (1) The cross-level fusion reverse residual module based on the attention mechanism designed in the present invention saves computational parameters while improving the representation ability of low-frequency channels.
[0021] (2) The lightweight smoke detection network designed by the present invention achieves high-precision smoke detection while saving computational effort and reducing detection time by deploying the core cross-level fusion reverse residual module and adjusting related parameters, thus providing a better solution for the deployment of smoke detection models in the industrial field. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is the basic architecture diagram of the cross-level fusion reverse residual module.
[0023] Figure 2 It is the structure diagram of the cross-level fusion reverse residual module. DETAILED DESCRIPTION
[0024] The present invention adopts the following technical solutions and implementation steps:
[0025] (1) Cross-level fusion reverse residual module
[0026] First, we deeply understand the key features of smoke images in industrial scenarios, and based on this, we design a cross-level fusion reverse residual module that combines expansion, filtering, attention mechanism, combination and fusion at multiple levels, aiming to fully capture the actual complex features of smoke images. Among them: the expansion layer and the filtering layer are set to point-by-point convolution and depth convolution respectively to increase the dimension of the smoke feature map and reduce the computational cost, thereby improving the ability to extract smoke features; the attention mechanism is used to improve the representation ability of low-frequency channels in the feature map, selectively enhance useful features and suppress useless features, and effectively solve the problem of low-frequency component detection; the joint layer continues to use point-by-point convolution to create a linear combination of its result and the addition of the input smoke feature map of the entire module in the fusion layer, and introduces the skip connection operation in the residual network at the end of the core module. Since the reverse residual operation in MobileNetv2 is fused, that is, point-by-point convolution is added again after point-by-point convolution and depth-by-depth convolution, forming a module shape that looks opposite to the original residual in shape, the module is called a cross-level fusion reverse residual module.
[0027] The structure of the cross-level fusion reverse residual module is:
[0028] The W×H×N-sized smoke feature map is used as input to the first expansion layer, and is convolved point by point with a convolution kernel designed to be 1×1×αN, so that the dimension is increased to α times of the original, aiming to improve the recognition ability of smoke features. Its output enters the second filter layer for deep convolution with a convolution kernel size of 3×3×αN, aiming to reduce the computational cost. Since the low-frequency components of smoke images are difficult to detect, an attention module is introduced in the third layer to emphasize and enhance the key features in the smoke image, including global average pooling and feature recalibration process, that is, using 1×1×αN global pooling to map the filter layer output to obtain the scalar of each channel, in order to solve the channel dependency problem of the attention mechanism, and send it to the feature recalibration stage, that is, two consecutive fully connected layers, to specifically enhance the important features of the smoke image and suppress redundant features, thereby improving the accuracy and stability of smoke detection. Among them, the first fully connected layer uses a weight of 1×1×αN / r to reduce the dimension by a ratio of r, thereby extracting the key feature information of important channels. The second fully connected layer uses a weight of 1×1×αN to further strengthen the representation ability of these features, so as to enhance the extraction and recognition of smoke features. The purpose of using two fully connected layers is to enhance the feature weights of important channels by introducing more nonlinear functions. The result of this layer is multiplied by the result of the second layer feature map to obtain the final output of the generated attention module and sent to the fourth joint layer. In general, this attention mechanism module calculates the weights of each channel of the input feature map, multiplies it with the original feature map to obtain a new smoke feature map with important features emphasized, and effectively improves the recognition and monitoring capabilities of smoke emissions. The joint layer is designed as a convolutional layer of 1×1×N size, the purpose of which is to create a feature map of the original dimension size and add it in the fifth fusion layer. This design is to ensure that the model can fully integrate multi-layer feature information, thereby improving the comprehensive recognition capability of smoke features. Inspired by the residual network, the original input of the entire cross-level fusion reverse residual module and the output of the fourth layer are added in the fifth fusion layer, with the aim of transferring the information in the previous layer to the next layer without difference, effectively improving the model performance, and integrating more feature information without introducing additional parameters and computational costs, so that the present invention can more accurately identify and monitor flue gas emissions, providing strong support for environmental protection in industrial production.
[0029] According to calculations, compared with the classic convolutional layer, the cross-level fusion reverse residual module saves the following computational cost:
[0030]
[0031] Among them, C1 is the parameter of the classic convolution module of the traditional smoke detection network, C2 is the parameter of the cross-level fusion reverse residual module in the present invention, N is the dimension of the input smoke image, D ω Enter the width of the input smoke image, D his the length of the input smoke image, α is the multiple of the dimension of the output smoke image compared to the input smoke image, D k It is the length of the convolution kernel of the classic convolution module and the cross-level fusion reverse residual module in the present invention.
[0032] (2) Lightweight smoke detection network structure
[0033] The lightweight smoke detection network is built on the basis of the above core modules. The entire network structure is as follows: Figure 1 As shown in the figure. The network takes the smoke image as input. The first layer uses a 9×9×32 convolution module to obtain a larger receptive field of the input smoke image to facilitate the subsequent feature extraction of low-frequency components. The second, third, and fourth layers are designed as the same cross-level fusion reverse residual module: α is designed to be 2, the convolution kernel size of each expansion layer is 1×1×64, the convolution kernel size of the filter layer is 3×3×64, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×16, and the result is added to the input of this core module again through a joint layer with a convolution kernel size of 1×1×32. In addition to the attention mechanism module, each layer in each module is equipped with a batch normalization layer and a ReLU6 activation function. Inspired by ResNet, at the end of the fourth layer, the result is combined with the output feature map of the first layer to increase the dimension and fuse the information into a larger feature representation. The purpose is to allow information to propagate directly through the network without being disturbed by the multi-layer forward propagation process, thereby improving the network's representation ability and classification performance for input data. The fifth layer is a maximum pooling layer with a size of 2×2 and a stride of 2. The purpose is to reduce the size of the feature map, retain the main feature information and reduce the amount of calculation. Through a series of convolution and attention mechanisms, the key features in the smoke image are effectively identified and enhanced.
[0034] Then it is sent to the cross-level fusion reverse residual module of the sixth and seventh layers again and feature connection is performed again. Among them, α is 2, the convolution kernel size of each expansion layer is 1×1×128, the convolution kernel size of the filter layer is 3×3×128, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×32, and the result is added to the input of this core module through the joint layer with a convolution kernel size of 1×1×64 again. And at the end of the seventh layer, the result is combined with the output feature map of the fifth layer. The eighth layer is a maximum pooling layer with a size of 2×2 and a stride of 2.
[0035] Finally, the ninth and tenth layers enter the cross-level fusion reverse residual module, where α is 2, the convolution kernel size of each expansion layer is 1×1×256, the convolution kernel size of the filter layer is 3×3×256, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×64, and the result is added to the input of this core module again through the joint layer with a convolution kernel size of 1×1×128. At the end of the tenth layer, the result is combined with the output feature map of the eighth layer. The eleventh layer is a maximum pooling layer with a size of 2×2 and a step size of 2. After all the above feature extraction processes, the final result is output through the Softmax function of the 1×1×2 convolution kernel of the twelfth layer and the maximum pooling layer with a size of 2×2 and a step size of 2 in the thirteenth layer. The purpose is to reduce the number of model parameters while adapting to input images of different sizes, and obtain the final judgment result of whether the image contains smoke.
[0036] After testing experiments, the smoke image detection accuracy of the present invention is 98.9%, and the parameter volume only requires 0.30M, which is more suitable for small model deployment in the industrial field and can better adapt to actual application scenarios that urgently need low latency, fast and accurate detection.
Claims
1. A lightweight smoke detection method based on cross-level fusion reverse residual, It is characterized in that The following steps are involved: Step 1: Design a cross-level fusion reverse residual module; Step 2: Design a lightweight smoke detection network based on the cross-level fusion reverse residual module.
2. According to claim 1, a lightweight smoke detection method based on cross-level fusion reverse residual, It is characterized in that In the first step: The cross-level fusion reverse residual module consists of expansion, filtering, attention mechanism, combination and fusion. The specific structure is: The feature map of size W×H×N is used as input to the first expansion layer, and is convolved point by point through a convolution kernel designed to be 1×1×αN, so that the dimension is increased to α times of the original, in order to improve the feature extraction capability; Its output enters the second filter layer for deep convolution with a kernel size of 3×3×αN to reduce the computational cost; Introducing the attention module in the third layer, including global average pooling and feature recalibration process; Use 1×1×αN global pooling to map the output of the filter layer to obtain the scalar of each channel, solving the channel dependency problem of the attention mechanism; and send it to the feature recalibration stage, that is, two consecutive fully connected layers, selectively enhancing the useful features of the channel and suppressing the channel features; the first fully connected layer uses a weight of 1×1×αN / r to reduce the dimension by a ratio of r, and the second fully connected layer uses a weight of 1×1×αN. The purpose of using two fully connected layers is to enhance the feature weights of important channels by introducing more nonlinear functions; the final output of the generated attention module is obtained by multiplying it with the result of the second layer feature map and sent to the fourth joint layer; this attention mechanism module calculates the weights of each channel of the input feature map, multiplies it with the original feature map to obtain a new feature map with emphasized important features; The joint layer is designed as a 1×1×N convolutional layer, with the purpose of creating feature maps of the original dimension size and adding them in the fifth fusion layer; the original input of the entire cross-level fusion reverse residual module and the output of the fourth layer are added in the fifth fusion layer, passing the information in the previous layer to the next layer without difference, improving the model performance and fusing feature information without introducing additional parameters and computational costs; According to calculations, compared with the classic convolutional layer, the cross-level fusion reverse residual module saves the following computational cost: Among them, C 1 is the number of parameters of the classic convolution module, C 2 is the number of parameters of the cross-level fusion reverse residual module, N is the input layer dimension, and D ω is the input width, D h is the input length, α is the dimension increase multiple, D k is the length of the convolution kernel.
3. According to the lightweight smoke detection method based on cross-level fusion reverse residual according to claim 1, It is characterized in that In the second step: The lightweight smoke detection network is built on the basis of the cross-level fusion reverse residual core module. With the smoke image as input, the first layer uses a 9×9×32 convolution module to obtain a larger receptive field of the input image to facilitate the subsequent feature extraction of low-frequency components. The second, third, and fourth layers are designed as the same cross-level fusion reverse residual module: α is 2, the convolution kernel size of each expansion layer is 1×1×64, the convolution kernel size of the filter layer is 3×3×64, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×16, and the result is added to the input of this core module through the joint layer with a convolution kernel size of 1×1×32 again; In addition to the attention mechanism module, each layer in each module is equipped with a batch normalization layer and a ReLU6 activation function. At the end of the fourth layer, the result is combined with the output feature map of the first layer to increase the dimension, and the information is fused into a feature representation, allowing information to be directly transmitted through the network, improving the network's representation ability and classification performance for input data. The fifth layer is a maximum pooling layer with a size of 2×2 and a stride of 2, which reduces the size of the feature map, retains the feature information and reduces the amount of calculation. Then it is sent to the cross-level fusion reverse residual module of the sixth and seventh layers again and feature connection is performed again; where α is 2, the convolution kernel size of each expansion layer is 1×1×128, the convolution kernel size of the filter layer is 3×3×128, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×32, and the result is added to the input of this core module through the joint layer with a convolution kernel size of 1×1×64 again; and at the end of the seventh layer, the result is combined with the output feature map of the fifth layer; the eighth layer is a maximum pooling layer with a size of 2×2 and a stride of 2; Finally, the ninth and tenth layers enter the cross-level fusion reverse residual module, where α is 2, the convolution kernel size of each expansion layer is 1×1×256, the convolution kernel size of the filter layer is 3×3×256, and r is designed to be 4 in the attention mechanism, that is, the convolution kernel of the fully connected layer is set to 1×1×64, and the result is added to the input of this core module through the joint layer with a convolution kernel size of 1×1×128 again; and at the end of the tenth layer, the result is combined with the output feature map of the eighth layer; the eleventh layer is a maximum pooling layer with a size of 2×2 and a stride of 2; After all the above feature extraction processes, the final result is output through the 1×1×2 convolution kernel of the twelfth layer and the Softmax function of the maximum pooling layer of the thirteenth layer with a size of 2×2 and a step size of 2, which reduces the number of model parameters while adapting to input images of different sizes, and obtains the final judgment result of whether the image contains smoke.
