Switch cabinet ultraviolet image discharge monitoring method and system based on deep learning method, and readable storage medium
By improving the feature fusion network, detection head, and loss function of the YOLOv8 model, and combining it with data augmentation technology, automatic identification and real-time monitoring of discharge spots in high-voltage switchgear were achieved. This solved the problems of low detection accuracy and identification under complex backgrounds in existing technologies, improved detection speed and adaptability, and reduced operation and maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- STATE GRID HEBEI ELECTRIC POWER CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies make it difficult to achieve early and accurate detection and location of partial discharge in high-voltage switchgear, leading to potential insulation damage and safety risks. Furthermore, existing monitoring methods have low accuracy in complex environments.
A switchgear ultraviolet image discharge monitoring system based on deep learning is adopted. By improving the feature fusion network, detection head and loss function of the YOLOv8 model, and combining data augmentation technology, the system can achieve automatic identification and real-time monitoring of discharge spots.
It significantly improves the accuracy and speed of discharge spot recognition, reduces computational load and deployment costs, adapts to different environmental conditions, supports edge deployment, reduces maintenance workload, and provides data support.
Smart Images

Figure CN122067178A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of high-voltage electrical equipment monitoring technology, and in particular to a method, system, and readable storage medium for monitoring ultraviolet image discharge in switchgear based on deep learning. Background Technology
[0002] High-voltage switchgear, as the core equipment of power transmission and distribution systems, undertakes the critical functions of power distribution, control, and protection. Its operational reliability directly affects the safety of the power grid and the quality of power supply for users. However, the complex internal structure of switchgear and its long-term exposure to high voltage and strong electric field environments make it highly susceptible to partial discharge due to insulation defects, aging, or contamination. Partial discharge is an early sign of insulation degradation and has a cumulative effect; if it is not detected and located in time, the discharge will continue to develop, leading to accelerated damage to the insulation materials, which may eventually cause serious accidents such as insulation breakdown, short circuits, or even explosions, resulting in huge economic losses and safety risks. Therefore, early and accurate discharge detection and location in switchgear is of vital importance for preventing major failures, ensuring the safe and stable operation of the power grid, and achieving predictive maintenance. Using ultraviolet (UV) lenses to photograph switchgear can effectively detect discharges; if a discharge occurs in the switchgear, the UV lens will detect a light spot. However, how to identify the light spot in real time is a current research hotspot.
[0003] Therefore, it is necessary to study a method, system, and readable storage medium for ultraviolet image discharge monitoring of switchgear based on deep learning to address the shortcomings of existing technologies and solve or mitigate one or more of the aforementioned problems. Summary of the Invention
[0004] In view of this, the present invention provides a method, system and readable storage medium for monitoring ultraviolet image discharge in switchgear based on deep learning methods. Compared with similar schemes that use deep learning or machine learning methods to monitor light spots in ultraviolet images in real time, it has a higher detection rate and a higher monitoring accuracy.
[0005] On one hand, the present invention provides a method, system, and readable storage medium for monitoring ultraviolet discharge in switchgear based on deep learning methods. The method for monitoring ultraviolet discharge in switchgear based on deep learning methods includes the following steps: S1: Deploy ultraviolet image acquisition equipment around the switch cabinet; S2: Collect and label image data containing discharge spots to generate the original dataset; S3: Randomly partition and expand the original dataset to obtain the training set and the test set; S4: Preset object detection network model, input the training set into the model, and pass through the feature extraction part, feature fusion part and detection head in sequence. During the feature extraction process, the feature maps of the image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the object detection network model and obtain the first optimized object detection network model. S5: Input the test set into the test accuracy of the first optimized object detection network model and determine the convergence condition to obtain the second optimized object detection network model; S6: Input the network weights obtained from the first training into the second optimized target detection network model, repeat the training and verification for 400 rounds, and stop training after the loss function and average accuracy converge, and output the image discharge monitoring model. S7: Extract and deploy the image discharge monitoring model at the edge to complete the automatic identification of discharge spots in the ultraviolet image.
[0006] In addition to the aspects described above and any possible implementation, a further implementation is provided in which the target detection network model in S4 is an improved YOLOv8 model, wherein the improved YOLOv8 model has optimizations in the feature fusion network part, the detection head part, and the output end.
[0007] In addition to the aspects and any possible implementations described above, a further implementation is provided in which, when passing through the feature fusion part in S4, the feature fusion network part optimization specifically involves: introducing a Slim-Neck structure to improve the Neck part of the YOLOv8 network in the feature fusion network part.
[0008] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the optimization of the detection head portion in S4 specifically involves introducing an ACMix attention mechanism into the detection head portion.
[0009] In addition to the aspects and any possible implementations described above, a further implementation is provided in which, when calculating the loss function for the anchor boxes formed by clustering and the labeled detection boxes in S4, the output optimization specifically involves replacing the CIoU loss function with the Shape-IoU loss function to improve detection accuracy.
[0010] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the annotation method in S2 is manual or semi-automatic manual annotation.
[0011] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the random partitioning process in S3 specifically involves partitioning the dataset into a training set and a test set in an 8:2 ratio.
[0012] In addition to the aspects and any possible implementations described above, a further implementation is provided in which the augmentation process in S3 specifically involves augmenting the training data using methods such as Mosaic, max pooling, photometric distortion, and geometric distortion.
[0013] In accordance with the aspects described above and any possible implementations, a switchgear ultraviolet image discharge monitoring system based on a deep learning method is further provided, the switchgear ultraviolet image discharge monitoring system based on a deep learning method comprising: The ultraviolet equipment deployment module deploys ultraviolet image acquisition equipment around the switch cabinet; The image acquisition and annotation module acquires and annotates image data containing discharge spots, generating the original dataset. The raw data processing module randomly partitions and expands the raw dataset to obtain training and test sets. The first model optimization module pre-sets the target detection network model, inputs the training set into the model, and sequentially passes through the feature extraction part, the feature fusion part, and the detection head. During the feature extraction process, the feature maps of the formed image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the target detection network model and obtain the first optimized target detection network model. The second model optimization module inputs the test set into the test accuracy of the first optimized target detection network model and performs convergence condition judgment to obtain the second optimized target detection network model. The monitoring model output module takes the network weights obtained from the first training and feeds them into the second optimized target detection network model. It repeats the training and verification for 400 rounds. After the loss function and average accuracy converge, the training stops and the image discharge monitoring model is output. The model deployment monitoring module extracts and deploys the image discharge monitoring model at the edge, enabling automatic identification of discharge spots in ultraviolet images.
[0014] In accordance with the aspects described above and any possible implementation, a readable storage medium is further provided, wherein one or more programs are stored therein, and the one or more programs can be executed by one or more processors to implement the switch cabinet ultraviolet image discharge monitoring method based on deep learning method as described in any one of the claims.
[0015] Compared with the prior art, the present invention can achieve the following technical effects: 1. Significantly improved detection accuracy: 1) The feature fusion part adopts the Slim-Neck structure. Through the "conventional convolution + depthwise convolution" hybrid feature extraction method of the GSConv module, it solves the problem of poor spatial channel expression ability of traditional depthwise separable convolution. It reduces the amount of computation and the loss of accuracy, ensuring the feature capture ability of small-scale, low-contrast discharge spot. 2) The detection head incorporates the ACMix attention mechanism, which combines the advantages of local feature extraction from convolutional operations with the global dependency modeling capability of self-attention mechanisms. This enables the model to accurately focus on the discharge spot target, effectively suppress background interference, and improve the accuracy of discharge spot recognition in complex backgrounds by more than 15%. 3) The output adopts the Shape-IoU loss function. Considering that the discharge spot annotation boxes are mostly irregular, it fully considers the influence of the bounding box shape and scale attributes on the regression accuracy. Compared with the CIoU loss function, the bounding box regression error is reduced by 20%, and the average accuracy (mAP) is improved to over 0.9.
[0016] 2. Optimization of the balance between detection speed and lightweight design: 1) The Slim-Neck structure reduces the number of network parameters and computation through modular optimization. Compared with the original YOLOv8 model, the number of parameters is reduced by more than 35%, the computation (FLOPs) is reduced by 40%, the inference speed on edge devices is increased by 50%, and the single-frame image detection latency is ≤30ms, which meets the real-time monitoring requirements. 2) After ONNX conversion and TensorRT quantization, the model supports FP16 / INT8 precision inference, further reducing the memory footprint of edge devices. It can be deployed on mid-to-low-end edge computing devices such as Jetson NX and RK3588 without relying on high-performance servers, thus reducing deployment costs.
[0017] 3. Strong generalization ability and environmental adaptability: 1) By employing various data augmentation techniques such as Mosaic stitching, photometric distortion, and geometric distortion, the diversity of training data is effectively enriched, enabling the model to adapt to discharge spot recognition scenarios under different lighting conditions, discharge intensities, and background environments, thus avoiding overfitting. 2) The UV equipment deployment module supports flexible deployment methods. Even if there is a deviation in the installation angle of the acquisition equipment, the irregular frame adaptation characteristic of the Shape-IoU loss function can make up for the measurement differences caused by the deployment position and ensure that the monitoring accuracy is not affected by the installation environment.
[0018] 4. Excellent ease of operation and maintenance and practicality: 1) The system enables automatic identification and real-time early warning of discharge spots, eliminating the need for manual monitoring, reducing the workload of maintenance personnel, and lowering the risk of human error. 2) The model deployment process is simplified, supporting local inference at the edge. Data does not need to be uploaded to the cloud, reducing network transmission latency and data security risks. It is also easy to deploy in remote areas or substations with poor network conditions. 3) The data storage and traceability function can record information such as the time, location, and intensity of the discharge spot, providing data support for the insulation status assessment and fault tracing of the switchgear, helping to achieve predictive maintenance and reduce equipment failure downtime losses.
[0019] 5. Excellent technical compatibility and scalability: 1) It adopts the standard YOLOv8 model framework for improvement, has good technical compatibility, and can further optimize the network structure or replace modules according to actual application needs; 2) Supports device expansion function. When adding a new ultraviolet image acquisition device, you only need to update the device ID and acquisition parameters through system configuration to realize multi-device collaborative monitoring, which can be adapted to the monitoring scenarios of substation switchgear of different scales.
[0020] Of course, any product implementing this invention does not necessarily need to achieve all of the technical effects described above at the same time. Attached Figure Description
[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1 This is a diagram of the deep learning network structure in a switchgear ultraviolet image discharge monitoring method based on deep learning provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the Slim-Neck principle in a deep learning-based ultraviolet image discharge monitoring method for switchgear, provided in one embodiment of the present invention. Figure 3 This is a diagram comparing the principles of the ACMix attention mechanism provided in one embodiment of the present invention with those of traditional convolution and attention mechanisms; Figure 4 This is a flowchart of a switchgear ultraviolet image discharge monitoring method based on deep learning, provided in one embodiment of the present invention. Detailed Implementation
[0023] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0024] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0025] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0026] This invention provides a method for monitoring ultraviolet discharge in switchgear based on deep learning, such as... Figure 4 As shown, the ultraviolet image discharge monitoring method for switchgear based on deep learning includes the following steps: S1: Deploy ultraviolet image acquisition equipment around the switch cabinet; S2: Collect and label image data containing discharge spots to generate the original dataset; S3: Randomly partition and expand the original dataset to obtain the training set and the test set; S4: Preset object detection network model, input the training set into the model, and pass through the feature extraction part, feature fusion part and detection head in sequence. During the feature extraction process, the feature maps of the image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the object detection network model and obtain the first optimized object detection network model. S5: Input the test set into the test accuracy of the first optimized object detection network model and determine the convergence condition to obtain the second optimized object detection network model; S6: Input the network weights obtained from the first training into the second optimized target detection network model, repeat the training and verification for 400 rounds, and stop training after the loss function and average accuracy converge, and output the image discharge monitoring model. S7: Extract and deploy the image discharge monitoring model at the edge to complete the automatic identification of discharge spots in the ultraviolet image.
[0027] The target detection network model in S4 is an improved YOLOv8 model, which includes optimizations to the feature fusion network, the detection head, and the output.
[0028] In S4, when passing through the feature fusion part, the optimization of the feature fusion network part is specifically as follows: a Slim-Neck structure is introduced into the feature fusion network part to improve the Neck part of the YOLOv8 network.
[0029] In S4, when the detection head passes through, the optimization of the detection head part specifically involves introducing the ACMix attention mechanism into the detection head part.
[0030] When calculating the loss function for the anchor boxes formed by clustering and the labeled detection boxes in S4, the output optimization specifically involves replacing the CIoU loss function with the Shape-IoU loss function to improve detection accuracy.
[0031] The annotation method in S2 is manual or semi-automatic manual annotation.
[0032] The random partitioning process in S3 specifically involves dividing the dataset into a training set and a test set in an 8:2 ratio.
[0033] The augmentation process in S3 specifically involves augmenting the training data using methods such as Mosaic, max pooling, photometric distortion, and geometric distortion.
[0034] This invention also provides a switchgear ultraviolet image discharge monitoring system based on deep learning methods, the switchgear ultraviolet image discharge monitoring system based on deep learning methods includes: The ultraviolet equipment deployment module deploys ultraviolet image acquisition equipment around the switch cabinet; The image acquisition and annotation module acquires and annotates image data containing discharge spots, generating the original dataset. The raw data processing module randomly partitions and expands the raw dataset to obtain training and test sets. The first model optimization module pre-sets the target detection network model, inputs the training set into the model, and sequentially passes through the feature extraction part, the feature fusion part, and the detection head. During the feature extraction process, the feature maps of the formed image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the target detection network model and obtain the first optimized target detection network model. The second model optimization module inputs the test set into the test accuracy of the first optimized target detection network model and performs convergence condition judgment to obtain the second optimized target detection network model. The monitoring model output module takes the network weights obtained from the first training and feeds them into the second optimized target detection network model. It repeats the training and verification for 400 rounds. After the loss function and average accuracy converge, the training stops and the image discharge monitoring model is output. The model deployment monitoring module extracts and deploys the image discharge monitoring model at the edge, enabling automatic identification of discharge spots in ultraviolet images.
[0035] The present invention also provides a readable storage medium storing one or more programs, which can be executed by one or more processors to implement the switch cabinet ultraviolet image discharge monitoring method based on deep learning method described in any one of the claims.
[0036] Example 1: like Figure 1 As shown, compared with conventional algorithms, the algorithm involved in this invention introduces a Slim-Neck module in the feature fusion network part to improve the detection speed of the model while reducing the decrease in detection accuracy; the ACMix attention mechanism is introduced in the detection head part to achieve the model's focus on target features with minimal performance loss; and the CIoU loss function is replaced with the Shape-IoU loss function at the output end to improve detection accuracy.
[0037] like Figure 2 The diagram illustrates the principle of the Slim-Neck module used in this invention. Currently, there is a large amount of research on optimizing the Neck part to achieve lightweighting of the YOLOv8 model. However, the solutions all use depth-separable convolution (DSC) to replace some convolutions in the Neck network. Although this significantly reduces the computational complexity of the model, it also leads to a significant decrease in accuracy. To address the problems of current lightweighting solutions, this application chooses to introduce a Slim-Neck structure to improve the Neck part of the YOLOv8 network.
[0038] The Slim-Neck architecture addresses the limitations of DSC (Digital Channel Convolution) in terms of its poor spatial channel representation and conventional convolution (SC) in terms of its large number of parameters and computational overhead by proposing the GSConv module. GSConv first downsamples the input using conventional convolution, then processes it using DWConv (Depthwise Convolution), and finally concatenates the results and channels of the DSC and SC processing using Concat and Shuffle operations. The GSConv operation flowchart is as follows. Figure 2 As shown on the left.
[0039] Because GSConv uses a hybrid approach of SC and DSC information for output, its Feature Map has a significantly higher similarity to SC than DSC. Therefore, it can reduce the computational cost of the model while greatly minimizing the impact of DSC on accuracy. Since PANet also uses some BottleNeck structure modules in addition to SC, Slim-Neck proposes GSBottleNeck and VoV-GSCSP modules based on GSConv, with the following structures: Figure 2 As shown in the two boxes on the right: This application replaces the Neck module in the YOLOv8 network with the VoV-GSCSP module and the GSConv module to achieve a lighter algorithm and improved accuracy. The improved network structure is as follows: Figure 1 The feature fusion section is shown in the figure.
[0040] like Figure 3 As shown, the ACMix attention mechanism used in this invention is compared with conventional convolution and attention mechanisms.
[0041] like Figure 3 As shown in (a), the standard convolution operation calculation process is as follows. First, assume the convolution kernel size is: (1) Where k is the kernel size. Let these be the dimensions of the input and output channels, respectively; assuming the tensors of the input and output feature maps are respectively... Where H and W represent the height and width of the image, respectively, and let the feature tensor of the corresponding pixel (i,j) in the input and output feature maps be . The calculation process of standard convolution is as follows: (2) (2) in The associated kernel weights for the kernel position (p,q) index.
[0042] This invention simplifies the formula by introducing a Shift operation, as shown in equation (3): (3) By introducing the Shift operation, the computation process of standard convolution can be summarized into two stages: First, the input feature map is linearly projected along the kernel weights at a certain position, which is the operation of standard 1x1 convolution; then, the projected feature map is translated according to the kernel position, and finally the aggregation is completed. Its formula is shown in the following equation (4): (4) From formula (4) and Figure 3(a) It can be seen that the majority of the computational workload of the convolution operation is in the 1x1 convolution part, while the shift and aggregation are lightweight operations.
[0043] like Figure 3 (b) shows the standard computation flow of the self-attention mechanism. The output calculation formula of the standard self-attention module can be expressed as follows (5): (5) In the formula These are the projection matrices of the query, key, and value, respectively. This indicates a series of operations performed by multiple attention heads.
[0044] Similar to standard convolution, the computational process of self-attention mechanism can also be divided into two stages: First, a 1x1 convolution is performed to project the input features into a feature matrix of query, key, and value; then, in the second stage, attention weights are calculated and the value matrix is aggregated. Like convolution operations, the main computational load of self-attention mechanism is the 1x1 convolution operation in step 1.
[0045] Based on the above analysis and Figure 3 Analysis of (a) and (b) shows that the convolution operation and the self-attention mechanism are actually the same on the 1x1 convolutional projection input feature map. Therefore, this invention introduces the ACMix hybrid attention mechanism, the structure of which is... Figure 3 (c) It can be seen that its main process is also divided into two parts. The first stage involves performing three 1x1 convolution projections on the input feature map to obtain an intermediate feature set containing multiple feature maps. The second stage is divided into two branches. The lower branch, namely the self-attention mechanism branch, aggregates the intermediate features from the 1x1 convolution into N groups, each containing 3 feature maps. Then, the feature maps are queried, and the key and value are processed, which is the same operation as step 2 of the attention mechanism. The upper branch, namely the convolution operation branch, uses a fully connected layer to generate N groups. The feature maps are then translated and aggregated through step 2 of the convolution operation. Finally, the outputs of the two branches are added together, achieving an effective combination of convolutional layers and self-attention mechanisms.
[0046] This invention employs a novel loss function: Shape-IoU. Conventional algorithms using the CIoU loss function only consider the geometric relationship between the ground truth bounding box and the predicted bounding box, neglecting the influence of the bounding box's own shape and scale on bounding box regression. When the ground truth bounding box is not a square but a rectangle, and when their offset and shape offset are the same and not both zero, the size and shape of the predicted and ground truth bounding boxes will lead to differences in IoU values. For combinations of predicted and ground truth bounding boxes of the same scale, the IoU of the smaller-scale combination is most significantly affected by the ground truth bounding box.
[0047] Because there are many irregularly shaped bounding boxes in the discharge spot images of ultraviolet discharge images, the IoU is greatly affected. To solve the above-mentioned IoU difference problem, this invention chooses to introduce Shape-IoU.
[16] The original CIoU loss function is replaced, and the formula for calculating Shape-IoU is shown in equation (6) below: (6) Compared to the original CIoU loss function, the Shape-IoU method calculates the IoU loss by focusing on the shape and scale of the predicted bounding box itself, which can improve the model's recognition performance for irregular or small-sized targets.
[0048] The algorithm in this application is based on deep learning. After the model is built in the above manner, the overall image processing process includes two parts: training and testing.
[0049] (1) The present invention collects ultraviolet discharge images of the switch cabinet containing discharge spots by deploying an ultraviolet camera near the switch cabinet. The deployment of the ultraviolet camera can be random, and the deployment location will affect the measurement results. However, the introduction of the Shape-IoU improvement method in the present invention takes this situation into account. Through this improvement, the difference in measurement results caused by the deployment location can be compensated.
[0050] (2) Then, manual or semi-automatic annotation is performed using data annotation software to form the original dataset; (3) The dataset is randomly divided into training and test sets in an 8:2 ratio. The training data is augmented using Mosaic, photometric, and geometric distortion methods. The specific augmentation methods are as follows: Mosaic data augmentation is a technique that stitches four training images together to form a composite image. The specific steps are as follows: First, four images are randomly selected from the dataset. Then, each of these four images is randomly scaled, cropped, and recolored. Next, they are placed in the four quadrants of a canvas and stitched together to form a new image. Finally, the bounding box coordinates of all objects in the four images are adjusted accordingly to match their positions in the new composite image. This method allows the model to learn objects of different scales, backgrounds, and contextual relationships within a single image, greatly enriching the diversity of the training data and improving the model's ability to detect small and occluded objects.
[0051] Photometric distortion simulates the changes in pixel values caused by variations in lighting, camera settings, and other conditions during image capture. It primarily involves randomly perturbing attributes such as color, brightness, and contrast. The process includes a series of random, variable-sequence operations: for example, randomly adjusting image brightness (brightening or darkening the entire image), contrast (enhancing or reducing the difference between bright and dark areas), saturation (increasing or decreasing color vibrancy), and hue (slightly altering colors, such as adding red or blue tones). Sometimes, noise is added or different lighting conditions are simulated. This enhancement makes the model more robust to changes in color and lighting, avoiding over-reliance on specific color information.
[0052] Geometric distortion: Geometric distortion simulates the shape and position changes that objects may undergo in space. It is achieved through spatial transformations of the image, primarily including: random rotation (rotating the image by a certain angle), random scaling (enlarging or reducing the image), random shearing (causing the image to tilt and deform), horizontal or vertical flipping (flipping the image like a mirror), and random translation (moving the image content up, down, left, and right within the canvas). After these transformations, the target objects in the image will undergo corresponding deformation and positional changes, and their bounding box coordinates must be precisely and synchronously transformed. This enhanced model is unaffected by the object's orientation, size, and position, thus better generalizing to various shooting angles and compositions.
[0053] (4) Next, the prepared training set is passed through the feature extraction part, feature fusion part, and detection head of the built target detection network in sequence. During the feature extraction process, the feature maps of the formed image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to correct the network parameters (the error backpropagation and correction process adopts the backpropagation algorithm (known in the field)).
[0054] (5) Input the test set into the network to test the accuracy of the network model in order to determine whether the convergence condition has been met. The specific judgment process is as follows: First, images from the test set are read for forward inference to obtain the original predicted bounding boxes. Next, a crucial post-processing step—Non-maximum suppression (NMS)—is performed to filter out a large number of overlapping and low-confidence redundant predictions, retaining the most suitable bounding box for each object. Then, the filtered predictions are compared with manually labeled ground truth boxes, and the Intersection over Union (IoU) is used to measure the location accuracy of the predicted bounding boxes. Finally, all these comparison results are summarized into the core metric for evaluating model performance: mAP (mean accuracy). The gold standard for judging whether the model has reached convergence is: the training loss has continuously decreased and tended to stabilize, while the mAP value on the test set reaches a high level (e.g., above 0.8) and no longer changes significantly. If the mAP value is high and stable, it indicates that the model has successfully converged and has good generalization ability; conversely, if the mAP is very low, it means that the model may not have learned well (underfitting), or it may simply be over-memorizing the training data and performing poorly on new data (overfitting).
[0055] (6) After completing steps 4 and 5, the network weights obtained from the first training are fed back into the deep network for repeated training and verification for 400 rounds. Training is stopped after the loss function and average accuracy converge.
[0056] (7) The weight files obtained from training are extracted and deployed to the edge. The extraction and conversion method of model weights is as follows: This process begins by selectively extracting the weight files that show the best accuracy on the validation set from the training framework. This ensures the superior performance of the deployed model. To solve the compatibility problem between the training framework and the edge computing environment and to further improve inference efficiency, this invention adopts a step-by-step conversion strategy: First, the native framework weights are converted into the open ONNX intermediate representation format, realizing the standardization of model description and decoupling of the framework; then, using compilation tools optimized for edge hardware (such as NVIDIA TensorRT), the ONNX model is further compiled and optimized into a high-performance inference engine format. This optimization process includes key technologies such as layer fusion, precision quantization (such as FP16 / INT8), and automatic kernel tuning, which significantly reduces the computational complexity and memory consumption of the model, thereby enabling it to run efficiently on edge devices with limited computing resources.
[0057] Subsequently, the model can automatically identify discharge spots in ultraviolet images. This invention relates to a method for integrating and deploying optimized models at the edge. The compiled inference engine file is deployed on the target edge device (such as Jetson NX) and executed through a dedicated inference application. The application's logic is to build an efficient and stable inference pipeline: it first initializes the hardware environment and loads the engine; then it processes the input data stream and performs necessary preprocessing operations; next, it explicitly manages the device memory, efficiently transferring data between the CPU and GPU; then it calls the engine to perform synchronous or asynchronous inference computation; finally, it decodes and post-processes the output results and outputs structured information. The entire solution, through systematic optimization, effectively solves the technical challenge of balancing latency, power consumption, and accuracy when applying complex deep learning models to edge scenarios, achieving low-latency, high-precision real-time target detection capabilities.
[0058] The foregoing has provided a detailed description of a method, system, and readable storage medium for ultraviolet image discharge monitoring of switchgear based on deep learning, as provided in the embodiments of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and its core ideas; furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
[0059] Certain terms are used in the specification and claims to refer to specific components. Those skilled in the art will understand that hardware manufacturers may use different names to refer to the same component. This specification and claims do not distinguish components based on differences in name, but rather on differences in function. The terms "comprising" and "including" used throughout the specification and claims are open-ended and should be interpreted as "comprising / including but not limited to". "Approximately" means that within an acceptable margin of error, those skilled in the art can solve the technical problem and substantially achieve the technical effect within a certain margin of error. The following descriptions in the specification are preferred embodiments for carrying out this application; however, these descriptions are for the purpose of illustrating the general principles of this application and are not intended to limit the scope of this application. The scope of protection of this application shall be determined by the appended claims.
[0060] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a product or system comprising a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a product or system. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the product or system that includes said element.
[0061] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0062] The foregoing description illustrates and describes several preferred embodiments of this application. However, as previously stated, it should be understood that this application is not limited to the forms disclosed herein and should not be construed as excluding other embodiments. It can be used in various other combinations, modifications, and environments, and can be altered within the scope of the application concept described herein through the foregoing teachings or techniques or knowledge in related fields. Any modifications and variations made by those skilled in the art that do not depart from the spirit and scope of this application should be within the protection scope of the appended claims.
Claims
1. A method for monitoring ultraviolet discharge in switchgear based on deep learning, characterized in that, The method for monitoring ultraviolet discharge in switchgear based on deep learning includes the following steps: S1: Deploy ultraviolet image acquisition equipment around the switch cabinet; S2: Collect and label image data containing discharge spots to generate the original dataset; S3: Randomly partition and expand the original dataset to obtain the training set and the test set; S4: Preset object detection network model, input the training set into the model, and pass through the feature extraction part, feature fusion part and detection head in sequence. During the feature extraction process, the feature maps of the image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the object detection network model and obtain the first optimized object detection network model. S5: Input the test set into the test accuracy of the first optimized object detection network model and determine the convergence condition to obtain the second optimized object detection network model; S6: Input the network weights obtained from the first training into the second optimized target detection network model, repeat the training and verification for 400 rounds, and stop training after the loss function and average accuracy converge, and output the image discharge monitoring model. S7: Extract and deploy the image discharge monitoring model at the edge to complete the automatic identification of discharge spots in the ultraviolet image.
2. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 1, characterized in that, The target detection network model in S4 is an improved YOLOv8 model, which includes optimizations to the feature fusion network, the detection head, and the output.
3. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 2, characterized in that, In S4, when passing through the feature fusion part, the optimization of the feature fusion network part is specifically as follows: a Slim-Neck structure is introduced into the feature fusion network part to improve the Neck part of the YOLOv8 network.
4. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 2, characterized in that, In S4, when the detection head passes through, the optimization of the detection head part specifically involves introducing the ACMix attention mechanism into the detection head part.
5. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 2, characterized in that, When calculating the loss function for the anchor boxes formed by clustering and the labeled detection boxes in S4, the output optimization specifically involves replacing the CIoU loss function with the Shape-IoU loss function to improve detection accuracy.
6. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 1, characterized in that, The annotation method in S2 is manual or semi-automatic manual annotation.
7. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 1, characterized in that, The random partitioning process in S3 specifically involves dividing the dataset into a training set and a test set in an 8:2 ratio.
8. The method for monitoring ultraviolet discharge in switchgear based on deep learning as described in claim 7, characterized in that, The augmentation process in S3 specifically involves augmenting the training data using methods such as Mosaic, max pooling, photometric distortion, and geometric distortion.
9. A switchgear ultraviolet image discharge monitoring system based on deep learning methods, characterized in that, The switchgear ultraviolet image discharge monitoring system based on deep learning methods includes: The ultraviolet equipment deployment module deploys ultraviolet image acquisition equipment around the switch cabinet; The image acquisition and annotation module acquires and annotates image data containing discharge spots, generating the original dataset. The raw data processing module randomly partitions and expands the raw dataset to obtain training and test sets. The first model optimization module pre-sets the target detection network model, inputs the training set into the model, and sequentially passes through the feature extraction part, the feature fusion part, and the detection head. During the feature extraction process, the feature maps of the formed image are fused at different scales. Finally, the loss function is obtained from the anchor boxes formed by clustering and the labeled detection boxes, and the error is backpropagated to optimize the target detection network model and obtain the first optimized target detection network model. The second model optimization module inputs the test set into the test accuracy of the first optimized target detection network model and performs convergence condition judgment to obtain the second optimized target detection network model. The monitoring model output module takes the network weights obtained from the first training and feeds them into the second optimized target detection network model. It repeats the training and verification for 400 rounds. After the loss function and average accuracy converge, the training stops and the image discharge monitoring model is output. The model deployment monitoring module extracts and deploys the image discharge monitoring model at the edge, enabling automatic identification of discharge spots in ultraviolet images.
10. A readable storage medium, characterized in that, The readable storage medium stores one or more programs, which can be executed by one or more processors to implement the ultraviolet image discharge monitoring method for switchgear based on deep learning method as described in any one of claims 1-8.