Smoke detection method and device based on deep learning, medium and equipment

Through the deep learning-based smoke detection method, using frame difference processing and deep learning models, the problem of poor dynamic smoke detection and tracking effects in the existing technology is solved, and the smoke detection and early warning capabilities in complex environments are improved. .

CN118887410AActive Publication Date: 2024-11-01NORTHEASTERN UNIV CHINA

Patent Information

Application Number
CN202410845997.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-11-01
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

Existing smoke detection methods are difficult to accurately detect dynamically changing smoke, and the tracking effect is poor, especially in complex process production environments, which are difficult to effectively warn of fires.

Method used

Using deep learning-based smoke detection method, the continuous shot images are acquired in real time, grayscale processing and frame difference processing are performed, frame difference mask map is generated, the area of ​​the moving object area is calculated, the potential smoke area is judged, and smoke feature extraction is performed. Confidence calculation, deep learning model is used to determine smoke detection results.

Benefits of technology

Accurate detection and tracking of dynamically changing smoke is achieved, the reliability and response speed of fire warnings are improved, and the false alarm rate is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887410A_ABST
    Figure CN118887410A_ABST
Patent Text Reader

Abstract

The invention discloses a smoke detection method and device based on deep learning, a medium and equipment, and the method comprises the steps: obtaining a plurality of frames of to-be-detected images which are continuously shot in real time, and dividing the plurality of to-be-detected images into a plurality of gray image sets; performing frame difference processing on each gray level image set to obtain a frame difference mask image corresponding to each gray level image set, and dividing the plurality of frame difference mask images into a plurality of mask image sets; calculating the area of a moving object region of each frame difference mask image in each mask image set, and judging whether a plurality of to-be-detected images corresponding to each mask image set have potential smoke regions or not based on the areas of a plurality of moving object regions in each mask image set; when the plurality of to-be-detected images corresponding to any one mask image set have potential smoke areas, performing smoke feature extraction on the plurality of to-be-detected images corresponding to any one mask image set to obtain a plurality of smoke feature images; and inputting the plurality of smoke feature maps into a deep learning model to obtain a smoke detection result, so that dynamically changing smoke can be accurately detected.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of smoke image recognition, and in particular to a smoke detection method, device, medium and equipment based on deep learning. Background Art

[0002] In industrial production, some raw materials (such as NdFeB powder) have the property of spontaneous combustion in the air. When the ambient temperature is slightly higher and the concentration reaches a certain level, spontaneous combustion will occur. Once spontaneous combustion occurs, it is difficult to extinguish it quickly, which can easily lead to major accidents and cause heavy losses. Therefore, it is very important to detect the signs of fire early and take measures in advance.

[0003] Smoke, temperature, and gas are important characteristics before a fire occurs, and can all be used as a basis for fire warning. Traditional fire warning systems mainly rely on smoke sensors to detect smoke, which is generally limited by space and smoke concentration, and is difficult to play an effective warning role, especially in complex process production environments.

[0004] In response to the problems of traditional smoke sensors in detecting smoke, researchers have proposed to identify smoke through images or videos to warn of fires. At present, image-based smoke detection methods include local binary patterns, wavelet transforms, optical flow methods, etc. These methods detect smoke by extracting smoke texture, color and other features. However, these methods generally have the following problems: since smoke will undergo a dynamic change process of gathering, rising, spreading with the wind until it dissipates, the texture, color and other features of the smoke are also changing during the dynamic change process. Since these smoke detection methods use fixed algorithms and perform smoke detection according to fixed smoke texture and color features, these smoke detection methods cannot accurately detect dynamically changing smoke and have poor tracking effects on smoke. Summary of the invention

[0005] In view of this, the present invention provides a smoke detection method, device, medium and equipment based on deep learning, the main purpose of which is to solve the problem that the current smoke detection method cannot accurately detect dynamically changing smoke and has poor smoke tracking effect.

[0006] According to one aspect of the present application, a smoke detection method based on deep learning is provided, the method comprising:

[0007] Acquire multiple frames of to-be-detected images of the target area that are continuously photographed in real time, perform grayscale processing on each frame of the to-be-detected image to obtain multiple grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain multiple grayscale image sets;

[0008] Performing frame difference processing on each grayscale image set respectively to obtain a frame difference mask image corresponding to each grayscale image set, taking a second preset number of frame difference mask images as a mask image set in the order of the grayscale image sets corresponding to the frame difference mask images, obtaining multiple mask image sets, and obtaining multiple images to be detected corresponding to each mask image set;

[0009] Calculating the moving object area of ​​each frame difference mask image in each mask atlas, and judging whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas based on the multiple moving object area areas in each mask atlas;

[0010] When there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas, extracting smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps;

[0011] The smoke confidence of each frame of the image to be detected corresponding to any one of the mask atlases is calculated based on the multiple smoke feature maps and a preset deep learning model, and the smoke detection result is determined according to the smoke confidence.

[0012] Optionally, performing frame difference processing on each grayscale image set to obtain a frame difference mask image corresponding to each grayscale image set includes:

[0013] Based on the first grayscale image and the last grayscale image in the grayscale image set, calculating the pixel value difference of each pixel point;

[0014] Based on the pixel value difference and pixel threshold of each pixel point, a frame difference mask image is generated, wherein in the frame difference mask image, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black.

[0015] Optionally, the calculating the moving object area of ​​each frame difference mask image in each mask image set, and judging whether there is a potential smoke area in a plurality of to-be-detected images corresponding to each mask image set based on a plurality of moving object area areas in each mask image set, comprises:

[0016] Calculating the area of ​​the moving object region in each frame difference mask image in each mask image set based on the color of the pixel points in the frame difference mask image;

[0017] Based on the areas of the multiple moving object regions in each mask atlas, obtaining the number of frame difference mask images whose areas of the moving object regions in each mask atlas belong to an area range;

[0018] Determine whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas according to the number of the frame difference mask images

[0019] Optionally, the determining, according to the number of the frame difference mask images, whether the multiple images to be detected corresponding to each mask atlas have potential smoke areas includes:

[0020] When the number of the frame difference mask images is greater than or equal to the number threshold, the multiple images to be detected corresponding to the mask atlas have potential smoke areas;

[0021] When the number of the frame difference mask images is less than the number threshold, the multiple images to be detected corresponding to the mask atlas do not have potential smoke areas.

[0022] Optionally, extracting smoke features from a plurality of images to be detected corresponding to any one of the mask atlases to obtain a plurality of smoke feature maps includes:

[0023] Performing convolution processing on the image to be detected based on two-dimensional convolution to obtain a first smoke feature map;

[0024] Performing convolution processing on the first smoke feature map based on the first dilated convolution to obtain a second smoke feature map, and processing the second smoke feature map based on the channel attention mechanism to obtain a channel attention feature map;

[0025] Performing convolution processing on the first smoke feature map based on a second dilated convolution to obtain a third smoke feature map, and processing the third smoke feature map based on a spatial attention mechanism to obtain a spatial attention feature map, wherein the number of channels of the first dilated convolution and the second dilated convolution is different;

[0026] The channel attention feature map and the space attention feature map are fused to obtain a smoke feature map.

[0027] Optionally, determining the smoke detection result according to the smoke confidence level includes:

[0028] When the smoke confidence of the image to be detected is greater than or equal to the confidence threshold, it is determined that smoke exists in the image to be detected.

[0029] Optionally, after determining that smoke exists in the image to be detected, the smoke detection method further includes:

[0030] The region of interest and the frame difference mask map corresponding to the image to be detected are obtained, and based on the corresponding region of interest and the frame difference mask map, the smoke region in the image to be detected is enhanced.

[0031] Optionally, the grayscale processing is performed on each frame of the image to be detected to obtain multiple grayscale images, including:

[0032] Perform preliminary smoke detection on each frame of the image to be detected to obtain the region of interest corresponding to each frame of the image to be detected;

[0033] Perform grayscale transformation on each region of interest respectively to obtain a grayscale image corresponding to each region of interest.

[0034] According to another aspect of the present application, a smoke detection device based on deep learning is provided, comprising:

[0035] A grayscale image set acquisition module is used to acquire multiple frames of to-be-detected images of a target area that are continuously photographed in real time, perform grayscale processing on each frame of the to-be-detected image to obtain multiple grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain multiple grayscale image sets;

[0036] a mask atlas acquisition module, configured to perform frame difference processing on each grayscale image set respectively, obtain a frame difference mask map corresponding to each grayscale image set, and use a second preset number of frame difference mask maps as a mask atlas according to the order of the grayscale image sets corresponding to the frame difference mask maps, to obtain multiple mask atlas sets, and obtain multiple images to be detected corresponding to each mask atlas set;

[0037] A smoke region judgment module is used to calculate the moving object region area of ​​each frame difference mask image in each mask atlas, and based on the multiple moving object region areas in each mask atlas, judge whether there is a potential smoke region in the multiple images to be detected corresponding to each mask atlas;

[0038] A smoke feature map acquisition module is used to extract smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps when there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas.

[0039] A detection result determination module is used to calculate the smoke confidence of each frame of the image to be detected corresponding to any mask atlas based on the multiple smoke feature maps and a preset deep learning model, and determine the smoke detection result according to the smoke confidence.

[0040] Optionally, the mask atlas acquisition module is further used for:

[0041] Based on the first grayscale image and the last grayscale image in the grayscale image set, calculating the pixel value difference of each pixel point;

[0042] Based on the pixel value difference and pixel threshold of each pixel point, a frame difference mask image is generated, wherein in the frame difference mask image, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black.

[0043] Optionally, the smoke area determination module is further used for:

[0044] Calculating the area of ​​the moving object region in each frame difference mask image in each mask image set based on the color of the pixel points in the frame difference mask image;

[0045] Based on the areas of the multiple moving object regions in each mask atlas, obtaining the number of frame difference mask images whose areas of the moving object regions in each mask atlas belong to an area range;

[0046] It is determined whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas according to the number of the frame difference mask images.

[0047] Optionally, the smoke area determination module is further used for:

[0048] When the number of the frame difference mask images is greater than or equal to the number threshold, the multiple images to be detected corresponding to the mask atlas have potential smoke areas;

[0049] When the number of the frame difference mask images is less than the number threshold, the multiple images to be detected corresponding to the mask atlas do not have potential smoke areas.

[0050] Optionally, the smoke characteristic image acquisition module is further used for:

[0051] Performing convolution processing on the image to be detected based on two-dimensional convolution to obtain a first smoke feature map;

[0052] Performing convolution processing on the first smoke feature map based on the first dilated convolution to obtain a second smoke feature map, and processing the second smoke feature map based on the channel attention mechanism to obtain a channel attention feature map;

[0053] Performing convolution processing on the first smoke feature map based on a second dilated convolution to obtain a third smoke feature map, and processing the third smoke feature map based on a spatial attention mechanism to obtain a spatial attention feature map, wherein the number of channels of the first dilated convolution and the second dilated convolution is different;

[0054] The channel attention feature map and the space attention feature map are fused to obtain a smoke feature map.

[0055] Optionally, the detection result determination module is further used to:

[0056] When the smoke confidence of the image to be detected is greater than or equal to the confidence threshold, it is determined that smoke exists in the image to be detected.

[0057] Optionally, the detection result determination module is further used to:

[0058] After determining that smoke exists in the image to be detected, a region of interest and a frame difference mask map corresponding to the image to be detected are obtained, and based on the corresponding region of interest and frame difference mask map, the smoke region in the image to be detected is enhanced.

[0059] Optionally, the grayscale image set acquisition module is further used for:

[0060] Perform preliminary smoke detection on each frame of the image to be detected to obtain the region of interest corresponding to each frame of the image to be detected;

[0061] Perform grayscale transformation on each region of interest respectively to obtain a grayscale image corresponding to each region of interest.

[0062] According to another aspect of the present application, a storage medium is provided, in which at least one executable instruction is stored, and the executable instruction enables a processor to perform operations corresponding to the above-mentioned deep learning-based smoke detection method.

[0063] According to another aspect of the present application, a computer device is provided, comprising: a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus;

[0064] The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the above-mentioned deep learning-based smoke detection method.

[0065] By means of the above technical solution, the technical solution provided by the embodiment of the present invention has at least the following advantages:

[0066] The present application provides a smoke detection method, device, equipment and medium based on deep learning. The method performs grayscale processing on multiple frames of to-be-detected images of a target area taken continuously to obtain multiple grayscale image sets. The frame difference method is used to generate a frame difference mask image corresponding to each grayscale image set. The frame difference mask image can reflect the moving object area. The multiple frame difference mask images are divided into multiple mask image sets. The moving object area of ​​each frame difference mask image in the mask image set is calculated. Based on the areas of multiple moving object areas in each mask image set, it is determined whether there is a potential smoke area in the image to be detected corresponding to the mask image set. When there is a potential smoke area in the image to be detected corresponding to any mask image set, any of the mask image sets is detected. Smoke features are extracted from multiple images to be detected corresponding to a mask atlas to obtain multiple smoke feature maps. Each smoke feature map is input into a preset deep learning model to calculate the smoke confidence of each frame of the image to be detected. According to the smoke confidence, the smoke detection result of each frame of the image to be detected is determined. Since the frame difference mask map can reflect the moving object area and can capture and track areas with dynamic features including smoke, the existence of potential smoke areas is determined according to the area of ​​the moving object area of ​​multiple frame difference mask maps. Smoke features are extracted and smoke detection is performed on the images to be detected where there is smoke, which can accurately detect dynamically changing smoke and effectively track the smoke.

[0067] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0069] Figure 1 A flowchart of a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0070] Figure 2 A flowchart of another deep learning-based smoke detection method provided in an embodiment of the present application is shown;

[0071] Figure 3 A frame of an image to be detected in a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0072] Figure 4Another frame of image to be detected of a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0073] Figure 5 A grayscale image of a region of interest of a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0074] Figure 6 A frame difference mask diagram of a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0075] Figure 7 A schematic diagram of a smoke feature attention module of a deep learning-based smoke detection method provided in an embodiment of the present application is shown;

[0076] Figure 8 An image after smoke area enhancement of a smoke detection method based on deep learning provided in an embodiment of the present application is shown;

[0077] Fig. 9 A model deployment flow chart of a deep learning-based smoke detection method provided in an embodiment of the present application is shown;

[0078] Fig.10 The test results of a smoke detection method based on deep learning provided in an embodiment of the present application are shown;

[0079] Fig.11 A block diagram of a smoke detection device based on deep learning provided in an embodiment of the present application is shown;

[0080] Fig.12 A schematic structural diagram of a computer device provided by an embodiment of the present invention is shown.

[0081] in,

[0082] Fig.11 In: 1102- grayscale image set acquisition module; 1104- mask atlas acquisition module; 1106- smoke area judgment module; 1108- smoke feature map acquisition module; 1110- detection result determination module;

[0083] Fig.12 In it: 1202 - processor; 1204 - communication interface; 1206 - memory; 1208 - communication bus; 1210 - program. DETAILED DESCRIPTION

[0084] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present invention can be combined with each other without conflict.

[0085] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the specific implementation methods, structures, features and effects of the present invention application are described in detail below in conjunction with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures, or characteristics in one or more embodiments may be combined in any suitable form.

[0086] In view of the problem that the current smoke detection method cannot accurately detect dynamically changing smoke and has a poor tracking effect on smoke, the embodiment of the present application provides a smoke detection method based on deep learning, such as Figure 1 As shown, the method includes:

[0087] 102: acquiring in real time a plurality of frames of to-be-detected images of the target area that are continuously photographed, performing grayscale processing on each frame of the to-be-detected image to obtain a plurality of grayscale images, and taking a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images, thereby obtaining a plurality of grayscale image sets;

[0088] 104: performing frame difference processing on each grayscale image set respectively to obtain a frame difference mask image corresponding to each grayscale image set, taking a second preset number of frame difference mask images as a mask image set in the order of the grayscale image sets corresponding to the frame difference mask images, obtaining a plurality of mask image sets, and obtaining a plurality of images to be detected corresponding to each mask image set;

[0089] 106: calculating the moving object area of ​​each frame difference mask image in each mask atlas, and judging whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas based on the multiple moving object area areas in each mask atlas;

[0090] 108: When there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas, extract smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps;

[0091] 110: Calculate the smoke confidence of each frame of the image to be detected corresponding to any mask atlas based on multiple smoke feature maps and a preset deep learning model, and determine the smoke detection result according to the smoke confidence.

[0092] Specifically, the target area is photographed continuously in real time to obtain multiple continuous multi-frame images to be detected. Alternatively, video capture can be performed on the target area to obtain continuous multi-frame images to be detected through the captured video. Grayscale processing is performed on the continuous multi-frame images to be detected to obtain grayscale images. The multiple grayscale images are grouped in the order in which the images to be detected are arranged. A first preset number of multiple grayscale images are grouped to obtain multiple grayscale image sets. A frame difference method is used to generate a frame difference mask image corresponding to each grayscale image set. The frame difference mask image can reflect the moving object area. According to the order of the grayscale image sets corresponding to each frame difference mask image, a second preset number of multiple frame difference mask images are grouped as a mask atlas set to obtain multiple mask atlas sets. The moving object area of ​​each frame difference mask image in each mask atlas set is calculated. Based on each The areas of multiple moving objects in the mask atlas are used to determine whether there is a potential smoke area in the image to be detected corresponding to the mask atlas. When there is a potential smoke area in the image to be detected corresponding to any mask atlas, smoke features are extracted for the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps. Each smoke feature map is input into a preset deep learning model to calculate the smoke confidence of the image to be detected corresponding to each smoke feature map. According to the smoke confidence of the image to be detected corresponding to each smoke feature map, the smoke detection result of the image to be detected corresponding to each smoke feature map is determined.

[0093] The present application provides a smoke detection method based on deep learning. Compared with the prior art, since the frame difference mask image can reflect the moving object area and can capture and track areas with dynamic characteristics including smoke, the existence of potential smoke areas is determined according to the areas of the moving object areas of multiple frame difference mask images, and smoke features and smoke detection are performed on the images to be detected in the smoke area, which can accurately detect dynamically changing smoke and effectively track the smoke.

[0094] In one embodiment of the present invention, grayscale processing is performed on each frame of the image to be detected to obtain multiple grayscale images, including:

[0095] Perform preliminary smoke detection on each frame of the image to be detected to obtain the region of interest corresponding to each frame of the image to be detected;

[0096] Perform grayscale transformation on each region of interest respectively to obtain a grayscale image corresponding to each region of interest.

[0097] In this embodiment, multiple frames of continuous images to be detected can be obtained by loading video images, or by continuous shooting to obtain multiple frames of continuous images to be detected, and preliminary smoke recognition is performed on each image to be detected. The region of interest corresponding to each frame of the image to be detected is determined based on the preliminary smoke recognition result, and subsequent accurate smoke detection is performed based on the region of interest, thereby removing interference and improving the smoke recognition effect. For example, the smoke detection method of the prior art is used to perform preliminary smoke recognition on the image to be detected.

[0098] The region of interest can be expressed as:

[0099] I={I1,I2,...,I k ,...} (1)

[0100]

[0101] Where I is a sequence of image frames to be detected at a continuous time, k represents the number of frames, and I k That is the k-th frame image; I r Indicates that from I k The region of interest obtained by cropping is (x, y) represents the pixel coordinates in the region of interest image, and (x′, y′) represents the I r In the corresponding I k The pixel coordinates in (x1, y1) and (x2, y2) are I k The coordinates of the upper left corner and the lower right corner of the selected area of ​​interest (usually a rectangle).

[0102] Obtain the grayscale image of the region of interest, convert the region of interest image into a grayscale image and store its adjacent frame images as a grayscale image set. The process can be expressed as:

[0103] V g = {g r-L+1 ,g r-L+2 ,g r-L+3 ,...,g r} (3)

[0104]

[0105] Where V g is a grayscale image set consisting of grayscale images of L consecutive frames of interest region images within a period of time, L is the length of the time window; g r isI r A grayscale image of The video sequence I r The B, G, and R channels, α1, α2, and α3 are the weights of each channel in the BGR color space.

[0106] For example, the grayscale images of the area of ​​interest corresponding to the first frame to the Lth frame of the image to be detected are taken as a grayscale image set, and the grayscale images of the area of ​​interest corresponding to the second frame to the L+1th frame of the image to be detected are taken as a grayscale image set. In this way, multiple grayscale image sets are generated.

[0107] In one embodiment of the present invention, frame difference processing is performed on each grayscale image set to obtain a frame difference mask image corresponding to each grayscale image set, including:

[0108] Based on the first grayscale image and the last grayscale image in the grayscale image set, calculate the pixel value difference of each pixel;

[0109] Based on the pixel value difference and pixel threshold of each pixel point, a frame difference mask image is generated, wherein in the frame difference mask image, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black.

[0110] Specifically, the frame difference method is a method for detecting moving targets by comparing the pixel value differences of adjacent images in multiple continuous image sequences. By subtracting the pixel values ​​of two frames and taking the absolute value of the brightness difference, it is possible to determine whether the value is greater than a threshold to analyze the motion characteristics of the video or image sequence, thereby determining whether there is an object moving in the image sequence.

[0111] In this embodiment, the first grayscale image and the last grayscale image in the grayscale image set are subjected to frame difference processing, the pixel value difference of each pixel point in the two grayscale images is calculated, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black, and a frame difference mask image is obtained. In the frame difference mask image, the white pixel area is the moving object area, or the pixel value area greater than 0 is the moving object area, and the process can be expressed as:

[0112]

[0113] Where m r It is a frame difference mask image corresponding to a grayscale image set, which is a binary image. T represents the pixel threshold. If the difference between the corresponding pixels of the two images is greater than the pixel threshold, it means that there is a moving object in the area.

[0114] In one embodiment, the moving object area of ​​each frame difference mask image in each mask atlas is calculated, and based on the multiple moving object area areas in each mask atlas, it is determined whether there is a potential smoke area in multiple images to be detected corresponding to each mask atlas, including:

[0115] Based on the color of the pixel points in the frame difference mask image, the area of ​​the moving object region in each frame difference mask image in each mask image set is calculated;

[0116] Based on the areas of multiple moving object regions in each mask atlas, the number of frame difference mask images whose areas of the moving object regions in each mask atlas belong to the area range is obtained;

[0117] According to the number of frame difference mask images, it is determined whether there are potential smoke areas in the multiple images to be detected corresponding to each mask atlas.

[0118] Specifically, the white area in the frame difference mask image represents the moving object area. The area of ​​the white area in the frame difference mask image is calculated to obtain the area size of the moving object area. According to the order of the grayscale atlases corresponding to the frame difference mask images, multiple frame difference mask images are divided into multiple mask atlas sets, and the area of ​​the moving object area of ​​each frame difference mask image in the mask atlas set is calculated, that is, the area size of the moving object area in the frame difference mask images within the length of multiple continuous video time windows is calculated and stored. The process can be expressed as:

[0119] V A ={A r-q+1 ,A r-q+2 ,A r-q+3 ,...,A r} (6)

[0120] A i =ΣΣm i (x,y),i=r,r+1,...,r+q-1 (7)

[0121] Where V A is the area of ​​the moving object region in the frame difference mask image within the length of q consecutive time windows; the area of ​​each moving object region A i The frame difference mask image m i It is obtained by summing the number of areas with pixel values ​​greater than 0.

[0122] Then the dynamic characteristics of smoke are analyzed. Specifically, if the area of ​​the moving object region in the frame difference mask image fluctuates within a certain range within a period of time, these areas are likely to be smoke. The process can be expressed as:

[0123] V S ={S r-q+1 ,S r-q+1 ,S r-q+2 ,...,S r} (8)

[0124]

[0125] Where V S It indicates the area where smoke may exist within the length of q consecutive time windows. Since the dynamic range of smoke is usually not large, if the area of ​​the moving object is Ai Within a certain area threshold (T0 and T1), it is considered that the moving object area is likely to be smoke.

[0126] In a mask atlas, the number of frame difference mask maps whose area of ​​the moving object region belongs to the area range is obtained, and it is determined whether the number of frame difference mask maps is greater than or equal to the number threshold. When the number of frame difference mask maps is greater than or equal to the number threshold, there are potential smoke areas in the multiple images to be detected corresponding to the mask atlas; when the number of frame difference mask maps is less than the number threshold, there are no potential smoke areas in the multiple images to be detected corresponding to the mask atlas.

[0127] For example, in a mask atlas, there are 40 frame difference mask maps. When the number of frame difference mask maps whose area of ​​the moving object region belongs to the area range is greater than or equal to 20, it is considered that there is a potential smoke area in the target area.

[0128] In one embodiment, smoke feature extraction is performed on a plurality of to-be-detected images corresponding to any mask atlas to obtain a plurality of smoke feature maps, including:

[0129] Performing convolution processing on the image to be detected based on two-dimensional convolution to obtain a first smoke feature map;

[0130] The first smoke feature map is convolved based on the first dilated convolution to obtain a second smoke feature map, and the second smoke feature map is processed based on the channel attention mechanism to obtain a channel attention feature map;

[0131] The first smoke feature map is convolved based on the second dilated convolution to obtain a third smoke feature map, and the third smoke feature map is processed based on the spatial attention mechanism to obtain a spatial attention feature map, wherein the number of channels of the first dilated convolution and the second dilated convolution is different;

[0132] The channel attention feature map and the spatial attention feature map are fused to obtain the smoke feature map.

[0133] In this embodiment, in order to accurately identify smoke, the smoke feature attention module (SFAM) is used to extract smoke features from the image to be detected to obtain a smoke feature map. It should be noted that the smoke feature attention module can be set up separately or added to a trained deep learning model for plug-and-play use. The module consists of two parts: channel attention and spatial attention. r First, the first feature map F is obtained by two-dimensional convolution, and then the first feature map F is convolved using two hole convolutions with different numbers of channels to obtain the second feature map F with a larger receptive field. c And the third characteristic graph F s, and then the second feature map F c Perform channel attention mechanism processing to obtain the channel feature map F c ′, for the third feature map F s进行 The spatial attention mechanism is used to obtain the spatial feature map F. s ′, and finally the channel feature map F c ′, spatial feature map F s ′ obtains a new smoke feature map F′ through feature fusion, and inputs the smoke feature map F′ into the pre-trained deep learning model. The smoke feature extraction process can be expressed as:

[0134] F′=F c ′⊕F s ′ (11)

[0135]

[0136] Among them, σ represents the activation function, δ represents the ReLU function, w1 and w2 represent the weights, and F N (i,j) represents the output feature map F c or F s The position on the graph, x and y represent the convolution kernel k N The relative position on the input feature map F, N is equal to N c or N s , r represents the hole rate, F(x,y) represents the position on the input feature map F, i and j represent the convolution kernel k in the input image I r The relative position on the image, H represents the length of the image, W represents the width of the image, and C represents the number of channels.

[0137] The smoke feature attention module is used to extract smoke features, thereby achieving better smoke tracking effects and eliminating interference from environmental factors such as lighting.

[0138] In one embodiment of the present invention, determining a smoke detection result according to a smoke confidence level includes:

[0139] When the smoke confidence of the image to be detected is greater than or equal to the confidence threshold, it is determined that smoke exists in the image to be detected.

[0140] In one embodiment of the present invention, after determining that smoke exists in the image to be detected, the smoke detection method further includes:

[0141] The region of interest and the frame difference mask map corresponding to the image to be detected are obtained, and based on the corresponding region of interest and the frame difference mask map, the smoke region in the image to be detected is enhanced.

[0142] Specifically, if there are a certain number of potential smoke areas, the smoke features of the current region of interest frame are extracted to obtain a smoke feature map, which is then fed into the trained deep learning model to calculate the smoke confidence. The process can be expressed as:

[0143]

[0144] Where P(Y) represents the confidence level of smoke in the current image; f is the activation function; w and b represent the network weights and bias of the model respectively; T s is the threshold value, if V S There are greater than T s If there is a region where smoke may exist, the current frame is sent to the model for inference to obtain the smoke confidence.

[0145] According to the smoke confidence level, it is determined whether there is smoke in the current frame. The process can be expressed as:

[0146]

[0147] Among them, y is the final result of smoke recognition, 1 indicates the presence of smoke, and 0 indicates the absence of smoke; k is the confidence threshold.

[0148] In one embodiment, if the current frame is judged to contain smoke, the frame difference mask image and the region of interest image obtained previously are used to enhance the image to be detected so as to realize real-time tracking of smoke. The process can be expressed as follows:

[0149]

[0150] Among them I k ′ is the enhanced current frame image, which is composed of the enhanced region of interest frame image I r ′, (x, y) represents the pixel coordinates in the enhanced current frame image, (x′, y′) represents I r ' corresponds to I k ′, (x1, y1) and (x2, y2) are the upper left corner coordinates and lower right corner coordinates of the region of interest (usually a rectangle) selected in step 1; the enhanced region of interest frame image I r 'From the original I r The blue channel, green channel and frame difference mask image m in are obtained by channel merging.

[0151] In one embodiment, a smoke alarm real-time processing module is used to improve the real-time response speed of smoke detection. The above algorithm is encapsulated into a class according to the functions and processing steps, and ported to the C++ environment. In order to improve the model reasoning speed, the model is deployed using TensorRT (a software development kit for high-performance deep learning model reasoning). The model is converted, imported into the reasoning engine, and encapsulated into a dynamic link library for external programs to perform reasoning output.

[0152] In one embodiment, at a raw material site of a rare earth recycling and reuse enterprise, multiple industrial cameras monitor the rare earth waste in different raw material areas of the site in real time and obtain the real-time video images of each industrial camera in the raw material area through a local area network. A portion of industrial video images showing smoke and fire at the site are selected. The video image data size dimensions are two spatial dimensions, horizontal and vertical, with a resolution of 2560×1440. A single frame image is an 8-bit three-channel color image. The video frame rate is 30 frames per second. In order to achieve real-time response speed of smoke detection, downsampling is performed when processing each frame of the image, and the downsampling rate is 4.

[0153] Perform smoke detection on the above sampled image frames, such as Figure 2 As shown in the figure, the specific process of smoke detection based on deep learning is as follows:

[0154] Step 1: Load the video image and select the region of interest for detection, such as Figure 3 and Figure 4 To load two frames of images in a video, Figure 3 is a video frame in a normal state (i.e. without smoke), Figure 4 It is a video frame in an abnormal state (i.e., with smoke), and the box represents the selected region of interest;

[0155] Step 2: Get the grayscale images of the adjacent frames of the region of interest, convert the frames of the region of interest into grayscale images, set the length of the video time window to 30, that is, store the adjacent 30 consecutive frames of images, and the grayscale image of one frame of the region of interest is as follows: Figure 5 As shown;

[0156] Step 3: Obtain the frame difference mask image. In the 30 frames of images stored in step 2, select the first frame and the last frame for frame difference. The pixel values ​​with a difference greater than 25 are white, otherwise they are black. Thus, a mask image is obtained, such as Figure 6 As shown, the white area in the mask image is the moving object area;

[0157] Step 4: Calculate the size of the moving object region. Based on step 3, obtain 40 consecutive frame difference mask images, calculate the size of the moving object region therein, and store them.

[0158] Step 5: Smoke dynamic feature analysis, determine one by one whether the area of ​​the 40 moving object regions stored in step 4 is within a certain threshold (35-500), if so, the moving object region is considered to be a potential smoke area;

[0159] Step 6: Calculate the smoke confidence. If there are 20 potential smoke areas in step 5, the current region of interest frame is sent to the trained deep learning classification model for smoke recognition. The training set used by the deep learning classification model is a public data set (8022 smoke and flame images and 900 smoke-free frames) and video frame images collected on site (4513 smoke frames and 21316 smoke-free frames). In order to accurately identify smoke, a plug-and-play smoke feature attention module (SFAM) is added to the trained deep learning model, as shown in Figure 7 As shown, this module consists of two parts: channel attention and spatial attention. The input image I r First, the feature map F is obtained by two-dimensional convolution, where the convolution kernel size is 3 and the number of channels is 16; then two dilated convolutions with different numbers of channels are used to obtain feature maps F with larger receptive fields. c and F s Here, the void rate is set to 2, and the number of channels is set to 32 and 48 respectively; then, the channel attention and spatial attention are used to obtain the channel and spatial distribution feature maps F of different importance. c ′ and F s ′; finally, the new feature map F′ is obtained by feature fusion and input into the pre-trained residual network;

[0160] The channel attention first takes the feature map F c Perform global average pooling to generate 1×1×N c (N c 32), and then obtain the feature vector with weights through two layers of fully connected layers, and use it to map the feature map F c Assign values ​​to obtain a new feature map, and finally perform a hole convolution on the new feature map to obtain F c ′; while spatial attention first takes the feature map F s Perform a reshape operation to get N s ×HW(N s 48), then transpose the feature vector and perform dot multiplication on the original vector to obtain a feature map of HW×H×W, and finally use the feature map to assign weights to the original feature map F to obtain F s ′.

[0161] The backbone network of the deep learning model uses ResNet (its residual structure can obtain deeper semantic information). It is first pre-trained using a public dataset and then further trained on video frame images collected on site. The model uses the Adam optimization algorithm during training, the learning rate is set to 0.0001, the number of network training iterations is 100,000 times, and the loss function uses cross entropy loss. Its loss function L can be expressed as:

[0162]

[0163] Among them, P i (Y) represents the predicted probability value of sample i, represents the label value of sample i (1 if there is smoke in the image, 0 if there is no smoke), and N is the number of training samples;

[0164] Step 7: Based on the smoke confidence level in step 6, if the smoke confidence level identified by the deep learning classification model is greater than 90%, it is considered that smoke exists in the current frame;

[0165] Step 8: If there is smoke in the current frame, the frame difference mask obtained in step 3 and the region of interest obtained in step 1 are used to enhance the current frame in the original video to achieve real-time tracking of smoke, such as Figure 8 As shown, the smoke area is enhanced using a mask;

[0166] Step 9: Considering the time-consuming influence of deep learning model reasoning, in order to improve the real-time response speed of smoke detection, the above algorithm is first encapsulated into a class according to the function and processing steps, and then ported to the C++ environment. In order to improve the model reasoning speed, the model is further deployed using TensorRT. By converting the model and using the created builder (Builder), network (Network) and parser (Parser), the converted model is imported into the reasoning engine (Engine), and then the image to be identified is imported into the model for reasoning output. In order to ensure real-time and portability, the present invention encapsulates the entire model loading and reasoning process into a dynamic link library for external program calls. The model deployment process is as follows: Fig. 9 shown.

[0167] After the above deployment, the practical results show that the present invention can perform real-time dynamic detection of smoke, has a fast detection speed and can be applied to actual fire warning. From the test results of 277.53 hours of video data collected on site, it can at least predict 10 minutes before the flame occurs, and the false alarm rate of smoke is extremely low, only 0.012%. Fig.10 shown.

[0168] Practical results show that the present invention has a fast real-time smoke detection speed and can be applied to fire warning in actual industrial production environments. It can at least predict fire 10 minutes before the flame is generated, and the smoke false alarm rate is extremely low, only 0.012%.

[0169] Furthermore, as a response to the above Figure 1 The implementation of the method shown in the figure, the embodiment of the present invention provides a smoke detection device based on deep learning, such as Fig.11 As shown, the device comprises:

[0170] A grayscale image set acquisition module 1102 is used to acquire in real time a plurality of frames of to-be-detected images of a target area that are continuously photographed, perform grayscale processing on each frame of the to-be-detected image to obtain a plurality of grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain a plurality of grayscale image sets;

[0171] The mask atlas acquisition module 1104 is used to perform frame difference processing on each grayscale image set respectively to obtain a frame difference mask map corresponding to each grayscale image set, and to use a second preset number of frame difference mask maps as a mask atlas according to the order of the grayscale image sets corresponding to the frame difference mask maps to obtain multiple mask atlas sets, and to obtain multiple images to be detected corresponding to each mask atlas set;

[0172] The smoke region determination module 1106 is used to calculate the moving object region area of ​​each frame difference mask image in each mask image set, and determine whether there is a potential smoke region in the multiple images to be detected corresponding to each mask image set based on the multiple moving object region areas in each mask image set;

[0173] The smoke feature map acquisition module 1108 is used to extract smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps when there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas.

[0174] The detection result determination module 1110 is used to calculate the smoke confidence of each frame of the image to be detected corresponding to any mask atlas based on multiple smoke feature maps and a preset deep learning model, and determine the smoke detection result according to the smoke confidence.

[0175] The present application provides a smoke detection device based on deep learning. Compared with the prior art, grayscale processing is performed on multiple frames of to-be-detected images of a target area taken continuously to obtain multiple grayscale image sets, and a frame difference method is used to generate a frame difference mask image corresponding to each grayscale image set. The frame difference mask image can reflect the moving object area, and the multiple frame difference mask images are divided into multiple mask image sets. The moving object area of ​​each frame difference mask image in each mask image set is calculated. Based on the areas of multiple moving object areas in each mask image set, it is determined whether there is a potential smoke area in the image to be detected corresponding to the mask image set. When there is a potential smoke area in the image to be detected corresponding to any mask image set, the image is detected. Smoke feature extraction is performed on multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps. Each original feature map is input into the preset deep learning model to calculate the smoke confidence of each frame of the image to be detected. According to the smoke confidence, the smoke detection result of each frame of the image to be detected is determined. Since the frame difference mask map can reflect the moving object area and can capture and track areas with dynamic features including smoke, the existence of potential smoke areas is determined according to the area of ​​the moving object area of ​​multiple frame difference mask maps. Smoke feature extraction and smoke detection are performed on the images to be detected where there is smoke, which can accurately detect dynamically changing smoke and effectively track the smoke.

[0176] In one embodiment, the mask atlas acquisition module is further used to:

[0177] Based on the first grayscale image and the last grayscale image in the grayscale image set, calculate the pixel value difference of each pixel;

[0178] Based on the pixel value difference and pixel threshold of each pixel point, a frame difference mask image is generated, wherein in the frame difference mask image, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black.

[0179] In one embodiment, the smoke area determination module is further used to:

[0180] Based on the color of the pixel points in the frame difference mask image, the area of ​​the moving object region in each frame difference mask image in each mask image set is calculated;

[0181] Based on the areas of multiple moving object regions in each mask atlas, the number of frame difference mask images whose areas of the moving object regions in each mask atlas belong to the area range is obtained;

[0182] According to the number of frame difference mask images, it is determined whether there are potential smoke areas in the multiple images to be detected corresponding to each mask atlas.

[0183] In one embodiment, the smoke area determination module is further used to:

[0184] When the number of frame difference mask images is greater than or equal to the number threshold, there are potential smoke areas in the multiple images to be detected corresponding to the mask atlas;

[0185] When the number of frame difference mask images is less than the number threshold, the multiple images to be detected corresponding to the mask atlas do not have potential smoke areas.

[0186] In one embodiment, the smoke characteristic image acquisition module is further used to:

[0187] Performing convolution processing on the image to be detected based on two-dimensional convolution to obtain a first smoke feature map;

[0188] The first smoke feature map is convolved based on the first dilated convolution to obtain a second smoke feature map, and the second smoke feature map is processed based on the channel attention mechanism to obtain a channel attention feature map;

[0189] The first smoke feature map is convolved based on the second dilated convolution to obtain a third smoke feature map, and the third smoke feature map is processed based on the spatial attention mechanism to obtain a spatial attention feature map, wherein the number of channels of the first dilated convolution and the second dilated convolution is different;

[0190] The channel attention feature map and the spatial attention feature map are fused to obtain the smoke feature map.

[0191] In one embodiment, the detection result determination module is further used to:

[0192] When the smoke confidence of the image to be detected is greater than or equal to the confidence threshold, it is determined that smoke exists in the image to be detected.

[0193] In one embodiment, the detection result determination module is further used to:

[0194] After determining that smoke exists in the image to be detected, the region of interest and the frame difference mask map corresponding to the image to be detected are obtained, and based on the corresponding region of interest and the frame difference mask map, the smoke region in the image to be detected is enhanced.

[0195] In one embodiment, the grayscale image set acquisition module is further used for:

[0196] Perform preliminary smoke detection on each frame of the image to be detected to obtain the region of interest corresponding to each frame of the image to be detected;

[0197] Perform grayscale transformation on each region of interest respectively to obtain a grayscale image corresponding to each region of interest.

[0198] According to one embodiment of the present invention, a storage medium is provided, wherein the storage medium stores at least one executable instruction, and the computer executable instruction can execute the deep learning-based smoke detection method in any of the above method embodiments.

[0199] Fig.12 A schematic diagram of the structure of a computer device provided according to an embodiment of the present invention is shown. The specific embodiment of the present invention does not limit the specific implementation of the computer device.

[0200] like Fig.12 As shown, the computer device may include: a processor (processor) 1202 , a communication interface (Communications Interface) 1204 , a memory (memory) 1206 , and a communication bus 1208 .

[0201] The processor 1202 , the communication interface 1204 , and the memory 1206 communicate with each other via a communication bus 1208 .

[0202] The communication interface 1204 is used to communicate with other devices such as clients or other servers.

[0203] The processor 1202 is used to execute the program 1210, and specifically can execute the relevant steps in the above-mentioned embodiment of the smoke detection method based on deep learning.

[0204] Specifically, the program 1210 may include program codes, which include computer operation instructions.

[0205] The processor 1202 may be a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention. The one or more processors included in the computer device may be processors of the same type, such as one or more CPUs; or processors of different types, such as one or more CPUs and one or more ASICs.

[0206] The memory 1206 is used to store the program 1210. The memory 1206 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.

[0207] The program 1210 may be specifically configured to enable the processor 1202 to perform the following operations:

[0208] Acquire multiple frames of to-be-detected images of the target area that are continuously photographed in real time, perform grayscale processing on each frame of the to-be-detected image to obtain multiple grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain multiple grayscale image sets;

[0209] Performing frame difference processing on each grayscale image set respectively to obtain a frame difference mask image corresponding to each grayscale image set, taking a second preset number of frame difference mask images as a mask image set in the order of the grayscale image sets corresponding to the frame difference mask images, obtaining multiple mask image sets, and obtaining multiple images to be detected corresponding to each mask image set;

[0210] Calculate the moving object area of ​​each frame difference mask image in each mask atlas, and based on the multiple moving object area areas in each mask atlas, determine whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas;

[0211] When there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas, smoke features are extracted from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps;

[0212] Based on multiple smoke feature maps and a preset deep learning model, the smoke confidence of each frame of the image to be detected corresponding to any mask atlas is calculated, and the smoke detection result is determined according to the smoke confidence.

[0213] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. In one embodiment, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0214] The above embodiments are only exemplary embodiments of the present application and are not intended to limit the present application. The protection scope of the present application is defined by the claims. Those skilled in the art may make various modifications or equivalent substitutions to the present application within the essence and protection scope of the present application, and such modifications or equivalent substitutions shall also be deemed to fall within the protection scope of the present application.

Claims

1. A smoke detection method based on deep learning, It is characterized in that include: Acquire multiple frames of to-be-detected images of the target area that are continuously photographed in real time, perform grayscale processing on each frame of the to-be-detected image to obtain multiple grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain multiple grayscale image sets; Performing frame difference processing on each grayscale image set respectively to obtain a frame difference mask image corresponding to each grayscale image set, taking a second preset number of frame difference mask images as a mask image set in the order of the grayscale image sets corresponding to the frame difference mask images, obtaining multiple mask image sets, and obtaining multiple images to be detected corresponding to each mask image set; Calculating the moving object area of ​​each frame difference mask image in each mask atlas, and judging whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas based on the multiple moving object area areas in each mask atlas; When there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas, extracting smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps; The smoke confidence of each frame of the image to be detected corresponding to any one of the mask atlases is calculated based on the multiple smoke feature maps and a preset deep learning model, and the smoke detection result is determined according to the smoke confidence.

2. The smoke detection method based on deep learning as claimed in claim 1, It is characterized in that The step of performing frame difference processing on each grayscale image set to obtain a frame difference mask image corresponding to each grayscale image set includes: Based on the first grayscale image and the last grayscale image in the grayscale image set, calculating the pixel value difference of each pixel point; Based on the pixel value difference and pixel threshold of each pixel point, a frame difference mask image is generated, wherein in the frame difference mask image, the pixel points whose pixel value difference is greater than the pixel threshold are set to white, and the pixel points whose pixel value difference is less than or equal to the pixel threshold are set to black.

3. The smoke detection method based on deep learning as claimed in claim 2, It is characterized in that The step of calculating the moving object area of ​​each frame difference mask image in each mask image set, and judging whether there is a potential smoke area in a plurality of images to be detected corresponding to each mask image set based on the plurality of moving object area areas in each mask image set, comprises: Calculating the area of ​​the moving object region in each frame difference mask image in each mask image set based on the color of the pixel points in the frame difference mask image; Based on the areas of the multiple moving object regions in each mask atlas, obtaining the number of frame difference mask images whose areas of the moving object regions in each mask atlas belong to an area range; It is determined whether there is a potential smoke area in the multiple images to be detected corresponding to each mask atlas according to the number of the frame difference mask images.

4. The smoke detection method based on deep learning as claimed in claim 3, It is characterized in that The determining, according to the number of the frame difference mask images, whether the multiple images to be detected corresponding to each mask atlas have potential smoke areas includes: When the number of the frame difference mask images is greater than or equal to the number threshold, the multiple images to be detected corresponding to the mask atlas have potential smoke areas; When the number of the frame difference mask images is less than the number threshold, the multiple images to be detected corresponding to the mask atlas do not have potential smoke areas.

5. The smoke detection method based on deep learning as claimed in claim 1, It is characterized in that The step of extracting smoke features from a plurality of images to be detected corresponding to any one of the mask atlases to obtain a plurality of smoke feature maps includes: Performing convolution processing on the image to be detected based on two-dimensional convolution to obtain a first smoke feature map; Performing convolution processing on the first smoke feature map based on the first dilated convolution to obtain a second smoke feature map, and processing the second smoke feature map based on the channel attention mechanism to obtain a channel attention feature map; Performing convolution processing on the first smoke feature map based on a second dilated convolution to obtain a third smoke feature map, and processing the third smoke feature map based on a spatial attention mechanism to obtain a spatial attention feature map, wherein the number of channels of the first dilated convolution and the second dilated convolution is different; The channel attention feature map and the space attention feature map are fused to obtain a smoke feature map.

6. The smoke detection method based on deep learning as claimed in claim 1, It is characterized in that Determining the smoke detection result according to the smoke confidence level includes: When the smoke confidence of the image to be detected is greater than or equal to the confidence threshold, determining that smoke exists in the image to be detected; After determining that smoke exists in the image to be detected, the smoke detection method further includes: The region of interest and the frame difference mask map corresponding to the image to be detected are obtained, and based on the corresponding region of interest and the frame difference mask map, the smoke region in the image to be detected is enhanced.

7. The smoke detection method based on deep learning as claimed in claim 1, It is characterized in that The grayscale processing is performed on each frame of the image to be detected to obtain multiple grayscale images, including: Perform preliminary smoke detection on each frame of the image to be detected to obtain the region of interest corresponding to each frame of the image to be detected; Perform grayscale transformation on each region of interest respectively to obtain a grayscale image corresponding to each region of interest.

8. A smoke detection device based on deep learning, It is characterized in that include: A grayscale image set acquisition module is used to acquire multiple frames of to-be-detected images of a target area that are continuously photographed in real time, perform grayscale processing on each frame of the to-be-detected image to obtain multiple grayscale images, and take a first preset number of grayscale images as a grayscale image set according to the shooting order of the to-be-detected images corresponding to the grayscale images to obtain multiple grayscale image sets; a mask atlas acquisition module, configured to perform frame difference processing on each grayscale image set respectively, obtain a frame difference mask map corresponding to each grayscale image set, and use a second preset number of frame difference mask maps as a mask atlas according to the order of the grayscale image sets corresponding to the frame difference mask maps, to obtain multiple mask atlas sets, and obtain multiple images to be detected corresponding to each mask atlas set; A smoke region judgment module is used to calculate the moving object region area of ​​each frame difference mask image in each mask atlas, and based on the multiple moving object region areas in each mask atlas, judge whether there is a potential smoke region in the multiple images to be detected corresponding to each mask atlas; A smoke feature map acquisition module is used to extract smoke features from the multiple images to be detected corresponding to any mask atlas to obtain multiple smoke feature maps when there is a potential smoke area in the multiple images to be detected corresponding to any mask atlas. A detection result determination module is used to calculate the smoke confidence of each frame of the image to be detected corresponding to any mask atlas based on the multiple smoke feature maps and a preset deep learning model, and determine the smoke detection result according to the smoke confidence.

9. A storage medium, wherein at least one executable instruction is stored in the storage medium, and the executable instruction enables a processor to perform operations corresponding to the deep learning-based smoke detection method as described in any one of claims 1 to 7.

10. A computer device, include: A processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface communicate with each other via the communication bus; The memory is used to store at least one executable instruction, and the executable instruction enables the processor to perform operations corresponding to the deep learning-based smoke detection method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Firework detection model training method, smoke and fire detection method and equipment

    CN112949453A

  • Model training and smoke detection method and device, electronic equipment and storage medium

    CN115187831A

  • Image data transmission method and system for monitoring video

    CN117768615A

  • Smoke detection method based on deep learning, device and storage medium

    US20240037950A1

Cited By

  • Smoke target detection method and device based on time sequence disturbance response diagram

    CN122289669A