Power station meter shell damage defect detection method based on positive sample defect comparison

By using the object detection model, diffusion generation model and adaptive sampling step determination mechanism in the damage detection of power station meter shells, and combining with the Dinov2 model to generate heat maps, the problems of low detection efficiency, high cost and weak generalization capabilities in the existing technology are solved, and efficient and accurate damage detection is achieved.

CN119810538APending Publication Date: 2025-04-11SHENZHEN LAIDA SIWEI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411882688.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

The prior art has problems such as low efficiency, high cost, strong human subjectivity and weak generalization ability in the damage detection of power station meter shells, especially under complex backgrounds and uneven light conditions.

Method used

Using a detection method based on positive sample defect comparison, combined with the object detection model, diffusion generation model and adaptive sampling step size determination mechanism, an adaptive spatial feature fusion mechanism was designed, and a heat map was generated through the Dinov2 model to analyze the defect area.

Benefits of technology

It improves detection efficiency and accuracy, can effectively identify the damaged area of ​​the meter shell in complex environments, reduces the false detection and missed detection rates, and provides highly targeted comprehensive judgment capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119810538A_ABST
    Figure CN119810538A_ABST
Patent Text Reader

Abstract

The invention discloses a power station meter shell damage defect detection method based on positive sample defect comparison. According to the method, a target detection model is used to obtain each meter area and meter type, then a diffusion generation algorithm is used as a basic model, a self-adaptive sampling step length determination mechanism and a self-adaptive spatial feature fusion mechanism are designed, and an original diffusion generation model is adapted to a generation model suitable for abnormal defect detection. According to the model, no matter whether a meter image has a shell damage area or not, a meter image without shell damage can be generated, finally, a DinoV2 model with power transformation knowledge is used for obtaining a thermodynamic diagram of a defect area, and finally analysis and judgment are obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a method for detecting damaged defects of power station meter casings based on positive sample defect comparison. Background Art

[0002] In substations, metering equipment is the core monitoring and control component, and its stable operation is crucial.

[0003] As an important barrier to protect the precision components inside, the meter casing must have good sealing and weather resistance. However, due to long-term exposure to complex environments such as high temperature, humidity, rain, wind and sand, the meter casing is often damaged due to aging, mechanical impact and other reasons, which may cause a series of electrical safety hazards. For example, rain or moisture penetrates into the meter through the damaged parts, causing circuit short circuits, component corrosion, and even serious faults such as leakage, which not only endangers the operation of the equipment itself, but also may pose a threat to the surrounding environment and personnel safety. At the same time, the sealing of the damaged casing decreases, and dust, fine particles or corrosive gases are more likely to invade, further damaging the precision components inside the meter, causing monitoring errors or equipment failure, thereby affecting the normal operation of the power supply system. In addition, cracks in the casing will reduce the meter's ability to adapt to environmental changes, and it will be difficult to withstand extreme temperature differences or long-term exposure to bad weather, resulting in accelerated equipment aging and a significant shortening of its service life, increasing operation and maintenance costs and the risk of power outages.

[0004] Traditional defect detection methods mainly rely on manual inspections, which have problems such as low efficiency, high cost, and strong human subjectivity. In addition, although there have been automated solutions based on target detection in recent years, these solutions are often limited to "detecting damaged areas" itself, and often need to rely on large defect images, and cannot provide comparative analysis before and after repair, lacking targeted comprehensive judgment capabilities.

[0005] At present, the technical solutions for detecting damage to the casing of substation meters are mainly divided into the following two categories: manual detection and detection methods based on machine vision. Although these two methods have achieved the identification of meter defects to a certain extent, there are still significant technical bottlenecks.

[0006] Manual inspection is a traditional method for identifying damaged substation meter casings. Operation and maintenance personnel usually use visual inspection or manual touch to determine whether the meter has cracks, damage or deformation. This method is highly flexible, and inspectors can adjust the inspection method according to actual conditions, such as close observation in low light or identification of minor damage by touch. It does not require complex equipment support and has a low initial cost. However, manual inspection is inefficient. Faced with a large number of widely distributed meters, it takes a lot of time and manpower to check them one by one. At the same time, its accuracy is greatly affected by the experience of the inspectors and the environment at the time, and it is easy to miss inspections or misjudgments. In addition, manual inspection results are difficult to accurately quantify and lack visual records, which cannot provide effective support for subsequent trend analysis or maintenance plans.

[0007] Machine vision methods use target detection models (such as YOLO, Faster R-CNN, etc.) or image segmentation technology to achieve automated detection of meter casing damage. Its implementation generally includes collecting on-site meter images, using deep learning models to mark damaged areas, and generating visual inspection reports. This method can quickly process a large number of images, significantly improve detection efficiency, and does not require human intervention, making it suitable for large-scale deployment. In addition, machine vision technology can provide intuitive detection results and generate clearly labeled visual reports, which is helpful for subsequent maintenance work. However, this method has poor adaptability to the environment and is prone to false detection or missed detection under conditions such as complex backgrounds and uneven lighting. At the same time, its strong detection ability depends on a large number of defect samples, and its generalization ability is weak in the face of unseen forms of damage. For subtle defects such as slight cracks or edge damage, the detection sensitivity is also insufficient. In addition, the existing machine vision methods lack a verification mechanism and cannot perform recovery analysis or further confirmation of the detection results, which limits their reliability and accuracy in practical applications.

[0008] Therefore, the prior art has defects and needs to be improved. Summary of the invention

[0009] The technical problem to be solved by the present invention is to provide a method for detecting damaged defects in power station meter casings based on positive sample defect comparison, to solve the problem that the existing diffusion model cannot be adapted to defect detection, and to solve the deficiency that the sampling steps of the existing diffusion model are fixed for each object.

[0010] The technical solution of the present invention is as follows: a method for detecting damaged defects of power station meter casings based on positive sample defect comparison is provided, comprising the following steps.

[0011] S1: Acquire a power station image.

[0012] S2: Input the power station image into the object detection model.

[0013] S3: The target detection model determines whether there is a meter; if not, the process ends; if so, the process proceeds to step S4.

[0014] S4: Crop the meter image to obtain the meter image.

[0015] S5: Input the meter image into the diffusion generation model; adopt the adaptive sampling step size determination mechanism to process the meter image.

[0016] S6: Get the generated image.

[0017] S7: Input the meter image and the generated image into the comparison model for comparison.

[0018] S8: Obtain inference results.

[0019] The specific mechanism for determining the adaptive sampling step length is as follows: Gaussian noise G is added to the image feature map of the meter image to obtain Z t , Z t Input into the diffusion model to get the predicted noise D t , Z t Subtract D t Get the output Z at time t-1 D t-1 ; Then pass the noise G at time t-1 t Get Z t-1 Output; then restore the two images and use the dinov2 model to get the score F of the difference between the two images score If it is greater than the preset threshold thres, the denoising process is terminated and the heat map and the label (0,1) of whether there is a shell defect are output, where 0 represents no defect and 1 represents a defect; if there is no F score If it is not greater than thres, the previous operation will continue until the preset maximum step length is reached and the process will be terminated.

[0020] The number of denoising steps required for different areas in the meter image is also different, and the spatial adaptive feature fusion mechanism is used for processing; specifically, the denoising step length used to gradually denoise the defective area and restore it to the normal area must be larger than that of the area without defects, and the noise is regionally weighted by using the heat map obtained by the Dinov2 comparison model; the specific formula is as follows:

[0021]

[0022] in refers to the latent space feature at this moment, m is the comparison heat map, and They refer to the latent space features of the original image with noise at time t and the latent space feature map after noise at time t.

[0023] The Dinov2 comparison model is obtained by removing the Patch Embed layer of the Dinov2 model and replacing it with a convolutional layer with an input channel of 4. The rest is consistent with the original Dinov2 model. The Dinov2 comparison model is then trained using the power station database.

[0024] The process of obtaining the heat map is as follows: We use Dinov2 to extract the multi-layer feature map F of the intermediate variables in the latent space l , then the abnormal heat map M l You can use cosine similarity:

[0025]

[0026] Where (i, j) is the coordinate position,<x,y> is the similarity cosine degree between x and y and each element, min represents the minimum value in the result matrix; finally, the abnormal heat map M can be the abnormal heat map M of each layer l Adding them together gives:

[0027]

[0028] After getting the abnormal heat map M, define its score F score It is the average of the top K scores of the entire image, where Top k refers to the first K elements in the anomaly heat map M after all the numbers are sorted in descending order. K is a custom parameter, indicating how many elements to take.

[0029] Using Latent Diffusion as the basis for the normal sample diffusion generation model, the noise diffusion and noise removal operations during generation are performed in the latent space rather than the original image.

[0030] The original RGB image input size of the diffusion generation model is 512x 512x 3. After using the encoder, the variable size in the latent space is 64x 64x 4. The size of the matrix is ​​much smaller than the original image, which can reduce the deployment cost of the diffusion generation model and increase the speed of image generation.

[0031] The diffusion generative model is a generative model based on a probability model. It generates data by simulating the gradual evolution of an image from noise to an image. Specifically, it gradually "erodes" a real image into pure noise by adding noise, and then learns how to restore the original image from pure noise.

[0032] The diffusion generation process is described by a forward diffusion process and a reverse generation process.

[0033] Forward diffusion process: gradually add noise to the image, and finally generate a pure Gaussian noise image; this process is a Markov process, which is divided into T steps, and gradually introduces noise; specifically, the image x in each step t They are all the previous step images plus some noise, the formula is:

[0034]

[0035] where ∈ t is the noise added at each step, α t is a hyperparameter that controls the noise intensity.

[0036] The goal of the reverse generation process is to gradually restore the original image from the pure noise image through reverse operations. This process uses a neural network to predict the content of each step to remove noise and finally generate a clear image. Each step of the reverse generation process is opposite to the forward diffusion process, that is, gradually denoising and restoring the original image information. The formula is:

[0037]

[0038] Among them, ∈ θ (x t ,t) is the noise predicted by the neural network model, α t is a hyperparameter that controls the strength of denoising.

[0039] In the diffusion generation model, the denoising effect is achieved through neural network learning in the reverse process; the training process is to let the diffusion generation model learn how to restore the structure of the original image from the noisy image; when generating new samples, the diffusion generation model starts from a pure noise image and gradually restores the target sample through reverse denoising.

[0040] By adopting the above scheme, the present invention provides a method for detecting damaged shell defects of power station meters based on positive sample defect comparison. First, the target detection model is used to obtain each meter area and meter type, and then the diffusion generation algorithm is used as the basic model. An adaptive sampling step determination mechanism and an adaptive spatial feature fusion mechanism are designed to adapt the original diffusion generation model to a generation model suitable for abnormal defect detection. This model can generate a meter image without damaged shell regardless of whether the meter image has a damaged shell area. Finally, the DinoV2 model with substation knowledge is used to obtain a thermal map of the defect area, and finally an analysis and judgment is obtained. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 is a flow chart of the method of the present invention;

[0042] Figure 2 A flow chart of the mechanism for determining the adaptive sampling step size;

[0043] Figure 3 This is an example of using an adaptive sampling step size determination mechanism;

[0044] Figure 4 A schematic diagram of the framework for the diffusion generation model. DETAILED DESCRIPTION

[0045] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0046] See also Figure 1-Figure 3 The present invention provides a method for detecting damaged defects of power station meter casings based on positive sample defect comparison, which includes the following steps.

[0047] S1: Acquire a power station image.

[0048] S2: Input the power station image into the object detection model.

[0049] S3: The target detection model determines whether there is a meter; if not, the process ends; if so, the process proceeds to step S4.

[0050] S4: Crop the meter image to obtain the meter image.

[0051] S5: Input the meter image into the diffusion generation model; adopt the adaptive sampling step size determination mechanism to process the meter image.

[0052] S6: Get the generated image.

[0053] S7: Input the meter image and the generated image into the comparison model for comparison.

[0054] S8: Obtain inference results.

[0055] The specific mechanism for determining the adaptive sampling step length is as follows: Gaussian noise G is added to the image feature map of the meter image to obtain Z t , Z t Input into the diffusion model to get the predicted noise D t , Z t Subtract D t Get the output Z at time t-1 D t-1 ; Then pass the noise G at time t-1 t Get Z t-1 Output; then restore the two images and use the dinov2 model to get the score F of the difference between the two images score If it is greater than the preset threshold thres, the denoising process is terminated and the heat map and the label (0,1) of whether there is a shell defect are output, where 0 represents no defect and 1 represents a defect; if there is no F scoreIf it is not greater than thres, the previous operation will continue until the preset maximum step length is reached and the process will be terminated.

[0056] The number of denoising steps required for different areas in the meter image is also different, and the spatial adaptive feature fusion mechanism is used for processing; specifically, the denoising step length used to gradually denoise the defective area and restore it to the normal area must be larger than that of the area without defects, and the noise is regionally weighted by using the heat map obtained by the Dinov2 comparison model; the specific formula is as follows:

[0057]

[0058] in refers to the latent space feature at this moment, m is the comparison heat map, and They refer to the latent space features of the original image with noise at time t and the latent space feature map after noise at time t.

[0059] The Dinov2 comparison model is obtained by removing the Patch Embed layer of the Dinov2 model and replacing it with a convolutional layer with an input channel of 4. The rest is consistent with the original Dinov2 model. The Dinov2 comparison model is then trained using the power station database.

[0060] The process of obtaining the heat map is as follows: We use Dinov2 to extract the multi-layer feature map F of the intermediate variables in the latent space l , then the abnormal heat map M l You can use cosine similarity:

[0061]

[0062] Where (i, j) is the coordinate position,<x,y> is the similarity cosine degree between x and y and each element, min represents the minimum value in the result matrix; finally, the abnormal heat map M can be the abnormal heat map M of each layer l Adding them together gives:

[0063]

[0064] After getting the abnormal heat map M, define its score F score is the average of the top K scores of the entire graph.

[0065] Using Latent Diffusion as the basis for the normal sample diffusion generation model, the overall structure is as follows Figure 4 As shown, the noise diffusion and noise removal operations during generation are performed in the latent space rather than the original image.

[0066] The original RGB image input size of the diffusion generation model is 512x 512x 3. After using the encoder, the variable size in the latent space is 64x 64x 4. The size of the matrix is ​​much smaller than the original image, which can reduce the deployment cost of the diffusion generation model and increase the speed of image generation.

[0067] The diffusion generative model is a generative model based on a probability model. It generates data by simulating the gradual evolution of an image from noise to an image. Specifically, it gradually "erodes" a real image into pure noise by adding noise, and then learns how to restore the original image from pure noise.

[0068] The diffusion generation process is described by a forward diffusion process and a reverse generation process.

[0069] Forward diffusion process: gradually add noise to the image, and finally generate a pure Gaussian noise image; this process is a Markov process, which is divided into T steps, and gradually introduces noise; specifically, the image x in each step t They are all the previous step images plus some noise, the formula is:

[0070]

[0071] where ∈ t is the noise added at each step, α t is a hyperparameter that controls the noise intensity.

[0072] The goal of the reverse generation process is to gradually restore the original image from the pure noise image through reverse operations. This process uses a neural network to predict the content of each step to remove noise and finally generate a clear image. Each step of the reverse generation process is opposite to the forward diffusion process, that is, gradually denoising and restoring the original image information. The formula is:

[0073]

[0074] Among them, ∈ θ (x t ,t) is the noise predicted by the neural network model, α t is a hyperparameter that controls the strength of denoising.

[0075] In the diffusion generation model, the denoising effect is achieved through neural network learning in the reverse process; the training process is to let the diffusion generation model learn how to restore the structure of the original image from the noisy image; when generating new samples, the diffusion generation model starts from a pure noise image and gradually restores the target sample through reverse denoising.

[0076] In summary, the present invention provides a method for detecting damaged shell defects of power station meters based on positive sample defect comparison. First, the target detection model is used to obtain each meter area and meter type. Then, the diffusion generation algorithm is used as the basic model, and an adaptive sampling step determination mechanism and an adaptive spatial feature fusion mechanism are designed to adapt the original diffusion generation model to a generation model suitable for abnormal defect detection. This model can generate a meter image without damaged shell regardless of whether the meter image has a damaged shell area. Finally, the DinoV2 model with substation knowledge is used to obtain a thermal map of the defect area, and finally an analysis and judgment is obtained.

[0077] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for detecting damage defects in power station meter casings based on positive sample defect comparison, characterized in that: The following steps are involved: S1: Acquire power station image; S2: Input the power station image into the object detection model; S3: The target detection model determines whether there is a meter; if not, the process ends; if so, the process proceeds to step S4; S4: cropping the meter image to obtain a meter image; S5: inputting the meter image into the diffusion generation model; Adopting adaptive sampling step size determination mechanism to process meter images; S6: Get the generated image; S7: inputting the meter image and the generated image into the comparison model for comparison; S8: Obtain inference results; The specific mechanism for determining the adaptive sampling step length is as follows: Gaussian noise G is added to the image feature map of the meter image to obtain Z t , Z t Input into the diffusion model to get the predicted noise D t , Z t Subtract D t Get the output Z at time t-1 D t-1 ; Then pass the noise G at time t-1 t Get Z t-1 Output; then restore the two images and use the dinov2 model to get the score F of the difference between the two images score If it is greater than the preset threshold thres, the denoising process is terminated and the heat map and the label (0,1) of whether there is a shell defect are output, where 0 represents no defect and 1 represents a defect; if there is no F score If it is not greater than thres, the previous operation will continue until the preset maximum step length is reached and the process will be terminated.

2. A method for detecting damage defects of power station meter casings based on positive sample defect comparison according to claim 1, characterized in that: The number of denoising steps required for different areas in the meter image is also different, and the spatial adaptive feature fusion mechanism is used for processing; specifically, the denoising step length used to gradually denoise the defective area and restore it to the normal area must be larger than that of the area without defects, and the noise is regionally weighted by using the heat map obtained by the Dinov2 comparison model; the specific formula is as follows: in refers to the latent space feature at this moment, m is the comparison heat map, and They refer to the latent space features of the original image with noise at time t and the latent space feature map after noise at time t.

3. The method for detecting damage defects of power station meter casings based on positive sample defect comparison according to claim 1 is characterized in that: The Dinov2 comparison model is obtained by removing the Patch Embed layer of the Dinov2 model and replacing it with a convolutional layer with an input channel of 4. The rest is consistent with the original Dinov2 model. The Dinov2 comparison model is then trained using the power station database.

4. A method for detecting damage defects in power station meter casings based on positive sample defect comparison according to claim 3, characterized in that: The process of obtaining the heat map is as follows: We use Dinov2 to extract the multi-layer feature map F of the intermediate variables in the latent space l , then the abnormal heat map M l You can use cosine similarity: Where (i, j) is the coordinate position, (x, y) is the similarity cosine between x and y and each element, and min represents the minimum value in the result matrix; finally, the abnormal heat map M can be the abnormal heat map M of each layer l Adding them together gives: After getting the abnormal heat map M, define its score F score is the average of the top K scores of the entire graph.

5. The method for detecting damage defects of power station meter casings based on positive sample defect comparison according to claim 1 is characterized in that: Using Latent Diffusion as the basis for the normal sample diffusion generation model, the noise diffusion and noise removal operations during generation are performed in the latent space rather than the original image.

6. A method for detecting damage defects in power station meter casings based on positive sample defect comparison according to claim 5, characterized in that: The original RGB image input size of the diffusion generation model is 512x512x3. After using the encoder, the variable size in the latent space is 64x64x4. The size of the matrix is ​​much smaller than the original image, which can reduce the deployment cost of the diffusion generation model and increase the speed of image generation.

7. The method for detecting damage defects of power station meter casings based on positive sample defect comparison according to claim 1 is characterized in that: The diffusion generative model is a generative model based on a probability model. It generates data by simulating the gradual evolution of an image from noise to an image. Specifically, it gradually "erodes" a real image into pure noise by adding noise, and then learns how to restore the original image from pure noise.

8. The method for detecting damage defects of power station meter casings based on positive sample defect comparison according to claim 7 is characterized in that: The diffusion generation process is described by the forward diffusion process and the reverse generation process; Forward diffusion process: gradually add noise to the image, and finally generate a pure Gaussian noise image; this process is a Markov process, which is divided into T steps, and gradually introduces noise; specifically, the image x in each step t They are all the previous step images plus some noise, the formula is: where ∈ t is the noise added at each step, α t is a hyperparameter that controls the noise intensity; The goal of the reverse generation process is to gradually restore the original image from the pure noise image through reverse operations. This process uses a neural network to predict the content of each step to remove noise and finally generate a clear image. Each step of the reverse generation process is opposite to the forward diffusion process, that is, gradually denoising and restoring the original image information. The formula is: Among them, ∈ θ (x t ,t) is the noise predicted by the neural network model, α t is a hyperparameter that controls the strength of denoising.

9. A method for detecting damage defects in power station meter casings based on positive sample defect comparison according to claim 8, characterized in that: In the diffusion generation model, the denoising effect is achieved through neural network learning in the reverse process; The training process is to let the diffusion generative model learn how to recover the structure of the original image from the noisy image; when generating new samples, the diffusion generative model starts from a pure noise image and gradually recovers the target sample through reverse denoising.