Fire hazard detection method and device, electronic equipment and storage medium

Through the improved YOLOv9 model, combined with the efficient multi-scale convolution module and the cascade-enhanced attention module, the problems of high manual inspection cost and large computing resource occupation are solved, and high-accuracy fire hazard detection is achieved, suitable for complex Electricity environment.

CN118941924APending Publication Date: 2024-11-12GUANGDONG POWER GRID CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411079607.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-07
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

In the prior art, manual patrols consume a lot of manpower and image detection models occupy a lot of computing resources, low detection accuracy, limited applicable scenarios, and difficult to effectively monitor fire hazards in complex power environments.

Method used

The improved YOLOv9 model based on the efficient multi-scale convolution module and cascade enhancement attention module is adopted to identify the recognized images through the trained fire hazard detection model, reducing labor costs and computing resource usage, and improving detection accuracy.

Benefits of technology

It realizes automated fire hazard detection, reduces labor costs and computing resources, improves detection accuracy, enriches applicable scenarios, and meets the real-time requirements in complex power environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118941924A_ABST
    Figure CN118941924A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a fire hazard detection method and device, electronic equipment and a storage medium. Obtaining a to-be-recognized image; identifying the fire hazard in the to-be-identified image through the trained fire hazard detection model, and determining a fire hazard detection result; wherein the fire hazard detection model is a YOLOv9 model improved based on an efficient multi-scale convolution module and a cascade enhanced attention module. According to the embodiment of the invention, the labor cost and the occupation of computing resources are reduced, the accuracy of fire hazard detection is improved, and the application scene is enriched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to image processing technology, and more particularly to a fire hazard detection method, device, electronic device and storage medium. Background Art

[0002] In complex power environments, such as power transmission and distribution networks, substations and around power facilities, there are a large number of potential fire hazards. Timely detection and effective management of wildfire hazards are crucial to ensuring power supply.

[0003] In the prior art, fire hazards are usually detected by relying on manual inspections or by using image detection models to detect monitored images.

[0004] However, manual inspections require a lot of manpower and have low detection accuracy. In order to ensure accuracy, image detection models require a lot of computing resources and are limited in their applicability scenarios. Summary of the invention

[0005] The present application provides a fire hazard detection method, device, electronic device and storage medium to reduce labor costs and the occupation of computing resources, improve the accuracy of fire hazard detection, and enrich applicable scenarios.

[0006] In a first aspect, an embodiment of the present application provides a fire hazard detection method, the fire hazard detection method comprising:

[0007] Obtain an image to be recognized;

[0008] The fire hazards in the image to be identified are identified through the trained fire hazard detection model to determine the fire hazard detection results; wherein, the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0009] In a second aspect, an embodiment of the present application further provides a fire hazard detection device, the fire hazard detection device comprising:

[0010] An image acquisition module to be identified, used to acquire an image to be identified;

[0011] The fire hazard detection module is used to identify the fire hazards in the image to be identified through the trained fire hazard detection model and determine the fire hazard detection results; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0012] In a third aspect, an embodiment of the present application further provides an electronic device, the electronic device comprising:

[0013] one or more processors;

[0014] A storage device for storing one or more programs;

[0015] When one or more programs are executed by one or more processors, the one or more processors implement any fire hazard detection method provided in the embodiments of the present application.

[0016] In a fourth aspect, an embodiment of the present application further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute any fire hazard detection method provided in the embodiment of the present application.

[0017] The present application obtains an image to be identified; identifies the fire hazards in the image to be identified through a trained fire hazard detection model, determines the fire hazard detection result, can automatically identify fire hazards, and reduce labor costs; wherein, the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module, the YOLOv9 model meets the real-time requirements, realizes automatic detection, reduces labor costs, based on an efficient multi-scale convolution module, reduces the number of parameters and the computational burden of the improved YOLOv9 model, reduces the occupation of computing resources, based on the cascade enhanced attention module, improves the improved YOLOv9 model's ability to detect small targets under complex backgrounds, and improves the detection accuracy. Therefore, through the technical solution of the present application, the problem that manual inspections require a lot of manpower and have low detection accuracy, while the image detection model requires a lot of computing resources and is limited in applicable scenarios is solved, achieving the effect of reducing labor costs and the occupation of computing resources, improving the detection accuracy of fire hazards, and enriching applicable scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 It is a flow chart of a fire hazard detection method in Embodiment 1 of the present application;

[0019] Figure 2a It is a flow chart of a fire hazard detection method in Embodiment 2 of the present application;

[0020] Figure 2b It is a schematic diagram of the structure of an efficient multi-scale convolution module in the second embodiment of the present application;

[0021] Figure 2c is a structural diagram of a channel attention module in Embodiment 2 of the present application;

[0022] Figure 2d is a schematic diagram of the structure of a spatial attention module in Embodiment 2 of the present application;

[0023] Figure 2eIt is a structural diagram of a cascade enhanced attention module in Example 2 of the present application;

[0024] Figure 3 It is a structural schematic diagram of a fire hazard detection device in Embodiment 3 of the present application;

[0025] Figure 4 It is a structural diagram of an electronic device in Embodiment 4 of the present application. DETAILED DESCRIPTION

[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0027] It should be noted that the terms "first" and "second" etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0028] Embodiment 1

[0029] Figure 1 This is a flow chart of a fire hazard detection method provided in Example 1 of the present application. This embodiment can be applied to the situation of automatically detecting fire hazards around power grid equipment. The method can be executed by a fire hazard detection device, which can be implemented in software and / or hardware and specifically configured in an electronic device.

[0030] See also Figure 1 The fire hazard detection method shown specifically includes the following steps:

[0031] S110: Obtain an image to be recognized.

[0032] The image to be identified can be an image of the surroundings of the power equipment taken by a camera or a camera, which is used to detect fire hazards, so as to timely discover and eliminate fire hazards and ensure the safety of the power equipment. For example, the fire hazard can be a burning cigarette butt, dead leaves and other flammable materials, etc., which is not specifically limited in this application. For example, the image to be identified can be obtained by taking pictures with a fixed camera, or by taking pictures with a camera carried by a mobile device such as a drone, which is not specifically limited in this application.

[0033] S120. Identify the fire hazards in the image to be identified through the trained fire hazard detection model, and determine the fire hazard detection result; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0034] The trained fire hazard detection model can be a deep learning model obtained by pre-training with labeled samples, and is used to identify fire hazards in the image to be identified. The fire hazard detection result includes the detected fire hazard and the corresponding fire hazard category. The image to be identified is input into the fire hazard detection model. If a fire hazard is detected, the detected fire hazard is circled in a square frame in the output image, and the type of the detected fire hazard is displayed, so that the user can locate the location of the fire hazard and handle it according to the type of fire hazard.

[0035] Specifically, the fire hazard detection model is a YOLOv9 (professional term, a deep learning model) model that is improved by an efficient multi-scale convolution module and a cascade-enhanced attention module. The YOLOv9 model is a deep learning model, but it requires a lot of computing power support, and the identification of fire hazards has high real-time requirements, which further enhances the requirements for computer computing power. In addition, the image to be identified has complex background information and small targets. Therefore, the YOLOv9 model is improved by an efficient multi-scale convolution module and a cascade-enhanced attention module. While meeting the real-time requirements, the computing power requirements of the YOLOv9 model are reduced, and the detection effect of small targets is improved.

[0036] With the development of deep learning technology, new possibilities have been provided for solving the problem of fire hazard detection. However, existing fire hazard detection methods based on deep learning have problems such as low accuracy and high computational complexity in the application of the power industry. These fire hazard detection methods may be unstable when dealing with target detection in complex power environments, and are easily affected by factors such as changes in illumination and target size, resulting in unreliable detection results. In addition, the structure of some existing deep learning algorithms is relatively complex, which increases the cost of deployment and maintenance, and is not conducive to the continuous optimization and upgrading of the algorithms.

[0037] The YOLO (You Only Look Once, a deep learning model) series of models are well-known for their high speed and high accuracy. They can realize automatic fire hazard detection by analyzing image or video data, significantly improving the efficiency and accuracy of fire hazard detection. The YOLO series of models can simultaneously complete target detection and positioning in a single forward propagation, and are suitable for scenarios with high real-time requirements. In addition, the YOLO series of models also have good versatility and scalability, and can adapt to target detection tasks in various complex environments.

[0038] However, target detection in complex power environments still faces many challenges, such as many background interferences, complex target morphology, and high real-time requirements. Therefore, a new method or system is needed to achieve real-time and accurate wildfire hazard detection in complex power environments. As the latest version of the YOLO series model, the YOLOv9 model has a higher detection speed and more accurate detection results with its advanced network architecture and algorithm optimization. It can better cope with the challenges of target detection in complex power environments and provide a more reliable fire hazard monitoring solution for the power industry.

[0039] The YOLOv9 model introduces a series of enhancements, including the new General Efficient Layer Aggregation Network (GELAN) architecture and Programmable Gradient Information (PGI), which greatly improve the performance and efficiency of the model. With the lightweight, high-speed and accurate characteristics of the YOLOv9 model, applying it to fire hazard monitoring can reduce computational complexity, improve detection accuracy, and improve detection efficiency to meet high real-time requirements.

[0040] The YOLOv9 model is improved based on the efficient multi-scale convolution module, which can reduce the number of parameters and the computational burden while retaining rich feature information; the YOLOv9 model is improved based on the cascade-enhanced attention module, which can utilize the attention mechanism and context information fusion to improve the improved YOLOv9 model's ability to detect small targets in complex backgrounds. The improved YOLOv9 model has high speed and high accuracy, and further improves the applicability of the model in complex power environments, which can achieve more reliable and efficient fire hazard monitoring results.

[0041] The technical solution of this embodiment, by acquiring an image to be identified; identifying the fire hazards in the image to be identified through a trained fire hazard detection model, determining the fire hazard detection result, can automatically identify fire hazards and reduce labor costs; wherein, the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module, the YOLOv9 model meets the real-time requirements, realizes automatic detection, reduces labor costs, based on an efficient multi-scale convolution module, reduces the number of parameters and the computational burden of the improved YOLOv9 model, reduces the occupation of computing resources, based on the cascade enhanced attention module, improves the improved YOLOv9 model's ability to detect small targets under complex backgrounds, and improves the detection accuracy. Therefore, through the technical solution of this application, the problem that manual inspections require a lot of manpower and have low detection accuracy, while the image detection model requires a lot of computing resources and is limited in applicable scenarios is solved, achieving the effect of reducing labor costs and the occupation of computing resources, improving the accuracy of fire hazard detection, and enriching applicable scenarios.

[0042] Embodiment 2

[0043] Figure 2a This is a flow chart of a fire hazard detection method provided in Example 2 of the present application. The technical solution of this embodiment is further refined on the basis of the above technical solution.

[0044] Furthermore, before “obtaining the image to be identified”, add: “Based on the efficient multi-scale convolution module and the cascade enhanced attention module, build an improved YOLOv9 model; based on the labeled sample data set, train the improved YOLOv9 model to obtain a trained fire hazard detection model” to obtain a trained fire hazard detection model.

[0045] See also Figure 2a A fire hazard detection method is shown, comprising:

[0046] S210. Build an improved YOLOv9 model based on efficient multi-scale convolution modules and cascade-enhanced attention modules.

[0047] The YOLOv9 model is improved through efficient multi-scale convolution modules and cascade-enhanced attention modules. To address the problem of many parameters in the YOLOv9 model taking up a lot of computing resources, the convolution layer can be replaced with an efficient multi-scale convolution module to reduce parameters and computation. For small target detection under complex background interference in power scenarios, a cascade-enhanced attention module can be added to improve the improved YOLOv9 model's ability to detect small targets and its ability to resist background interference.

[0048] In an optional embodiment, an improved YOLOv9 model is built based on an efficient multi-scale convolution module and a cascade-enhanced attention module, including: replacing some standard convolution layers in the YOLOv9 model backbone network with an efficient multi-scale convolution module, and adding a cascade-enhanced attention module between the backbone network and the neck network to build an improved YOLOv9 model.

[0049] The backbone network is the core part of the YOLOv9 model, which is used to extract features from input data. It contains a large number of network parameters and requires a large amount of computing resources. Therefore, by replacing some standard convolutional layers in the backbone network of the YOLOv9 model with efficient multi-scale convolutional modules, the number of network parameters in the backbone network of the YOLOv9 model can be reduced, and the amount of computation can be reduced. By replacing some standard convolutional layers in the backbone network of the YOLOv9 model with efficient multi-scale convolutional modules, the computational complexity can be significantly reduced while maintaining the feature extraction capability of the YOLOv9 model, making it more suitable for resource-constrained environments and scenarios with high real-time requirements, enriching applicable scenarios and improving real-time performance.

[0050] Compared with traditional convolution operations, efficient multi-scale convolution modules can not only reduce the number of parameters and computational burden, but also improve the accuracy and efficiency of detection, and achieve lightweight and efficient target detection. Efficient multi-scale convolution modules improve the model's ability to recognize targets of different sizes by fusing multi-scale information.

[0051] Figure 2b This is a schematic diagram of the structure of an efficient multi-scale convolution module. Figure 2b As shown in the figure, the input image Input first undergoes a conventional convolution operation conv, and then is divided into k groups, and a linear operation Φ is performed on each group to generate a complete feature map, where Φ usually involves convolution kernels of 1×1, 3×3, 5×5, and 7×7. Finally, channel feature fusion is performed using point-by-point convolution conv to produce the output Output.

[0052] The efficient multi-scale convolution module combines convolution operations of different scales, including 1×1, 3×3, 5×5, and 7×7 convolution kernels, to capture and fuse multi-scale feature information, enabling the efficient multi-scale convolution model to extract features at different scales, thereby better identifying and detecting objects of various sizes.

[0053] In efficient multi-scale convolution, the input image first undergoes a conventional convolution operation and then is divided into k groups, with convolution operations applied independently in each group. This grouped convolution strategy can effectively reduce the processing of redundant features and improve computational efficiency. After the convolution operation of each group, the generated feature maps are fused through linear operations to generate a complete feature map.

[0054] The efficient multi-scale convolution module draws on the point convolution technology in MobileNet (a professional term, a type of network) and effectively integrates the results of different groups of convolutions through intra-channel feature fusion, which not only retains multi-scale feature information but also reduces computational complexity. Through intra-channel feature fusion, the features extracted by different convolution kernels are comprehensively processed to improve computational efficiency and reduce the complexity of redundant computation.

[0055] In order to illustrate that the efficient multi-scale convolution module reduces the computational burden by reducing the processing of redundant features compared to ordinary convolution, the computational complexity is analyzed below.

[0056] Number of floating point operations (F s )The formula is as follows:

[0057] F s =Cout×Hout×Wout×Cin×K×K;

[0058] Among them, Cout, Hout, Wout and Cin represent the number of output channels, the height of the output feature map, the width of the output feature map and the number of input channels respectively, and K represents the size of the convolution kernel.

[0059] Assuming there is an identity transformation and s-1 redundant feature maps, the number of feature maps of the efficient multi-scale convolutional model is reduced by a factor of s, and its computational complexity is reduced by a factor of r s :

[0060]

[0061] In the calculation formula of the reduction factor, the numerator represents the complexity of the standard convolution, and the denominator represents the complexity of the efficient multi-scale convolution model. Specifically: s represents the total number of maps generated by each channel, which is used to control the number of feature maps. k can be adjusted to represent the size of the grouped convolution kernel, d represents the size of the linear transformation convolution kernel, c represents the total number of input feature maps, which is usually larger, n / s represents the number of intrinsic feature maps output after the standard convolution, and d×d represents the average convolution kernel size for linear operations, which is usually similar to k×k.

[0062] The neck network helps to process multi-scale information and improve the robustness of the model. Exemplarily, the neck network can include a feature fusion layer. Therefore, adding a cascade-enhanced attention module between the backbone network and the neck network can allow the improved YOLOv9 model to better identify key areas in the image and improve the accuracy of detection. The cascade-enhanced attention module can be a multi-layer cascaded attention module, which can improve the accuracy of small target detection under complex background interference.

[0063] The traditional attention module consists of two sub-modules: channel attention and spatial attention. Figure 2c is a schematic diagram of the structure of the channel attention module (CAM), as shown in Figure 2c As shown in the figure, CAM extracts key information from the input feature map through average pooling Avgpool and maximum pooling Maxpool operations, and generates dual feature maps. Then, these feature maps pass through the shared multi-layer perceptron FC, add the elements one by one, and generate the channel attention map through the Sigmoid operation. Figure 2d is a schematic diagram of the structure of the spatial attention module (SAM), as shown Figure 2d As shown in the figure, SAM performs global maximum pooling and Maxpool global average pooling Avgpool on the input feature map to generate a pair of feature maps. Then, these feature maps are connected along the channel axis, and the number of parameters is reduced through the convolution operation Conv2d. Through the Sigmoid operation, a spatial attention feature map is finally generated.

[0064] In an optional embodiment, the cascade-enhanced attention module includes: at least two channel attention modules and at least two spatial attention modules.

[0065] Through this multi-level cascade design, the cascade-enhanced attention module can more effectively capture and emphasize the key features of fire hazard targets, thereby improving the accuracy and robustness of detection. The cascade-enhanced attention module is of great significance in addressing the challenges of fire hazard detection in complex power environments, especially under complex background interference, which can significantly improve the detection capability of the improved model.

[0066] Figure 2e A schematic diagram of the structure of a cascade-enhanced attention module. Figure 2e The cascaded and unfolded design of the cascade-enhanced attention module MCE-CBAM is demonstrated. Figure 2e Figure 2 shows how multiple CAM and SAM modules are combined and applied at different levels. Specifically, the cascade-enhanced attention module arranges multiple CAM and SAM modules in hierarchical order to form a hierarchical cascade structure, thereby extracting and strengthening the information of fire hazard features layer by layer. The cascade-enhanced attention module allows the feature extraction to be gradually refined at each layer, improving the detection accuracy of fire hazards.

[0067] The cascade-enhanced attention module includes at least two channel attention modules and at least two spatial attention modules, which can effectively suppress the interference of unnecessary information and enhance the attention to key features. It can improve the attention ability and detection accuracy of small targets in the multi-target detection task of fire hazards in complex power environments.

[0068] S220. Based on the labeled sample data set, the improved YOLOv9 model is trained to obtain a trained fire hazard detection model.

[0069] The improved YOLOv9 model needs to be trained in a supervised manner so that the improved YOLOv9 model has recognition capabilities and ensures the accuracy of the recognition results.

[0070] The labeled training sample data set may be a sample data set with sample labels, which is used to train the improved YOLOv9 model. Exemplarily, the labeled training sample data set may be obtained through historical data, or may be generated through an image generation model as required, which is not specifically limited in this application. Sample labels may be annotated manually or through a model, which is not specifically limited in this application.

[0071] In an optional embodiment, the labeled training sample data set is obtained in the following manner: obtaining a target prompt word; the target prompt word includes at least one scene element of power facilities, staff, trees, smoking and dead leaves; according to the target prompt word, the labeled sample data is obtained based on chatGPT; according to the preset ratio of the training set, the verification set and the test set, the corresponding training sample data set is obtained.

[0072] The target prompt words are used to define the scene features of the image to be generated. Exemplarily, the target prompt words may include the elements included in the image and the layout of the elements. In the power scene, the target prompt words include at least one scene element of power facilities, workers, trees, smoking and dead leaves, which contain various possible sources of fire hazards, provide rich visual information for the fire hazard detection model, and improve the detection accuracy of the model.

[0073] ChatGPT is an image generation model that can generate corresponding images based on target prompt words. The images generated by ChatGPT can include labels, so the labeled sample data can be directly obtained based on ChatGPT according to the target prompt words. Optionally, you can also use crawler technology to obtain certain sample data containing target prompt words from public websites and historical resources, and manually annotate them to obtain labeled sample data. Annotated targets include people, cigarettes, hay, dead leaves, and trees.

[0074] The preset ratio may be a preset data ratio of a training set, a validation set, and a test set. Exemplarily, the preset ratio may be 0.7:0.1:0.2 to ensure the diversity of the data set and improve the generalization ability of the trained model. According to the preset ratio, a corresponding training sample data set is obtained from the sample data set.

[0075] By obtaining target prompt words; the target prompt words include at least one scene element of power facilities, staff, trees, smoking and dead leaves; according to the target prompt words, the labeled sample data is obtained based on ChatGPT; according to the preset ratio of training set, validation set and test set, the corresponding training sample data set is obtained, which can ensure that the data set not only contains the scene diagram of the real power work scene, but also includes the annotation information of potential fire hazard sources such as smoking and flammable materials, which provides sufficient data support for model training and enables it to better cope with the fire hazard detection tasks in complex environments in the power industry.

[0076] In an optional embodiment, an improved YOLOv9 model is trained based on a labeled sample data set to obtain a trained fire hazard detection model, including: obtaining a labeled training sample data set; training an improved YOLOv9 model based on programmable gradient information using the labeled training sample data to obtain a trained fire hazard detection model.

[0077] During the training of the improved YOLOv9 model, the initial learning rate is set to 0.001, and a phased decay strategy is adopted to gradually reduce the learning rate to accurately adjust the network weights, improve the convergence speed and model stability. The batch size can be set to 64 to balance the training speed and resource consumption. The optimizer selects Adam, using its adaptive learning rate adjustment to optimize large-scale training data and make the training process more efficient.

[0078] To train the improved YOLOv9 model, you also need to select a loss function. The last few layers of the improved YOLOv9 model usually output the coordinates of the bounding box (such as center point, width, and height) and the classification score, so the loss function includes the bounding box loss function and the classification loss function.

[0079] The bounding box loss can be selected as CIoU (Complete Intersection over Union, a professional term, a loss function). CIoU further considers the shape and direction of the bounding box, and is used to optimize the bounding box coordinates predicted by the model to make them closer to the real bounding box coordinates, providing a more comprehensive regression loss evaluation for the model. CIoU loss is an improved IoU loss that is used to better align the predicted box and the real box. CIoU loss is combined with other losses (such as classification loss) to form a total loss function; the back-propagation algorithm is used to update the network weights so that the accuracy of the predicted box is gradually improved.

[0080] The CIoU loss uses the IoU, center point distance, aspect ratio and other information of the predicted box and the real box to calculate the CIoU loss value. The calculation formula of the CIoU loss is expressed as:

[0081]

[0082]

[0083] Among them, L CIoU represents the bounding box loss function, u and v represent the center coordinates of the predicted box and the true box, respectively. 2 (u,v) represents the square of the distance between the center point of the predicted box and the real box, α represents the trade-off factor, B and B gt Represent the predicted box and the real box respectively, w and h represent the width and height of the real box, w gt and h gt Indicates the width and height of the prediction box.

[0084] The classification loss can use cross entropy loss to ensure that the model can effectively distinguish different fire hazard categories. The classification loss calculation formula is as follows:

[0085]

[0086] Among them, y represents the label value, Represents the i-th predicted output value, i represents the i-th sample, and N represents the total number of samples.

[0087] Programmable Gradient Information (PGI) technology plays an important role in YOLOv9, improving training efficiency and model performance through the following steps:

[0088] (1) Forward Propagation

[0089] The input data is extracted through the main branch and sent to the auxiliary reversible branch to maintain the details and integrity of the data. The auxiliary reversible branch maintains information integrity through pooling and unpooling operations.

[0090] (2) Gradient generation and back propagation

[0091] The auxiliary reversible branch generates stable and high-quality gradient information during the back-propagation phase of training, and the multi-level auxiliary information component collects feedback information at different levels of the network and feeds it back to the main network.

[0092] (3) Dynamic adjustment and performance optimization

[0093] According to the training performance, the working parameters and structure of the auxiliary reversible branches and multi-level auxiliary information are adjusted in a timely manner to make the network better adapt to the changes in training data, optimize the information flow and gradient utilization, and improve the model's recognition accuracy and generalization ability for fire hazards in complex environments.

[0094] By obtaining a labeled training sample data set and training the improved YOLOv9 model based on programmable gradient information through the labeled training sample data, a trained fire hazard detection model is obtained, which can improve the model's recognition accuracy and generalization ability for fire hazards in complex environments.

[0095] S230: Obtain an image to be identified.

[0096] S240. Identify the fire hazards in the image to be identified through the trained fire hazard detection model, and determine the fire hazard detection result; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0097] The technical solution of this embodiment builds an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module, and reduces the demand for computing resources by obtaining the real-time performance of the improved model; based on the labeled sample data set, the improved YOLOv9 model is trained to obtain a trained fire hazard detection model, which can make the trained fire hazard detection model meet the accuracy requirements and improve the accuracy of fire hazard detection.

[0098] Embodiment 3

[0099] Figure 3 The figure shows a schematic diagram of the structure of a fire hazard detection device provided in the third embodiment of the present application. This embodiment is applicable to the case of automatically detecting fire hazards around power grid equipment. The specific structure of the fire hazard detection device is as follows:

[0100] The image acquisition module 310 is used to acquire the image to be recognized;

[0101] The fire hazard detection module 320 is used to identify the fire hazards in the image to be identified through a trained fire hazard detection model and determine the fire hazard detection results; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0102] The technical solution of this embodiment, by acquiring an image to be identified; identifying the fire hazards in the image to be identified through a trained fire hazard detection model, determining the fire hazard detection result, can automatically identify fire hazards and reduce labor costs; wherein, the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module, the YOLOv9 model meets the real-time requirements, realizes automatic detection, reduces labor costs, based on an efficient multi-scale convolution module, reduces the number of parameters and the computational burden of the improved YOLOv9 model, reduces the occupation of computing resources, based on the cascade enhanced attention module, improves the improved YOLOv9 model's ability to detect small targets under complex backgrounds, and improves the detection accuracy. Therefore, through the technical solution of this application, the problem that manual inspections require a lot of manpower and have low detection accuracy, while the image detection model requires a lot of computing resources and is limited in applicable scenarios is solved, achieving the effect of reducing labor costs and the occupation of computing resources, improving the accuracy of fire hazard detection, and enriching applicable scenarios.

[0103] Optionally, the fire hazard detection device further includes:

[0104] Model building module, used to build an improved YOLOv9 model based on efficient multi-scale convolution modules and cascade-enhanced attention modules;

[0105] The model training module is used to train the improved YOLOv9 model based on the labeled sample data set to obtain a trained fire hazard detection model.

[0106] Optional, model building module, including:

[0107] The YOLOv9 model improvement unit is used to replace some standard convolutional layers in the YOLOv9 model backbone network with efficient multi-scale convolutional modules, and to add a cascade-enhanced attention module between the backbone network and the neck network to build an improved YOLOv9 model.

[0108] Optionally, a cascade-enhanced attention module comprises: at least two channel attention modules and at least two spatial attention modules.

[0109] Optional, model training module, including:

[0110] A training sample data set acquisition unit, used to acquire a labeled training sample data set;

[0111] The model training unit is used to train the improved YOLOv9 model through the labeled training sample data based on programmable gradient information to obtain a trained fire hazard detection model.

[0112] Optionally, the labeled training sample dataset is obtained by:

[0113] Obtaining target prompt words; the target prompt words include at least one scene element selected from power facilities, staff, trees, smoking and dead leaves;

[0114] According to the target prompt word, obtain the labeled sample data based on chatgpt;

[0115] According to the preset ratio of training set, validation set and test set, the corresponding training sample data set is obtained.

[0116] The fire hazard detection device provided in the embodiments of the present application can execute the fire hazard detection method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing the fire hazard detection method.

[0117] According to an embodiment of the present invention, the present invention also provides an electronic device, a readable storage medium and a computer program product.

[0118] Embodiment 4

[0119] Figure 4 A schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present application is shown in FIG. Figure 4 As shown, the electronic device includes a processor 410, a memory 420, an input device 430, and an output device 440; the number of the processor 410 in the electronic device can be one or more. Figure 4 A processor 410 is taken as an example; the processor 410, the memory 420, the input device 430 and the output device 440 in the electronic device can be connected via a bus or other means. Figure 4 The example of connecting through bus is taken in the following.

[0120] The memory 420, as a computer-readable storage medium, can be used to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the fire hazard detection method in the embodiment of the present application (for example, the image acquisition module 310 to be identified and the fire hazard detection module 320). The processor 410 executes various functional applications and data processing of the electronic device by running the software programs, instructions and modules stored in the memory 420, that is, implements the above-mentioned fire hazard detection method.

[0121] The memory 420 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system and at least one application required for a function; the data storage area may store data created according to the use of the terminal, etc. In addition, the memory 420 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some instances, the memory 420 may further include a memory remotely arranged relative to the processor 410, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0122] The input device 430 may be used to receive input character information and generate key signal input related to user settings and function control of the electronic device. The output device 440 may include a display device such as a display screen.

[0123] Embodiment 5

[0124] Embodiment 5 of the present application also provides a storage medium containing computer executable instructions, which, when executed by a computer processor, are used to execute a fire hazard detection method, the method comprising: obtaining an image to be identified; identifying fire hazards in the image to be identified by using a trained fire hazard detection model, and determining a fire hazard detection result; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

[0125] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the method operations described above, can also execute related operations in the fire hazard detection method provided in any embodiment of the present application.

[0126] Through the above description of the implementation method, the technicians in the relevant field can clearly understand that the present application can be implemented with the help of software and necessary general hardware, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application can be essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ROM), random access memory (RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for an electronic device (which can be a personal computer, server, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0127] It is worth noting that in the embodiment of the above-mentioned fire hazard detection device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application.

[0128] Note that the above are only preferred embodiments of the present application and the technical principles used. Those skilled in the art will understand that the present application is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims

1. A method for detecting fire hazards, It is characterized in that include: Obtain an image to be recognized; The fire hazards in the image to be identified are identified by using a trained fire hazard detection model to determine the fire hazard detection result; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

2. The method according to claim 1, It is characterized in that Before obtaining the image to be recognized, it also includes: Based on the efficient multi-scale convolution module and the cascade enhanced attention module, an improved YOLOv9 model is built; Based on the labeled sample data set, the improved YOLOv9 model is trained to obtain a trained fire hazard detection model.

3. The method according to claim 2, It is characterized in that The improved YOLOv9 model is constructed based on the efficient multi-scale convolution module and the cascade enhanced attention module, including: The improved YOLOv9 model is built by replacing some standard convolutional layers in the backbone network of the YOLOv9 model with efficient multi-scale convolutional modules and adding cascade-enhanced attention modules between the backbone network and the neck network.

4. The method according to claim 3, It is characterized in that The cascade-enhanced attention module includes: at least two channel attention modules and at least two spatial attention modules.

5. The method according to claim 2, It is characterized in that The improved YOLOv9 model is trained based on the labeled sample data set to obtain a trained fire hazard detection model, including: Obtain a labeled training sample dataset; The improved YOLOv9 model is trained using the labeled training sample data based on programmable gradient information to obtain a trained fire hazard detection model.

6. The method according to claim 5, It is characterized in that The labeled training sample data set is obtained in the following way: Obtaining a target prompt word; the target prompt word includes at least one scene element selected from the group consisting of power facilities, staff, trees, smoking, and dead leaves; According to the target prompt word, obtaining the labeled sample data based on chatgpt; According to the preset ratio of the training set, the validation set and the test set, the corresponding training sample data set is obtained.

7. A fire hazard detection device, It is characterized in that include: An image acquisition module to be identified, used to acquire an image to be identified; The fire hazard detection module is used to identify the fire hazards in the image to be identified through a trained fire hazard detection model and determine the fire hazard detection results; wherein the fire hazard detection model is an improved YOLOv9 model based on an efficient multi-scale convolution module and a cascade enhanced attention module.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the program, the fire hazard detection method as described in any one of claims 1-6 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the program is executed by a processor, the fire hazard detection method as described in any one of claims 1 to 6 is implemented.

10. A computer program product, It is characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the fire hazard detection method according to any one of claims 1 to 6.