Lightweight method and device for power grid fire monitoring

By adopting the YOLOv8n model in power grid fire monitoring and combining Ghost convolution and network pruning technology, the problem of high computing resources demand on edge devices is solved, and the accuracy and efficiency of the lightweight fire monitoring model is improved.

CN120071235APending Publication Date: 2025-05-30STATE GRID LOCATION BASED SERVICE CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411949500.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In power grid fire monitoring, deep learning models are difficult to run in real-time on edge devices with low power consumption and limited computing resources, resulting in lightweighting of the model.

Method used

The YOLOv8n model is used as the fire point detection and region segmentation model, and the lightweight detection model is obtained by introducing technologies such as Ghost convolution, sparse training, channel pruning and layer pruning.

Benefits of technology

The lightweight fire monitoring model is achieved, ensuring the accuracy of fire monitoring, and at the same time reducing the demand for hardware resources, improving detection efficiency and inference speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120071235A_ABST
    Figure CN120071235A_ABST
Patent Text Reader

Abstract

The invention provides a lightweight method for power grid fire monitoring, and relates to the technical field of model lightweight, and the method comprises the steps: S1, employing a YOLOv8n model as a fire point detection and region segmentation model; s2, Ghost convolution is introduced into the model, and convolution operation is realized through a convolution layer and a Ghost module; s3, sparse training is carried out on the fire point detection and region segmentation model, pruning is carried out on the fire point detection and region segmentation model in a channel pruning and layer pruning combined mode, and a pruned model is obtained; s4, performing quantification processing on the pruned model to obtain a lightweight detection model; and S5, establishing a necessary environment required for model operation on the edge calculation board card, deploying the lightweight detection model to the edge calculation board card, and realizing power grid fire monitoring by operating the lightweight detection model. According to the scheme, the light weight of the fire monitoring model is realized, and meanwhile, the fire monitoring precision is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of model lightweighting, and particularly to a lightweight method and device for power grid fire monitoring. Background Art

[0002] With the steady growth of power demand, the power grid industry is developing rapidly. Along with the booming development of the power grid industry, transmission lines, as the main channels for power transmission, their reliability and safe operation are crucial to the power system. Since many power transmission and distribution lines are distributed in mountainous areas with inaccessible terrain, complex natural conditions, and a large number of combustible and flammable substances, there are great fire hazards. If a fire point fails to be detected in time, due to the relatively blocked traffic and communication conditions in mountainous areas, it often leads to the expansion of the fire, an increase in the degree of equipment damage, and poses great challenges to the safe operation and emergency repair of the power grid.

[0003] Traditional wildfire detection methods mainly include manual inspections and installing sensors for detection. These methods can, to a certain extent, detect fires and prevent the spread of the fire, but the efficiency is relatively low, wasting a large amount of human and material resources. For areas with complex terrain, it is difficult to achieve comprehensive and detailed inspections.

[0004] Using deep learning models for wildfire detection has significant advantages. It can achieve high-precision fire recognition by automatically extracting complex features in images, especially being outstanding in the early stage of a fire or when there is only slight smoke. In addition, deep learning models have strong adaptability and can cope with complex scenarios under different terrains, climates, and lighting conditions through continuous training to ensure the reliability and stability of detection. At the same time, deep learning models also support multi-modal input, such as the combination of images and sensor data, which can perceive the fire situation more comprehensively.

[0005] However, deep learning models usually have deep network layers, many model parameters, and large weight files. In the specific task of wildfire detection, the design and optimization of the model must consider the usage scenarios of resource-constrained devices, such as drones, satellites, or edge devices, which pose relatively high requirements for real-time performance, accuracy, and model efficiency. Deploying network models with high computational resource requirements to edge devices (such as drones) with low power consumption, limited computational resources, and limited storage resources faces many restrictions, and the problem of model lightweighting needs to be solved urgently. Summary of the Invention

[0006] This application aims to at least solve one of the technical problems in the related technologies to some extent.

[0007] To this end, the first object of this application is to propose a lightweight method for power grid fire monitoring, which realizes the lightweighting of the fire monitoring model while ensuring the accuracy of fire monitoring.

[0008] The second object of this application is to propose a lightweight device for power grid fire monitoring.

[0009] To achieve the above object, an embodiment of the first aspect of this application proposes a lightweight method for power grid fire monitoring, including: Step S1: Using the YOLOv8n model as the fire point detection and region segmentation model; Step S2: Introducing Ghost convolution into the fire point detection and region segmentation model, and implementing convolution operations through convolutional layers and Ghost modules; Step S3: Sparsely training the fire point detection and region segmentation model, and pruning the fire point detection and region segmentation model by combining channel pruning and layer pruning to obtain the pruned model; Step S4: Quantifying the pruned model to obtain a lightweight detection model; Step S5: Building the necessary environment required for model operation on an edge computing board, and deploying the lightweight detection model to the edge computing board to achieve power grid fire monitoring by running the lightweight detection model.

[0010] Optionally, in an embodiment of this application, implementing convolution operations through convolutional layers and Ghost modules includes:

[0011] Performing convolution operations on the input feature map through convolutional layers to obtain an intrinsic feature map;

[0012] Within the Ghost module, using Depthwise convolution to generate ghost feature maps based on the intrinsic feature map;

[0013] Connecting the intrinsic feature map and the ghost feature map through an identity connection to obtain an output feature map.

[0014] Optionally, in an embodiment of this application, the intrinsic feature map is Y w′*h′*m , for each channel feature map y' of Y i , using Depthwise convolution to generate ghost feature map y ij , expressed as:

[0015] y ij = φ i,j (y' i ) i = 1,..., m, j = 1,..., s

[0016] where φ i,j is the Depthwise convolution operation, i is the number corresponding to the current original feature map, j is the number of current linear operations, m is the number of original feature maps, and s is the number of ghost feature maps.

[0017] Optionally, in an embodiment of this application, step S3 specifically includes:

[0018] Step S31: Conduct sparse training on the fire point detection and region segmentation model;

[0019] Step S32: Perform channel pruning on the fire point detection and region segmentation model;

[0020] Step S33: Perform layer pruning on the fire point detection and region segmentation model;

[0021] Step S34: Fine-tune the fire point detection and region segmentation model;

[0022] Step S35: Iteratively perform steps S31 - S34. After each iteration, determine the recognition accuracy of the model. When the recognition accuracy of the model no longer changes, stop the iteration to obtain the pruned model.

[0023] Optionally, in an embodiment of the present application, performing channel pruning on the fire point detection and region segmentation model includes:

[0024] Adding L1 regularization to the scale factor of the BN layer in the model, expressed as:

[0025] L = L original + λ∑|ω i |

[0026] where L is the total loss with L1 regularization, L original is the original loss function, ω i is each parameter in the model, and λ is a hyperparameter controlling the regularization strength;

[0027] When the distance between the scale factor of the BN layer in any channel and 0 is less than the preset threshold, it is determined that the importance of this channel to the model output is low;

[0028] Delete all channels with low importance to achieve channel pruning.

[0029] To achieve the above object, an embodiment of the second aspect of the present invention proposes a lightweight device for power grid fire monitoring, including:

[0030] A model construction module for using the YOLOv8n model as the fire point detection and region segmentation model;

[0031] A convolution introduction module for introducing Ghost convolution into the fire point detection and region segmentation model to implement convolution operations through convolutional layers and Ghost modules;

[0032] A model pruning module for performing sparse training on the fire point detection and region segmentation model and pruning the fire point detection and region segmentation model in a combined manner of channel pruning and layer pruning to obtain the pruned model;

[0033] The quantization processing module is used to perform quantization processing on the pruned model to obtain a lightweight detection model;

[0034] The power grid fire monitoring module is used to build the necessary environment required for model operation on the edge computing board, and deploy the lightweight detection model to the edge computing board to realize power grid fire monitoring by running the lightweight detection model.

[0035] Optionally, in an embodiment of the present application, the convolutional operation is implemented through a convolutional layer and a Ghost module, including:

[0036] Perform a convolutional operation on the input feature map through a convolutional layer to obtain an eigen feature map;

[0037] Within the Ghost module, use depthwise convolution to generate ghost feature maps based on the eigen feature map;

[0038] Connect the eigen feature map and the ghost feature map through an identity connection to obtain an output feature map.

[0039] Optionally, in an embodiment of the present application, the eigen feature map is Y w′*h′*m , for the feature map y′ of each channel of Y i , use depthwise convolution to generate a ghost feature map y ij , expressed as:

[0040] y ij =φ i,j (y′ i ) i = 1,..., m, j = 1,..., s

[0041] where φ i,j is the depthwise convolution operation, i is the number corresponding to the current original feature map, j is the number of current linear operations, m is the number of original feature maps, and s is the number of ghost feature maps.

[0042] Optionally, in an embodiment of the present application, the model pruning module specifically includes:

[0043] The sparsification training unit is used to perform sparsification training on the fire point detection and region segmentation model;

[0044] The channel pruning unit is used to perform channel pruning on the fire point detection and region segmentation model;

[0045] The layer pruning unit is used to perform layer pruning on the fire point detection and region segmentation model;

[0046] The fine-tuning unit is used to perform fine-tuning on the fire point detection and region segmentation model;

[0047] An iterative unit for iteratively calling a sparsification training unit, a channel pruning unit, a layer pruning unit, and a fine-tuning unit. After each iteration, it determines the recognition accuracy of the model. When the recognition accuracy of the model no longer changes, the iteration stops, and the pruned model is obtained.

[0048] Optionally, in an embodiment of the present application, channel pruning of the fire point detection and region segmentation model includes:

[0049] Adding L1 regularization to the scale factor of the BN layer of the model, expressed as:

[0050] L = L original + λ∑|ω i |

[0051] Where L is the total loss with L1 regularization, L original is the original loss function, ω i is each parameter in the model, and λ is a hyperparameter that controls the regularization strength;

[0052] When the distance between the scale factor of the BN layer of any channel and 0 is less than a preset threshold, it is determined that the importance of this channel to the model output is low;

[0053] Delete all channels with low importance to achieve channel pruning.

[0054] The lightweight method for power grid fire monitoring in the embodiments of the present application uses the YOLOv8n model for wildfire detection; adopts the idea of "feature reuse", utilizes the Ghost module, and generates additional feature maps through low-cost operations, thereby achieving the purpose of reducing the consumption of computing resources. Moreover, the Ghost module can capture rich feature information, ensuring that the performance of the network is comparable to that before lightweighting, guaranteeing the fire point detection accuracy while improving the detection efficiency; on this basis, adopting network pruning technology, by pruning redundant network parameters, can significantly reduce the model parameters and computational volume, greatly reducing the demand for hardware resources, ensuring the accuracy and inference speed of the model, and the pruned model is more versatile and can adapt to wildfire detection requirements in different environments.

[0055] Additional aspects and advantages of the present application will be given in part in the following description, become apparent in part from the following description, or be understood through the practice of the present application. Description of the Drawings

[0056] The above and / or additional aspects and advantages of the present application will become apparent and easy to understand from the following description of the embodiments in conjunction with the drawings, where:

[0057] Figure 1 is a schematic flowchart of a lightweight method for power grid fire monitoring provided by Embodiment 1 of the present application;

[0058] Figure 2 Schematic diagram of the feature map generation process for the embodiments of the present application;

[0059] Figure 3 Schematic diagram of the airborne computing platform mechanism for the embodiments of the present application;

[0060] Figure 4 Schematic diagram of the initial state of the visualization display web application for the embodiments of the present application;

[0061] Figure 5 Schematic diagram of the visualization operation result of the web application for the embodiments of the present application;

[0062] Figure 6 Schematic diagram of the structure of a lightweight device for power grid fire monitoring provided by the embodiments of the present application. Detailed implementation manners

[0063] The embodiments of the present application will be described in detail below. Examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described by referring to the accompanying drawings are exemplary and are intended to explain the present application, and should not be construed as a limitation to the present application.

[0064] The lightweight method and device for power grid fire monitoring according to the embodiments of the present application will be described below with reference to the accompanying drawings.

[0065] Figure 1 Schematic diagram of the process of a lightweight method for power grid fire monitoring provided by Embodiment 1 of the present application.

[0066] As Figure 1 shown, the lightweight method for power grid fire monitoring includes the following steps:

[0067] Step S1: Use the YOLOv8n model as the fire point detection and region segmentation model;

[0068] In this embodiment, using the YOLOv8n model for fire monitoring has obvious advantages in the task of detecting wildfires facing the power grid.

[0069] As a lightweight version, YOLOv8n greatly reduces the demand for hardware resources by reducing the model parameters and computational load. It is particularly suitable for running on devices with limited computing power, such as drones and edge devices. This lightweight design not only reduces energy consumption but also ensures smooth operation of the model on embedded or mobile devices. In addition, YOLOv8n retains the feature of fast inference, capable of processing input images at extremely high frame rates to achieve real-time wildfire detection, which is particularly important for early fire warning. In the face of complex wildfire scenarios, YOLOv8n can quickly capture subtle features such as flames and smoke, thus issuing early warnings in a timely manner to help relevant departments respond quickly and reduce the risk of fire spread. YOLOv8n is an ideal tool for wildfire detection tasks, especially suitable for real-time monitoring and early detection.

[0070] Step S2: Introduce Ghost convolution into the fire point detection and region segmentation model, and implement convolution operations through convolutional layers and Ghost modules;

[0071] In this embodiment, traditional convolution operations require complex convolution calculations for each input channel and generate corresponding output feature maps, resulting in a large computational load. Specifically, assuming that the input image has C in channels, the output feature map has C out channels, the convolution kernel size is k×k, and the width and height of the image are W and H respectively, then the computational load of each convolution operation is as follows:

[0072] Computational load = Cin * Cout * k * k * W * H

[0073] According to the visualization results of the output feature maps during the practical process, it is found that some feature maps are highly similar. There is a certain amount of redundant calculation in generating similar feature maps using traditional convolution operations. Therefore, the idea of "feature reuse" is proposed. By using the Ghost module (Ghost Module), additional feature maps are generated through low-cost operations, thereby achieving the purpose of reducing computational resource consumption. Specifically, the input feature map is divided into two parts: one part generates fine intrinsic feature maps Y w′*h′*m through traditional convolution operations, and the other part generates "ghost feature maps" through low-cost linear operations, that is, for each channel's feature map y′ i of Y, Depthwise convolution is used to generate ghost feature maps y ij , expressed as:

[0074] y ij = φ i,j (y′ i ) i = 1,..., m, j = 1,..., s

[0075] where φi,j Refers to the Depthwise convolution operation. In traditional convolution, each output channel is convolved with all input channels, which generates a large number of parameters and computations. In Depthwise convolution, each input channel uses an independent convolution kernel, thus greatly reducing the computational amount and the number of parameters. As shown in the following formula:

[0076] Computational amount = Cout * k * k * W * H

[0077] For example, if the number of input and output channels is the same, the computational amount of Depthwise convolution is 1 / C of that of traditional convolution in , and finally, the eigen feature map obtained in the first step and the Ghost feature map obtained in the second step are connected through identity to obtain all the feature maps required for the final result.

[0078] The schematic diagram of the whole process of generating Ghost feature maps from eigen feature maps and splicing is as Figure 2 shown. These ghost feature maps are not directly learned from the original image, but new features are generated through low-dimensional transformation to achieve efficient feature expansion. Compared with traditional CNN networks, the Ghost module avoids this redundant convolution operation by using a low-cost feature map generation method. It generates more features by using less computation, so the number of parameters to be learned is greatly reduced. This enables the network to obtain more feature expression capabilities without adding too many parameters, avoids the storage of redundant features, and reduces the occupancy of memory space. Using this model lightweight technology, the algorithm can be deployed to devices with limited computing and memory storage resources (such as wildfire inspection drones, etc.), and the Ghost module can capture rich feature information to ensure that the performance of the network is the same as that before lightweighting, while ensuring the fire point detection accuracy and improving the detection efficiency.

[0079] Step S3: Perform sparse training on the fire point detection and region segmentation model, and prune the fire point detection and region segmentation model by combining channel pruning and layer pruning to obtain the pruned model;

[0080] In this embodiment, first, the importance of each weight in the network is calculated and sorted in a sparse manner. On this basis, a pruning threshold is calculated and the model is pruned, and finally, the model is fine-tuned. Specifically, step S3 includes:

[0081] Step S31: Perform sparse training on the fire point detection and region segmentation model;

[0082] Step S32: Perform channel pruning on the fire point detection and region segmentation model;

[0083] Step S33: Perform layer pruning on the fire point detection and region segmentation model;

[0084] Step S34: Fine-tune the fire point detection and region segmentation model;

[0085] Step S35: Iteratively perform steps S31 - S34. After each iteration, determine the recognition accuracy of the model. When the recognition accuracy of the model no longer changes, stop the iteration to obtain the pruned model.

[0086] Sparsification training is mainly to screen and cut off the factors that are not important for model detection to prepare for pruning. In the pruning process, first determine the threshold based on the above results, and then remove the non-critical parameters in the model. Pruning can be divided into unstructured pruning and structured pruning. Unstructured pruning can better retain the accuracy of the model, but the generated parameters are extremely sparse, which will increase the complexity of the deployment process, require specific underlying hardware and matrix algorithms, and also occupy a large amount of storage resources. Structured pruning has a larger granularity and can better protect the regularity of the network. Currently, structured pruning includes layer pruning and channel pruning. Layer pruning mainly solves the dependency relationship between layers and the importance ranking of each layer. The disadvantage is that directly pruning the intermediate layer will cause the feature maps of the upper and lower layers to not match, affecting the forward propagation path. Channel pruning can greatly reduce the number of model parameters, but the real-time performance improvement is not significant. Therefore, in this embodiment, a combination of the two is proposed to perform pruning operations on the model. Finally, since the performance will be affected during the pruning process, it is necessary to fine-tune the network to modify the pruned model to restore the original performance.

[0087] In this embodiment, based on the yolov8n model, network pruning technology is adopted, making this embodiment more advantageous in the wildfire detection task. During the pruning process of YOLOv8n, the role of the BN layer is to normalize the output of each layer, and the scale factor (γ) in the BN layer determines the scaling size of each channel after normalization. To achieve channel pruning, this embodiment adds L1 regularization to the scale factor of the BN layer:

[0088] L = L origingl + λ∑|ω i |

[0089] As shown in the above formula, the sum of the absolute values of all parameters is added as a penalty term to the loss function, forcing those scale factors that contribute less to the final output to become very small or even close to zero. Among them, L is the total loss with L1 regularization, L original is the original loss function, ω iwhere each parameter in the model, and λ is a hyperparameter that controls the regularization strength. When the scale factor of the BN layer in a certain channel is close to zero, it means that the importance of this channel to the model output is relatively low. Therefore, it can be safely pruned (i.e., deleted), thereby reducing the computational amount and the number of parameters of the model and achieving the sparsification of the network. By pruning redundant network parameters, the pruning technique can significantly reduce the model size while maintaining the detection accuracy and false omission rate of the original model. This can not only reduce the computational and storage requirements of the device but also improve the inference speed on the premise of ensuring the accuracy of the wildfire detection model. In addition, the pruned model is more versatile and can adapt to the wildfire detection requirements in different environments, such as real-time monitoring and low-power operation.

[0090] Step S4: Quantize the pruned model to obtain a lightweight detection model.

[0091] Step S5: Build the necessary environment required for the model to run on the edge computing board, deploy the lightweight detection model to the edge computing board, and realize the power grid fire monitoring by running the lightweight detection model.

[0092] In this embodiment, the computing module is planned to select an edge intelligent inference module. This type of intelligent inference module is designed with a chip of a specific architecture and has high inference capabilities. It can implement image recognition, image classification, etc. on the edge side and is widely used in edge AI scenarios such as intelligent cameras, robots, and drones. As Figure 3 shown, the board communication protocol is planned to adopt the 1000BASE-T communication protocol or a communication protocol adapted to the general interface of the drone, and an adapter interface based on differential lines is designed. According to the requirements of high computing power, low power consumption, and large capacity for the computing load in the edge computing scenario, an edge computing load that meets the corresponding requirements is designed starting from aspects such as volume, power consumption, interface, and storage, and a simulation system and a demonstration platform are constructed, thereby providing a hardware foundation and system support for the simulation verification of the lightweight fire point detection algorithm. The schematic diagram of the airborne computing platform structure is as Figure 3 shown.

[0093] In this embodiment, before deploying the lightweight processed model to the edge computing board, it is necessary to build the necessary environment for running YOLOv8n on the edge computing board, install the Ubuntu operating system, update the system software packages, and configure the development environment, including installing the required software dependencies such as Python, ultralytics, opencv, matplotlib, numpy, etc. Then connect the edge computing board to the local area network through the network port, and use MobaXterm or other SSH tools to transfer the model file, the lightweight algorithm code file for power grid fire monitoring, and the test sample pictures to the SD storage card of the edge computing board.

[0094] The Gradio library provides a simple and intuitive interface that can easily integrate the processing process and output results of an algorithm into a web application for display. By using the Gradio library, it is possible to visualize the running results of a lightweight algorithm for power grid fire monitoring on a high-performance edge computing board. The initial state of the visualization web application is as Figure 4 shown.

[0095] After pressing the "Run Fire Detection" button, the edge computing board receives a running instruction through the local area network, automatically runs the lightweight algorithm for power grid fire monitoring, detects fire and smoke in the test sample image, generates visualization test results and specific index values, and transmits the results back to the web application side. The visualization running results of the web application are as Figure 5 shown.

[0096] Among them, Precision, Recall, and mAP50 represent different evaluation indicators for the accuracy of fire point detection, and Inference Speed represents the average inference speed per image, with the unit of ms. The 851.6866 in the figure represents that the average time per image for running the lightweight algorithm for power grid fire monitoring this time is 851.6866 ms. The lower half of the web application shows the visualization detection results. The gray font is the image name corresponding to the image below. The red box is the smoke detection box, and the pink box is the fire point detection box. The text corresponding to the upper left corner of the box represents the relevant information of the box. For example, "{0:'smoke'}0.9" where 0 represents the category serial number, 0 corresponds to smoke, 1 corresponds to fire, and 0.9 represents the confidence level of this category. The closer to 1, the greater the probability that the detection model believes that the area of the box is the corresponding category.

[0097] The system will receive the image to be detected, and after algorithm processing, it will display the detected fire location and dangerous area in real time and provide corresponding alarm information. Users can control the operation of the algorithm remotely and view indicators such as the accuracy, response time, and resource consumption of fire monitoring in real time. The interactive components supported by Gradio enable users to monitor the performance of the algorithm, test the performance of the algorithm on edge devices, and ensure that the visual analysis of power grid fire monitoring is intuitive and efficient.

[0098] To implement the above embodiments, the present application also proposes a lightweight device for power grid fire monitoring.

[0099] Figure 6 It is a schematic structural diagram of a lightweight device for power grid fire monitoring provided by an embodiment of the present application.

[0100] As Figure 6 shown, the lightweight device for power grid fire monitoring includes:

[0101] A model construction module for using the YOLOv8n model as a fire point detection and region segmentation model;

[0102] A convolution introduction module for introducing Ghost convolution into the fire point detection and region segmentation model and implementing convolution operations through convolutional layers and Ghost modules;

[0103] A model pruning module for performing sparse training on the fire point detection and region segmentation model and pruning the fire point detection and region segmentation model by combining channel pruning and layer pruning to obtain a pruned model;

[0104] A quantization processing module for performing quantization processing on the pruned model to obtain a lightweight detection model;

[0105] A power grid fire monitoring module for building a necessary environment required for model operation on an edge computing board and deploying the lightweight detection model to the edge computing board to achieve power grid fire monitoring by running the lightweight detection model.

[0106] Optionally, in an embodiment of the present application, implementing convolution operations through convolutional layers and Ghost modules includes:

[0107] Performing convolution operations on the input feature map through convolutional layers to obtain an eigen feature map;

[0108] Within the Ghost module, using depthwise convolution to generate ghost feature maps based on the eigen feature map;

[0109] Connecting the eigen feature map and the ghost feature map through an identity connection to obtain an output feature map.

[0110] Optionally, in an embodiment of the present application, the eigen feature map is Y w′*h′*m , for each channel's feature map y′ of Y i , using depthwise convolution to generate ghost feature map y ij , expressed as:

[0111] y ij = φ i,j (y′ i ) i = 1,..., m, j = 1,..., s

[0112] Where φ i,j is the depthwise convolution operation, i is the number corresponding to the current original feature map, j is the number of current linear operations, m is the number of original feature maps, and s is the number of ghost feature maps.

[0113] Optionally, in an embodiment of the present application, the model pruning module specifically includes:

[0114] A sparsification training unit for sparsifying the training of the fire point detection and region segmentation model;

[0115] A channel pruning unit for pruning the channels of the fire point detection and region segmentation model;

[0116] A layer pruning unit for pruning the layers of the fire point detection and region segmentation model;

[0117] A fine-tuning unit for fine-tuning the fire point detection and region segmentation model;

[0118] An iteration unit for iteratively calling the sparsification training unit, the channel pruning unit, the layer pruning unit, and the fine-tuning unit. After each iteration, determine the recognition accuracy of the model. When the recognition accuracy of the model no longer changes, stop the iteration to obtain the pruned model.

[0119] Optionally, in an embodiment of the present application, pruning the channels of the fire point detection and region segmentation model includes:

[0120] Adding L1 regularization to the scale factor of the BN layer of the model, expressed as:

[0121] L = L original + λ∑|ω i |

[0122] where L is the total loss with L1 regularization, L original is the original loss function, ω i is each parameter in the model, and λ is a hyperparameter controlling the regularization strength;

[0123] When the distance between the scale factor of the BN layer of any channel and 0 is less than a preset threshold, it is determined that the importance of this channel to the model output is low;

[0124] Delete all channels with low importance to achieve channel pruning.

[0125] It should be noted that the foregoing explanation of the embodiment of the lightweight method for power grid fire monitoring also applies to the lightweight device for power grid fire monitoring in this embodiment, and will not be elaborated here.

[0126] In the description of this specification, the descriptions referring to terms such as "one embodiment", "some embodiments", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of this application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0127] In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, "a plurality" means at least two, such as two, three, etc., unless otherwise specifically defined.

[0128] Any process or method description shown in a flowchart or described in other ways herein can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a customized logic function or process, and the scope of the preferred embodiments of this application includes additional implementations, where the functions may be executed in a manner that is not shown or discussed, including in a substantially simultaneous manner according to the involved functions or in a reverse order, which should be understood by those skilled in the art to which the embodiments of this application pertain.

[0129] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a definable sequence list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other systems that can fetch and execute instructions from the instruction execution system, apparatus, or device), or used in combination with these instruction execution systems, apparatus, or devices. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use by or in combination with an instruction execution system, apparatus, or device. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer diskette (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpretation, or other suitable processing as necessary, and then stored in a computer memory.

[0130] It should be understood that various parts of the present application can be implemented by hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or a combination of the following techniques well known in the art can be used: discrete logic circuits with logic gate circuits for implementing logical functions on data signals, application-specific integrated circuits with suitable combinational logic gate circuits, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0131] Those of ordinary skill in the art of this technology can understand that all or part of the steps carried by the method of the above embodiments can be completed by a program instructing relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it includes one or a combination of the steps of the method embodiments.

[0132] In addition, each functional unit in various embodiments of the present application may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. When the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0133] The above-mentioned storage medium may be a read-only memory, a magnetic disk, an optical disc, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.

Claims

1. A lightweight method for power grid fire monitoring, characterized in that: include: Step S1: Use the YOLOv8n model as the fire point detection and region segmentation model; Step S2: introducing Ghost convolution into the fire point detection and region segmentation model, and implementing convolution operation through convolution layer and Ghost module; Step S3: performing sparse training on the fire point detection and region segmentation model, and pruning the fire point detection and region segmentation model by combining channel pruning and layer pruning to obtain a pruned model; Step S4: quantizing the pruned model to obtain a lightweight detection model; Step S5: Build the necessary environment required for model operation on the edge computing board, and deploy the lightweight detection model to the edge computing board, and realize power grid fire monitoring by running the lightweight detection model.

2. The method according to claim 1, characterized in that The convolution operation is implemented by the convolution layer and the Ghost module, including: Perform convolution operation on the input feature map through the convolution layer to obtain the intrinsic feature map; In the Ghost module, a ghost feature map is generated based on the intrinsic feature map using Deepwise convolution; The intrinsic feature map and the ghost feature map are connected through identity to obtain an output feature map.

3. The method according to claim 2, characterized in that The intrinsic characteristic diagram is Y w′*h′*m , for the feature map y of each channel of Y i ′ , Deepwise convolution is used to generate ghost feature map y ij , expressed as: y ij =φ i,j (y i ′ )i=1,...,m,j=1,...,s Among them, φ i,j is the Deepwise convolution operation, i is the number corresponding to the current original feature map, j is the number of current linear operations, m is the number of original feature maps, and s is the number of ghost feature maps.

4. The method according to claim 1, characterized in that The step S3 specifically includes: Step S31: performing sparse training on the fire point detection and region segmentation model; Step S32: performing channel pruning on the fire point detection and region segmentation model; Step S33: performing layer pruning on the fire point detection and region segmentation model; Step S34: fine-tuning the fire point detection and region segmentation model; Step S35: Iterate steps S31-S34. After each iteration, determine the recognition accuracy of the model. When the recognition accuracy of the model no longer changes, stop the iteration to obtain the pruned model.

5. The method according to claim 4, characterized in that The channel pruning of the fire point detection and region segmentation model includes: Add L1 regularization to the scale factor of the BN layer of the model, expressed as: L=L original +λΣ|ω i | Where L is the total loss with L1 regularization, L original is the original loss function, ω i is each parameter in the model, and λ is a hyperparameter that controls the strength of regularization; When the distance between the BN layer scale factor of any channel and 0 is less than a preset threshold, it is determined that the importance of the channel to the model output is low; Delete all channels with low importance to achieve channel pruning.

6. A lightweight device for power grid fire monitoring, characterized in that: include: Model building module, used to use YOLOv8n model as the fire point detection and region segmentation model; A convolution introduction module, used to introduce Ghost convolution into the fire point detection and region segmentation model, and implement convolution operation through convolution layer and Ghost module; A model pruning module, used for performing sparse training on the fire point detection and region segmentation model, and pruning the fire point detection and region segmentation model by combining channel pruning and layer pruning to obtain a pruned model; A quantization processing module, used to perform quantization processing on the pruned model to obtain a lightweight detection model; The power grid fire monitoring module is used to build the necessary environment required for model operation on the edge computing board, and deploy the lightweight detection model to the edge computing board, and realize power grid fire monitoring by running the lightweight detection model.

7. The device according to claim 6, characterized in that The convolution operation is implemented by the convolution layer and the Ghost module, including: Perform convolution operation on the input feature map through the convolution layer to obtain the intrinsic feature map; In the Ghost module, a ghost feature map is generated based on the intrinsic feature map using Deepwise convolution; The intrinsic feature map and the ghost feature map are connected through identity to obtain an output feature map.

8. The device according to claim 7, characterized in that The intrinsic characteristic diagram is Y w′*h′*m , for the feature map y of each channel of Y i ′ , Deepwise convolution is used to generate ghost feature map y ij , expressed as: y ij =φ i,j (y i ′ )i=1,...,m,j=1,...,s Among them, φ i,j is the Deepwise convolution operation, i is the number corresponding to the current original feature map, j is the number of current linear operations, m is the number of original feature maps, and s is the number of ghost feature maps.

9. The device according to claim 6, characterized in that The model pruning module specifically includes: A sparse training unit, used for performing sparse training on the fire point detection and region segmentation model; A channel pruning unit, used for performing channel pruning on the fire point detection and region segmentation model; A layer pruning unit, used for performing layer pruning on the fire point detection and region segmentation model; A fine-tuning unit, used for fine-tuning the fire point detection and region segmentation model; An iteration unit is used to iteratively call the sparse training unit, the channel pruning unit, the layer pruning unit, and the fine-tuning unit, and determine the recognition accuracy of the model after each iteration. When the recognition accuracy of the model no longer changes, the iteration is stopped to obtain a pruned model.

10. The device according to claim 9, characterized in that The channel pruning of the fire point detection and region segmentation model includes: Add L1 regularization to the scale factor of the BN layer of the model, expressed as: L=L origingl +λ∑|ω i | Where L is the total loss with L1 regularization, L original is the original loss function, ω i is each parameter in the model, and λ is a hyperparameter that controls the strength of regularization; When the distance between the BN layer scale factor of any channel and 0 is less than a preset threshold, it is determined that the importance of the channel to the model output is low; Delete all channels with low importance to achieve channel pruning.