Fault indicator damp detection method and related equipment
By improving the YOLOv8 model, combining CSP module, CBAM module and multi-scale feature fusion technology, the problem of low detection accuracy of fault indicator condensation area in complex scenarios is solved, and high-precision and real-time moisture detection effect is achieved.
Patent Information
- Application Number
- CN202510111073.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-04-29
AI Technical Summary
The prior art has low detection accuracy of the fault indicator condensation area in complex scenarios, and it is difficult to realize real-time monitoring and accurate identification of moisture-bearing states.
The improved YOLOv8 model is adopted, and feature extraction and enhancement is performed through the CSP module and the CBAM module, combining multi-scale feature fusion and non-maximum suppression technology to achieve high-precision detection of the condensation area.
The detection accuracy of condensation areas in complex scenarios is improved, real-time monitoring and accurate identification of moisture-bearing states are achieved, and the uniqueness and accuracy of detection results are enhanced.
Smart Images

Figure CN119904814A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electric power equipment monitoring, and in particular relates to a method for detecting moisture in a fault indicator and related equipment. Background Art
[0002] When the fault indicator is hung outdoors, it is easy to produce internal condensation due to the influence of environmental factors such as the temperature difference between day and night and rain and snow. Condensation is the phenomenon that water vapor in the air condenses into water droplets on the surface of the equipment. Its generation is related to the ambient humidity, temperature and the temperature of the equipment surface. When the ambient humidity is high and the surface temperature of the equipment is lower than the ambient temperature, water vapor will condense into water droplets on the surface of the equipment. This phenomenon is particularly common in humid environments, such as distribution rooms and basements. The generation of condensation depends on the ambient humidity and temperature difference. When the air humidity is high and the equipment temperature is lower than the ambient temperature, the water vapor in the air will be cooled and liquefied into water and attached to the surface of the equipment. Condensation has a great impact on electrical equipment. First, condensation will increase the humidity on the surface of the equipment, thereby reducing the insulation performance of the equipment and increasing the risk of accidents such as leakage and short circuit. Secondly, condensation may also cause corrosion to the circuit boards, components, etc. of the equipment, affecting the normal operation and service life of the equipment. In addition, condensation may also cause mold to form inside the equipment, affecting the electrical and mechanical properties of the equipment.
[0003] Existing fault indicator condensation detection mainly relies on manual visual detection. Manual detection methods are inefficient due to staff visual fatigue, false detection and missed detection, and are limited by weather conditions and cannot achieve real-time monitoring. In addition, the detection equipment used by inspectors often lacks intelligent processing capabilities and cannot accurately identify the moisture state. It lacks effective algorithm support and is difficult to accurately extract moisture characteristics from complex environmental factors. With the rapid development of artificial intelligence technology, the YOLO (You Only Look Once) series of target detection algorithms are widely used in industrial detection due to their fast detection speed and high accuracy. However, the original YOLOv8 algorithm still has limitations when dealing with high reflection, complex background and small target detection problems. Summary of the invention
[0004] The object of the present invention is to provide a method for detecting moisture in a fault indicator and related equipment, so as to solve the problem of low accuracy in the prior art when detecting condensation areas in complex scenes.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, a method for detecting moisture in a fault indicator comprises the following steps: Acquiring fault indicator images; The fault indicator image is input into a pre-trained improved YOLOv8 model, a feature map is first obtained by feature extraction using a CSP module, and then a weight is assigned to each channel and spatial position of the feature map using a CBAM module to obtain a number of enhanced feature maps; After multi-scale feature fusion of the plurality of enhanced feature maps, target detection is performed using the improved YOLOv8 model to obtain a bounding box and a confidence score of the condensation area; Based on the target detection result composed of the bounding box and the confidence score of the condensation area, repeated target detection results are removed by non-maximum suppression to complete the moisture detection of the fault indicator.
[0006] In some embodiments, the training step of the improved YOLOv8 model specifically includes: After accurately marking the condensation area of the fault indicator image, the image is divided into a training set and a validation set; The CBAM module is embedded in the output end of the CSP module of the backbone network of the original YOLOv8 model, and a multi-scale feature fusion module is added to the detection head of the original YOLOv8 model. The combination of WIoU and Focal Loss is used as the loss function to obtain the improved YOLOv8 model. The training set is input into the improved YOLOv8 model for training, and back propagation optimization is performed through the loss function, and a pre-trained improved YOLOv8 model is obtained through multiple iterations.
[0007] In some embodiments, the step of inputting the training set into the improved YOLOv8 model for training, performing back propagation optimization through the loss function, and iterating multiple times to obtain the pre-trained improved YOLOv8 model specifically includes: The training set is input into the improved YOLOv8 model, a feature map is first obtained by feature extraction using the CSP module, a weight is then assigned to each channel and spatial position of the feature map using the CBAM module, and a plurality of enhanced feature maps are obtained, and target detection is performed after multi-scale feature fusion of the plurality of enhanced feature maps, so as to obtain a prediction box, classification probability and confidence of the condensation area; The error between the predicted box and the real box of the condensation area is calculated by the WIoU; Combined with the classification probability, the error between each predicted category and the true category is calculated by the Focal Loss; Calculating a confidence error of the prediction box according to the confidence; The error between the predicted box and the true box, the error between each predicted category and the true category, and the confidence error are combined according to preset weights to obtain a total loss; The network weights of the improved YOLOv8 model are updated based on the total loss, and the above steps are repeated for iteration until the improved YOLOv8 model converges on the data set and the validation set, thereby obtaining a pre-trained improved YOLOv8 model.
[0008] In some implementations, the step of inputting the fault indicator image into a pre-trained improved YOLOv8 model, first extracting features through a CSP module to obtain a feature map, and then assigning weights to each channel and spatial position of the feature map through a CBAM module to obtain a plurality of enhanced feature maps specifically includes: Input the fault indicator image into the improved YOLOv8 model, and obtain a feature map through CSP module feature extraction; Performing global average pooling and maximum pooling on the feature map and then inputting it into a fully connected layer to generate channel attention weights; Weighting the feature map channel by channel according to the channel attention weight to obtain an intermediate feature map; The intermediate feature maps are concatenated after global average pooling and maximum pooling along the channel dimension, and spatial weights are generated through a convolutional layer; The intermediate feature maps are weighted position by position according to the spatial weight to obtain a plurality of enhanced feature maps.
[0009] In some implementations, the step of performing multi-scale feature fusion on the plurality of enhanced feature maps specifically includes: After aligning the several enhanced feature maps in the spatial dimension through upsampling or downsampling, weighted summation is performed to obtain a fused feature map.
[0010] In some embodiments, the step of removing duplicate target detection results by non-maximum suppression specifically includes: sorting the bounding boxes in descending order according to the confidence scores; Calculating the intersection-and-union ratio between each of the bounding boxes and other bounding boxes, and when the intersection-and-union ratio is greater than a preset intersection-and-union ratio threshold, removing the bounding box with a lower confidence score; Repeat the above steps until all bounding boxes are traversed and non-redundant bounding boxes are retained.
[0011] In a second aspect, a fault indicator moisture detection system includes: An image acquisition module, used for acquiring an image of a fault indicator; A feature enhancement module, used for inputting the fault indicator image into a pre-trained improved YOLOv8 model, first extracting features through a CSP module to obtain a feature map, and then assigning weights to each channel and spatial position of the feature map through a CBAM module to obtain a number of enhanced feature maps; A multi-scale feature fusion detection module is used to perform multi-scale feature fusion on the plurality of enhanced feature maps, and then perform target detection through the improved YOLOv8 model to obtain a bounding box and a confidence score of a condensation area; The redundant detection result removal module is used to remove repeated target detection results based on the target detection results composed of the bounding box and confidence score of the condensation area through non-maximum suppression to complete the moisture detection of the fault indicator.
[0012] In a third aspect, an electronic device includes a memory, a processor, and a computer program stored in the memory and executable in the processor, wherein the processor implements the steps of the method for detecting moisture in a fault indicator when executing the computer program.
[0013] In a fourth aspect, a computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting moisture in a fault indicator are implemented.
[0014] In a fifth aspect, a computer program product is provided, comprising a computer program, which, when executed by a processor, is based on a hardware platform NVIDIA RTX 3090 GPU and a PyTorch deep learning framework Python 3.8 to implement the steps of a method for detecting moisture in a fault indicator.
[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a method for detecting moisture on a fault indicator. The fault indicator image is input into a pre-trained improved YOLOv8 model. A feature map is first obtained by feature extraction using a CSP module. A weight is then assigned to each channel and spatial position of the feature map using a CBAM module to obtain a number of enhanced feature maps, which can enhance the capabilities of feature extraction and feature enhancement and improve the accuracy of target detection. After multi-scale feature fusion is performed on the enhanced feature maps, the target is detected using the improved YOLOv8 model to obtain a bounding box and a confidence score of a condensation area, which can better process enhanced feature maps of fault indicators of different scales and improve detection accuracy. Finally, duplicate target detection results are removed by non-maximum suppression to ensure the uniqueness and accuracy of the detection results. Therefore, based on the above content, the present invention can effectively improve the detection accuracy of condensation areas in complex scenes by introducing a CBAM module and a multi-scale feature fusion module with an attention mechanism.
[0016] Furthermore, the present invention calculates the error between the predicted box and the real box of the condensation area by WIoU; combines the classification probability, calculates the error between each predicted category and the real category by Focal Loss, and calculates the confidence error of the predicted box according to the confidence; finally, the error between the predicted box and the real box, the error between each predicted category and the real category, and the confidence error are combined according to preset weights to obtain a total loss, and the network weights of the improved YOLOv8 model are updated based on the total loss, which can comprehensively consider the error between the predicted box and the real box, the predicted category error and the confidence error, and can improve the training effect and final detection performance of the improved YOLOv8 model. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 A sample diagram of a second remote fault indicator provided for this embodiment; Figure 2 A schematic diagram of the condensation area marking of the second remote fault indicator provided in this embodiment; Figure 3 A specific flow chart of a method for detecting moisture in a fault indicator provided in this embodiment; Figure 4 The experimental result diagram provided for this embodiment, wherein (a) and (b) are the target detection results of the improved YOLOv8 model in different scenarios; Figure 5 A schematic flow chart of a method for detecting moisture in a fault indicator provided by the present invention; Figure 6 A structural schematic diagram of a fault indicator moisture detection system provided by the present invention. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution of the present invention will be further described in detail below in conjunction with the accompanying drawings, and the described content is intended to explain the present invention rather than to limit it.
[0019] It should be noted that the terms "including" and "having" and any variations thereof in the specification and claims of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, system, product or apparatus comprising a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units that are not explicitly listed or are inherent to these processes, methods, systems, products or apparatus.
[0020] like Figure 3 and Figure 5 As shown, this embodiment provides a method for detecting moisture in a fault indicator, comprising the following steps: S1, collecting fault indicator images; S2, inputting the fault indicator image into a pre-trained improved YOLOv8 model, first extracting features through a CSP module to obtain a feature map, and then assigning weights to each channel and spatial position of the feature map through a CBAM module to obtain a number of enhanced feature maps; S3, after multi-scale feature fusion of the plurality of enhanced feature maps, target detection is performed using the improved YOLOv8 model to obtain a bounding box and a confidence score of the condensation area; S4, based on the target detection result composed of the bounding box and the confidence score of the condensation area, the repeated target detection results are removed by non-maximum suppression to complete the moisture detection of the fault indicator.
[0021] The following is a detailed description of the above contents: 1. Improve the YOLOv8 model 1.1 Attention mechanism migration: A lightweight CBAM (Convolutional Block Attention Module) module is embedded in the YOLOv8 backbone network. The algorithm process combines channel and spatial attention mechanisms to enhance the model's ability to focus on the features of the condensation area while maintaining lightweight characteristics, which is suitable for efficient target detection tasks. Embedding a lightweight CBAM module in the YOLOv8 backbone network can be achieved through the following steps: 1.1.1 CBAM module structure CBAM is a lightweight module that combines channel attention (CA) and spatial attention (SA). Its core function is to enhance the expressiveness of key features. The calculation process is divided into two steps: 1.1.1.1 Channel Attention Mechanism (CA) Goal: Assign weights to each channel to increase the importance of channel features.
[0022] (1) First, input feature map Perform global average pooling and maximum pooling:
[0023] in , is the global average pooling result, is the maximum pooling result.
[0024] (2) Input the pooling results into a shared two-layer fully connected network:
[0025] in is the channel attention weight; is the Sigmoid function, and is the weight matrix of the fully connected layer.
[0026] (3) Use channel weights to weight the original feature map channel by channel:
[0027] in represents element-wise multiplication, is the intermediate feature map.
[0028] 1.1.1.2 Spatial Attention Mechanism (SA) Goal: Assign weights to each spatial position to improve the feature expression ability of key positions.
[0029] (1) Perform global average pooling and maximum pooling on the channel dimension of the feature map to generate a single channel feature map:
[0030] (2) Concatenate the two pooling results and generate spatial weights through a convolutional layer:
[0031] in , Represents a splicing operation, is the Sigmoid function.
[0032] (3) Use spatial weights to weight the feature map position by position:
[0033] in, It is the enhanced feature map after being enhanced by the CBAM module.
[0034] 1.1.2 Determine the embedding position of the CBAM module After selecting the CSP module in the YOLOv8 backbone network, the CBAM module is embedded. The output feature map of the CSP module, that is, the feature map after residual fusion, is enhanced by the CBAM module.
[0035] 1.1.3 The specific process of embedding the CBAM module is as follows: 1.1.3.1 Feature map input, the output feature map of a layer of YOLOv8 is , this feature map is directly used as the input of the CBAM module.
[0036] 1.1.3.2 Channel Attention Processing Perform global pooling (average pooling and maximum pooling) and use a two-layer fully connected network to generate channel weights , weight the original features channel by channel to generate an intermediate feature map .
[0037] 1.1.3.3 Spatial attention processing Perform global pooling (average and maximum pooling along the channel dimension), concatenate and generate spatial weights through the convolution layer , weight the intermediate features position by position to generate the final output .
[0038] 1.1.4 Mathematical model integration In the backbone network of YOLOv8, the calculation process of the embedded CBAM module is: Feature extraction stage:
[0039] Where X is the feature map of the input image.
[0040] CBAM enhancement stage:
[0041] CBAM processing includes channel attention and spatial attention.
[0042] Next level processing:
[0043] 1.2 Improving the loss function The loss function is optimized by combining weighted IoU (WIoU) and Focal Loss to improve the detection effect of small targets and complex background areas. The following are the specific steps and corresponding mathematical models: 1.2.1 Introduction to the original loss function of YOLOv8, which includes positioning loss, classification loss and target confidence loss. In scenes with small targets and complex backgrounds, the standard IoU is sensitive to target size and is difficult to effectively measure the precise positioning of small targets. The standard classification loss is sensitive to data imbalance, especially when small targets are suppressed by background areas. The combination of WIoU and Focal Loss can significantly improve these two deficiencies.
[0044] 1.2.2 Improved Positioning Loss with Weighted IoU WIoU introduces weights to different bounding box parameters (center point, width and height) based on IoU, focusing on optimizing: IoU definition:
[0045] WIoU introduces weight: Center offset penalty: Penalty for the center of the prediction box and the center of the real frame The offset is added with weight penalty:
[0046] in is the adjustment weight.
[0047] Aspect ratio penalty: weight the difference between width and height:
[0048] is the adjustment weight.
[0049] Weighted IoU combines the above factors:
[0050] The goal is to minimize WIoU, that is:
[0051] 1.2.3 Introducing Focal Loss to Improve Classification Loss Focal Loss is designed to solve the problem of class imbalance. It dynamically adjusts the weights of easy-to-classify samples and hard-to-classify samples to highlight the focus on hard-to-classify samples. The formula is as follows:
[0052] in: is the model’s predicted probability for the target category; is the weight balance factor of positive and negative samples; It is a hyperparameter for adjusting the weight of hard-to-classify samples.
[0053] Characteristics of Focal Loss: First, it controls the impact of easily separable samples. , reduce the loss weight of easy-to-classify samples and focus on hard-to-classify samples; second, solve the class imbalance by Adjust the loss ratio of positive and negative samples.
[0054] 1.2.4 Design of comprehensive loss function Original loss decomposition: Total loss of original YOLOv8:
[0055] in: is the positioning loss; is the classification loss; is the target confidence loss.
[0056] Combine WIoU and Focal Loss into the total loss:
[0057] Adjust weight: set up , , The weight of , to adapt to the small target detection task; Adjusting hyperparameters in Focal Loss and , to control sample imbalance and difficulty.
[0058] 1.2.5 The algorithm flow of introducing the improved function is as follows: (1) Inputting the training set into the improved YOLOv8 model to obtain the prediction box, classification probability and confidence of the condensation area; (2) Positioning loss calculation: Use WIoU to calculate the error between the predicted box and the real box of the condensation area, and optimize the center, width, height and IoU of the box.
[0059] (3) Classification loss calculation: Focal Loss is used to calculate the error between each predicted category and the true category, increasing attention to small objects and difficult-to-classify samples.
[0060] (4) Confidence loss calculation: Calculate the confidence error of whether the predicted box contains the target.
[0061] (5) Total loss combination: Combine the above three parts of loss according to weights.
[0062] (6) Back-propagation optimization: Use the total loss to update the network weights.
[0063] 1.3 Feature Fusion A multi-scale feature fusion module is added to the detection head of YOLOv8 to improve the robustness to condensation areas of different sizes.
[0064] 1.3.1 Input Features Multi-scale feature maps output from the backbone network or feature pyramid network (FPN / PAN):
[0065] in: They represent low, medium, and high-level features respectively, with different resolutions and receptive fields.
[0066] 1.3.2 Core Fusion Method (1) Upsampling: Upsample lower resolution high-level features to higher resolution to align spatial dimensions:
[0067] Upsample(·) usually uses nearest neighbor interpolation or bilinear interpolation.
[0068] (2) Downsampling: Downsample the high-resolution low-level features to align the spatial dimensions:
[0069] Downsampling is usually achieved through convolution or pooling.
[0070] (3) Weighted fusion: A weighted mechanism is used to fuse feature maps of different scales:
[0071] in: and After up / down sampling Aligned feature maps; It is a learnable fusion weight that controls the contribution ratio of each feature map.
[0072] (4) Perform independent predictions on the fused features to generate multi-scale detection results.
[0073] 2. Model training and optimization 2.1 Training Strategy Use transfer learning technology to fine-tune the pre-trained YOLOv8 model; combine data enhancement techniques such as random rotation, brightness adjustment, and contrast enhancement to improve the generalization ability of the model.
[0074] 2.2 Optimization Methods The AdamW optimizer is used in conjunction with cosine annealing learning rate scheduling to ensure rapid model convergence.
[0075] 2.2.1 Model Initialization Load the YOLOv8 backbone network and detection head.
[0076] Configure training hyperparameters, batch size, initial learning rate, and number of iterations.
[0077] 2.2.2 Configuration Optimizer Use AdamW as the optimizer and set the initial learning rate Weight decay coefficient .
[0078] 2.2.3 Configuring Learning Rate Scheduling Set the cosine annealing scheduler parameters: maximum number of steps Corresponding total number of iterations, minimum learning rate .
[0079] 2.2.4 Training Process (1) At each iteration step: calculate the current learning rate according to the cosine annealing scheduling formula , use AdamW to update the network weights ; (2) Periodically save the model weights and observe the convergence trend.
[0080] 2.3 Verification and Adjustment Monitor the loss and accuracy on the validation set and adjust based on the training performance , .
[0081] 3. Detection and post-processing 3.1 Testing process The fault indicator image to be detected is input into the improved YOLOv8 model, which outputs the bounding box and confidence score of the condensation area.
[0082] 3.1.1 Data Input Provides trained YOLOv8 model and test images.
[0083] The model outputs the detection results for each target, including: Bounding box coordinates:
[0084] Confidence score:
[0085] Category tag: "condensation".
[0086] 3.1.2 Preliminary test results Assume that YOLOv8 outputs candidate boxes, and the detection result of each candidate box is:
[0087] in .
[0088] 3.2 Post-processing strategy Non-Maximum Suppression (NMS) is used to remove duplicate detection results and provide a detailed detection report.
[0089] 3.2.1 NMS Process (1) Confidence sorting, by confidence Sort all candidate boxes in descending order.
[0090] (2) Calculate IoU (intersection over union) for each candidate box and other candidate boxes Calculate the intersection-over-union ratio:
[0091] in: Area The intersection area of two boxes; Area The area of the union of two boxes.
[0092] (3) Remove duplicate boxes and set IoU threshold .like , remove the boxes with lower scores .
[0093] (4) Keep the result: Repeat the above steps until all candidate boxes are processed and finally the non-redundant detection boxes are retained.
[0094] 3.2.2 Test report generation Combined with the above detection and analysis, the detailed content of the condensation area of the fault indicator is generated: 3.2.2.1 Detection results, total number of detected targets.
[0095] The location information and confidence of each target:
[0096] 3.2.2.2 Detection performance indicators: detection accuracy (mAP), recall rate (Recall), and detection speed (FPS).
[0097] Through the above process, the detection and analysis tasks of the condensation area of the fault indicator can be completed efficiently, ensuring the accuracy of the results and providing a reliable basis for subsequent maintenance or repair work.
[0098] Based on the above content, experimental testing and verification are carried out: 1. Dataset construction: First collect samples, such as Figure 1 As shown, 5000 images of the two-remote fault indicator were collected in a laboratory environment, including three typical states: no condensation, slight condensation, and severe condensation; Then, sample annotation is performed, such as Figure 2 As shown in the figure, the condensation area is annotated at the pixel level using professional tools, and the generated annotation file is in YOLO format.
[0099] 2. Model training Experimental environment: The hardware is NVIDIA RTX 3090 GPU, the software is PyTorch deep learning framework, Python3.8; Training process: The dataset is divided into training set (80%), validation set (10%) and test set (10%).
[0100] The initial learning rate is set to 0.001, the batch size is set to 16, and the training is performed for 100 rounds.
[0101] The model performance is evaluated by the mAP (Mean Average Precision) indicator.
[0102] 3. Detection Application (1) Test scenario The improved YOLOv8 model is deployed on edge devices to analyze fault indicator images taken at the power site in real time.
[0103] (2) Test results like Figure 4 As shown in the figure, the experimental results of the improved YOLOv8 model in different scenarios of the remote fault indicator image of part 2 of this embodiment are obtained. The improved YOLOv8 model can complete the processing of a single image within 200ms, with a detection accuracy of 94.8% and a recall rate of 92.5%. In the large-area condensation scenario, the model detection performance is better than other traditional methods.
[0104] The experimental comparison is shown in Table 1 below: Table 1 Comparison of detection performance of each model for the condensation area of the fault indicator
[0105] The experimental results show that the improved YOLOv8 model provided by this embodiment is significantly better than the traditional method in detection accuracy and recall rate, and is close to the original YOLOv8 in speed, meeting the real-time requirements.
[0106] The method for detecting moisture in fault indicators provided in this embodiment effectively improves the detection accuracy of condensation areas in complex scenes by introducing an attention mechanism and a feature fusion module. Based on the lightweight design of YOLOv8, real-time detection can be achieved, which is suitable for online monitoring systems. Experiments show that the improved YOLOv8 model can still maintain high detection performance under conditions of changing lighting, complex backgrounds, and significant differences in target size. This embodiment optimizes the model structure to adapt to the special application scenarios of the remote fault indicator and meet industrial detection needs.
[0107] Therefore, the fault indicator moisture detection method provided in this embodiment has significant practical value and broad market prospects, especially in the field of intelligent detection of power equipment; it can improve the efficiency of power inspection, replace manual inspection, and greatly reduce labor costs and misjudgment rate; ensure equipment safety, quickly identify condensation risks, take protective measures in time, and extend equipment life; it is compatible with a variety of equipment, and by adjusting the model, it can be extended to surface detection of other types of power equipment, such as circuit breakers, insulators, etc.
[0108] like Figure 6 As shown, this embodiment also provides a fault indicator moisture detection system, including: An image acquisition module, used for acquiring an image of a fault indicator; A condensation area detection module is used to input the fault indicator image into the improved YOLOv8 model for target detection, obtain the bounding box and confidence score of the condensation area, and complete the detection of moisture on the fault indicator; In the condensation area detection module, the improved YOLOv8 model adds a CBAM module, an improved loss function and a multi-scale feature fusion module on the basis of the original YOLOv8 model, and the condensation area in the fault indicator image is accurately marked as a training set for training.
[0109] The division of modules in the embodiments of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present invention may be integrated into one processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.
[0110] In this embodiment, a computer device is also provided, which includes a processor and a memory, the memory is used to store a computer program (in this embodiment, the computer program includes a calculation component and an iteration component, which can perform model calculation and model update), the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of a fault indicator moisture detection method.
[0111] This embodiment also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in the computer device and, of course, extended storage media supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of a method for detecting moisture in a fault indicator in the above embodiment.
[0112] This embodiment further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the corresponding steps of the method for detecting moisture in a fault indicator in the above embodiment are implemented.
[0113] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0114] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0115] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0116] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0117] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting moisture in a fault indicator, characterized in that: The following steps are involved: Acquiring fault indicator images; The fault indicator image is input into a pre-trained improved YOLOv8 model, a feature map is first obtained by feature extraction using a CSP module, and then a weight is assigned to each channel and spatial position of the feature map using a CBAM module to obtain a number of enhanced feature maps; After multi-scale feature fusion of the plurality of enhanced feature maps, target detection is performed using the improved YOLOv8 model to obtain a bounding box and a confidence score of the condensation area; Based on the target detection result composed of the bounding box and the confidence score of the condensation area, repeated target detection results are removed by non-maximum suppression to complete the moisture detection of the fault indicator.
2. A method for detecting moisture in a fault indicator according to claim 1, characterized in that: The training steps of the improved YOLOv8 model specifically include: After accurately marking the condensation area of the fault indicator image, the image is divided into a training set and a validation set; The CBAM module is embedded in the output end of the CSP module of the backbone network of the original YOLOv8 model, and a multi-scale feature fusion module is added to the detection head of the original YOLOv8 model. The combination of WIoU and Focal Loss is used as the loss function to obtain the improved YOLOv8 model. The training set is input into the improved YOLOv8 model for training, and back propagation optimization is performed through the loss function, and a pre-trained improved YOLOv8 model is obtained through multiple iterations.
3. A method for detecting moisture in a fault indicator according to claim 2, characterized in that: The step of inputting the training set into the improved YOLOv8 model for training, performing back propagation optimization through the loss function, and iterating multiple times to obtain the pre-trained improved YOLOv8 model specifically includes: The training set is input into the improved YOLOv8 model, a feature map is first obtained by feature extraction using the CSP module, a weight is then assigned to each channel and spatial position of the feature map using the CBAM module, and a plurality of enhanced feature maps are obtained, and target detection is performed after multi-scale feature fusion of the plurality of enhanced feature maps, so as to obtain a prediction box, classification probability and confidence of the condensation area; The error between the predicted box and the real box of the condensation area is calculated by the WIoU; Combined with the classification probability, the error between each predicted category and the true category is calculated by the Focal Loss; Calculating a confidence error of the prediction box according to the confidence; The error between the predicted box and the true box, the error between each predicted category and the true category, and the confidence error are combined according to preset weights to obtain a total loss; The network weights of the improved YOLOv8 model are updated based on the total loss, and the above steps are repeated for iteration until the improved YOLOv8 model converges on the data set and the validation set, thereby obtaining a pre-trained improved YOLOv8 model.
4. A method for detecting moisture in a fault indicator according to claim 1, characterized in that: The step of inputting the fault indicator image into the pre-trained improved YOLOv8 model, first extracting the feature map through the CSP module, and then assigning weights to each channel and spatial position of the feature map through the CBAM module to obtain a plurality of enhanced feature maps specifically includes: Input the fault indicator image into the improved YOLOv8 model, and obtain a feature map through CSP module feature extraction; Performing global average pooling and maximum pooling on the feature map and then inputting it into a fully connected layer to generate channel attention weights; Weighting the feature map channel by channel according to the channel attention weight to obtain an intermediate feature map; The intermediate feature maps are concatenated after global average pooling and maximum pooling along the channel dimension, and spatial weights are generated through a convolutional layer; The intermediate feature maps are weighted position by position according to the spatial weight to obtain a plurality of enhanced feature maps.
5. A method for detecting moisture in a fault indicator according to claim 1, characterized in that: The step of performing multi-scale feature fusion on the plurality of enhanced feature maps specifically includes: After aligning the several enhanced feature maps in the spatial dimension through upsampling or downsampling, weighted summation is performed to obtain a fused feature map.
6. A method for detecting moisture in a fault indicator according to claim 1, characterized in that: The step of removing repeated target detection results by non-maximum suppression specifically includes: sorting the bounding boxes in descending order according to the confidence scores; Calculating the intersection-and-union ratio between each of the bounding boxes and other bounding boxes, and when the intersection-and-union ratio is greater than a preset intersection-and-union ratio threshold, removing the bounding box with a lower confidence score; Repeat the above steps until all bounding boxes are traversed and non-redundant bounding boxes are retained.
7. A fault indicator moisture detection system, characterized in that: include: An image acquisition module, used for acquiring an image of a fault indicator; A feature enhancement module, used for inputting the fault indicator image into a pre-trained improved YOLOv8 model, first extracting features through a CSP module to obtain a feature map, and then assigning weights to each channel and spatial position of the feature map through a CBAM module to obtain a number of enhanced feature maps; A multi-scale feature fusion detection module is used to perform multi-scale feature fusion on the plurality of enhanced feature maps, and then perform target detection through the improved YOLOv8 model to obtain a bounding box and a confidence score of a condensation area; The redundant detection result removal module is used to remove repeated target detection results based on the target detection results composed of the bounding box and confidence score of the condensation area through non-maximum suppression to complete the moisture detection of the fault indicator.
8. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable in the processor, wherein the processor implements the steps of a method for detecting moisture in a fault indicator as claimed in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for detecting moisture in a fault indicator according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that: When the computer program is executed by the processor, it is based on the hardware platform NVIDIA RTX 3090 GPU and the PyTorch deep learning framework Python 3.8 to implement the steps of the fault indicator moisture detection method described in any one of claims 1 to 6.