Fire detection method and device based on global attention and dense multi-scale

By using global attention and dense multi-scale methods in fire detection, image features are extracted and enhanced, the problem of poor performance of existing fire detection methods is solved, and more efficient fire detection is achieved.

CN119380167BActive Publication Date: 2025-04-29ZHEJIANG DAHUA TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411977987.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

Existing fire detection methods are prone to missed and missed detection, resulting in poor fire detection performance, especially when the fire point is different from the camera.

Method used

The fire detection method based on global attention and dense multi-scale is adopted. By obtaining the images to be detected and extracting the basic features, the multi-scale features are extracted using the dense multi-scale module, and the features are enhanced through the global attention module. Finally, the enhanced features are fused with the multi-scale features for fire detection.

Benefits of technology

It improves the processing ability of scale changes in fire images, effectively avoids background interference in the image, and improves the performance and accuracy of fire detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119380167B_ABST
    Figure CN119380167B_ABST
Patent Text Reader

Abstract

The present application relates to a fire detection method and device based on global attention and dense multi-scale, the method comprising: obtaining an image to be detected and extracting basic features of the image to be detected; extracting multi-scale features from the basic features based on a dense multi-scale module; the dense multi-scale module comprises a number of dense multi-scale blocks connected in sequence; the dense multi-scale blocks have different void rates; based on the global attention module, enhancing the basic features to obtain attention features; fusing the attention features with the multi-scale features to obtain target features; and performing fire detection on the image to be detected based on the target features. Through the present application, multi-scale features in the image to be detected are extracted, and feature enhancement processing is performed on the basic features in the image to be detected, which can improve the processing capability of scale changes in the fire image and effectively avoid interference, thereby obtaining better fire detection performance and solving the problem of poor fire detection performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a fire detection method and device based on global attention and dense multi-scale. Background Art

[0002] In fire monitoring, deep learning-based fire detection solutions have been widely used in public places, high-rise buildings, forests and other scenarios, providing strong support for early warning and alarm of fires, and effectively reducing the risk and losses of fires.

[0003] Due to the different distances between the camera and the fire or smoke in actual scenes, the size of the fire spots in the fire pictures collected by the camera will vary greatly. The fire spots far away from the camera occupy fewer pixels, while the fire spots close to the camera occupy more pixels. The current fire detection methods are prone to missed detections and false detections, which in turn lead to poor fire detection performance.

[0004] With regard to the problem of poor fire detection performance in related technologies, no effective solution has been proposed so far. Summary of the invention

[0005] Based on this, it is necessary to provide a fire detection method and device based on global attention and intensive multi-scale that can improve the fire detection performance in response to the above technical problems.

[0006] In the first aspect, a fire detection method based on global attention and dense multi-scale is provided in this embodiment, including:

[0007] Acquire an image to be detected and extract basic features of the image to be detected;

[0008] Extracting multi-scale features from the basic features based on a dense multi-scale module; the dense multi-scale module includes a plurality of dense multi-scale blocks connected in sequence; the dense multi-scale blocks have different hole rates;

[0009] Based on the global attention module, the basic features are enhanced to obtain attention features;

[0010] Performing feature fusion on the attention feature and the multi-scale feature to obtain a target feature;

[0011] Based on the target features, fire detection is performed on the image to be detected.

[0012] In some embodiments, the step of acquiring the image to be detected and extracting basic features includes:

[0013] Preprocessing the acquired fire monitoring image to obtain the image to be detected;

[0014] The image to be detected is input into a preset backbone network, and the shallow features output by the network layer in the preset backbone network and the final features outputted in the end are extracted to obtain basic features.

[0015] In some embodiments, extracting multi-scale features from the basic features based on a dense multi-scale module includes:

[0016] Inputting the final feature among the basic features into the first dense multi-scale block;

[0017] For each dense multi-scale block connected thereafter, the features input to the dense multi-scale block and the features output by the dense multi-scale block are fused and then input to the next dense multi-scale block, and finally the multi-scale features are output.

[0018] In some of the embodiments, the dense multi-scale block includes a convolution layer and a dilated convolution, and the dilated convolution of each dense multi-scale block has a different dilation rate.

[0019] In some of the embodiments, the global attention module includes a channel attention submodule and a spatial attention submodule;

[0020] The global attention module is used to enhance the basic features to obtain attention features, including:

[0021] Inputting shallow features in the basic features into the channel attention submodule and the spatial attention submodule respectively, and obtaining channel attention features and spatial attention features correspondingly;

[0022] The channel attention feature and the spatial attention feature are feature fused to obtain a feature-enhanced attention feature.

[0023] In some of the embodiments, the channel attention submodule includes a multi-layer perceptron; and the spatial attention submodule includes two convolutional layers.

[0024] In some of the embodiments, it also includes:

[0025] The dense multi-scale module and the global attention module are trained based on a pre-constructed fire image training set and a loss function.

[0026] In a second aspect, in this embodiment, a fire detection device based on global attention and dense multi-scale is provided, including:

[0027] A feature extraction module is used to obtain the image to be detected and extract the basic features of the image to be detected;

[0028] A multi-scale feature extraction module, used for extracting multi-scale features from the basic features based on a dense multi-scale module; the dense multi-scale module comprises a plurality of dense multi-scale blocks connected in sequence; the dense multi-scale blocks have different hole rates;

[0029] A feature enhancement module, used for enhancing the basic features based on the global attention module to obtain attention features;

[0030] The fire detection module is used to fuse the attention feature and the multi-scale feature to obtain a target feature; based on the target feature, fire detection is performed on the image to be detected.

[0031] In a third aspect, a computer device is provided in this embodiment, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the fire detection method based on global attention and dense multi-scale described in the first aspect is implemented.

[0032] In a fourth aspect, in this embodiment, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the fire detection method based on global attention and dense multi-scale described in the first aspect above is implemented.

[0033] Compared with the related art, the fire detection method and device based on global attention and dense multi-scale provided in this embodiment obtains the basic features of the image to be detected and extracts the basic features of the image to be detected; based on the dense multi-scale module, extracts the multi-scale features in the basic features; the dense multi-scale module includes a number of dense multi-scale blocks connected in sequence; the dense multi-scale blocks have different hole rates; based on the global attention module, the basic features are enhanced to obtain attention features; the attention features and the multi-scale features are fused to obtain target features; based on the target features, the image to be detected is subjected to fire detection. Through this embodiment, the multi-scale features in the image to be detected are extracted, and the basic features in the image to be detected are subjected to feature enhancement processing, and the enhanced attention features and multi-scale features are fused to obtain the target features for fire detection, which can improve the processing capability of scale changes in the fire image and effectively avoid interference, thereby obtaining better fire detection performance and solving the problem of poor fire detection performance.

[0034] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0036] Figure 1 is a hardware structure block diagram of a terminal of a fire detection method based on global attention and dense multi-scale in an embodiment;

[0037] Figure 2 is a flow chart of a fire detection method based on global attention and dense multi-scale in one embodiment;

[0038] Figure 3 is a schematic diagram of a dense multi-scale module in one embodiment;

[0039] Figure 4 is a schematic diagram of a channel attention submodule in one embodiment;

[0040] Figure 5 is a schematic diagram of a spatial attention submodule in one embodiment;

[0041] Figure 6 is a schematic diagram of the structure of a fire detection network based on global attention and dense multi-scale in one embodiment;

[0042] Figure 7 is a flow chart of a fire detection method based on global attention and dense multi-scale in another embodiment;

[0043] Figure 8 The structure block diagram of a fire detection device based on global attention and dense multi-scale in one embodiment.

[0044] In the figure: 102, processor; 104, memory; 106, transmission device; 108, input and output device; 10, feature extraction module; 20, multi-scale feature extraction module; 30, feature enhancement module; 40, fire detection module. DETAILED DESCRIPTION

[0045] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0046] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with general skills in the technical field to which this application belongs. The words "one", "a", "the", "these" and the like in this application do not indicate a quantitative limitation, and they may be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there may be three relationships, for example, "A and / or B" may mean: A exists alone, A and B exist at the same time, and B exists alone. Generally, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.

[0047] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 is a hardware structure block diagram of the terminal of the fire detection method based on global attention and dense multi-scale in this embodiment. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 and a memory 104 for storing data, wherein the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.

[0048] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the fire detection method based on global attention and dense multi-scale in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0049] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.

[0050] In this embodiment, a fire detection method based on global attention and dense multi-scale is provided. Figure 2 is a flow chart of the fire detection method based on global attention and dense multi-scale in this embodiment, as shown in Figure 2 As shown, the method comprises the following steps:

[0051] Step S201, obtaining an image to be detected and extracting basic features of the image to be detected.

[0052] Specifically, fixed surveillance cameras are installed in areas where fires may occur (such as warehouses, factories, forests, etc.). These cameras can continuously capture images of the surrounding environment. The acquired fire monitoring videos are preprocessed, such as image size adjustment, noise removal, etc., to obtain the image to be detected.

[0053] The preset backbone network is used to extract the basic features in the image to be detected. The preset backbone network includes but is not limited to MobileNetV3 (mobile network), ResNet (Residual Network), and VGGNet (Visual Geometry Group Network). Among them, the basic features include shallow features and final features. The image to be detected is input into the preset backbone network, and the image data will be processed in turn through each layer of the preset backbone network. In this forward propagation process, the shallow part of the network will first perform preliminary feature extraction on the image to be detected to obtain preliminary shallow feature representations, such as edges, corners, textures, etc., and finally the preset backbone network outputs the final features.

[0054] Step S202: extracting multi-scale features from basic features based on a dense multi-scale module; the dense multi-scale module includes a plurality of dense multi-scale blocks connected in sequence; and the dense multi-scale blocks have different hole rates.

[0055] Specifically, the Dense Multi-scale Module (DMM) contains several densely connected Dense Blocks (DBs), each of which can access the feature information of all subsequent dense multi-scale blocks and pass on the information that needs to be retained. Each dense multi-scale block includes dilated convolutions with different dilation rates, and the dilation rates of the dilated convolutions correspond to the dilation rates of the dense multi-scale blocks. By setting different dilation rates, the dilated convolutions can sample images at different scales. The larger the dilation rate, the larger the interval between the sampling points, and the sparser the feature map obtained, corresponding to a larger receptive field and coarser scale information; while the dilated convolution with a smaller dilation rate can capture finer local detail information. The final features in the basic features are input into the dense multi-scale module, and multi-scale features are further obtained by connecting multiple dense multi-scale blocks with dense residual connections, which can obtain richer scale diversity and further expand the scale perception range.

[0056] Step S203: Based on the global attention module, the basic features are enhanced to obtain attention features.

[0057] Specifically, the Global Attention Module (GAM) includes a channel attention submodule and a spatial attention submodule. The shallow features in the basic features are input into the channel attention submodule and the spatial attention submodule respectively, and the shallow features extracted from the preset backbone network are optimized by feature enhancement using the global attention module, specifically, the fire condition in the shallow features is enhanced, and the interference background in the shallow features is suppressed to obtain the attention features.

[0058] Step S204: Fusing the attention feature and the multi-scale feature to obtain the target feature.

[0059] Specifically, the attention features enhanced by the global attention module and the multi-scale features output by the dense multi-scale module are upsampled and fused, and then input into the convolution layer and a series of dilated convolutions for dimensionality reduction and nonlinearity increase to obtain the final target features.

[0060] Step S205: Perform fire detection on the image to be detected based on the target features.

[0061] Specifically, based on the feature map of the target feature, the feature value of each pixel or area in the feature map can be compared with the set threshold. If the feature value exceeds the threshold, the pixel or area is judged as a possible fire; otherwise, it is judged as no fire. By analyzing a large number of fire images with marked fire areas and background areas, one or more appropriate thresholds are determined. These thresholds can be based on the statistical characteristics of the pixel values ​​in the feature map, such as mean, variance, etc., or can be fixed values ​​set based on experience.

[0062] Through the above steps, the multi-scale features in the image to be detected can be extracted through the dense multi-scale module, and the basic features in the image to be detected can be enhanced through the global attention module. The enhanced attention features and multi-scale features are fused to obtain the target features for fire detection, which can improve the processing ability of scale changes in fire images and effectively avoid background interference in images, ensuring the integrity and comprehensiveness of feature extraction, thereby generating high-quality fire prediction maps, and then obtaining better fire detection performance, solving the problem of poor fire detection performance. In addition, using dense multi-scale blocks including dilated convolutions in dense multi-scale modules can further reduce network parameters and improve network operation efficiency.

[0063] In some embodiments, the step S201 of acquiring the image to be detected and extracting basic features includes the following steps:

[0064] The acquired fire monitoring image is preprocessed to obtain the image to be detected; the image to be detected is input into the preset backbone network, the shallow features output by the network layer in the preset backbone network and the final features of the final output are extracted to obtain the basic features.

[0065] Specifically, the acquired fire monitoring video is preprocessed, such as image resizing and noise removal, to obtain the image to be detected. The image to be detected is processed in turn by each layer of the preset backbone network to obtain basic features. Certain specific shallow layers in the preset backbone network can be designated as layers that output shallow features, generally after the first few convolutional layers or pooling layers of the network. The convolution layer performs convolution operations by sliding the convolution kernel on the image to extract local features of the image, such as edges, corners, textures, etc. The pooling layer downsamples the feature map output by the convolution layer, reducing the amount of data while retaining the main features, and obtaining a preliminary shallow feature representation. The final features output by the preset backbone network usually retain richer semantic information.

[0066] For example, in the classic VGGNet, the feature map after the second or third convolutional block can be selected as the shallow feature; in ResNet, the features output by the first few residual modules may be selected as the shallow features. These shallow features have a relatively low semantic level, but retain rich image details and texture information.

[0067] The preset backbone network can adopt the lightweight MobileNetV3. The first 7 layers of MobileNetV3 complete the feature extraction. The first 7 layers include a convolution structure and 6 bneck (bottleneck) structures. The bneck layer cleverly combines the depth-separable convolution, inverse residual structure and SE (Squeeze-and-Excitation) channel attention mechanism to achieve the goal of improving its performance while keeping the network lightweight.

[0068] In this embodiment, the image to be detected is input into a preset backbone network, and the shallow features and final features therein are extracted as basic features, so that the basic features can be further processed with multi-scale and feature enhancement in the subsequent process.

[0069] In some embodiments, the step S202 extracts multi-scale features from basic features based on the dense multi-scale module, including the following steps:

[0070] The final features in the basic features are input into the first dense multi-scale block; for each dense multi-scale block connected thereafter, the features of the input dense multi-scale block and the features output by the dense multi-scale block are fused and input into the next dense multi-scale block, and finally the multi-scale features are output.

[0071] Specifically, the dense multi-scale blocks in the dense multi-scale module are densely connected in sequence, each dense multi-scale block includes a convolution layer and a dilated convolution, and the dilated convolution of each dense multi-scale block has different dilation rates, which correspond to the dilation rates of the dense multi-scale blocks respectively.

[0072] Figure 3 is a schematic diagram of a dense multi-scale module in this embodiment, such as Figure 3 As shown in the figure, the dense multi-scale module includes 4 dense multi-scale blocks (the brackets are the dilation ratios of the dilated convolutions). The dense multi-scale blocks are composed of ReLU activation function, convolution layer with convolution kernel 1, ReLU activation function and dilated convolution layer. The purpose of designing the convolution layer with convolution kernel 1 is to reduce the dimension and reduce the number of parameters. The dilation ratios of the 4 dense multi-scale blocks are 3, 6, 12 and 18 respectively. Taking the second dense multi-scale block as an example, the dense multi-scale block includes ReLU activation function, convolution layer with convolution kernel 1, ReLU activation function and dilated convolution layer with dilation ratio 6. The final features in the basic features are input into the first dense multi-scale block, and the multi-scale features are output after passing through each dense multi-scale block. In each dense multi-scale block connected after the first dense multi-scale block, the features of the input dense multi-scale block and the features output by the dense multi-scale block are fused and then input into the next dense multi-scale block. Multiple dense multi-scale blocks can be connected with dense residual connections, further expanding the scale perception range.

[0073] Through the design of dense multi-scale blocks including dilated convolution in this embodiment, richer scale diversity can be obtained, the scale perception range is further expanded, and network parameters are reduced, thereby improving operation efficiency.

[0074] In some embodiments, in step S203, based on the global attention module, the basic features are enhanced to obtain the attention features, including the following steps:

[0075] The shallow features in the basic features are respectively input into the channel attention submodule and the spatial attention submodule to obtain the channel attention features and the spatial attention features respectively; the channel attention features and the spatial attention features are feature fused to obtain the feature-enhanced attention features.

[0076] Specifically, the global attention module includes a channel attention submodule and a spatial attention submodule. The extracted shallow features are input into the channel attention submodule and the spatial attention submodule respectively to obtain channel attention features and spatial attention features.

[0077] Figure 4 is a schematic diagram of the channel attention submodule in this embodiment, such as Figure 4As shown in the figure, the input is a shallow feature of size C×W×H, where C represents the number of channels, W represents the width, and H represents the height. First, it undergoes a permutation operation to convert its shape from C×W×H to W×H×C. The purpose of this step is to better process the features in subsequent operations. The permuted features are fed into a two-layer multilayer perceptron (MLP). The features processed by the multilayer perceptron undergo another reverse permutation (reverse permutation) to convert their shape from W×H×C back to C×W×H. The reverse permuted features pass through a Sigmoid activation function. The Sigmoid function compresses the output value to between 0 and 1, which is used to generate channel attention weights. After the Sigmoid activation function, the final output channel attention feature is obtained. The channel attention submodule uses three-dimensional permutation to retain information in the three dimensions of the feature, and includes a two-layer multilayer perceptron (MLP) to amplify the cross-dimensional channel-space dependency.

[0078] Figure 5 is a schematic diagram of the spatial attention submodule in this embodiment. Figure 5 As shown in the figure, the input is a shallow feature with a shape of C×H×W, where C represents the number of channels, H represents the height, and W represents the width. The input feature first passes through a 7×7 convolution layer, which is used to perform preliminary extraction and fusion of spatial information of the input feature. The shape of the feature changes from C×H×W to C / r×H×W, where r is a scaling factor used to reduce the number of channels for subsequent processing. The feature after the first convolution passes through a 7×7 convolution layer, which further fuses and processes the spatial information, and the shape of the feature is restored to C×H×W. The feature after the second convolution passes through a Sigmoid activation function, which compresses the output value to between 0 and 1 for generating spatial attention weights. After the Sigmoid activation function, the final output spatial attention feature is obtained. The spatial attention submodule realizes the fusion of spatial information through two convolution operations, and retains more feature mapping information by abandoning the maximum pooling operation, which helps to improve the model's attention to and processing capabilities of spatial information.

[0079] The channel attention features and spatial attention features are fused to obtain feature-enhanced attention features.

[0080] The global attention module in this embodiment is used to optimize the shallow features in the preset backbone network, enhance the important features of the fire situation, suppress unimportant features such as interference background, and make the model pay more attention to the target area and reduce attention to irrelevant background information.

[0081] In some embodiments, the following steps provide a training process for a Global Attention and Dense Multi-scale Fire Detection Network (GADMNet):

[0082] The dense multi-scale module and the global attention module are trained based on the pre-constructed fire image training set and loss function.

[0083] Specifically, the fire monitoring video is segmented into static fire monitoring images in frames using video processing tools. After image preprocessing, a fire image dataset is constructed and divided into a training set and a test set.

[0084] Figure 6 is a schematic diagram of the structure of the fire detection network based on global attention and dense multi-scale in this embodiment, as shown in Figure 6 As shown in the figure, the training set is randomly cropped into an input image of 576×768 size in combination with the area where fire spots or smoke appear in the fire image, and the image is input into the preset backbone network based on MobileNetV3 to extract basic features. The multi-scale features in the basic features are extracted by connecting four dense multi-scale blocks in series in the dense multi-scale module. In addition, the shallow features in the preset backbone network are enhanced by the global attention module to filter out background interference and obtain attention features. The extracted multi-scale features and attention features are spliced ​​and fused after upsampling to ensure the integrity and comprehensiveness of feature extraction. Finally, after a 3×3 convolution layer and a series of dilated convolutions, the feature map of the target feature is generated. The feature map is compared with the GroundTruth (true value) feature map, and the loss function is calculated. The network parameters (including the parameters of the dense multi-scale module and the global attention module) are optimized according to the loss function. After the network converges, a fire detection network based on global attention and dense multi-scale can be obtained. Among them, loss functions include but are not limited to MSE (Mean Squared Error) and MAE (Mean Absolute Error).

[0085] Through the training process provided in this embodiment, the integrity and comprehensiveness of feature extraction can be guaranteed, thereby generating high-quality fire prediction maps, thereby improving the fire detection performance of the network.

[0086] The present embodiment is described and illustrated below through preferred embodiments.

[0087] Figure 7 is a flow chart of the fire detection method based on global attention and dense multi-scale in this embodiment, as shown in Figure 7As shown, the method comprises the following steps:

[0088] Step S701, preprocessing the acquired fire monitoring image to obtain an image to be detected.

[0089] Step S702: input the image to be detected into a preset backbone network, extract the shallow features output by the network layer in the preset backbone network and the final features outputted in the end, and obtain the basic features.

[0090] Step S703, input the final features into the first dense multi-scale block; for each dense multi-scale block connected thereto, perform feature fusion on the features input into the dense multi-scale block and the features output by the dense multi-scale block, and then input them into the next dense multi-scale block, and finally output the multi-scale features.

[0091] In step S704, the shallow features are input into the channel attention submodule and the spatial attention submodule respectively to obtain the channel attention features and the spatial attention features respectively; the channel attention features and the spatial attention features are subjected to feature fusion to obtain the feature-enhanced attention features.

[0092] Step S705, performing feature fusion of the attention feature and the multi-scale feature to obtain the target feature; and performing fire detection on the image to be detected based on the target feature.

[0093] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0094] In this embodiment, a fire detection device based on global attention and dense multi-scale is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "sub-unit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation in hardware, or a combination of software and hardware, is also possible and conceivable.

[0095] Figure 8 is a structural block diagram of the fire detection device based on global attention and dense multi-scale in this embodiment, such as Figure 8 As shown, the device comprises:

[0096] The feature extraction module 10 is used to obtain the image to be detected and extract the basic features of the image to be detected;

[0097] A multi-scale feature extraction module 20 is used to extract multi-scale features from basic features based on a dense multi-scale module; the dense multi-scale module includes a plurality of dense multi-scale blocks connected in sequence; the dense multi-scale blocks have different hole rates;

[0098] A feature enhancement module 30 is used to enhance the basic features based on the global attention module to obtain attention features;

[0099] The fire detection module 40 is used to fuse the attention feature and the multi-scale feature to obtain the target feature; based on the target feature, fire detection is performed on the image to be detected.

[0100] Through the device provided in this embodiment, it is possible to extract multi-scale features in the image to be detected through a dense multi-scale module, and perform feature enhancement processing on the basic features in the image to be detected through a global attention module, and fuse the enhanced attention features and multi-scale features to obtain the target features for fire detection, which can improve the processing ability of scale changes in fire images and effectively avoid background interference in images, ensure the integrity and comprehensiveness of feature extraction, thereby generating high-quality fire prediction maps, and then obtain better fire detection performance, solving the problem of poor fire detection performance. In addition, using dense multi-scale blocks including dilated convolutions in dense multi-scale modules can further reduce network parameters and improve network operation efficiency.

[0101] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.

[0102] In this embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0103] Optionally, the computer device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0104] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.

[0105] In addition, in combination with the fire detection method based on global attention and dense multi-scale provided in the above embodiments, a storage medium can also be provided in this embodiment to implement. The storage medium stores a computer program; when the computer program is executed by the processor, any one of the fire detection methods based on global attention and dense multi-scale in the above embodiments is implemented.

[0106] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0107] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.

[0108] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.

[0109] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.

[0110] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.

Claims

1. A fire detection method based on global attention and dense multi-scale, characterized in that: include: Preprocessing the acquired fire monitoring image to obtain an image to be detected; Inputting the image to be detected into a preset backbone network, extracting shallow features output by the network layer in the preset backbone network and final features outputted in the end, and obtaining basic features; Inputting the final feature among the basic features into the first dense multi-scale block of the dense multi-scale module; For each dense multi-scale block connected thereafter, the features input to the dense multi-scale block and the features output by the dense multi-scale block are fused and then input to the next dense multi-scale block, and finally multi-scale features are output; the dense multi-scale module includes a plurality of dense multi-scale blocks connected in sequence, and the dense multi-scale block is composed of a ReLU activation function, a convolution layer with a convolution kernel of 1, a ReLU activation function, and a hole convolution layer, and the hole convolution layer has different hole rates; Based on the global attention module, the basic features are enhanced to obtain attention features; wherein the global attention module includes a channel attention submodule and a spatial attention submodule; The method of enhancing the basic features based on the global attention module to obtain the attention features includes the following steps: Inputting shallow features in the basic features into the channel attention submodule and the spatial attention submodule respectively, and obtaining channel attention features and spatial attention features correspondingly; Fusing the channel attention feature with the spatial attention feature to obtain a feature-enhanced attention feature; Performing feature fusion on the attention feature and the multi-scale feature to obtain a target feature; Based on the target features, fire detection is performed on the image to be detected.

2. The method according to claim 1, characterized in that The channel attention submodule includes a multi-layer perceptron; the spatial attention submodule includes two convolutional layers.

3. The method according to claim 1, characterized in that Also includes: The dense multi-scale module and the global attention module are trained based on a pre-constructed fire image training set and a loss function.

4. A fire detection device based on global attention and dense multi-scale, characterized in that: include: A feature extraction module is used to pre-process the acquired fire monitoring image to obtain an image to be detected; Inputting the image to be detected into a preset backbone network, extracting shallow features output by the network layer in the preset backbone network and final features outputted in the end, and obtaining basic features; A multi-scale feature extraction module, used for inputting the final feature of the basic features into the first dense multi-scale block of the dense multi-scale module; for each dense multi-scale block connected thereafter, the features input into the dense multi-scale block and the features output by the dense multi-scale block are subjected to feature fusion and then input into the next dense multi-scale block, and finally multi-scale features are output; the dense multi-scale module comprises a plurality of dense multi-scale blocks connected in sequence, wherein the dense multi-scale blocks are composed of a ReLU activation function, a convolution layer with a convolution kernel of 1, a ReLU activation function and a hole convolution layer, and the hole convolution layer has different hole rates; A feature enhancement module, used to enhance the basic features based on the global attention module to obtain attention features; wherein the global attention module includes a channel attention submodule and a spatial attention submodule; The method of enhancing the basic features based on the global attention module to obtain the attention features includes the following steps: Inputting shallow features in the basic features into the channel attention submodule and the spatial attention submodule respectively, and obtaining channel attention features and spatial attention features correspondingly; Fusing the channel attention feature with the spatial attention feature to obtain a feature-enhanced attention feature; The fire detection module is used to fuse the attention feature and the multi-scale feature to obtain a target feature; based on the target feature, fire detection is performed on the image to be detected.

5. A computer device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute the fire detection method based on global attention and dense multi-scale according to any one of claims 1 to 3.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the fire detection method based on global attention and dense multi-scale described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • SAR image multi-scale ship target detection method and device based on attention mechanism

    CN115995041A