Explosion-proof electrical equipment appearance hidden danger detection method based on YOLOv11 model

By using a YOLOv11 model-based method for detecting potential hazards in the appearance of electrical equipment, combined with fault tree analysis and dataset optimization, the problems of low efficiency and accuracy in electrical explosion-proof safety inspections have been solved. This method enables automated and accurate detection of potential hazards in electrical equipment, thereby improving the safety management level of explosion-hazardous areas.

CN121811210APending Publication Date: 2026-04-07INST OF URBAN SAFETY & ENVIRONMENTAL SCI BEIJING ACAD OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-24
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

In existing technologies, electrical explosion-proof safety inspections rely on manual inspections, which are inefficient, highly subjective, and have a high rate of missed or false detections. They cannot meet the safety management needs of explosion-hazardous areas and lack accurate detection solutions that combine fault tree analysis to screen key hidden dangers.

Method used

A method for detecting potential hazards in the appearance of explosion-proof electrical equipment based on the YOLOv11 model is adopted. High-risk hazards are screened through fault tree analysis, a diverse dataset is constructed, and the detection model is optimized to achieve automatic, efficient, and accurate detection.

Benefits of technology

It enables efficient and accurate detection of potential defects in the appearance of explosion-proof electrical equipment, reduces the cost of manual inspection, minimizes the risk of missed or false detections, and significantly improves the level of electrical explosion-proof safety management in explosion-hazardous areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121811210A_ABST
    Figure CN121811210A_ABST
Patent Text Reader

Abstract

The invention relates to an anti-explosion electrical equipment appearance hidden danger detection method based on a YOLOv11 model, and belongs to the technical field of electrical equipment safety detection. S2, constructing a data set; s3, model building and training; and S4, appearance hidden danger detection. According to the method, high-risk hidden dangers are accurately screened through fault tree analysis, and the pertinence of a detection target is ensured; a constructed data set is combined with a real scene and a simulation scene, and has good diversity and generalization ability after preprocessing and data enhancement; a detection model based on YOLOv11 optimization is small in parameter quantity and high in reasoning efficiency, and the training efficiency and the detection performance are improved through transfer learning; experimental verification shows that the average detection precision of the model on four types of detection targets exceeds 85%, the overall average precision reaches 87.4%, efficient and accurate detection of hidden dangers of the appearance of the explosion-proof electrical equipment can be effectively achieved, the manual detection cost is reduced, the missed detection and false detection risks are reduced, and the electrical explosion-proof safety management level of an explosion dangerous area is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to a YOLOv11 model-based appearance hidden danger detection method for explosion-proof electrical equipment and belongs to the technical field of electrical equipment safety detection. BACKGROUND

[0002] Electrical explosion-proof safety in explosion-hazardous areas is directly related to personnel life and property safety and social stability. In recent years, electrical hidden danger accidents have occurred frequently, exposing the shortcomings of traditional detection methods.

[0003] At present, electrical explosion-proof safety detection mainly relies on manual inspection, which has the problems of low efficiency, strong subjectivity, high missed detection and misdiagnosis rates, and cannot meet the safety management needs of explosion-hazardous areas.

[0004] As an advanced target detection algorithm, the YOLO series model has been successfully applied in many fields, but there are few special studies on appearance hidden danger detection of explosion-proof electrical equipment. There is a lack of a scheme combining fault tree analysis to screen key hidden dangers and realizing accurate detection based on an optimized YOLO model in the prior art, which cannot efficiently identify the core appearance hidden dangers of explosion-proof electrical equipment and restricts the improvement of the electrical explosion-proof safety level in explosion-hazardous areas. SUMMARY

[0005] The purpose of the present application is to provide a YOLOv11 model-based appearance hidden danger detection method for explosion-proof electrical equipment, to realize automatic, efficient and accurate detection of appearance hidden dangers of explosion-proof electrical equipment, to solve the drawbacks of traditional manual detection, and to improve the intelligent level of electrical explosion-proof safety management in explosion-hazardous areas.

[0006] The above-mentioned purpose of the present application is achieved by the following technical scheme:

[0007] A YOLOv11 model-based appearance hidden danger detection method for explosion-proof electrical equipment, comprising the following steps:

[0008] S1 Hidden danger identification and screening

[0009] S11 Statistics of electrical explosion-proof safety detection project data, and division of hidden dangers into three categories of safety technical measures, safety management measures and environment;

[0010] S12 Construction of a fault tree with electrical explosion-proof performance failure as a top event, 12 hidden danger categories as intermediate events and 32 safety hidden dangers as bottom events, calculation of 32 minimum cut sets through Boolean algebra, calculation of probability importance and critical importance of bottom events by formula, and screening of special environmental factors (X4), hidden dangers of power distribution systems (X5-X7), hidden dangers of explosion-proof electrical equipment (X 17 -X 21) high-risk hidden dangers, determine the core detection target of the appearance of explosion-proof electrical equipment;

[0011] S2 dataset construction

[0012] S21 original data collection: field shooting of explosion-proof distribution box video and frame extraction, obtaining real scene images of different types and models of explosion-proof distribution box from different angles; taking pictures of the finished state in the explosion-proof distribution box workshop to obtain simulation scene images, enriching the diversity of data scenes;

[0013] S22 data preprocessing: using computer vision tools to standardize the original image, unifying the resolution to 640x640 pixels, performing standardized renaming, redundant image elimination and data sequence randomization operations; using median filter algorithm to suppress image noise, maintaining edge details while improving signal-to-noise ratio, finally obtaining 2400 standard images conforming to the specification;

[0014] S23 data augmentation and labeling: expand data distribution through random rotation(±15°), horizontal and vertical flipping, brightness and contrast adjustment(±20%), Gaussian noise injection, etc. to build a reinforced dataset containing 3410 samples; use labeling software to calibrate the detection target position, divide the detection target into four categories: EX explosion-proof mark, explosion-proof distribution box, missing unsealed or compressed parts, and incorrect sealing with plastic sealing parts, and clearly define the labeling standards for each type of target, divide the training set and test set in the ratio of 8:2;

[0015] S3 model building and training

[0016] Model architecture design: based on YOLOv11 to build a detection model, including:

[0017] S31 backbone network: use C3K2 module to optimize information flow path and reduce computational overhead; integrate SPPF module to aggregate multi-scale context information; introduce C2PSA module to enhance attention mechanism and improve key feature extraction capability;

[0018] S32 neck network: through up-sampling and cross-layer connection, realize the fusion of different level features, complement multi-scale information;

[0019] S33 detection head: use depth separable convolution to reduce computational complexity, through decoupling prediction to complete end-to-end output of target positioning and classification, set the output layer to(13, 13, 36), (26, 26, 36), (52, 52, 36) multi-scale feature map, adapt to different size target detection;

[0020] S34 Training environment and parameter configuration: build a training environment based on CUDA parallel computing platform, cuDNN deep neural network acceleration library and PyTorch framework; set the batch size to 8, the training round to 200, the initial learning rate to 0.01, and use the dynamic learning rate adjustment strategy; select the loss function and activation function suitable for the target detection task, introduce the COCO dataset pre-training weight for transfer learning, and accelerate the model convergence;

[0021] S35 Training process monitoring: the model completes a training cycle every time, and the performance is verified using the test set, the training effect is dynamically monitored, and after 200 iterations, the model loss value is reduced to 12.42, and the training effect is stable;

[0022] S4 Appearance defect detection

[0023] The image of the explosion-proof electrical equipment to be detected is input into the trained model, the model extracts multi-scale features through the backbone network, and after fusion through the neck network, the detection head outputs the class, position coordinates and confidence of the detection target, realizing automatic identification of EX explosion-proof marks, explosion-proof distribution boxes and two types of core appearance defects, and providing accurate detection result support for safety management.

[0024] Preferably, in S11, the safety technical measure class includes power distribution systems, explosion-proof electrical equipment, explosion-proof electrical equipment, electrical lines, and grounding resistors; the safety management measure class includes device surface temperature, electrical equipment management data, periodic detection, and periodic maintenance; and the environment class includes environmental temperature, environmental humidity, corrosive environment, and special environment.

[0025] Preferably, in S11, the special environment is a dust environment.

[0026] Preferably, in S12, the probability importance and critical importance of the fault tree are calculated by formulas (1) and (2) respectively, and the probability of occurrence of the top event is calculated by formula (3), P(T) = 0.641, that is, the probability of occurrence of the electrical explosion-proof performance failure of the system is about 64.1%.

[0027]

[0028] In the formula: I pr (i) is the probability importance of the bottom event i;

[0029] P(T) is the probability of occurrence of the top event;

[0030] q i is the probability of occurrence of the bottom event i;

[0031] n is the total number of bottom events;

[0032] I c(i) is the critical importance of the bottom event i.

[0033] Preferably, the following steps are further included: precision (P) and recall (R) are used as core evaluation indexes, the precision is a key parameter for evaluating the accuracy of the prediction result of the model, and reflects the proportion of real positive samples in the detection results judged as positive samples, and the calculation formula is as follows:

[0034]

[0035] In the formula, the true positive (TP) represents the number of hidden danger targets correctly identified by the model, that is, the positive samples consistent with the true label in the prediction result; and the false positive (FP) represents the number of false alarm targets misjudged by the model, that is, the case that the actual negative sample is incorrectly identified as a positive sample;

[0036] The recall rate is an important index for measuring the integrity of the model, and reflects the coverage ability of the model to the actual hidden danger targets, the index focuses on the proportion of successfully identified real positive samples from all real positive samples, and directly reflects the ability level of the model to avoid missed detection, and the calculation formula is as follows:

[0037]

[0038] In the formula, the true positive (TP) remains the above definition, and the false negative (FN) represents the number of real hidden danger targets that the model fails to detect; through the quantitative index, the system evaluates the target discovery and identification efficiency of the model in the actual application scene, and provides a theoretical basis for the reliability of the appearance hidden danger detection of the explosion-proof electrical equipment.

[0039] Beneficial effects

[0040] The present application accurately screens high-risk hidden dangers through fault tree analysis, ensures the pertinence of the detection target, the constructed data set combines real scenes and simulated scenes, and has good diversity and generalization ability after preprocessing and data enhancement, the detection model based on YOLOv11 optimization has less parameter quantity, high inference efficiency, and the training efficiency and detection performance are improved through transfer learning; experimental verification shows that the average detection accuracy of the model on four types of detection targets is more than 85%, the overall average accuracy is 87.4%, and the efficient and accurate detection of the appearance hidden danger of the explosion-proof electrical equipment can be effectively realized, the artificial detection cost is reduced, the risk of missed detection and misjudgment is reduced, and the electrical explosion-proof safety management level of the explosion danger area is significantly improved.

[0041] The present application will be further described below through specific embodiments and drawings, but it does not mean the limitation of the protection scope of the present application. DETAILED DESCRIPTION

[0042] Figure 1 This is the fault tree for the electrical explosion-proof performance failure in Embodiment 1 of the present invention;

[0043] Figure 2 This is a diagram of the YOLOv11 network structure in Embodiment 1 of the present invention;

[0044] Figure 3 These are images collected on-site in Embodiment 1 of the present invention;

[0045] Figure 4 The image is a simulated scene image from Embodiment 1 of the present invention;

[0046] Figure 5 This is the loss curve of the model training set in Embodiment 1 of the present invention;

[0047] Figure 6 This is a diagram showing the detection effect of the model in Embodiment 1 of the present invention;

[0048] Figure 7 This is the precision-recall curve of the model in Embodiment 1 of the present invention. Detailed Implementation

[0049] The present invention will be further described below with reference to specific embodiments. It should be understood that the following text is only used to describe one or more specific implementations of the present application and does not strictly limit the scope of protection specifically claimed in the present application. In the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other.

[0050] Unless otherwise specified, the components involved in the following embodiments are all commercially available conventional components, and the methods used are all methods commonly used in this technical field.

[0051] Example 1

[0052] A method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model, comprising the following steps:

[0053] 1. Analysis of electrical explosion-proof safety hazards in explosion-prone areas

[0054] 1.1 Statistical Analysis of Potential Safety Hazards in Electrical Explosion-Proof Testing

[0055] Table 1 shows the types of hazards found in electrical explosion-proof safety testing projects. These hazards are categorized into three main types: safety technical measures, safety management measures, and environmental hazards.

[0056] The specific subcategories of hazards under each category are as follows:

[0057] Variable power distribution system: involving isolation seal, explosion-proof measures of variable power distribution facilities, variable power distribution room site selection and location, etc.; Explosion-proof electrical equipment: including equipment selection, installation specification, product compliance, operating status and intrinsic safety performance, etc.; Electrical wiring: covering steel pipe and flexible pipe wiring, cable wiring installation, general electrical wiring regulations and intrinsic safety requirements in explosive hazardous environments; Grounding resistance: measuring resistance value by grounding resistance tester; Equipment surface temperature: measured by infrared temperature detector or contact type temperature detector; Explosion-proof electrical equipment management data: including equipment specification, operation procedures and management system and other related documents; Regular detection: covering detection system, operation approval process and detection records and other data; Regular maintenance: including maintenance system and maintenance records and other documents; Detection and maintenance personnel professionalism: assessing whether they have received electrical explosion-proof safety training, whether they have explosion-proof electrical special operation certificate, and technical ability and professional level; Environmental temperature and humidity: environmental temperature and humidity may affect the accuracy of explosion-proof electrical equipment surface temperature and grounding resistance measurement, and high temperature and humidity can accelerate equipment aging and shorten service life; Corrosion: corrosive environment may cause explosion-proof electrical equipment shell corrosion, accelerate aging and reduce explosion-proof performance, and the presence of corrosive medium in the environment and the completeness of corrosion protection measures need to be evaluated; Special environment: including dust environment, dust accumulation may affect equipment heat dissipation, etc.

[0058] Table 1 Electrical explosion-proof safety detection hidden danger statistics

[0059]

[0060] 1.2, Fault tree analysis

[0061] Taking electrical explosion-proof performance failure as the top event of the fault tree, 12 hidden danger categories as the intermediate events, and 32 safety hidden dangers as the bottom events, an electrical explosion-proof performance failure fault tree is compiled, the event description is shown in Table 2, and the fault tree analysis is shown in Figure 1 , combined with project data statistics, accident case analysis and expert experience, the occurrence probability of each bottom event is assumed as shown in Table 3;

[0062] List the Boolean algebra expression of the fault tree: T = M1+M2+M3=X1+X2+…+X 32 , after calculation, the electrical explosion-proof performance failure fault tree has 32 minimum cut sets, the probability importance and critical importance of the fault tree are calculated by formulas (1) and (2), the detailed results are shown in Table 4, and the probability of the top event occurrence is calculated by formula (3), P(T) = 0.641, i.e. the probability of electrical explosion-proof performance failure of the system is about 64.1%;

[0063]

[0064]

[0065] wherein: I pr (i) is the probability importance of the bottom event i;

[0066] P(T) is the probability of the top event occurrence;

[0067] q i is the probability of the bottom event i occurrence;

[0068] n is the total number of bottom events;

[0069] I c (i) is the critical importance of the bottom event i;

[0070] Based on the data results and the fault tree structure, the analysis is carried out from three aspects of the structural importance, the probability importance and the critical importance. In the aspect of the structural importance, since the fault tree is all OR gate, the structural importance of all bottom events is equal, i.e. all bottom events are equally important, each bottom event can independently lead to the failure of the electrical explosion-proof performance, and therefore, all bottom events need to be concerned. The probability importance represents the influence degree of the slight change of the bottom event occurrence probability on the top event occurrence probability. In the aspect of the probability importance, the probability importance of X4 (special environmental factors), X5-X7 (hidden troubles of the power distribution system), X 17 -X 21 (hidden troubles of the explosion-proof electrical equipment) is the highest, which means that the probability change of these bottom events has the greatest influence on the top event probability, and these events should be monitored and controlled in priority. The critical importance represents the relative influence degree of the relative change of the bottom event occurrence probability on the top event occurrence probability, and is the priority target index of safety improvement. In the aspect of the critical importance, the critical importance of X4, X5-X7, X 17 -X 21 is the highest, which means that reducing the occurrence probability of these bottom events can most effectively reduce the top event probability, and in the case of limited resources, these fields should be improved in priority, such as strengthening environmental management, perfecting the safety measures of the power distribution system, and ensuring the safety compliance of the explosion-proof electrical equipment. In summary, combined with the importance ranking, the focus of safety management should be placed on the environmental control, the power distribution system and the explosion-proof electrical equipment. At the same time, all bottom events on the fault tree are equally important in structure, and the corresponding safety management work also needs to be improved. Combined with the actual situation, the explosion-proof electrical equipment is easy to detect and identify, and therefore, the explosion-proof electrical equipment appearance hidden trouble detection model based on the YOLOv11 model will take the most used explosion-proof distribution box in the explosion-proof electrical equipment as the detection focus.

[0071] Table 2 Fault tree event description

[0072]

[0073]

[0074] Table 3 Probability of occurrence of bottom events

[0075]

[0076] Table 4 Probability importance and critical importance

[0077]

[0078] 2. YOLOv11 target detection model

[0079] 2.1. Backbone network

[0080] In the design of the backbone network of YOLOv11, a C3K2 module is used to handle the feature extraction task at different stages. This module effectively optimizes the information flow path in the network by segmenting the feature map and applying a series of small-scale convolution kernels (such as 3x3 convolution). Compared with traditional large-scale convolution kernels, this design significantly reduces the computational overhead while maintaining the ability of feature representation, thereby improving the processing speed. Compared with the C2f module, the C3K2 module further optimizes the efficiency of feature representation by reducing the number of parameters. In addition, the network integrates an SPPF module, which performs multiple maximum pooling operations of different scales in parallel to effectively aggregate multi-scale context information. This structure significantly enhances the model's detection ability for multi-scale targets while maintaining real-time inference speed. To further improve the feature selection performance, the backbone network also introduces a C2PSA module. This module processes information independently on different branches of the feature map through two PSA (Positioning System Architecture) components and enhances the attention mechanism through feature concatenation operations, thereby effectively improving the model's ability to perceive and extract key features.

[0081] 2.2. Network structure of YOLOv11

[0082] The network structure of YOLOv11 is shown in Figure 2 The network structure of YOLOv11 mainly includes three parts: backbone network (Backbone), neck network (Neck), and detection head (Head).

[0083] To extract multi-scale features from input images, the model adopts Backbone as the basic feature extractor; this part mainly consists of the following modules: Convolutional layers (Conv) gradually extract features from shallow features such as edges and textures to more abstract deep features through layer-by-layer operations; the C3k2 module, as one of the core components, supports two working modes (c3k = False / True), and through the processing flow of "split-bottleneck / sub-C3k module-splicing", it reduces the computational complexity while maintaining the feature expression ability; the SPPF module expands the receptive field to capture long-distance feature dependencies and reduces the computational burden through multiple max pooling and feature splicing; the C2PSA module introduces the PSA attention mechanism to enhance the focusing ability on key features and improve the relevance of feature extraction;

[0084] Neck is responsible for fusing and enhancing the features output by Backbone to improve the feature expression ability in subsequent detection tasks; this part first realizes multi-scale feature fusion through upsampling and splicing operations, combining shallow detail information with deep semantic content to improve the detection effect of targets of different scales; then, the C3k2 module is used again to further refine the fused features to ensure that the features passed to the detection head have both richness and discriminability;

[0085] Head, based on the enhanced features output by Neck, completes the target classification and bounding box regression tasks, and its core Detect module mainly includes the following components: final detection features are extracted through convolution and deep convolution; in terms of loss calculation, the CIoU loss function is used to optimize the position of the bounding box, which takes into account factors such as overlapping area, center point distance, and aspect ratio; at the same time, the classification loss (CLSLoss) is used to improve the prediction accuracy of target classes;

[0086] The overall workflow of the model is as follows: input images are sequentially extracted features by Backbone, multi-scale fusion and enhancement by Neck, and finally output target classes and positioning results by Head. The "Backbone-Neck-Head" architecture is widely used in target detection tasks, achieving a good balance between precision and efficiency;

[0087] 3、Dataset preparation

[0088] 3.1、Original data collection

[0089] 1) On-site shooting of explosion-proof distribution box video, through video frame extraction, pictures of different types and different models of explosion-proof distribution boxes at different angles are intercepted from the video stream, and the collected picture data is as shown in Figure 3

[0090] ​2) Simulated scene data: To improve the generalization ability of the model, take pictures of the out-of-factory state in the explosion-proof distribution box finished product workshop, as shown in Figure 4

[0091] 3.2, Data preprocessing

[0092] Optimize the quality of the dataset through a systematic image preprocessing process:

[0093] First, standardize the original image through computer vision tools, including uniform resolution to 640x640 pixels, standard renaming, removing redundant images, and randomly shuffling data order. To suppress noise interference generated during image acquisition, a median filter algorithm is used to effectively suppress noise while preserving edge details and significantly improving image signal-to-noise ratio. After the above preprocessing steps, a total of 2400 standard images that meet the specifications are obtained.

[0094] To further enhance the diversity and generalization ability of the dataset, the invention implements a comprehensive data augmentation strategy: by introducing random rotation (±15°), horizontal and vertical flipping, brightness and contrast adjustment (±20%), Gaussian noise injection, and other multi-transformation methods, the coverage of data distribution is effectively expanded. After data augmentation, a strengthened dataset containing 3410 samples is finally constructed, providing sufficient and high-quality data support for subsequent model training.

[0095] 3.3, Making dataset

[0096] Use the annotation software to mark the position of the detection target in the picture data, and divide the detection target into 4 detection categories: EX explosion-proof mark, explosion-proof distribution box, unsealed or missing compression piece, and incorrect sealing with plastic sealing piece. In the annotation process, clearly divide the unsealed or missing compression piece and the incorrect sealing with plastic sealing ring into two categories. Mark the missing compression piece or fastening screw around the explosion-proof distribution box as unsealed or missing compression piece. Plastic sealing pieces are only used to prevent internal threads from being worn out during shipment. However, through project visits and research, many enterprises do not replace them during installation and directly use plastic sealing pieces. The correct method is to use metal compression pieces to connect steel pipes or flexible pipes, and use a flexible joint to transition. Therefore, mark the use of plastic sealing pieces at the wiring port of the explosion-proof distribution box as incorrect sealing with plastic sealing ring. Clear division helps the model to efficiently recognize various targets. Cut the dataset into training set and test set. The training set is used to train model parameters, and the test set is used to test the performance of the model.

[0097] 4, Explosion-proof electrical equipment appearance hidden danger detection model

[0098] 4.1, Model construction

[0099] ​Based on the YOLOv11 architecture, an explosion-proof electrical equipment appearance hidden danger detection model is constructed:

[0100] The model construction process mainly includes three key links: running environment configuration, neural network hyperparameter optimization, and pre-trained weight selection.

[0101] Running environment configuration:

[0102] The deep learning training environment adopted is based on GPU parallel computing architecture, specifically built by CUDA parallel computing platform, cuDNN deep neural network acceleration library, and PyTorch framework layer by layer. This technology stack fully utilizes the large-scale parallel computing advantages of GPU, providing efficient numerical operation support for model training.

[0103] Neural network hyperparameter optimization:

[0104] Neural network hyperparameters, as pre-set variables before model training, directly affect the convergence performance and detection accuracy of the model. Through systematic grid search experiments, the batch size is finally determined to be 8, the training round is 200, the initial learning rate is set to 0.01, and the dynamic learning rate adjustment strategy is adopted. At the same time, the loss function and activation function suitable for the target detection task are selected to build a complete optimization target system.

[0105] Pre-trained weight selection: To accelerate model convergence and improve generalization ability, the transfer learning method is adopted, and the COCO dataset is used as the source domain for pre-training. Through parameter fine-tuning, knowledge transfer is achieved, significantly improving the training efficiency and feature extraction ability of the model in the explosion-proof equipment hidden danger detection task.

[0106] 4.2, Model training

[0107] For the scene of hidden dangers of explosion-proof distribution boxes, the detection targets are divided into four key categories: EX explosion-proof mark, explosion-proof distribution box, missing of unblocked or compressed parts, and incorrect blocking with plastic blocking parts. The dataset is divided according to the ratio of 8:2, and finally 2387 images are obtained for the training set and 1023 images for the test set.

[0108] In terms of model structure design, the network sets three anchor boxes of different scales on each grid unit of the feature map to adapt to the detection needs of targets of different sizes. The output layer uses a multi-scale feature map structure with sizes of (13, 13, 36), (26, 26, 36), and (52, 52, 36) respectively, responsible for large, medium, and small target detection tasks. This multi-scale prediction mechanism ensures the sensitivity of the model to various size defect features. During the training process, the model is periodically validated using test set data after completing each training cycle to dynamically monitor the training effect of the model and ensure stable performance optimization during the training process.

[0109] 5. Model detection result analysis

[0110] The initial learning rate of the model is set to 0.01, and the learning rate is updated gradually during the training process. The change of the model training set loss value with the iteration number is recorded during the training process, as shown in Figure 5 ;

[0111] According to the change of the model training set loss value, the training of the model can be monitored. The size of the training set is 1000 pictures for the first 100 times, and the training set increases by 1387 pictures after 100 times of training, a total of 2387 pictures.

[0112] As can be seen from Figure 5 , the model loss value decreases rapidly in the first 10 iterations, and then the model loss value decreases slowly. After 200 iterations, the training of the model is completed, and the final model loss value is reduced to 12.42. At this time, the model has a good training effect, indicating that the model has a certain practical significance for detecting the appearance hidden danger of the explosion-proof distribution box.

[0113] 5.1, detection result analysis

[0114] The test set data is used to test the model, and the detection results of part of the hidden danger are obtained, as shown in Figure 6 . The detection results of the YOLOv11 model on the test set are shown in the figure, and the target class and class confidence given by the model are labeled on the detection frame. As can be seen from Figure 6 , the model correctly frames the EX explosion-proof mark, explosion-proof distribution box, and area without plugging or compression loss, and the model also labels the confidence of the detection result. The model has good multi-scale detection ability for detection categories.

[0115] 5.2, precision-recall curve result analysis

[0116] For performance evaluation of the explosion-proof electrical equipment appearance hidden danger detection model, precision (P) and recall (R) are used as the core evaluation indexes. Precision is a key parameter for evaluating the accuracy of the model prediction result, reflecting the proportion of real positive samples in the detection results judged as positive samples. The calculation formula is as follows:

[0117]

[0118] In the formula, True Positive (TP) represents the number of potential hazards correctly identified by the model, that is, positive samples whose prediction results are consistent with the actual labels; False Positive (FP) represents the number of false alarm targets misjudged by the model, that is, cases that are actually negative samples but are incorrectly identified as positive samples.

[0119] Recall, as an important indicator for measuring the completeness of a model's detection, reflects the model's ability to cover real-world potential targets. This indicator focuses on the proportion of targets successfully identified by the model from all real positive samples, directly reflecting the model's ability to avoid missed detections. The calculation formula is as follows:

[0120]

[0121] In the formula, true positive (TP) remains as defined above, and false negative (FN) represents the number of real hidden danger targets that the model failed to detect. Through this quantitative index, the target discovery and identification effectiveness of the model in actual application scenarios can be systematically evaluated, providing a theoretical basis for the reliability of appearance hidden danger detection of explosion-proof electrical equipment.

[0122] like Figure 7 As shown, the precision and recall of the target detection model exhibit a significant negative correlation. This phenomenon is mainly affected by the confidence threshold adjustment mechanism. When a higher confidence threshold is set, the model's criteria for judging positive samples become stricter, resulting in a significant improvement in precision. However, some true targets are missed because they do not reach the threshold, leading to a corresponding decrease in recall. Conversely, when the confidence threshold is set lower, the model's coverage of targets expands, improving recall. However, this also introduces more false positives, causing a decrease in precision.

[0123] To address the specific needs of detecting potential visual hazards in explosion-proof electrical equipment, and considering the potentially serious consequences of missed detections, the model optimization strategy appropriately sacrifices recall within an acceptable range to ensure high accuracy. This decision is based on the safety principle of "better to report false positives than to miss false positives" in practical engineering applications, ensuring the reliability of identified hazards. Experimental data shows that when the recall rate is controlled below 70%, the model's detection accuracy for all types of hazards can be maintained above 80%, verifying the practical application value of this detection model in the task of identifying visual hazards in explosion-proof distribution boxes.

[0124] 5.3 Analysis of Statistical Results of Average Detection Accuracy

[0125] The average detection accuracy is the area enclosed by the PR curve. The average detection accuracy for different detection categories can be used to evaluate the model's detection performance for that category. The calculation formula is as follows:

[0126]

[0127] In the formula: A is the average detection accuracy;

[0128] The mean average precision (mAP) reflects the average accuracy of all classes, and its calculation formula is:

[0129]

[0130] In the formula: C is the number of classes; A i is the average detection accuracy of class i, and the average detection accuracy A covers the change trend of precision and recall, which can more comprehensively reflect the detection performance of the model for a single class, and the mAP is the average of all classes A, which is used to evaluate the overall detection ability of the model on all classes;

[0131] After calculation, the average detection accuracies of EX explosion-proof mark, explosion-proof distribution box, missing of unblocked or compressed parts, and incorrect blocking of plastic blocking parts are 87.8%, 89.4%, 85.9%, and 86.5%, respectively, and the mean average detection accuracy of the model is 87.4%. The above results indicate that the model has good performance for each detection category, and the overall accuracy of the model is high, which has certain ability to be applied to the detection of hidden dangers of explosion-proof distribution box appearance;

[0132] 6、Conclusion

[0133] (1) The main hidden dangers in electrical explosion safety detection are explosion-proof electrical equipment hidden dangers, power distribution system hidden dangers, and electrical line hidden dangers, which account for 25.65%, 21.95%, and 17.22%, respectively. Enterprises in explosive danger areas should focus on special safety management;

[0134] (2) In the electrical explosion fault tree, X4 (special environmental factors), X5-X7 (power distribution system hidden dangers), and X 17 -X 21 (explosion-proof electrical equipment hidden dangers) have the highest probability importance, which are 39.35%, 38.75%, and 37.85%, respectively. The probability changes of these bottom events have the greatest impact on the probability of the top event, and these events should be monitored and controlled first. At the same time, combined with the critical importance, in the case of limited resources, environmental management should be strengthened first, the site dust should be cleaned up, the power distribution system safety measures should be improved, and the safety compliance of explosion-proof electrical equipment should be ensured;

[0135] (3) Through on-site detection, simulation collection and preparation of the appearance hidden danger detection data set of the explosion-proof distribution box, taking the EX explosion-proof mark, the explosion-proof distribution box, the missing of the unblocked or compressed parts and the incorrect blocking by using the plastic blocking piece as the main detection target, an appearance hidden danger detection model of the explosion-proof electrical equipment is obtained based on the YOLOv11 model training; the average detection accuracy of the model for the four detection categories is 87.8%, 89.4%, 85.9% and 86.5% respectively, and the average detection accuracy of the model is 87.4%; the above results show that the model has good performance for each detection category, and the overall accuracy of the model is high, and the model is suitable for the detection of the appearance hidden danger of the explosion-proof electrical equipment.

[0136] Although the above has made detailed description on the purpose concept and embodiments of the present application, those skilled in the art can recognize that various improvements and changes can be made to the present application without departing from the scope defined by the claims, and such improvements and changes should still belong to the protection scope of the present application.

Claims

1. A method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model, comprising the following steps: S1 Hazard Identification and Screening S11 statistics on electrical explosion-proof safety testing projects categorize potential hazards into three main types: safety technical measures, safety management measures, and environment. S12 constructs a fault tree with electrical explosion-proof performance failure as the top event, 12 hazard categories as intermediate events, and 32 safety hazards as bottom events. Through Boolean algebra calculations, 32 minimal cut sets are obtained. The probability importance and critical importance of the bottom events are calculated using formulas. Based on the calculation results, high-risk hazards are selected: special environmental factors (X4), power distribution system hazards (X5-X7), and explosion-proof electrical equipment hazards (X...). 17 -X 21 To identify the core detection targets for potential appearance hazards in explosion-proof electrical equipment; S2 dataset construction S21 Raw Data Collection: On-site video recording of explosion-proof distribution boxes and frame extraction to obtain real scene images of different types and models of explosion-proof distribution boxes from various angles; factory condition photos of explosion-proof distribution boxes in the finished product workshop to obtain simulated scene images, enriching the diversity of data scenes; S22 Data Preprocessing: The original images were standardized using computer vision tools to unify the resolution to 640×640 pixels. Standardized renaming, redundant image removal, and random shuffling of data order were performed. Median filtering algorithm was used to suppress image noise, preserve edge details, and improve the signal-to-noise ratio, ultimately obtaining 2400 standardized images that conform to the specifications. S23 Data Augmentation and Annotation: The data distribution was expanded by methods such as random rotation ±15°, horizontal and vertical flipping, brightness and contrast adjustment ±20%, and Gaussian noise injection to construct an augmented dataset containing 3410 samples; the location of the detection targets was calibrated using annotation software, and the detection targets were divided into four categories: EX explosion-proof signs, explosion-proof distribution boxes, unsealed or missing clamping parts, and incorrect sealing with plastic sealing parts. The annotation standards for each type of target were clarified, and the training set and test set were divided in an 8:2 ratio. S3 Model Construction and Training Model architecture design: The detection model is built based on YOLOv11, including: S31 backbone network: The C3K2 module is used to optimize the information flow path and reduce computational overhead; the SPPF module is integrated to aggregate multi-scale contextual information; and the C2PSA module is introduced to enhance the attention mechanism and improve the ability to extract key features. S32 neck network: Through upsampling, downsampling and cross-layer connections, it achieves the fusion of features from different levels and complements multi-scale information; S33 Detection Head: It adopts depthwise separable convolution to reduce computational complexity and completes end-to-end output of target localization and classification through decoupled prediction. The output layer is set with multi-scale feature maps of (13, 13, 36), (26, 26, 36), and (52, 52, 36) to adapt to the detection of targets of different sizes. S34 Training Environment and Parameter Configuration: Build a training environment based on the CUDA parallel computing platform, cuDNN deep neural network acceleration library, and PyTorch framework; set the batch size to 8, the training epochs to 200, the initial learning rate to 0.01, and adopt a dynamic learning rate adjustment strategy; select loss and activation functions suitable for the object detection task, and introduce pre-trained weights from the COCO dataset for transfer learning to accelerate model convergence; S35 Training Process Monitoring: After each training cycle, the model is tested using a test set to verify its performance and dynamically monitor the training effect. After 200 iterations, the model loss value dropped to 12.42, and the training effect stabilized. S4 Exterior Defect Detection The image of the explosion-proof electrical equipment to be tested is input into the trained model. The model extracts multi-scale features through the backbone network, and after fusion by the neck network, the detection head outputs the category, location coordinates and confidence level of the detected target. This enables automatic identification of EX explosion-proof marks, explosion-proof distribution boxes and two types of core appearance hazards, providing accurate detection results support for safety management.

2. The method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model as described in claim 1, characterized in that: In S11, the safety technical measures category includes power distribution systems, explosion-proof electrical equipment, electrical lines, and grounding resistance; the safety management measures category includes equipment surface temperature, electrical equipment management data, periodic inspection, and periodic maintenance; and the environment category includes ambient temperature, ambient humidity, corrosive environments, and special environments.

3. The method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model as described in claim 2, characterized in that: In S11, the special environment is a dusty environment.

4. The method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model as described in claim 3, characterized in that: In S12, the probability importance and critical importance of the fault tree are calculated by formulas (1) and (2) respectively. The probability of the top event is calculated by formula (3), P(T) = 0.641, that is, the probability of the system failing the electrical explosion-proof performance is about 64.1%. In the formula: I pr (i) represents the probability importance of the base event i; P(T) is the probability of the top event occurring; q i It is the probability of the occurrence of the base event i; n is the total number of base events; I c (i) represents the critical importance of the base event i.

5. The method for detecting visual defects in explosion-proof electrical equipment based on the YOLOv11 model as described in claim 4, characterized in that: The process also includes the following steps: Precision (P) and recall (R) are used as core evaluation metrics. Precision is a key parameter for evaluating the accuracy of the model's prediction results, reflecting the proportion of true positive samples among the detection results that are judged as positive samples. The calculation formula is as follows: In the formula, true positive (TP) represents the number of potential hazards correctly identified by the model, i.e., positive samples whose prediction results are consistent with the actual labels; false positive (FP) represents the number of false alarm targets misjudged by the model, i.e., cases that are actually negative samples but are incorrectly identified as positive samples. Recall, as an important indicator for measuring the completeness of a model's detection, reflects the model's ability to cover real-world potential targets. This indicator focuses on the proportion of targets successfully identified by the model from all real positive samples, directly reflecting the model's ability to avoid missed detections. The calculation formula is as follows: In the formula, true positive (TP) retains the above definition, and false negative (FN) represents the number of real hidden danger targets that the model failed to detect. Through this quantitative index, the system evaluates the target discovery and identification effectiveness of the model in practical application scenarios, and provides a theoretical basis for the reliability of appearance hidden danger detection of explosion-proof electrical equipment.