Insulator breakage detection method, device and electronic equipment
By combining damaged target detection and watermark localization models, a watermark mask is generated and watermark interference is removed, solving the problem of distinguishing watermarks from damage states in insulator inspection images, improving detection accuracy and stability, and ensuring power grid safety.
Patent Information
- Application Number
- CN202511303760.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing technologies struggle to accurately distinguish between camera watermarks and damage conditions in insulator inspection images, leading to false detections and erroneous alarms that affect the safe operation of the power grid.
A combination of a damaged target detection model and a watermark localization model is used to generate a watermark mask. The presence of a damaged area is determined by cross-union ratio (CUI), and the image is processed in the watermark area removal model to ensure detection accuracy.
It improves the accuracy of insulator damage detection, reduces false alarms caused by watermark interference, and enhances the safe and stable operation of the power system.
Smart Images

Figure CN120807518B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image detection technology, and in particular to a method, apparatus and electronic device for detecting insulator damage. Background Technology
[0002] In power systems, insulators, as key components connecting high-voltage transmission lines, play a crucial role in connecting conductors at different potentials and providing insulation, fixation, and suspension. Their performance directly affects the safe and stable operation of the power grid. Because insulators operate under harsh environments such as strong sunlight, high-voltage electric fields, and large temperature and humidity fluctuations, they are susceptible to contamination, aging, and cracking, leading to a decline in their insulation performance. Especially in high-voltage transmission, insulator breakage seriously threatens the safe operation of the power system.
[0003] In actual substations, insulators are mostly located at high positions, requiring real-time monitoring via cameras. However, during comprehensive inspections, the white watermarks (such as camera time and equipment number) often overlap with the insulators. These white watermarks are easily confused with the white core of damaged insulators, making them difficult to distinguish. Therefore, using only target detection algorithms for insulator damage detection is insufficient to differentiate between the watermark attachment state and the damage state, easily leading to false detections and sending erroneous alarm messages to the power grid inspection system, interfering with its normal operation. Therefore, timely and accurate detection of insulator damage is crucial for ensuring the safe operation of the power grid system. Summary of the Invention
[0004] This application aims to at least solve the technical problems existing in the prior art and provide an insulator damage detection method, device and electronic equipment.
[0005] In a first aspect, this application provides an insulator damage detection method, the method comprising: acquiring an insulator inspection image; processing the insulator inspection image using a damage target detection model to obtain a first detection result; processing the insulator inspection image using a watermark positioning model to obtain watermark region location information of the insulator inspection image; generating a watermark mask based on the watermark region location information; wherein, the pixel value of the watermark pixel in the watermark mask is a first pixel value, and the pixel value of the non-watermark pixel is a second pixel value; when the intersection-exchange ratio between the insulator damage region and the watermark region in the watermark mask in the first detection result is less than a preset overlap threshold, performing: inputting the watermark mask and the insulator inspection image to a watermark removal model to obtain a watermark-removed image;
[0006] The watermark-removed image is processed using a damaged target detection model to obtain a second detection result, which is then output.
[0007] Secondly, this application provides an insulator damage detection device for implementing the method provided in the first aspect of this application. The device includes: an image acquisition module for acquiring an insulator inspection image; a first detection result acquisition module for processing the insulator inspection image using a damage target detection model to obtain a first detection result; a watermark region determination module for processing the insulator inspection image using a watermark positioning model to obtain watermark region location information of the insulator inspection image; a watermark mask generation module for generating a watermark mask based on the watermark region location information; wherein the pixel value of the watermark pixel in the watermark mask is a first pixel value, and the pixel value of the non-watermark pixel in the watermark mask is a second pixel value; and a detection result acquisition module that, when the intersection-exchange ratio between the insulator damage region and the watermark region in the watermark mask in the first detection result is less than a preset overlap threshold, performs the following: inputting the watermark mask and the insulator inspection image to a watermark removal model to obtain a watermark-removed image; processing the watermark-removed image using the damage target detection model to obtain a second detection result, and outputting the second detection result.
[0008] Thirdly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first aspect of this application.
[0009] Fourthly, this application provides an electronic device comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method described in the first aspect of this application.
[0010] The beneficial technical effects of this application are as follows: First, the insulator inspection image is processed using a damaged target detection model to obtain a first detection result. When the first detection result includes at least one damaged insulator area, to avoid false detection caused by confusion between the camera watermark and the white kernel when the insulator is damaged, the insulator inspection image is processed using a watermark positioning model to obtain the watermark area location information. Then, a watermark mask is generated based on the watermark area location information. The watermark mask distinguishes watermark pixels from non-watermark pixels using pixel values. The cross-union ratio (CUIR) between the watermark area composed of watermark pixels and the damaged insulator area in the first detection result is calculated. When the CUIR is greater than or equal to a preset overlap threshold, it indicates that the damaged insulator area in the first detection result is highly likely to be a watermark, and no damage is output. When the CUIR is less than the preset overlap threshold, it is considered that there is a high probability of insulator damage. At this time, in order to improve the detection accuracy and avoid the interference of the watermark on the detection result, a watermark-removed image is generated based on the watermark mask after removing the text watermark from the insulator inspection image. Finally, the watermark-removed image is processed using the damaged target detection model to obtain and output a second detection result.
[0011] As can be seen, this application provides a detection scheme that can accurately identify the status of insulators even when watermarks are present, reducing the loss of insulator information caused by watermarks, effectively avoiding false alarms of insulator defects, improving the accuracy and stability of insulator defect detection, and providing strong protection for the safe and stable operation of the power system. Attached Figure Description
[0012] Figure 1 This is a flowchart illustrating a preferred embodiment of the insulator damage detection method of the present invention;
[0013] Figure 2 This is a flowchart illustrating the insulator damage detection method in another preferred embodiment of the present invention;
[0014] Figure 3 This is a flowchart of insulator damage detection in one example of the present invention;
[0015] Figure 4 This is a schematic diagram of the structure of a text detection network in a preferred embodiment of the present invention;
[0016] Figure 5 This is a schematic diagram of the training framework of the watermark positioning model in a preferred embodiment of the present invention;
[0017] Figure 6 This is a schematic diagram of the structure of an electronic device in a preferred embodiment of the present invention. Detailed Implementation
[0018] Embodiments of the present invention are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and should not be construed as limiting the present invention.
[0019] In the description of this invention, it should be understood that the terms "longitudinal", "lateral", "up", "down", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.
[0020] In the description of this invention, unless otherwise specified and limited, it should be noted that the terms "installation", "connection" and "linking" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two components. They can be direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0021] The insulator damage detection method provided by this invention can be executed by at least one of the following electronic devices: a server, a terminal, or other electronic devices that can be configured to execute the insulator damage detection method provided in this application. In other words, the insulator damage detection method can be executed by software or hardware installed on a terminal device or a server device; the software can be a blockchain platform. The server includes, but is not limited to: a single server, a server cluster, a cloud server, or a cloud server cluster. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0022] This invention provides a method for detecting insulator damage. In a preferred embodiment, please see... Figure 1 and Figure 2 The method includes:
[0023] Step S1: Obtain insulator inspection images.
[0024] In this embodiment, multiple insulator monitoring areas are set up in the substation. During inspections, cameras or drones fixed to each monitoring area capture inspection videos of each area. Frame extraction is performed on these videos to obtain multiple insulator inspection images. Specifically, the entity executing the insulator damage detection method can read insulator inspection images from a database, or it can acquire insulator inspection images in real time from the cameras fixed to the monitoring areas or from the drone cameras.
[0025] Step S2: Process the insulator inspection image using the damaged target detection model to obtain the first detection result.
[0026] In this embodiment, the damaged target detection model preferably uses, but is not limited to, existing YOLO series networks, such as YOLOv8x (an existing target detection network). YOLO is an abbreviation for You Only Look Once, a real-time target detection network. A target detection sample set is pre-constructed. The target detection sample includes an insulator inspection image and the corresponding detection label. The detection label includes the damage category of the damaged target area in the insulator inspection image, as well as the detection box position information of each damaged target area. Damage categories include insulator cracks, insulator spontaneous explosion, pollution discharge traces, surface contamination, creepage traces, and glaze detachment. The network of the damaged target detection model is iteratively trained using the target detection sample set. During training, the cross-entropy loss is calculated based on the detection results of the damaged target detection model and the detection labels of the samples. The network parameters of the damaged target detection model are updated using gradient descent based on the cross-entropy loss until the training times reach the preset maximum number of training iterations, at which point training ends, and the damaged target detection model is obtained.
[0027] In this embodiment, to effectively capture various possible damage features and improve the accuracy and generalization ability of identifying insulator damage, the target detection sample set preferably includes multiple positive samples and multiple negative samples. Positive samples represent insulator inspection images where there is actually one or more damaged targets (one damaged target corresponds to one damaged area of the insulator), and negative samples represent insulator inspection images where there are actually no damaged targets (i.e., damaged areas of the insulator).
[0028] In this embodiment, the first detection result includes detection information for at least one damaged target, or is normal (indicating that the insulator in the insulator inspection image is undamaged, i.e., there is no damaged target or no damaged area of the insulator). The detection information for each damaged target includes the damage category (external insulator crack damage, insulator spontaneous explosion, contamination discharge traces, surface contamination, creepage traces, or glaze flaking), the confidence probability of the damage category, and the damaged area of the insulator corresponding to the damaged target (i.e., the detection frame location information of the damaged target). If there is no damaged target in the insulator inspection image, the output is normal, or the output is as follows: Figure 3 The second detection result in the example shown is unmarked in the insulator inspection image.
[0029] Step S3: Process the insulator inspection image using the watermark positioning model to obtain the watermark area location information of the insulator inspection image.
[0030] In this embodiment, the watermark localization model is not limited to the text detection network of existing OCR (Optical Character Recognition) models, such as the text detection network of PP-OCRv3. PP-OCRv3 is the third version of a practical, ultra-lightweight OCR model launched by the Baidu team, and its full name is Paddle-PipelineOCR v3. Preferably, to extract the watermark region location information with higher accuracy, the text detection network of PP-OCRv3 has been improved, such as... Figure 4 As shown, the PP-LCNetV3 network replaces the original MobileNetv3 backbone network in PP-OCRv3 to improve feature extraction capabilities. PP-LCNetV3 (PaddlePaddle Lightweight CPU Network Version 3) is the third version of a lightweight convolutional neural network series released by Baidu, and it is a backbone network. MobileNetv3 is a lightweight convolutional neural network series released by Google. Specifically, the watermark region location information in the insulator inspection image includes the coordinates of the top-left and bottom-right corners of the watermark detection box. Figure 3 The image shows a visual example of a watermark detection box.
[0031] Step S4: Generate a watermark mask based on the watermark region location information; wherein, the pixel value of the watermark pixel in the watermark mask is the first pixel value, and the pixel value of the non-watermark pixel is the second pixel value. The first pixel value is not equal to the second pixel value; the first pixel value can be the pixel value of a white pixel, and the second pixel value can be the pixel value of a black pixel.
[0032] In this embodiment, from Figure 3 In the example shown, watermarks such as "September 7, 2024", "Saturday", and "18:08:46" can be seen in the insulator inspection image. These watermarks are mainly white or black. Therefore, the preset watermark pixel value condition is that the pixel value of a pixel is equal to or close to the pixel value of a black pixel or a white pixel. Therefore, step S4 includes: extracting the watermark region image from the insulator inspection image based on the watermark region location information; and obtaining a watermark mask using OpenCV image processing methods combined with the preset watermark pixel value condition. Figure 3 The example provided shows a watermark mask where the watermark is represented by white pixels and the non-watermark areas by black pixels. OpenCV stands for Open Source Computer Vision Library.
[0033] In this embodiment, non-watermark pixels that are white or nearly white, and non-watermark pixels that are black or nearly black, in the watermark area image may become noise pixels during the watermark mask generation process, introducing interference. To reduce the impact of these noise pixels, step S4 preferably includes:
[0034] Step S4a: Extract the watermark region image from the insulator inspection image based on the watermark region location information; perform text recognition on the watermark region image to obtain multiple recognized characters;
[0035] Step S4b: Obtain the initial watermark mask by processing as follows: Pixels in the watermark region image whose pixel values meet the preset watermark pixel value conditions are designated as watermark pixels, and the pixel values of the watermark pixels are assigned as the first pixel value; Pixels in the watermark region image whose pixel values do not meet the preset watermark pixel value conditions are designated as non-watermark pixels, and the pixel values of the non-watermark pixels are assigned as the second pixel value; thus obtaining the initial watermark mask.
[0036] Step S4c involves transforming each identified character into the font and size of the watermark in the camera image, obtaining a text template for each identified character. Each text template is then aligned with its corresponding character in the initial watermark mask. Watermark pixels outside the aligned area in the initial watermark template are deleted, and missing watermark pixels within the aligned area are filled in. This effectively corrects the initial watermark mask using the text template, resulting in the final watermark mask. This process eliminates interference from noisy pixels and improves the accuracy of subsequent damage detection.
[0037] Step S5: When the cross-over ratio between the damaged insulator area and the watermark area in the watermark mask in the first detection result is less than a preset overlap threshold, that is, when the cross-over ratio between the damaged insulator area (the area determined by the damaged target detection box position information) and the watermark area in the watermark mask in at least one of the damaged targets in the first detection result is less than the preset overlap threshold, execute:
[0038] Step S51: Input the watermark mask and the insulator inspection image into the watermark removal model to obtain the watermark-removed image. Specifically: The watermark removal model includes an image segmentation unit and an image inpainting model; the image segmentation unit uses the watermark mask to segment the image to be repaired from the insulator inspection image that lacks the watermark (i.e., segments out the region composed of all non-watermark pixels); the image inpainting model uses a deep learning-based image inpainting network to process the image to be repaired to obtain the watermark-removed image.
[0039] Step S52: Process the watermark-removed image using the damaged target detection model to obtain a second detection result, and output the second detection result. The second detection result includes detection information for at least one damaged target or is normal (indicating that the insulator in the insulator inspection image is undamaged).
[0040] Preferably, step S5 further includes: when the overlap ratio between the damaged insulator area and the watermark area in the watermark mask in the first detection result is greater than or equal to a preset overlap threshold, that is, when the overlap ratio between the damaged insulator area and the watermark area in the watermark mask of all damaged targets in the first detection result is greater than or equal to the preset overlap threshold, or when the first detection result is normal, then step S53 is executed, and step S53 is: prompt no damage.
[0041] In this embodiment, the preset overlap threshold can be set empirically, and is not limited to 0.5 or 0.6. Steps S51 and S52 are used to remove the watermark while preserving the insulator area around the watermark, thereby reducing false alarms in insulator detection caused by watermark issues and improving the utilization rate of features in the image.
[0042] In this embodiment, please refer to Figure 1 and Figure 2 Steps S3 and S4 constitute the watermark mask generation step, and step S2 and the watermark mask generation step can be described as follows: Figure 2 The parallel execution shown can be performed, or step S2 can be executed first, followed by the watermark mask generation step, as shown below. Figure 1 As shown, or, the watermark mask generation step can be performed first and then step S2 can be performed, which is not limited in this invention.
[0043] In this embodiment, the watermark region in the watermark mask is the area composed of all watermark pixels in the watermark mask, such as... Figure 3 In the given watermark mask example, the watermark area is the region composed of all white pixels.
[0044] In this embodiment, for ease of implementation, the insulator damage area in the first detection result refers to the area selected by the detection frame of the damaged target. There may be more than two damaged targets in the first detection result; in this case, step S5 is executed separately for each damaged target.
[0045] In this embodiment, the image inpainting model in the watermark removal model can employ an existing deep learning-based image inpainting network. For example, the DeepFillv2 network (a gated convolution-based freeform image inpainting network (second generation)) can be selected, which includes a generator and a discriminator. The training process of the image inpainting model includes:
[0046] (1) Collect multiple watermark-free original insulator inspection images covering various states and backgrounds of insulators. Construct a sample pair set based on the original insulator inspection images. Each sample pair includes the original insulator inspection image and the corresponding image to be repaired. The process of obtaining the image to be repaired corresponding to the original insulator inspection image is as follows: inject a watermark into the original insulator inspection image to obtain a watermarked inspection image by means of text watermark injection. Obtain the watermark mask of the watermarked inspection image according to the above steps S3 and S4. Use the watermark mask to segment the image to be repaired that is missing the watermark from the original insulator inspection image. Divide the sample pair set into a training set, a test set, and a validation set.
[0047] (2) Construct the DeepFillv2 network. The DeepFillv2 network includes a generator and a discriminator. The generator generates a reconstructed image without watermark based on the image to be repaired. The discriminator is used to determine whether the reconstructed image comes from the original insulator inspection image.
[0048] (3) Use the samples in the training set to iteratively train the DeepFillv2 network and update the network parameters until the preset maximum number of training iterations is reached.
[0049] (4) Use the samples of the test set and validation set to test and validate the DeepFillv2 network generator obtained in step (3). If the test and validation are passed, use the trained generator as the image inpainting model. If the test or validation is not passed, adjust the training parameters and return to continue executing steps (3) and (4).
[0050] To significantly improve the watermark positioning accuracy of the watermark positioning model, effectively eliminate text interference in non-defect areas, ensure the reliability of insulator defect detection, and accelerate the training efficiency of the watermark positioning model, in a preferred embodiment, the training method of the watermark positioning model includes:
[0051] Step A1: Construct the first student model and the second student model using a pre-set text detection network, and determine the teacher model.
[0052] In this embodiment, both the first student model and the second student model employ a preset text detection network. The preset text detection network can be a text detection network from the existing PP-OCRv3 network. Preferably, to improve feature extraction capabilities, the preset text detection network uses... Figure 4 The image shows the text detection network obtained by replacing the original MobileNetv3 backbone network in PP-OCRv3 with the PP-LCNetV3 network. The teacher model is the pre-trained text detection network in the PP-OCRv3 model.
[0053] Step A2: Using the teacher model, train the first student model and the second student model using a collaborative learning method. When the training stops, select either the first student model or the second student model as the watermark localization model. The training stopping condition is not limited to reaching the preset maximum number of training rounds.
[0054] In this embodiment, step A2 includes:
[0055] Step A21: Collect multiple original inspection images with watermarks covering various states and backgrounds of the insulators. Watermark detection boxes can be manually selected from the original inspection images (or automatically selected using a more precise pre-trained text detection network model). Based on this, construct a watermark localization sample set. Each watermark localization sample includes an original inspection image and a corresponding watermark detection box label. The watermark detection box label includes the location information of the selected watermark detection box. Divide the watermark localization sample set into a training set, a test set, and a validation set.
[0056] Step A22, please see Figure 5 Based on the collaborative learning method, the training set in step A21 is used to train the first student model and the second student model in multiple rounds synchronously, and the training set is also input to the teacher model in multiple rounds synchronously. The first student model, the second student model and the teacher model output the corresponding watermark detection results respectively until the training stops. The watermark detection results include the confidence that the target of the watermark detection box is the watermark, and the watermark detection box position information.
[0057] In each training session, the total loss function value of the first student model is calculated, and the network parameters of the first student model are adjusted using gradient descent based on the total loss function value; the total loss function value of the second student model is calculated, and the network parameters of the second student model are adjusted using gradient descent based on the total loss function value.
[0058] The total loss function during training of the first student model Including the first true label loss companion loss and first distillation loss Specifically:
[0059] ;
[0060] First Real Label Loss The first true label loss is obtained by calculating the cross-entropy loss or detection box regression loss between the watermark detection box label of the sample and the watermark detection result obtained by the first student model. .
[0061] companion loss This includes the KL divergence loss calculated based on the watermark detection results obtained from the first student model and the watermark detection results obtained from the second student model for the samples. Alternatively, calculate the regression loss of the detection box. KL divergence is also called relative entropy.
[0062] First distillation loss for:
[0063]
[0064] Among them, the first student teacher divergence loss ;
[0065] in, This represents the watermark detection results of the sample obtained by the first student model. This represents the watermark detection results of the samples obtained by the teacher model; This represents the dilation function, used to expand the feature regions in the original input inspection image to include more contextual information; Represents the binary cross-entropy loss function; This represents the Dice loss function. This represents the balancing hyperparameter, used to control the balance between the binary cross-entropy loss and the Dice loss; express arrive The divergence is used to describe the information loss of the teacher model when using the first student model. express arrive The divergence is used to measure the risk of the first student model deviating from the true distribution of the teacher model.
[0066] Similarly, the total loss function of the second student model during training Including second true label loss companion loss Second distillation loss Specifically:
[0067] ;
[0068] Second True Label Loss The second true label loss is obtained by calculating the cross-entropy loss or detection box regression loss between the watermark detection box label of the sample and the watermark detection result obtained by the second student model. .
[0069] Second distillation loss for:
[0070]
[0071] Among them, the second student teacher divergence loss ;
[0072] in, This indicates the watermark detection results of the samples obtained by the second student model. express arrive The divergence is used to describe the information loss of the teacher model when using the second student model. express arrive The divergence is used to measure the risk of the second student model deviating from the true distribution of the teacher model.
[0073] In this embodiment, through the first distillation loss Second distillation loss Add the KL divergence loss function (i.e.) and The knowledge distillation process of the teacher model, the first student model, and the second student model is optimized to make the distribution of the results of the three models more similar, thereby improving training efficiency and further improving the detection accuracy of the student model.
[0074] Step A23: Use the test set and validation set from step A21 to test and validate the first and second student models obtained after training in step A22. If either the first or second student model passes the test and validation, select the passing student model as the final watermark localization model. If both the first and second student models pass the test and validation, select the student model with the best performance from the first and second student models as the final watermark localization model. If neither the first nor the second student model passes the test and validation, adjust the training parameters and return to continue executing steps A22 and A23.
[0075] In the watermark localization model task of this application, the original labeled watermark detection boxes usually contain background or edge noise, resulting in blurred watermark edges. Therefore, in a preferred embodiment, the training method of the watermark localization model further includes:
[0076] Set the dynamic shrinkage rate of the detection frame Dynamic shrinkage rate of the detection frame The size of the watermark is positively correlated with the number of training rounds of the watermark localization model;
[0077] In each training round of the watermark localization model, the size of the detection box of the watermark detection box label of the sample is updated according to the dynamic shrinkage rate of the detection box before participating in the training.
[0078] In each training round, the dynamic shrinkage rate of the detection box is measured. Shrink the detection box of the watermark label corresponding to the sample to generate a more compact internal region as the positive sample. Set a lower value in the initial training stage. The positive sample region is relatively wide, making it easier for the watermark localization model to learn the approximate location of the watermark. This increases with the number of training rounds. The stricter requirements in the positive sample area force the watermark positioning model to learn finer boundaries, enabling adaptive adjustment of the detection box shrinkage ratio. This significantly improves the accuracy of watermark positioning in complex environments, effectively eliminates text interference in non-defect areas, and ensures the reliability of insulator defect detection.
[0079] In this embodiment, preferably, the dynamic shrinkage rate of the detection frame is used. The calculation formula is:
[0080]
[0081] in, Indicates the proportionality coefficient; This represents the bias coefficient. Indicates the current training round. This indicates the preset total number of training rounds. , The values of are all greater than 0 and less than 1. The value of is not limited to 0.4. The value of is not limited to 0.2.
[0082] The insulator damage detection method provided by this invention combines YOLO, OCR algorithms and watermark removal algorithms to avoid misjudgments caused by watermark interference, improve the accuracy and stability of insulator defect detection, and provide strong protection for the safe and stable operation of the power system.
[0083] This invention also discloses an insulator damage detection device for implementing the above-mentioned insulator damage detection method, the device comprising:
[0084] The image acquisition module acquires images of insulators during inspections.
[0085] The first detection result acquisition module processes the insulator inspection image using the damaged target detection model to obtain the first detection result;
[0086] The watermark region determination module uses a watermark positioning model to process insulator inspection images and obtain the watermark region location information of the insulator inspection images.
[0087] A watermark mask generation module generates a watermark mask based on the location information of the watermark region; wherein, the pixel value of the watermark pixel in the watermark mask is the first pixel value, and the pixel value of the non-watermark pixel in the watermark mask is the second pixel value.
[0088] The detection result acquisition module performs the following steps when the overlap ratio between the damaged insulator area and the watermark area in the watermark mask in the first detection result is less than the preset overlap threshold: input the watermark mask and the insulator inspection image to the watermark removal model to obtain the watermark-removed image; process the watermark-removed image using the damaged target detection model to obtain the second detection result, and output the second detection result.
[0089] In this embodiment, the image acquisition module, the first detection result acquisition module, the watermark area determination module, the watermark mask generation module, and the detection result acquisition module correspond one-to-one with steps S1, S2, S3, S4, and S5 of the above-described insulator damage detection method of the present invention, and will not be described again here.
[0090] The present invention also discloses a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described insulator damage detection method provided by the present invention. The computer program product should be understood as a software product that mainly implements its solution through a computer program, such as a program product integrated in the cloud or a software library.
[0091] The present invention also discloses an electronic device, in one embodiment of which the electronic device includes at least one processor; and a memory communicatively connected to the at least one processor; wherein,
[0092] The memory stores a computer program that can be executed by the at least one processor, such that the at least one processor can perform the insulator damage detection method provided by the present invention.
[0093] like Figure 6 The diagram shown is a schematic representation of an electronic device for an insulator damage detection method according to an embodiment of the present invention. The electronic device may include a processor 10, a memory 11, a communication bus 12, and a communication interface 13. It may also include a computer program, such as an insulator damage detection method program, stored in the memory 11 and executable on the processor 10.
[0094] In some embodiments, the processor 10 may be composed of integrated circuits, such as a single packaged integrated circuit or multiple integrated circuits with the same or different functions, including combinations of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control unit of the electronic device, connecting various components of the entire electronic device through various interfaces and lines. It executes programs or modules stored in the memory 11 (e.g., executing insulator damage detection methods) and calls data stored in the memory 11 to perform various functions of the electronic device and process data.
[0095] The memory 11 includes at least one type of readable storage medium, including flash memory, portable hard drive, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of an electronic device, such as a portable hard drive. In other embodiments, the memory 11 can be an external storage device of the electronic device, such as a plug-in portable hard drive, SmartMediaCard (SMC), SecureDigital (SD) card, FlashCard, etc. Furthermore, the memory 11 can include both internal and external storage units of the electronic device. The memory 11 can be used not only to store application software and various types of data installed in the electronic device, such as the code of an insulator damage detection method program, but also to temporarily store data that has been output or will be output.
[0096] The communication bus 12 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This bus can be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable communication between the memory 11 and at least one processor 10, etc.
[0097] Communication interface 13 is used for communication between the aforementioned electronic device and other devices, including a network interface and a user interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a Wi-Fi interface, Bluetooth interface, etc.), typically used to establish communication connections between the electronic device and other electronic devices. The user interface may be a display, an input unit (such as a keyboard), and optionally, a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen, etc. The display may also be appropriately referred to as a screen or display unit, used to display information processed in the electronic device and to display a visual user interface.
[0098] Figure 6 Only electronic devices with components are shown; it will be understood by those skilled in the art that... Figure 6 The structure shown does not constitute a limitation on the electronic device and may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0099] For example, although not shown, the electronic device may also include a power supply (such as a battery) to power various components. Preferably, the power supply can be logically connected to at least one processor 10 via a power management device, thereby enabling functions such as charging management, discharging management, and power consumption management. The power supply may also include one or more DC or AC power supplies, recharging devices, power fault detection circuits, power converters or inverters, power status indicators, and other arbitrary components. The electronic device may also include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.
[0100] It should be understood that the embodiments are for illustrative purposes only and are not limited to this structure in the scope of the patent application.
[0101] Furthermore, if the modules / units integrated into the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, a computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a portable hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0102] In the description of this specification, the references to terms such as "an embodiment," "some embodiments," "example," "specific example," "a implementation," "a preferred implementation," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0103] Although embodiments of the invention have been shown and described, those skilled in the art will understand that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the claims and their equivalents.
Claims
1. A method for detecting insulator damage, characterized in that, The method includes: Acquire images of insulators during inspection; The damaged target detection model is used to process the insulator inspection images to obtain the first detection result; The watermark positioning model is used to process insulator inspection images to obtain the location information of the watermark area in the insulator inspection images; A watermark mask is generated based on the location information of the watermark region; wherein, the pixel value of the watermark pixel in the watermark mask is the first pixel value, and the pixel value of the non-watermark pixel is the second pixel value; When the overlap ratio between the damaged insulator area and the watermark area in the watermark mask in the first detection result is less than the preset overlap threshold, the following steps are executed: Input the watermark mask and the insulator inspection image into the watermark removal model to obtain the watermark-removed image; The watermark-removed image is processed using a damaged target detection model to obtain a second detection result, which is then output.
2. The method as described in claim 1, characterized in that, When the overlap ratio between the damaged area of the insulator and the watermark area in the watermark mask in the first detection result is greater than or equal to the preset overlap threshold, it indicates that there is no damage.
3. The method as described in claim 1 or 2, characterized in that, The process of generating a watermark mask based on the location information of the watermark region includes: The watermarked area image is extracted from the insulator inspection image based on the location information of the watermarked area; Pixels in the watermark region image whose pixel values meet the preset watermark pixel value conditions are taken as watermark pixels, and the pixel values of the watermark pixels are assigned the first pixel value. Pixels in the watermarked area image whose pixel values do not meet the preset watermark pixel value conditions are designated as non-watermarked pixels, and the pixel values of the non-watermarked pixels are assigned the second pixel value.
4. The method as described in claim 1, characterized in that, The training method for the watermark localization model includes: A pre-defined text detection network was used to construct a first student model and a second student model, respectively, and a teacher model was determined. The teacher model is used to train the first student model and the second student model using a collaborative learning method. When the training stops, either the first student model or the second student model is selected as the watermark positioning model.
5. The method as described in claim 4, characterized in that, The total loss function during training of the first student model Including the first true label loss companion loss and first distillation loss The first distillation loss for: Among them, the first student teacher divergence loss ; in, This represents the watermark detection results of the sample obtained by the first student model. This represents the watermark detection results of the samples obtained by the teacher model; Represents the expansion function; Represents the binary cross-entropy loss function; Represents the Dice loss function; Indicates the equilibrium hyperparameters; express arrive The divergence; express arrive The divergence.
6. The method as described in claim 4 or 5, characterized in that, The training method for the watermark localization model also includes: Set the dynamic shrinkage rate of the detection box. The magnitude of the dynamic shrinkage rate of the detection box is positively correlated with the number of training rounds of the watermark localization model. In each training round of the watermark localization model, the size of the detection box of the watermark detection box label of the sample is updated according to the dynamic shrinkage rate of the detection box before participating in the training.
7. The method as described in claim 6, characterized in that, Detection frame dynamic shrinkage rate The calculation formula is: in, Represents the proportionality coefficient. This represents the bias coefficient. Indicates the current training round. This indicates the preset total number of training rounds.
8. An insulator damage detection device, used to implement the method according to any one of claims 1-7, characterized in that, The device includes: The image acquisition module acquires images of insulators during inspections. The first detection result acquisition module processes the insulator inspection image using the damaged target detection model to obtain the first detection result; The watermark region determination module uses a watermark positioning model to process insulator inspection images and obtain the watermark region location information of the insulator inspection images. A watermark mask generation module generates a watermark mask based on the location information of the watermark region; wherein, the pixel value of the watermark pixel in the watermark mask is the first pixel value, and the pixel value of the non-watermark pixel in the watermark mask is the second pixel value. The detection result acquisition module performs the following steps when the overlap ratio between the damaged insulator area and the watermark area in the watermark mask in the first detection result is less than the preset overlap threshold: input the watermark mask and the insulator inspection image to the watermark removal model to obtain the watermark-removed image; process the watermark-removed image using the damaged target detection model to obtain the second detection result, and output the second detection result.
9. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the method according to any one of claims 1-7.
10. An electronic device, characterized in that, The electronic device includes: At least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores a computer program executable by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Power transmission line insulation damage detection method, model training method, device and equipment
CN116703822A
Insulator image anomaly detection method, device and equipment and storage medium
CN118279263A