A CNN firework detection method and system based on a double attention mechanism

By employing a CNN-based smoke detection method with a dual attention mechanism, combined with visual algorithms and sensor data, rapid and accurate identification and alarm of smoke in tower equipment rooms were achieved. This solved the problems of slow response and false alarms in traditional fire monitoring methods, and improved the security of communication infrastructure.

CN120088740BActive Publication Date: 2026-02-24CHINA TOWER CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510586888.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-08
Publication Date
2026-02-24
Estimated Expiration
2045-05-08

AI Technical Summary

Technical Problem

Traditional fire monitoring methods rely on smoke detectors or temperature sensors, which are slow to react and cannot identify potential hazards in a timely manner. Furthermore, environmental noise and interference factors can cause false alarms, affecting the reliability and effectiveness of the equipment.

Method used

A CNN-based smoke detection method with a dual attention mechanism is adopted. Image data is acquired in real time through camera monitoring, and combined with data from CO concentration, temperature and humidity sensors. A lightweight convolutional neural network and a dual attention mechanism are used for feature extraction and recognition to achieve fast and accurate smoke detection.

Benefits of technology

It improves the accuracy and timeliness of smoke and fire detection, reduces the false alarm rate, ensures the safety management level of communication equipment rooms, and provides early warning capabilities for fires.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088740B_ABST
    Figure CN120088740B_ABST
Patent Text Reader

Abstract

The application discloses a CNN firework detection method and system based on a double attention mechanism, comprising the following steps: acquiring a history image of fireworks and preprocessing the history image of the fireworks, extracting features of the history image of the fireworks after processing, obtaining feature data of the history image of the fireworks, establishing a firework detection model based on a double attention mechanism according to the feature data, inputting a to-be-detected image into the firework detection model for firework recognition and outputting a recognition result, performing double authentication based on the recognition result and environmental perception data, and issuing an alarm information if the authentication is passed. The application can effectively detect dangerous scenes caused by small targets such as cigarette butts and sparks in the tower room, and through training and learning of long-distance and small target features, the model can effectively detect the features of the firework target in the real-time video of the camera, so as to achieve recognition and tracking of small target objects and improve the accuracy of the CNN in small target detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of image processing technology, and in particular relates to a CNN-based method and system for detecting fireworks based on a dual attention mechanism. Background Technology

[0002] In today's rapidly developing information and intelligent world, tower equipment rooms, as a crucial component of communication networks, house critical network equipment and data centers. These rooms are densely packed with equipment, most of which are high-value assets; therefore, ensuring their safe and stable operation is paramount. Fires not only severely damage equipment but can also cause service interruptions, impacting the normal operation of the entire communication network and resulting in significant economic losses and social consequences. However, traditional fire monitoring methods rely heavily on smoke detectors or temperature sensors, which often react slowly in the early stages of a fire, failing to identify potential hazards in a timely manner. Furthermore, environmental noise and other interference factors can lead to false alarms, affecting the reliability and effectiveness of the equipment. Summary of the Invention

[0003] To address the aforementioned issues, this invention provides a CNN smoke detection method and system based on a dual attention mechanism. This addresses the problems of traditional fire monitoring methods relying heavily on smoke detectors or temperature sensors, which often have slow responses in the early stages of a fire, leading to an inability to identify potential hazards in a timely manner. Additionally, environmental noise and other interference factors can cause false alarms, thus affecting the reliability and effectiveness of the equipment.

[0004] A CNN-based smoke detection method based on a dual attention mechanism includes:

[0005] Acquire historical images of fireworks and preprocess them;

[0006] Feature extraction is performed on the processed historical fireworks images to obtain feature data of the historical fireworks images;

[0007] A fireworks detection model based on a dual attention mechanism was established based on feature data;

[0008] The image to be detected is input into the fireworks detection model for fireworks recognition and the recognition result is output.

[0009] The system performs dual authentication based on the identification results and environmental perception data. If the authentication is successful, an alarm message is issued.

[0010] According to a specific embodiment of the present invention, acquiring historical fireworks images and preprocessing the historical fireworks images includes:

[0011] The historical video stream data of fireworks is acquired and processed by frame segmentation and data annotation to obtain historical images of fireworks;

[0012] The historical images of fireworks were normalized.

[0013] According to a specific embodiment of the present invention, feature extraction is performed on the processed historical fireworks image to obtain feature data of the historical fireworks image, including:

[0014] Based on image resolution, historical images of fireworks are divided into multiple channels to obtain multi-channel image data.

[0015] Initial feature extraction was performed on the multi-channel image data based on the convolutional neural network algorithm to obtain multi-channel feature data of the historical fireworks image;

[0016] Based on a dual attention mechanism, deep feature extraction is performed on multi-channel feature data to obtain deep feature data of historical fireworks images.

[0017] According to a specific embodiment of the present invention, deep feature extraction is performed on multi-channel feature data based on a dual attention mechanism to obtain deep feature data of the fireworks history image, including:

[0018] Based on the dual attention mechanism, channel attention features and spatial attention features are extracted from multi-channel feature data, where channel attention features include channel saliency information and spatial attention features include spatial location information.

[0019] Feature enhancement and feature stitching are performed based on channel attention features and spatial attention features to obtain depth feature data of historical fireworks images.

[0020] According to a specific embodiment of the present invention, establishing a fireworks detection model based on a dual attention mechanism according to feature data includes:

[0021] Based on the feature data, a channel attention model and a spatial attention model are established respectively. The channel attention model and the spatial attention model adopt a parallel structure. The channel attention model is used to extract the saliency information of the feature channels, and the spatial attention model is used to extract the position information of the target in space.

[0022] According to a specific embodiment of the present invention, the method further includes acquiring environmental sensing data, including CO concentration, temperature and humidity data.

[0023] According to a specific embodiment of the present invention, dual authentication is performed based on the identification result and environmental perception data. If the authentication is successful, an alarm message is issued, including:

[0024] Based on the recognition results, it is determined whether smoke or fire has been detected. If it has been detected, it is determined whether the environmental perception data has reached a preset threshold. If it has, an alarm message is issued.

[0025] According to a specific embodiment of the present invention, the identification result includes the type of fireworks, the target location, and the confidence score.

[0026] A CNN-based smoke detection system based on a dual attention mechanism includes:

[0027] The data acquisition and processing module is used to acquire historical images of fireworks and preprocess them.

[0028] The feature extraction module is used to extract features from the processed fireworks history images to obtain feature data of the fireworks history images;

[0029] The model building module is used to build a fireworks detection model based on a dual attention mechanism based on feature data;

[0030] The recognition module inputs the image to be detected into the fireworks detection model to identify fireworks and outputs the recognition results;

[0031] The alarm module is used for dual authentication based on the recognition results and environmental perception data. If the authentication is successful, an alarm message is issued.

[0032] According to a specific embodiment of the present invention, the data acquisition and processing module further includes:

[0033] The data acquisition module is used to acquire historical video stream data of fireworks and perform frame-by-frame processing and data annotation on the historical video stream to obtain historical images of fireworks;

[0034] The data processing module is used to normalize historical images of fireworks.

[0035] According to a specific embodiment of the present invention, the feature extraction module further includes:

[0036] The channel segmentation module is used to perform multi-channel segmentation on historical fireworks images based on image resolution to obtain multi-channel image data.

[0037] The initial feature extraction module is used to perform initial feature extraction on multi-channel image data based on the convolutional neural network algorithm to obtain multi-channel feature data of the fireworks history image;

[0038] The deep feature extraction module is used to extract deep features from multi-channel feature data based on a dual attention mechanism to obtain deep feature data of historical fireworks images.

[0039] According to a specific embodiment of the present invention, the deep feature extraction module further includes:

[0040] The dual attention feature extraction module is used to extract channel attention features and spatial attention features from multi-channel feature data based on the dual attention mechanism. The channel attention features include channel saliency information, and the spatial attention features include spatial location information.

[0041] The feature enhancement and stitching module is used to perform feature enhancement and feature stitching based on channel attention features and spatial attention features to obtain depth feature data of historical fireworks images.

[0042] According to a specific embodiment of the present invention, it further includes:

[0043] The environmental sensing data acquisition module is used to acquire CO concentration, temperature, and humidity data.

[0044] According to a specific embodiment of the present invention, the alarm module further includes:

[0045] The first judgment unit is used to determine whether smoke has been detected based on the recognition result;

[0046] The second judgment unit is used to determine whether a preset threshold has been reached based on environmental perception data.

[0047] An alarm unit is used to send alarm information based on the judgment results of the first judgment unit and the second judgment unit.

[0048] An electronic device includes a processor and a memory, wherein a computer program is stored in the memory and is loaded and executed by the processor to implement the above-described CNN smoke detection method based on a dual attention mechanism.

[0049] A computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the above-described CNN-based smoke detection method based on a dual attention mechanism.

[0050] Compared with existing technologies, the CNN smoke detection method and system based on a dual attention mechanism provided by this invention have the following advantages:

[0051] 1. This invention designs a CNN model with a small number of parameters and a small target detection model based on a dual attention mechanism, which can effectively detect dangerous scenarios caused by small targets such as cigarette butts and sparks in the tower machine room. Through training and learning on the features of long-distance and small targets, the model can effectively detect the features of smoke and fire targets in real-time video from the camera, thereby achieving the recognition and tracking of small target objects, improving the accuracy of CNN in small target detection, enhancing the feature representation of small targets and improving the model's ability to capture detailed features. In detecting dangerous situations caused by small targets such as cigarette butts in the tower machine room, it can ensure that the occurrence of dangerous accidents is cut off at the source.

[0052] 2. This invention utilizes CO, temperature, and humidity sensors to comprehensively assist in monitoring the safety situation in the computer room. It combines the sensor detection end and the vision algorithm end to jointly detect dangerous smoke and fire scenarios. Once an anomaly is detected, it is immediately verified with the data collected by the sensor end. If the data exceeds the preset threshold, an alarm is immediately triggered. This mechanism not only improves the response speed of smoke and fire detection but also reduces the possibility of false alarms.

[0053] 3. This invention also provides optional remote operation and maintenance and management functions, which can detect dangerous and abnormal accidents such as fires in the computer room in real time, thereby providing effective protection for the safe operation of the tower computer room. Attached Figure Description

[0054] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0055] Figure 1 This is a flowchart of a CNN-based smoke detection method based on a dual attention mechanism according to an embodiment of the present invention.

[0056] Figure 2 This is a flowchart of a method for acquiring and preprocessing historical images of fireworks according to an embodiment of the present invention.

[0057] Figure 3 This is a flowchart of a method for feature extraction from historical fireworks images according to an embodiment of the present invention.

[0058] Figure 4 This is a flowchart of a method for deep feature extraction of multi-channel feature data based on a dual attention mechanism according to an embodiment of the present invention.

[0059] Figure 5 This is an overall framework diagram of a CNN fireworks detection model based on a dual attention mechanism provided according to an embodiment of the present invention.

[0060] Figure 6 This is a schematic diagram illustrating the enhanced operation of feature extraction using a dual attention model according to an embodiment of the present invention.

[0061] Figure 7 This is a schematic diagram of a dual attention feature fusion process according to an embodiment of the present invention.

[0062] Figure 8This is a structural diagram of a CNN smoke detection system based on a dual attention mechanism according to an embodiment of the present invention.

[0063] Figure 9 This is a structural diagram of a data acquisition and processing module provided according to an embodiment of the present invention.

[0064] Figure 10 This is a structural diagram of a feature extraction module provided according to an embodiment of the present invention.

[0065] Figure 11 This is a structural diagram of a depth feature extraction module provided according to an embodiment of the present invention.

[0066] Figure 12 This is a structural diagram of an alarm module according to an embodiment of the present invention.

[0067] Figure 13 This is a schematic diagram of a computer device structure according to an embodiment of the present invention.

[0068] Figure label:

[0069] 00-Environmental perception data acquisition module; 01-Data acquisition and processing module; 02-Feature extraction module; 03-Model building module; 04-Recognition module; 05-Alarm module;

[0070] 011-Data Acquisition Module; 012-Data Processing Module;

[0071] 021-Channel segmentation module; 022-Initial feature extraction module; 023-Depth feature extraction module;

[0072] 0231 - Dual attention feature extraction module; 0232 - Feature enhancement and concatenation module;

[0073] 051 - First judgment unit; 052 - Second judgment unit; 053 - Alarm unit. Detailed Implementation

[0074] To enable those skilled in the art to more clearly understand the concepts and ideas of the present invention, the present invention is described in detail below with reference to specific embodiments. It should be understood that the embodiments given herein are only a part of all possible embodiments of the present invention. Those skilled in the art, after reading this specification, are capable of making improvements, modifications, or substitutions to parts or the entirety of the following embodiments, and such improvements, modifications, or substitutions are also included within the scope of protection claimed by the present invention.

[0075] In this document, the terms “announcement,” “arrival,” and other similar words are not intended to imply any order, quantity, or importance, but are merely used to distinguish different elements. The terms “one,” “a,” and other similar words are not intended to indicate the existence of only one thing, but rather that the description pertains to only one of the things, which may have one or more. The terms “contains,” “includes,” and other similar words are intended to indicate a logical relationship, not a spatial relationship. For example, “A includes B” means that logically B belongs to A, not that spatially B is located inside A. Furthermore, the meanings of the terms “contains,” “includes,” and other similar words should be considered open-ended, not closed. For example, “A includes B” means that B belongs to A, but B does not necessarily constitute all of A; A may also include other elements such as C, D, and E.

[0076] In this document, the terms "embodiment," "this embodiment," "an embodiment," and "one embodiment" do not imply that the description applies only to one specific embodiment, but rather that such description may also be applicable to one or more other embodiments. Those skilled in the art will understand that any description made herein with respect to one embodiment can be substituted, combined, or otherwise combined with the descriptions in one or more other embodiments. New embodiments resulting from such substitutions, combinations, or other combinations are readily conceived by those skilled in the art and fall within the scope of protection of this invention.

[0077] Example 1

[0078] Additional aspects and advantages of embodiments of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of the invention. Figures 1-7 This invention provides a CNN-based smoke detection method based on a dual attention mechanism, comprising:

[0079] S1: Acquire historical images of fireworks and preprocess them.

[0080] S2: Extract features from the processed historical fireworks images to obtain feature data of the historical fireworks images.

[0081] S3: Establish a fireworks detection model based on a dual attention mechanism using feature data.

[0082] S4: Input the image to be detected into the fireworks detection model to identify fireworks and output the recognition results.

[0083] S5: Perform dual authentication based on the recognition results and environmental perception data. If the authentication is successful, an alarm message will be issued.

[0084] Compared to traditional fire monitoring methods that rely heavily on smoke detectors or temperature sensors, these devices often react slowly in the early stages of a fire and cannot promptly identify potential hazards. Furthermore, environmental noise and other interference factors can lead to false alarms, affecting the reliability and effectiveness of the equipment. This invention utilizes a small target detection algorithm based on a lightweight dual-attention mechanism to perform real-time inference and smoke / fire detection at the camera end. By monitoring the computer room environment in real time, it accurately identifies small targets such as smoke and flames. Combined with sensor data, it can more comprehensively analyze environmental changes within the computer room, providing strong support for fire early warning. When the visual algorithm detects smoke / fire and the sensor detects that it has reached the ignition threshold, an alarm is triggered, enabling rapid alerts in the early stages of a fire. This not only improves the accuracy and timeliness of smoke / fire detection but also significantly reduces the false alarm rate, enhancing the safety management level of the computer room and ensuring the stable operation of communication infrastructure.

[0085] Specifically, step S1, acquiring historical fireworks images and preprocessing them, includes:

[0086] S11: Obtain historical video stream data of fireworks and perform frame segmentation and data annotation on the historical video stream to obtain historical images of fireworks.

[0087] S12: Normalize the historical images of fireworks.

[0088] In a specific embodiment of the present invention, a camera is used to acquire historical video stream data of fireworks and the historical video stream data is processed by frame segmentation to obtain historical images of fireworks. After obtaining the historical images of fireworks, the images are labeled with data and the labeled images are normalized to facilitate the subsequent training of the fireworks detection model.

[0089] Specifically, step S2 extracts features from the processed fireworks history image to obtain feature data of the fireworks history image, including:

[0090] S21: Based on image resolution, the historical images of fireworks are divided into multiple channels to obtain multi-channel image data.

[0091] S22: Based on the convolutional neural network algorithm, initial feature extraction is performed on the multi-channel image data to obtain multi-channel feature data of the fireworks history image.

[0092] S23: Based on the dual attention mechanism, deep feature extraction is performed on the multi-channel feature data to obtain the deep feature data of the fireworks history image.

[0093] Furthermore, step S23 uses a dual attention mechanism to extract deep features from the multi-channel feature data, obtaining the deep feature data of the fireworks history image, including:

[0094] S231: Based on the dual attention mechanism, channel attention features and spatial attention features are extracted from multi-channel feature data respectively. The channel attention features include channel saliency information, and the spatial attention features include spatial location information.

[0095] S232: Based on channel attention features and spatial attention features, feature enhancement processing and feature stitching are performed to obtain the depth feature data of the fireworks history image.

[0096] In a specific embodiment of the present invention, by dividing historical fireworks images into multiple channels according to different image resolution dimensions, historical fireworks images with multiple channels are obtained. Each channel represents a feature dimension of the image, and different channels contain different image feature information. By analyzing and extracting features from images of different channels separately, images can be analyzed from multiple dimensions to more accurately identify these features. After dividing the images into multiple channels, the present invention performs feature extraction on the image data of each channel separately, such as... Figure 7 As shown, this invention first uses a convolutional neural network (CNN) algorithm to extract initial features from the historical fireworks images of each channel, obtaining the corresponding fireworks feature data for each channel. Lightweight CNNs, due to their relatively simple model structure and high computational efficiency, are particularly suitable for real-time monitoring in resource-constrained environments. By applying lightweight CNNs to fireworks detection, efficient image processing and analysis can be achieved, enabling timely detection of potential hazards. Then, a dual attention mechanism is employed to extract deep features from the fireworks feature data of each channel, capturing spatial and channel feature information in the image. The dual attention mechanism includes two branches: a channel attention branch and a spatial attention branch. The channel attention branch captures the correlation between feature channels in the image, while the spatial attention branch captures the correlation of features in spatial location. Through the dual attention mechanism, spatial and channel feature information of the fireworks feature data for each channel can be extracted. Then, feature enhancement and feature concatenation are performed on the extracted spatial and channel feature information to obtain the deep feature data of the historical fireworks images. This deep feature data enhances the feature representation of small targets and improves the model's ability to capture detailed features, thereby more accurately detecting the spatial location and salient feature information of small targets in the tower equipment room. This invention utilizes a lightweight CNN and a dual attention mechanism to effectively capture the spatial and channel information of features in images for small target detection in tower equipment rooms. Furthermore, the lightweight dual attention convolution design has low computational cost, making it suitable for applications in resource-constrained environments.

[0097] Specifically, step S3, establishing a fireworks detection model based on a dual attention mechanism using feature data, includes:

[0098] Based on the feature data, a channel attention model and a spatial attention model are established respectively. The channel attention model and the spatial attention model adopt a parallel structure. The channel attention model is used to extract the saliency information of the feature channels, and the spatial attention model is used to extract the position information of the target in space.

[0099] In a specific embodiment of the present invention, the fireworks detection model based on a dual attention mechanism includes an input module, a feature extraction module, and an output module, such as... Figure 5 As shown, the model's input module is used to input historical images of fireworks and environmental perception data. The environmental perception data includes CO concentration, temperature, and humidity data collected by sensors. Based on the detection requirements of small fireworks targets inside the tower's equipment room, this embodiment of the invention designs a multi-channel input module to perform independent lightweight convolutional neural network processing on data from different channels. Each channel represents a feature dimension in the image and shares the same convolution and attention operations on the same channel. The processed multi-channel features are concatenated and used as input to a dual attention mechanism, thereby more accurately detecting the spatial location and salient feature information of small targets. The model's output module outputs the recognition results of the image to be detected, including the fireworks category, target location, and confidence score. Furthermore, the output module also outputs alarm information. The feature extraction module employs convolutional layers and a dual attention mechanism. The convolutional layers utilize a traditional CNN architecture. The dual attention module divides the output data of the convolutional layers into two parallel branches: a channel attention branch and a spatial attention branch. The channel attention branch focuses on the correlation between feature channels in the image, treating each feature channel as a unit and establishing a channel correlation model through a self-attention network. The spatial attention branch focuses on the spatial correlation of features, also employing a self-attention mechanism to model spatial information. This parallel attention representation enables feature modeling from different perspectives of the input image. Because the same convolution and attention operations are shared on the same channel, most targets in the image share similar feature spaces in both channel and spatial perspectives, resulting in consistent representations. This consistency remains stable across channels and space. However, for noisy or anomalous targets, their representation patterns are random and diverse, neither sharing strong channel and spatial correlations with normal targets nor exhibiting consistency with other noise points. The smoke detection model based on the dual attention mechanism established in this invention can more accurately identify and distinguish between normal targets and anomalous information, resulting in more precise detection, especially suitable for small target detection in complex environments.

[0100] In a specific embodiment of the present invention, a loss function based on feature saliency is also designed during the feature modeling process. The similarity between the two features is measured by calculating the maximum mean difference between the target feature and the background feature, thereby improving the model's detection accuracy for small targets.

[0101] In a specific embodiment of the present invention, the process of establishing the dual attention model is as follows: Figure 6 As shown:

[0102] The dual attention model consists of two parts: a channel attention module and a spatial attention module, which are connected in parallel. Specifically, the channel attention module calculates the average value for each channel using global average pooling and passes the result to a fully connected layer to calculate the attention weight for each channel. The calculation process is as follows:

[0103] (1)

[0104] (2)

[0105] Where F is the feature map, and These represent channel-based attention and space-based attention, respectively. This indicates element-wise multiplication. and These represent the output feature maps after channel attention and spatial attention, respectively.

[0106] The channel attention module first performs max pooling and average pooling on the input feature map in the spatial dimension, then passes each through a multilayer perceptron with shared weights. The outputs of the two are then summed element-wise, followed by a sigmoid activation function to obtain the channel attention weights. Multiplying these weights element-wise with the input feature map achieves the channel attention mechanism. The output of the channel attention can be expressed as:

[0107] (3)

[0108] Where MLP represents a multilayer perceptron, AvgPool represents global average pooling, and MaxPool represents max pooling. It is the output image based on channel attention.

[0109] Max pooling and average pooling are performed separately in the spatial dimension, which essentially means retaining only the channel dimension and setting other dimensions to 1, resulting in a one-dimensional vector. This vector is then passed through a multilayer perceptron with shared weights. The multilayer perceptron consists of two convolutional layers. The first convolution is followed by a ReLU activation function, and the second convolution is followed by a sigmoid activation function to obtain the output weights. Then, each channel is multiplied by its corresponding weight. The above process can be represented as follows:

[0110] (4)

[0111] in, and These represent the first convolution operation and the second convolution operation, respectively. and These represent average pooling and max pooling, respectively. This represents the sigmoid activation function.

[0112] In the spatial attention module, the input feature map is first subjected to channel-based max pooling and average pooling operations. The two resulting feature maps are then concatenated based on their channels, followed by convolution and a sigmoid activation function to obtain attention weights with one channel and the same size as the input feature map. These attention weights are then multiplied element-wise with the input feature map, thus completing the spatial attention calculation. This process can be represented as:

[0113] (5)

[0114] in, This indicates a convolution operation with a kernel size of 7 × 7. This indicates global average pooling, while MaxPool indicates max pooling. M s (F) is the output image based on spatial attention.

[0115] Finally, the output feature maps after channel attention and spatial attention are concatenated, so that they first pass through the channel attention mechanism and then the spatial attention mechanism to extract information from the image in the channel dimension and the spatial dimension, respectively, in the order of channel first and then spatial. The specific formula is as follows:

[0116] (6)

[0117] in, This means that attention-enhanced feature output is performed first in the channel dimension, and then attention-intensity feature output is performed in the spatial dimension.

[0118] For the cascaded channel-space attention module, features are processed sequentially through the channel attention and spatial attention modules, progressively uncovering salient features in the image information. The channel attention module first weights the input features to enhance the model's sensitivity to key channels; then, the spatial attention module further expands the spatial relevance of the features, ensuring that the final representation possesses strong global and local perception capabilities.

[0119] Unlike the previous sequential attention mechanism that first focuses on channels and then on spatial location, this invention connects the two in parallel. This significantly reduces the computational load of the model and is more suitable for detecting small targets such as fireworks and cigarette butts in real-time images. A lightweight switch activation function is then used for normalization to more easily and efficiently capture weight information in both channel and spatial dimensions. The input feature map is combined with the channel weights. The features extracted from the two attention operations are concatenated, and the channels are processed through a 1×1 convolution operation. The specific calculation formula is shown below:

[0120] (7)

[0121] in, This indicates a parallel computing method.

[0122] For the parallel channel attention module and spatial attention module, the channel attention module takes a global perspective, emphasizing the importance of specific channel features based on the weighted relationships of different channel features. The spatial attention module, on the other hand, focuses on local spatial information, emphasizing the correlation between different locations in the image. The joint representation based on the parallel channel and spatial attention modules, as well as the cascaded channel-spatial attention module, allows for more comprehensive dual-dimensional attention processing of multi-level features in visual tasks, thereby improving the model's expressive and generalization abilities. In the parallel attention structure, the channel and spatial attention modules extract features independently from the channel and spatial dimensions, respectively, ensuring the model can fully capture detailed features from different dimensions. Furthermore, the use of shared weights further enhances the model's ability to recognize and abstract multi-view features.

[0123] Since the channel attention module and spatial attention module in the parallel structure have different output dimensions, this invention unifies the output dimensions of the parallel modules by adding an upsampling operation to ensure the stability of subsequent calculations and compensate for this difference. This upsampling process ensures that channel and spatial information can interact at the same scale, thereby forming a richer joint feature representation.

[0124] Specifically, in step S4, the image to be detected is input into the fireworks detection model for fireworks identification, and the identification results are output. The identification results include fireworks category, target location, and confidence score. The output identification results can be used as a basis for judging fireworks. When fireworks are identified, the fireworks category, target location, and confidence score are uploaded to the cloud management module for remote operation and maintenance and real-time monitoring.

[0125] Specifically, step S5 performs dual authentication based on the recognition result and environmental perception data. If the authentication is successful, an alarm message is issued, including:

[0126] Based on the recognition results, it is determined whether smoke or fire has been detected. If it has been detected, it is determined whether the environmental perception data has reached a preset threshold. If it has, an alarm message is issued.

[0127] In a specific embodiment of this invention, the recognition results output by the model are combined with environmental perception data detected by the sensors. When the model detects smoke and fire and the environmental perception data detected by the sensors reaches a preset threshold, an alarm is immediately triggered, and data slices are uploaded to the platform for storage, facilitating subsequent management and maintenance. By combining the recognition results with the environmental perception data detected by the sensors, once the model detects an anomaly, it immediately verifies the data collected by the sensors. If the data exceeds the preset threshold, an alarm is immediately triggered. This mechanism not only improves the response speed of smoke and fire detection but also reduces the possibility of false alarms.

[0128] Example 2

[0129] Based on the above method, embodiments of the present invention also provide a CNN smoke detection system based on a dual attention mechanism, such as... Figures 8-12 As shown, it includes:

[0130] The environmental sensing data acquisition module 00 is used to acquire CO concentration, temperature and humidity data.

[0131] The data acquisition and processing module 01 is used to acquire historical images of fireworks and preprocess them.

[0132] Feature extraction module 02 is used to extract features from the processed fireworks history image to obtain feature data of the fireworks history image.

[0133] Model building module 03 is used to build a fireworks detection model based on a dual attention mechanism based on feature data.

[0134] The recognition module 04 inputs the image to be detected into the fireworks detection model to perform fireworks recognition and outputs the recognition results.

[0135] Alarm module 05 is used for dual authentication based on recognition results and environmental perception data. If the authentication is successful, an alarm message will be issued.

[0136] This invention provides a CNN smoke and fire detection system based on a dual attention mechanism. Utilizing a lightweight dual attention mechanism-based small target detection algorithm, it performs real-time inference and smoke and fire detection at the camera end. By monitoring the computer room environment in real time, it accurately identifies small targets such as smoke and flames. Simultaneously, by combining sensor data, it can more comprehensively analyze environmental changes within the computer room, providing strong support for fire early warning. When the visual algorithm detects smoke and fire that matches the sensor's ignition threshold, an alarm is triggered, enabling rapid alerts in the early stages of a fire. This not only improves the accuracy and timeliness of smoke and fire detection but also significantly reduces the false alarm rate, enhancing the safety management level of the computer room and ensuring the stable operation of communication infrastructure.

[0137] Specifically, the data acquisition and processing module 01 also includes:

[0138] The data acquisition module 011 is used to acquire historical video stream data of fireworks and perform frame-by-frame processing and data annotation on the historical video stream to obtain historical images of fireworks. It is also used to acquire environmental perception data, including CO concentration, temperature and humidity data.

[0139] Data processing module 012 is used to normalize historical images of fireworks.

[0140] In a specific embodiment of the present invention, the data acquisition module 011 first acquires historical video stream data of fireworks and performs frame segmentation processing on the historical video stream data to obtain historical images of fireworks. Then, the data processing module 012 performs data annotation on the acquired historical images of fireworks and performs normalization processing on the data-annotated images to facilitate subsequent training of the fireworks detection model.

[0141] Specifically, feature extraction module 02 also includes:

[0142] The channel segmentation module 021 is used to perform multi-channel segmentation on historical fireworks images based on image resolution to obtain multi-channel image data.

[0143] The initial feature extraction module 022 is used to perform initial feature extraction on multi-channel image data based on the convolutional neural network algorithm to obtain multi-channel feature data of the fireworks history image;

[0144] The deep feature extraction module 023 is used to extract deep features from multi-channel feature data based on a dual attention mechanism to obtain the deep feature data of the fireworks history image.

[0145] Furthermore, the deep feature extraction module 023 also includes:

[0146] The dual attention feature extraction module 0231 is used to extract channel attention features and spatial attention features from multi-channel feature data based on the dual attention mechanism. The channel attention features include channel saliency information, and the spatial attention features include spatial location information.

[0147] The feature enhancement and stitching module 0232 is used to perform feature enhancement and feature stitching based on channel attention features and spatial attention features to obtain depth feature data of the fireworks history image.

[0148] In a specific embodiment of the present invention, the fireworks history image is first divided into multiple channels according to different image resolution dimensions by the channel segmentation module 021, resulting in multiple channels of fireworks history images. Each channel represents a feature dimension of the image, and different channels contain different image feature information. By analyzing and extracting features from the images of different channels separately, the image can be analyzed from multiple dimensions to more accurately identify these features. After the image is divided into multiple channels, the present invention uses the initial feature extraction module 022 to extract features from the image data of each channel separately, such as... Figure 7 As shown, this invention first extracts initial features from the historical images of fireworks in each channel using a convolutional neural network algorithm, thereby obtaining the fireworks feature data for the corresponding channel. Lightweight convolutional neural networks are particularly suitable for real-time monitoring in resource-constrained environments due to their relatively simple model structure and high computational efficiency. By applying lightweight CNNs to fireworks detection, efficient image processing and analysis can be achieved, and potential dangers can be detected in a timely manner. Then, the deep feature extraction module 023 is used to extract deep features from the fireworks feature data of each channel to capture spatial and channel feature information in the image. The dual attention mechanism includes two branches: a channel attention branch and a spatial attention branch. The channel attention branch is used to capture the correlation between feature channels in the image, and the spatial attention branch is used to capture the correlation of features in spatial location. The dual attention feature extraction module 0231 can extract the spatial and channel feature information of the fireworks feature data of each channel. Then, the feature enhancement and stitching module 0232 performs feature enhancement and feature stitching on the extracted spatial and channel feature information to obtain the deep feature data of the fireworks historical image. This deep feature data can enhance the feature representation of small targets and improve the model's ability to capture detailed features, thereby more accurately detecting the spatial location information and salient feature information of small targets in the tower equipment room. This invention, through a lightweight CNN and a dual attention mechanism, can effectively capture the spatial and channel information of features in the image in the task of detecting small targets in the tower equipment room. Moreover, the lightweight dual attention convolution has low computational cost and is suitable for application in resource-limited environments.

[0149] Specifically, this invention utilizes model building module 03 to establish a fireworks detection model based on a dual attention mechanism.

[0150] In a specific embodiment of the present invention, the fireworks detection model based on a dual attention mechanism includes an input module, a feature extraction module, and an output module, such as... Figure 5 As shown, the model's input module is used to input historical images of fireworks and environmental perception data. The environmental perception data includes CO concentration, temperature, and humidity data collected by sensors. Based on the detection requirements of small fireworks targets inside the tower's equipment room, this embodiment of the invention designs a multi-channel input module to perform independent lightweight convolutional neural network processing on data from different channels. Each channel represents a feature dimension in the image and shares the same convolution and attention operations on the same channel. The processed multi-channel features are concatenated and used as input to the dual attention mechanism, thereby more accurately detecting the spatial location and salient feature information of small targets. The model's output module outputs the recognition results of the image to be detected, including the fireworks category, target location, and confidence score. On the other hand, the output module also outputs alarm information. The feature extraction module employs convolutional layers and a dual attention mechanism. The convolutional layers use a traditional CNN convolutional neural network architecture. The dual attention module consists of a channel attention model and a spatial attention model, which are implemented in parallel. The channel attention model extracts the salient information of the feature channels, while the spatial attention model extracts the target's spatial location information. The channel attention model focuses on the correlation between feature channels in an image, treating each feature channel as a unit and establishing a correlation model between channels through a self-attention network. The spatial attention model focuses on the correlation of features in spatial location, also employing a self-attention mechanism to model spatial information. This parallel attention representation enables feature modeling from different perspectives of the input image. Because the same convolution and attention operations are shared on the same channel, most targets in the image share similar feature spaces in both channel and spatial perspectives, resulting in consistent representations. This consistency can be maintained stably in both channels and space. However, for noisy or anomalous targets, their representation patterns are random and diverse, neither sharing strong correlations with normal targets in channels and space nor consistent with other noise points. The smoke and fire detection model based on a dual attention mechanism established by this invention can more accurately identify and distinguish between normal targets and anomalous information, resulting in more precise detection, especially suitable for small target detection in complex environments.

[0151] Specifically, alarm module 05 also includes:

[0152] The first judgment unit 051 is used to determine whether fireworks are detected based on the recognition result.

[0153] The second judgment unit 052 is used to determine whether a preset threshold has been reached based on environmental perception data.

[0154] Alarm unit 053 is used to send alarm information based on the judgment results of the first judgment unit and the second judgment unit.

[0155] In a specific embodiment of this invention, the alarm module 05 combines the recognition result output by the model with the environmental perception data detected by the sensor. When the first judgment unit 051 determines that smoke or fire has been detected and the second judgment unit 052 determines that the detected environmental perception data has reached a preset threshold, the alarm unit 053 is immediately triggered to issue an alarm message. At the same time, the data slice is uploaded to the platform for storage, so as to facilitate subsequent management and maintenance. By combining the recognition result with the environmental perception data detected by the sensor, once the model detects an anomaly, it immediately verifies it with the data collected by the sensor. If the data exceeds the preset threshold, an alarm is immediately triggered. This mechanism not only improves the response speed of smoke and fire detection but also reduces the possibility of false alarms.

[0156] Example 3

[0157] To achieve small-target smoke and fire detection within the tower equipment room, this invention also provides a CNN smoke and fire detection product based on a dual attention mechanism, to implement the aforementioned CNN smoke and fire detection method based on a dual attention mechanism. The product includes:

[0158] The system comprises a sensor acquisition module, a camera vision processing module, an alarm intelligence module, and a cloud management module. The sensor acquisition module collects environmental data such as CO concentration, temperature, and humidity in real time, providing essential information for smoke and fire detection. The camera vision processing module employs a small target detection algorithm based on a lightweight dual-attention mechanism. It provides inference and analysis capabilities based on visual information from the computer room under camera monitoring, offering real-time protection for the normal operation of the computer room. The neural network algorithm used incorporates a unique lightweight dual-attention module with a multi-scale feature fusion module to provide feature information for small targets such as cigarette butts and sparks. It also effectively captures long-distance dependencies of global features to obtain feature information for distant small targets. The small target detection algorithm integrated into the camera vision processing module enables efficient real-time inference and detection at the camera end, ensuring smooth image processing and timely identification of smoke and fire, and performing dual authentication with environmental perception data collected by the sensors. The alarm intelligence module combines camera detection results with sensor data. Once the camera detects smoke and fire and the relevant data collected by the sensors reaches a preset threshold, an alarm is immediately issued. This not only improves the response speed of smoke and fire detection but also reduces the possibility of false alarms. The cloud management module provides a convenient interface for remote operation and maintenance personnel, supports real-time monitoring and alarm information dissemination. Through the cloud management module, users can achieve comprehensive monitoring and maintenance of the tower equipment room, improving the overall security management level.

[0159] In one specific embodiment of the invention, data is first collected using CO, temperature, and humidity sensors to obtain indoor environmental perception data for the tower equipment room. Simultaneously, model inference is performed at the camera end, and suspicious small targets are monitored in real time. Finally, the detected suspicious targets are dual-authenticated with the sensor data. The model is then uploaded to the cloud for fusion and subsequently sent back to the camera end for updates. The camera algorithm detection module analyzes the uploaded video frames using a CNN smoke detection method based on a dual-attention mechanism. Once an anomaly is detected, it immediately verifies the data collected by the sensors. If the threshold is exceeded, an alarm response is immediately initiated, and data slices are uploaded to the platform for storage, facilitating subsequent management and maintenance. The camera algorithm detection module also optimizes the algorithm model based on target detection and uploads the model. This ensures that while monitoring equipment anomalies, a continuously updated inference model is provided for early warning of fire hazards such as smoke.

[0160] Example 4

[0161] like Figure 13As shown, this embodiment of the invention also provides an electronic device, including a processor and a memory. The memory stores a computer program, which is loaded and executed by the processor to implement the aforementioned CNN smoke detection method based on a dual attention mechanism. The device in this invention can be a server, PC, PAD, mobile phone, etc.

[0162] Furthermore, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, which is loaded and executed by a processor to implement the above-described CNN smoke detection method based on a dual attention mechanism.

[0163] In summary, the CNN smoke detection method and system based on a dual attention mechanism described in this invention has the following advantages:

[0164] 1. This invention designs a CNN model with a small number of parameters and a small target detection model based on a dual attention mechanism, which can effectively detect dangerous scenarios caused by small targets such as cigarette butts and sparks in the tower machine room. Through training and learning on the features of long-distance and small targets, the model can effectively detect the features of smoke and fire targets in real-time video from the camera, thereby achieving the recognition and tracking of small target objects, improving the accuracy of CNN in small target detection, enhancing the feature representation of small targets and improving the model's ability to capture detailed features. In detecting dangerous situations caused by small targets such as cigarette butts in the tower machine room, it can ensure that the occurrence of dangerous accidents is cut off at the source.

[0165] 2. This invention utilizes CO, temperature, and humidity sensors to comprehensively assist in monitoring the safety situation in the computer room. It combines the sensor detection end and the vision algorithm end to jointly detect dangerous smoke and fire scenarios. Once an anomaly is detected, it is immediately verified with the data collected by the sensor end. If the data exceeds the preset threshold, an alarm is immediately triggered. This mechanism not only improves the response speed of smoke and fire detection but also reduces the possibility of false alarms.

[0166] 3. This invention also provides optional remote operation and maintenance and management functions, which can detect dangerous and abnormal accidents such as fires in the computer room in real time, thereby providing effective protection for the safe operation of the tower computer room.

[0167] The concepts, principles, and ideas of the present invention have been described in detail above with reference to specific embodiments (including examples and instances). Those skilled in the art should understand that the embodiments of the present invention are not limited to those given above. After reading this application, those skilled in the art can make any possible improvements, substitutions, and equivalents to the steps, methods, systems, and components in the above embodiments. These improvements, substitutions, and equivalents should be considered to fall within the scope of the present invention, and the scope of protection of the present invention is limited to the claims.

Claims

1. A CNN-based smoke detection method based on a dual attention mechanism, characterized in that, include: Acquire historical images of fireworks and preprocess them; Feature extraction is performed on the processed historical fireworks image to obtain the feature data of the historical fireworks image, specifically including: The historical fireworks images are divided into multiple channels based on image resolution to obtain multi-channel image data. Initial feature extraction is performed on the multi-channel image data based on the convolutional neural network algorithm to obtain the multi-channel feature data of the fireworks history image; Based on a dual attention mechanism, deep feature extraction is performed on the multi-channel feature data to obtain the deep feature data of the fireworks history image, which further includes: Based on a dual attention mechanism, channel attention features and spatial attention features are extracted from multi-channel feature data, wherein the channel attention features include channel saliency information and the spatial attention features include spatial location information. Feature enhancement and feature stitching are performed based on channel attention features and spatial attention features to obtain the depth feature data of the fireworks history image; A fireworks detection model based on a dual attention mechanism is established based on the aforementioned feature data, specifically including: Based on the feature data, a channel attention model and a spatial attention model are established respectively. The channel attention model and the spatial attention model adopt a parallel structure. The channel attention model is used to extract the saliency information of the feature channels, and the spatial attention model is used to extract the position information of the target in space. The smoke detection model is represented as follows: in Where F is the feature map, M C and M S These represent channel-based attention and space-based attention, respectively. This indicates element-wise multiplication. F' and F'' represent the output feature maps after channel attention and spatial attention, respectively. F''' represents the output feature map after parallel concatenation of the output feature maps after channel attention and spatial attention. Indicates a parallel computing method; The image to be detected is input into the fireworks detection model for fireworks recognition and the recognition result is output. Based on the identification results and environmental perception data, dual authentication is performed. If the authentication is successful, an alarm message is issued.

2. The CNN smoke detection method based on dual attention mechanism according to claim 1, characterized in that, The process of acquiring historical fireworks images and preprocessing them includes: Historical video stream data of fireworks is acquired and the historical video stream is processed by frame segmentation and data annotation to obtain historical images of fireworks; The historical images of the fireworks were normalized.

3. The CNN smoke detection method based on dual attention mechanism according to claim 1, characterized in that, The method also includes acquiring environmental sensing data, which includes CO concentration, temperature, and humidity data.

4. The CNN smoke detection method based on dual attention mechanism according to claim 3, characterized in that, The dual authentication based on the identification result and environmental perception data, and the issuance of alarm information if the authentication is successful, includes: Based on the recognition results, it is determined whether smoke or fire has been detected. If so, it is determined whether the environmental perception data has reached a preset threshold. If so, an alarm message is issued.

5. The CNN smoke detection method based on dual attention mechanism according to claim 1, characterized in that, The identification results include the type of fireworks, the target location, and the confidence score.

6. A CNN-based smoke detection system based on a dual attention mechanism, characterized in that, include: The data acquisition and processing module is used to acquire historical images of fireworks and preprocess the historical images of fireworks; A feature extraction module is used to extract features from the processed fireworks history image to obtain feature data of the fireworks history image. The feature extraction module further includes: The channel segmentation module is used to perform multi-channel segmentation on the historical fireworks image based on image resolution to obtain multi-channel image data. The initial feature extraction module is used to perform initial feature extraction on the multi-channel image data based on the convolutional neural network algorithm to obtain the multi-channel feature data of the fireworks history image; A deep feature extraction module is used to extract deep features from multi-channel feature data based on a dual attention mechanism to obtain the deep feature data of the fireworks history image. The deep feature extraction module further includes: The dual attention feature extraction module is used to extract channel attention features and spatial attention features from multi-channel feature data based on a dual attention mechanism, wherein the channel attention features include channel saliency information and the spatial attention features include spatial location information. The feature enhancement and stitching module is used to perform feature enhancement processing and feature stitching based on channel attention features and spatial attention features to obtain the depth feature data of the fireworks history image; The model building module is used to build a fireworks detection model based on a dual attention mechanism according to the feature data, including a channel attention model and a spatial attention model. The channel attention model and the spatial attention model adopt a parallel structure. The channel attention model is used to extract the saliency information of the feature channels, and the spatial attention model is used to extract the position information of the target in space. The smoke detection model is represented as follows: in Where F is the feature map, M C and M S These represent channel-based attention and space-based attention, respectively. This indicates element-wise multiplication. F' and F'' represent the output feature maps after channel attention and spatial attention, respectively. F''' represents the output feature map after parallel concatenation of the output feature maps after channel attention and spatial attention. This indicates a parallel computing method; the recognition module inputs the image to be detected into the fireworks detection model to perform fireworks recognition and outputs the recognition result; The alarm module is used to perform dual authentication based on the identification results and environmental perception data. If the authentication is successful, an alarm message is issued.

7. The CNN smoke detection system based on dual attention mechanism according to claim 6, characterized in that, The data acquisition and processing module also includes: The data acquisition module is used to acquire historical video stream data of fireworks and perform frame-by-frame processing and data annotation on the historical video stream to obtain historical images of fireworks; The data processing module is used to normalize the historical fireworks images.

8. The CNN smoke detection system based on dual attention mechanism according to claim 6, characterized in that, Also includes: The environmental sensing data acquisition module is used to acquire CO concentration, temperature, and humidity data.

9. The CNN smoke detection system based on dual attention mechanism according to claim 8, characterized in that, The alarm module also includes: The first judgment unit is used to determine whether smoke or fire has been detected based on the recognition result; The second judgment unit is used to determine whether a preset threshold has been reached based on the environmental perception data. An alarm unit is used to send alarm information based on the judgment results of the first judgment unit and the second judgment unit.

10. An electronic device, characterized in that, include: A processor and a memory, wherein the memory stores a computer program, which is loaded and executed by the processor to implement the CNN-based smoke detection method based on a dual attention mechanism as described in any one of claims 1 to 5.

11. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which is loaded and executed by a processor to implement the CNN-based smoke detection method based on a dual attention mechanism as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Smoking behavior detection method based on SDVGNet network

    CN118587762A

  • Smoke detection system and method

    CN119274038A

  • Subway fire detection method based on YOLOv8

    CN119942764A