Firework recognition method, device and equipment and readable storage medium

By selecting target areas from high vantage points and with a wide field of view, and combining multiple image recognition algorithms, the problem of low accuracy in fireworks recognition under high vantage points and with a wide field of view was solved, achieving higher accuracy and precision in fireworks recognition.

CN115294340BActive Publication Date: 2026-07-03CHINA TOWER CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA TOWER CO LTD
Filing Date
2022-08-08
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

When using visual recognition algorithms to identify fireworks from high vantage points and with a wide field of view, false alarms and low recognition accuracy are common problems.

Method used

By obtaining the confidence level of the target object in the first image, the target area is filtered out and magnified for shooting to obtain multiple frames of the second image. At least two image recognition algorithms are combined to identify fireworks, and multiple confidence levels are combined to determine the third confidence level, thereby improving the recognition accuracy.

Benefits of technology

By combining multiple magnified images and various recognition algorithms, the accuracy and precision of fireworks identification have been improved, reducing false alarms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115294340B_ABST
    Figure CN115294340B_ABST
Patent Text Reader

Abstract

The application provides a method for identifying fireworks, comprising: obtaining a first confidence corresponding to a target object to be identified in a first image; determining a target region in the first image when the first confidence is greater than a first preset value; taking an enlarged shot of the target region to obtain K second images; identifying the second images according to at least two image recognition algorithms to obtain a second confidence corresponding to each image recognition algorithm of the target object; and determining a third confidence according to the first confidence and the second confidence, wherein the third confidence is used to represent the probability that the target object is fireworks. In this way, the first image is preliminarily screened to obtain the first confidence, then an enlarged shot is taken, and then the second confidence is obtained through two image recognition algorithms. The third confidence is obtained by comprehensively obtaining the confidence through multiple ways, thereby improving the accuracy of the third confidence and the precision of the identification of fireworks.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus, device and readable storage medium for smoke and fire recognition. Background Technology

[0002] Severe fires are highly likely to occur in sparsely populated areas. Therefore, people use high-definition cameras to acquire real-time images of the area and then employ deep learning algorithms to identify the presence of smoke and fire in the images, thus greatly saving manpower costs. However, to monitor large areas, high-definition cameras are often mounted on high towers. At high points with wide fields of view, the dynamic changes of smoke, water vapor, clouds, and lights are more similar. Therefore, using visual recognition algorithms to identify the presence of smoke and fire in images can easily result in misidentifying water vapor, clouds, and lights as smoke and fire.

[0003] Therefore, when using visual recognition algorithms to identify fireworks in images from high vantage points and with a wide field of view, false alarms are likely to occur, resulting in low accuracy in identifying fireworks. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, device, and readable storage medium for identifying fireworks, so as to solve the problem of poor accuracy in identifying fireworks.

[0005] In a first aspect, embodiments of the present invention provide a method for identifying fireworks, comprising: obtaining a first confidence level corresponding to a target object to be identified in a first image, wherein the first confidence level is used to represent the probability that the target object in the first image is fireworks; determining a target region in the first image when the first confidence level is greater than a first preset value, wherein the target region is an image region including the target object; taking a magnified picture of the target region to obtain K frames of second images, each frame of the second image including the target region, wherein K is a positive integer; performing fireworks identification on the second image according to at least two image recognition algorithms to obtain a second confidence level corresponding to each image recognition algorithm for the target object, wherein the second confidence level is used to represent the probability that the target object in the second image is fireworks; and determining a third confidence level based on the first confidence level and the second confidence level, wherein the third confidence level is used to represent the probability that the target object is fireworks.

[0006] Secondly, an embodiment of the present invention provides a smoke and fire detection device, characterized in that the smoke and fire detection device comprises:

[0007] The acquisition module is used to acquire a first confidence score corresponding to the target object to be identified in the first image, wherein the first confidence score is used to represent the probability that the target object in the first image is fireworks;

[0008] The first determining module is used to determine the target region in the first image when the first confidence level meets the firework recognition triggering condition, wherein the target region is an image region including the target object;

[0009] The first acquisition module is used to zoom in and capture the target area to obtain K frames of second images, each frame of the second image including the target area, where K is a positive integer;

[0010] The second acquisition module is used to perform fireworks identification on the second image according to at least two image recognition algorithms, and to obtain a second confidence level for the target object corresponding to each image recognition algorithm. The second confidence level is used to represent the probability that the target object in the second image is fireworks.

[0011] The second determining module is used to determine the third confidence level based on the first confidence level and the second confidence level, wherein the third confidence level is used to represent the probability that the target object is fireworks.

[0012] Thirdly, embodiments of the present invention provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method of any one of claims 1 to 7.

[0013] Fourthly, embodiments of the present invention provide a readable storage medium having a computer program stored thereon, characterized in that the computer program, when executed by a processor, implements the steps of the method according to any one of claims 1 to 7.

[0014] This application embodiment obtains a first confidence level corresponding to a target object to be identified in a first image, the first confidence level representing the probability that the target object in the first image is fireworks; when the first confidence level is greater than a first preset value, a target region in the first image is determined, the target region being an image region including the target object; the target region is magnified and photographed to obtain K frames of second images, each frame of the second image including the target region, where K is a positive integer; fireworks identification is performed on the second image according to at least two image recognition algorithms, obtaining a second confidence level for each image recognition algorithm corresponding to the target object, the second confidence level representing the probability that the target object in the second image is fireworks; a third confidence level is determined based on the first confidence level and the second confidence level, the third confidence level representing the probability that the target object is fireworks. In this way, the target objects in the first image with a wide field of view are initially screened to obtain the first confidence level. Then, the target objects that have passed the initial screening are magnified and photographed. The dynamic range of the target objects in the magnified image is larger, which can better distinguish the dynamic changes of fireworks from other dynamic targets. Then, two image recognition algorithms are used to obtain the second confidence level. The third confidence level is obtained by combining the confidence levels obtained by multiple methods, thereby improving the accuracy of the third confidence level and thus improving the accuracy of fireworks recognition. Attached Figure Description

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

[0016] Figure 1 This is a flowchart of the smoke and fire recognition method provided in an embodiment of the present invention;

[0017] Figure 2 This is a structural diagram of the smoke and fire recognition device provided in an embodiment of the present invention;

[0018] Figure 3 This is a structural diagram of an electronic device provided in an embodiment of the present invention;

[0019] Figure 4 This is a structural diagram of another electronic device provided in an embodiment of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] Unless otherwise defined, the technical or scientific terms used in this invention shall have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship also changes accordingly.

[0022] like Figure 1 The diagram shown is a flowchart of a smoke and fire recognition method provided in an embodiment of this application, including the following steps:

[0023] Step 101: Obtain the first confidence level corresponding to the target object to be identified in the first image. The first confidence level is used to represent the probability that the target object in the first image is fireworks.

[0024] It should be understood that the first image can be acquired at regular intervals; further, it can be acquired at 5-second intervals or 10-second intervals, without further limitation here.

[0025] Optionally, the first confidence level corresponding to the target object in the first image can be obtained by calculating it using the YOLOv5 algorithm or by other visual recognition algorithms, without further limitation here.

[0026] Alternatively, the first image can be acquired by positioning the camera at a higher location; furthermore, the camera can be a wide-angle camera. This configuration allows the first image to cover a larger area, thereby reducing the total number of cameras used and lowering operating costs.

[0027] Step 102: If the first confidence level is greater than the first preset value, determine the target region in the first image, wherein the target region is an image region that includes the target object;

[0028] It should be noted that the specific value of the first preset value can be determined based on a large amount of practical data or experience.

[0029] It should be understood that by determining the target region in the first image when the first confidence level is greater than a first preset value, the target region is an image region that includes the target object. In this way, first images with a low probability that the target object is fireworks can be filtered out, and first images with a high probability that the target object is fireworks can be directly determined, reducing the number of first images that need to be determined and improving the efficiency of determining the target region.

[0030] Step 103: Zoom in and take pictures of the target area to obtain K frames of second images, each frame of the second image including the target area, where K is a positive integer;

[0031] It should be noted that the second K-frame image mentioned above is a continuous frame image, which can also be referred to as video.

[0032] It should be understood that K needs to be greater than 5. For example, K can be 100 or 1000. No further restrictions are imposed here.

[0033] It should be noted that by magnifying and photographing the target area, K frames of second images are obtained, each frame of which includes the target area, where K is a positive integer. This allows for the acquisition of dynamic change information of the target object, thus enabling better identification of fireworks as a dynamic target object.

[0034] Step 104: Perform fireworks identification on the second image according to at least two image recognition algorithms to obtain the second confidence level of the target object for each image recognition algorithm. The second confidence level is used to represent the probability that the target object in the second image is fireworks.

[0035] It should be noted that the second image is subjected to fireworks identification using at least two image recognition algorithms to obtain a second confidence level for each image recognition algorithm corresponding to the target object. This second confidence level represents the probability that the target object in the second image is fireworks. In this way, by obtaining confidence levels through multiple methods, a more comprehensive probability of identifying the target object as fireworks is obtained.

[0036] Step 105: Determine the third confidence level based on the first confidence level and the second confidence level. The third confidence level is used to represent the probability that the target object is fireworks.

[0037] Optionally, in the embodiments of this application, if the third confidence level is greater than the fourth preset value, it can be understood that the target object is fireworks; if the third confidence level is less than or equal to the fourth preset value, it can be understood that the target object is not fireworks.

[0038] In this embodiment, a first confidence level is obtained for the target object to be identified in the first image. The first confidence level represents the probability that the target object in the first image is fireworks. If the first confidence level is greater than a first preset value, a target region in the first image is determined. The target region is an image region that includes the target object. The target region is magnified and photographed to obtain K frames of second images, each frame of the second image including the target region, where K is a positive integer. The second image is used to identify fireworks according to at least two image recognition algorithms to obtain a second confidence level for each image recognition algorithm corresponding to the target object. The second confidence level represents the probability that the target object in the second image is fireworks. A third confidence level is determined based on the first confidence level and the second confidence level. The third confidence level represents the probability that the target object is fireworks. In this way, the target objects in the first image with a wide field of view are initially screened to obtain the first confidence level. Then, the target objects that have passed the initial screening are magnified and photographed. The dynamic range of the target objects in the magnified image is larger, which can better distinguish the dynamic changes of fireworks from other dynamic targets. Then, two image recognition algorithms are used to obtain the second confidence level. The third confidence level is obtained by combining the confidence levels obtained by multiple methods, thereby improving the accuracy of the third confidence level and thus improving the accuracy of fireworks recognition.

[0039] Optionally, in some embodiments, before zooming in on the target area to obtain K-frame second images, the method further includes:

[0040] The shooting angle and magnification are determined based on the position and size information of the target area in the first image.

[0041] It should be noted that magnifying the aforementioned target area can be done using a spherical camera, which can rotate to capture the image.

[0042] It should be noted that the shooting angle and magnification are determined based on the position and size information of the target area in the first image. For example, if the area of ​​the target area occupies 10% of the area of ​​the first image and the target area is located in the upper left corner of the first image, the shooting angle of the camera can be shifted from its original position to the upper left corner. Furthermore, since the area of ​​the target area only occupies 10% of the area of ​​the first image, the shooting magnification of the camera can be increased to three times or five times the original.

[0043] It should be understood that before obtaining the K-frame second image by magnifying and photographing the target area, the process further includes: determining the shooting angle and magnification based on the position and size information of the target area in the first image. This allows for obtaining a clearer target object in the second image compared to the first image. A clearer target object makes dynamic changes in the target object more apparent in the consecutive K-frame second images, which is beneficial for distinguishing dynamic targets such as fireworks and clouds.

[0044] Optionally, in some embodiments, the at least two image recognition algorithms include a first image recognition algorithm and a second image recognition algorithm;

[0045] The second image is subjected to smoke and fire recognition using at least two image recognition algorithms. The second confidence level for each image recognition algorithm corresponding to the target object is obtained by:

[0046] The second image is subjected to fireworks recognition according to the first image recognition algorithm to obtain the first sub-confidence level;

[0047] The second image is subjected to fireworks recognition according to the second image recognition algorithm to obtain the second sub-confidence score;

[0048] The second confidence level includes the first sub-confidence level and the second sub-confidence level. The first image recognition algorithm is an algorithm of Gaussian mixture background modeling, morphological filtering and Canny edge detection. The second image recognition algorithm is the YOLOv5 algorithm.

[0049] It should be noted that the second image is used to identify fireworks and obtain the second sub-confidence score by following the first image recognition algorithm described above. The first image recognition algorithm is a hybrid algorithm that includes Gaussian background modeling, morphological filtering and Canny edge detection. The second image is then subjected to Gaussian background modeling, morphological filtering and Canny edge detection in sequence.

[0050] Optionally, in some embodiments, the step of performing smoke and fire recognition on the second image according to the first image recognition algorithm to obtain the first sub-confidence score includes:

[0051] Gaussian background modeling is performed on the preceding M frames of the K-frame second image to obtain a foreground image, which is used to represent the target object in the K-frame second image, where K and M are positive integers;

[0052] The foreground image is subjected to morphological filtering to obtain the first target image;

[0053] The first target image is subjected to the Canny edge detection algorithm to obtain the second target image;

[0054] Based on the second target image, obtain the first sub-confidence of the second image;

[0055] The first target image is a part of the second image.

[0056] It should be noted that M is always less than K; the value of M can be 5.

[0057] Optionally, in some embodiments, the step of performing smoke and fire recognition on the second image according to the second image recognition algorithm to obtain a second sub-confidence score includes:

[0058] The YOLOv5 algorithm was used to perform detection on the second image at two scales: 13*13 and 26*26.

[0059] It should be noted that the second image is detected at two scales, 13*13 and 26*26, using the YOLOv5 algorithm. This reduces the computational load by 75% compared to the original method of using YOLOv5 to upsample and independently detect at three scales (13*13, 26*26, and 52*52). This effectively saves on computer hardware costs and improves detection speed and efficiency.

[0060] Optionally, in some embodiments, obtaining the first sub-confidence of the second target image in the second image based on the edge information of the second target image includes:

[0061] The pixel block areas of each frame of the second image whose pixel block area is greater than the second preset value are merged;

[0062] Obtain the growth rate and the growth rate distribution of each frame of the second image in the K frames;

[0063] When the growth rate is greater than a third preset value and satisfies a normal distribution, a first sub-confidence level is obtained based on the growth rate and the pixel block area after merging the K-frame second images.

[0064] It should be noted that the formula for merging the pixel block areas of each frame of the second image whose pixel block area is greater than the second preset value in the K frames of the second image is as follows:

[0065]

[0066] In the formula P T The sum of the pixel block areas in each of the K frames of the second image where the pixel block area is greater than a second preset value. Let be the area of ​​the pixel block of the second image in the i-th frame.

[0067] Obtain the growth rate and the growth rate distribution of each frame of the second image in the K frames;

[0068] The formula for calculating the growth rate is as follows:

[0069]

[0070] Where τ is the weight value, P Ti The pixel block area of ​​the i-th frame in the K-frame second image where the pixel block area is greater than the second preset value;

[0071] The formula for calculating the growth rate distribution is as follows:

[0072]

[0073] Wherein, δ is the fourth preset value;

[0074] When the growth rate is greater than a third preset value and satisfies a normal distribution, a first sub-confidence level is obtained based on the growth rate and the pixel block area after merging the second images of K frames;

[0075] The formula for calculating the first sub-confidence level is as follows:

[0076]

[0077] Among them, P areas δ represents the first sub-confidence level, c is the amplification factor, and δ is the fourth preset value.

[0078] It should be noted that the magnification factor can be calculated from the grayscale histogram.

[0079] Optionally, in some embodiments, after determining a third confidence level based on the first confidence level and the second confidence level, wherein the third confidence level represents the probability that the target object is fireworks, and before determining that the target object is fireworks if the third confidence level satisfies a first preset value, the method further includes:

[0080] The following formula:

[0081]

[0082] In the formula P end W1 is the third confidence level, W2 is the first confidence level, and W2 is the second sub-confidence level. areas ω represents the first sub-confidence level, and is set according to the actual application scenario.

[0083] In this application, when the third confidence level is greater than 0.5, the target object is determined to be fireworks; when the third confidence level is less than 0.5, the target object is determined not to be fireworks.

[0084] like Figure 2 As shown in the figure, this application embodiment also provides a smoke and fire detection device, the smoke and fire detection device comprising:

[0085] The acquisition module 201 is used to acquire a first confidence level corresponding to the target object to be identified in the first image, wherein the first confidence level is used to represent the probability that the target object in the first image is fireworks;

[0086] The first determining module 202 is used to determine a target region in the first image when the first confidence level meets the firework recognition triggering condition, wherein the target region is an image region including the target object;

[0087] The first acquisition module 203 is used to zoom in and capture the target area to obtain K frames of second images, each frame of the second image including the target area, where K is a positive integer;

[0088] The second obtaining module 204 is used to perform fireworks identification on the second image according to at least two image recognition algorithms, and obtain a second confidence level of the target object for each image recognition algorithm. The second confidence level is used to represent the probability that the target object in the second image is fireworks.

[0089] The second determining module 205 is used to determine the third confidence level based on the first confidence level and the second confidence level, wherein the third confidence level is used to represent the probability that the target object is fireworks.

[0090] like Figure 3 As shown, Figure 3 This is a structural diagram of an electronic device provided in an embodiment of this application, including a processor 301, a memory 302, and a program or instructions stored in the memory 302 and executable on the processor 301. When the program or instructions are executed by the processor 301, they implement the various processes of the above-described embodiment of the smoke and fire recognition method and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0091] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.

[0092] like Figure 4 As shown, Figure 4 This is a structural diagram of another electronic device provided in an embodiment of this application.

[0093] The electronic device 400 includes, but is not limited to, components such as: radio frequency unit 401, network module 402, audio output unit 403, input unit 404, sensor 405, display unit 406, user input unit 407, interface unit 408, memory 409, and processor 410.

[0094] Those skilled in the art will understand that the electronic device 400 may also include a power supply (such as a battery) for supplying power to various components. The power supply may be logically connected to the processor 410 through a power management system, thereby enabling functions such as managing charging, discharging, and power consumption through the power management system. Figure 4 The electronic device structure shown does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown, or combine certain components, or have different component arrangements, which will not be elaborated here.

[0095] The processor 410 is configured to perform the following operations: acquire a first confidence score corresponding to a target object to be identified in a first image, the first confidence score representing the probability that the target object in the first image is fireworks; if the first confidence score is greater than a first preset value, determine a target region in the first image, the target region being an image region including the target object; zoom in and capture the target region to obtain K frames of second images, each frame of the second image including the target region, where K is a positive integer; perform fireworks identification on the second image according to at least two image recognition algorithms, and acquire a second confidence score for each image recognition algorithm corresponding to the target object, the second confidence score representing the probability that the target object in the second image is fireworks; determine a third confidence score based on the first confidence score and the second confidence score, the third confidence score representing the probability that the target object is fireworks.

[0096] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described smoke and fire recognition method and achieve the same technical effect. To avoid repetition, they will not be described again here.

[0097] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.

[0098] This application also provides a chip, which includes a processor and a communication interface. The communication interface and the processor are coupled. The processor is used to run programs or instructions to implement the various processes of the above-described embodiments of the smoke and fire recognition method and achieve the same technical effect. To avoid repetition, it will not be described again here.

[0099] It should be understood that the chip mentioned in the embodiments of this application may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.

[0100] This application also provides a computer program product stored in a non-volatile storage medium, configured to be executed by at least one processor to implement the steps of the method described above.

[0101] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for identifying fireworks, characterized in that, include: Obtain a first confidence score corresponding to the target object to be identified in the first image, wherein the first confidence score is used to represent the probability that the target object in the first image is fireworks; If the first confidence level is greater than the first preset value, a target region in the first image is determined, wherein the target region is an image region that includes the target object; The target area is magnified and photographed to obtain K frames of second images, each frame of the second image including the target area, where K is a positive integer; The second image is subjected to fireworks identification using at least two image recognition algorithms to obtain a second confidence level for each image recognition algorithm corresponding to the target object. The second confidence level is used to represent the probability that the target object in the second image is fireworks. A third confidence level is determined based on the first confidence level and the second confidence level, and the third confidence level is used to represent the probability that the target object is fireworks; Before zooming in on the target area to obtain K frames of the second image, the method further includes: The shooting angle and magnification are determined based on the position and size information of the target area in the first image; The at least two image recognition algorithms include a first image recognition algorithm and a second image recognition algorithm; The second image is subjected to smoke and fire recognition using at least two image recognition algorithms. The second confidence level for each image recognition algorithm corresponding to the target object is obtained by: The second image is subjected to fireworks recognition according to the first image recognition algorithm to obtain the first sub-confidence level; The step of performing smoke and fire recognition on the second image according to the first image recognition algorithm to obtain the first sub-confidence includes: Gaussian mixture background modeling is performed on the preceding M frames of the K-frame second image to obtain a foreground image, which is used to represent the target object in the K-frame second image, where K and M are positive integers; The foreground image is subjected to morphological filtering to obtain the first target image; The first target image is subjected to the Canny edge detection algorithm to obtain the second target image; Based on the second target image, obtain the first sub-confidence of the second image; Wherein, the first target image is a part of the second image; The second image is subjected to fireworks recognition according to the second image recognition algorithm to obtain the second sub-confidence score; Wherein, the second confidence level includes the first sub-confidence level and the second sub-confidence level, the first image recognition algorithm is an algorithm of Gaussian mixture background modeling, morphological filtering and Canny edge detection algorithm, and the second image recognition algorithm is YOLOv5 algorithm; The step of performing smoke and fire recognition on the second image according to the second image recognition algorithm to obtain the second sub-confidence includes: The YOLOv5 algorithm was used to perform detection on the second image at two scales: 13*13 and 26*26. The step of obtaining the first sub-confidence of the second target image in the second image based on the edge information of the second target image includes: The pixel block areas of each frame of the second image whose pixel block area is greater than the second preset value are merged; Obtain the growth rate and distribution of the pixel block area in each frame of the second image in the K frames; When the growth rate is greater than a third preset value and satisfies a normal distribution, a first sub-confidence level is obtained based on the growth rate and the pixel block area after merging the K-frame second images.

2. The method according to claim 1, characterized in that, Determining the third confidence level based on the first confidence level and the second confidence level includes: The third confidence level is determined using the following formula: ; 。 3. A smoke and fire detection device, characterized in that, The smoke detection device includes: The acquisition module is used to acquire a first confidence score corresponding to the target object to be identified in the first image, wherein the first confidence score is used to represent the probability that the target object in the first image is fireworks; The first determining module is used to determine the target region in the first image when the first confidence level meets the firework recognition triggering condition, wherein the target region is an image region including the target object; The first acquisition module is used to zoom in and capture the target area to obtain K frames of second images, each frame of the second image including the target area, where K is a positive integer; The second acquisition module is used to perform fireworks identification on the second image according to at least two image recognition algorithms, and to obtain a second confidence level for the target object corresponding to each image recognition algorithm. The second confidence level is used to represent the probability that the target object in the second image is fireworks. The second determining module is used to determine a third confidence level based on the first confidence level and the second confidence level, wherein the third confidence level represents the probability that the target object is fireworks. The smoke detection device is also used for: The shooting angle and magnification are determined based on the position and size information of the target area in the first image; The at least two image recognition algorithms include a first image recognition algorithm and a second image recognition algorithm; The second image is subjected to smoke and fire recognition using at least two image recognition algorithms. The second confidence level for each image recognition algorithm corresponding to the target object is obtained by: The second image is subjected to fireworks recognition according to the first image recognition algorithm to obtain the first sub-confidence level; The step of performing smoke and fire recognition on the second image according to the first image recognition algorithm to obtain the first sub-confidence includes: Gaussian mixture background modeling is performed on the preceding M frames of the K-frame second image to obtain a foreground image, which is used to represent the target object in the K-frame second image, where K and M are positive integers; The foreground image is subjected to morphological filtering to obtain the first target image; The first target image is subjected to the Canny edge detection algorithm to obtain the second target image; Based on the second target image, obtain the first sub-confidence of the second image; Wherein, the first target image is a part of the second image; The second image is subjected to fireworks recognition according to the second image recognition algorithm to obtain the second sub-confidence score; Wherein, the second confidence level includes the first sub-confidence level and the second sub-confidence level, the first image recognition algorithm is an algorithm of Gaussian mixture background modeling, morphological filtering and Canny edge detection algorithm, and the second image recognition algorithm is YOLOv5 algorithm; The step of performing smoke and fire recognition on the second image according to the second image recognition algorithm to obtain the second sub-confidence includes: The YOLOv5 algorithm was used to perform detection on the second image at two scales: 13*13 and 26*26. The step of obtaining the first sub-confidence of the second target image in the second image based on the edge information of the second target image includes: The pixel block areas of each frame of the second image whose pixel block area is greater than the second preset value are merged; Obtain the growth rate and distribution of the pixel block area in each frame of the second image in the K frames; When the growth rate is greater than a third preset value and satisfies a normal distribution, a first sub-confidence level is obtained based on the growth rate and the pixel block area after merging the K-frame second images.

4. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, The processor executing the computer program is a step in implementing the method of claim 1 or 2.

5. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method of claim 1 or 2.