Insulator damage detection method and device and electronic equipment
By combining damaged target detection and watermark positioning models, generating watermark masks and processing insulator inspection images, the problem of false detection caused by watermark interference is solved, the accuracy and stability of insulator detection are improved, and the safety of the power grid is guaranteed.
Patent Information
- Application Number
- CN202511303760.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-12
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2045-09-12
AI Technical Summary
Existing technologies make it difficult to accurately distinguish camera watermarks from damage in insulator inspection images, resulting in false detections and affecting the normal operation of the power grid inspection system.
The damaged target detection model and the watermark positioning model are combined to generate a watermark mask. The presence of damage is determined by the intersection-union ratio. The watermark removal model is used to process the image to improve the detection accuracy.
Effectively avoid watermark interference, improve the accuracy and stability of insulator defect detection, and ensure the safe and stable operation of the power system.
Smart Images

Figure CN120807518A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image detection, in particular to an insulator damage detection method and device and electronic equipment. BACKGROUND
[0002] In the power system, as a key component connecting high-voltage transmission lines, the insulator bears the important functions of connecting different potential conductors and realizing insulation, fixation and suspension, and its performance directly affects the safe and stable operation of the power grid. Due to the long-term operation of the insulator in the harsh environment of strong light irradiation, high-voltage electric field, and large temperature and humidity changes, the insulator is easily affected by pollution, aging, and cracking, which leads to a decline in its insulation performance. Especially under high-voltage transmission, insulator cracking will seriously threaten the safe operation of the power system.
[0003] In actual substations, the insulator is mostly at a high position and needs to be monitored in real time by a camera. However, during global inspection, the time and device number of the camera and other white watermarks often overlap with the insulator. These white watermarks are easily confused with the white core of the damaged insulator and are difficult to distinguish. Therefore, only using a target detection algorithm to detect insulator damage cannot distinguish between the watermark attachment state and the damage state on the insulator, which is likely to cause false detection and further send false alarm information to the power grid inspection system, thereby interfering with the normal operation of the power grid inspection system. Therefore, timely and accurate detection of insulator damage is of great significance to the safe operation of the power grid system. SUMMARY
[0004] The present 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, the present application provides an insulator damage detection method, which comprises: 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 position information of the insulator inspection image; generating a watermark mask based on the watermark region position information; wherein the pixel value of a watermark pixel point in the watermark mask is a first pixel value, and the pixel value of a non-watermark pixel point is a second pixel value; when the intersection-over-union of the insulator damage region in the first detection result and the watermark region in the watermark mask 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; processing the watermark-removed image using the damage target detection model to obtain a second detection result, and outputting the second detection result.
[0006] In a second aspect, the application provides an insulator damage detection device for implementing the method provided in the first aspect of the application. The device comprises: an image acquisition module configured to acquire an insulator inspection image; a first detection result acquisition module configured to process the insulator inspection image by using a damage target detection model to obtain a first detection result; a watermark region determination module configured to process the insulator inspection image by using a watermark positioning model to obtain watermark region position information of the insulator inspection image; a watermark mask generation module configured to generate a watermark mask based on the watermark region position information; wherein the pixel value of a watermark pixel point in the watermark mask is a first pixel value, and the pixel value of a non-watermark pixel point in the watermark mask is a second pixel value; and a detection result acquisition module configured to, when the intersection-over-union ratio of the insulator damage region in the first detection result and the watermark region in the watermark mask is less than a preset overlap threshold, perform: 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 by using the damage target detection model to obtain a second detection result, and outputting the second detection result.
[0007] In a third aspect, the application provides a computer program product comprising a computer program which, when executed by a processor, implements the steps of the method provided in the first aspect of the application.
[0008] In a fourth aspect, the 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 which can be executed by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the method described in the first aspect of the application.
[0009] The application has the following beneficial technical effects: first, the insulator inspection image is processed by using the damage target detection model to obtain the first detection result; when the first detection result includes at least one insulator damage region, in order to avoid the misjudgment caused by the confusion between the camera watermark and the white kernel when the insulator is damaged, the watermark positioning model is used to process the insulator inspection image to obtain the watermark region position information, and then the watermark mask is generated based on the watermark region position information, the watermark pixel points and the non-watermark pixel points are distinguished by the pixel value in the watermark mask, and then the intersection-over-union ratio of the watermark region composed of the watermark pixel points and the insulator damage region in the first detection result is calculated; when the intersection-over-union ratio is greater than or equal to the preset overlap threshold, it is indicated that the insulator damage region in the first detection result is most likely a watermark, and no damage is output; when the intersection-over-union ratio is less than the preset overlap threshold, it is considered that there is most likely an insulator damage; at this time, in order to improve the detection accuracy and avoid the interference of the watermark on the detection result, the watermark-removed image corresponding to the insulator inspection image is generated based on the watermark mask, and finally the damage target detection model is used to process the watermark-removed image to obtain and output the second detection result.
[0010] It can be seen that the application provides a detection scheme capable of accurately identifying the state of the insulator in the presence of the watermark, reduces the loss of insulator information caused by the watermark, effectively avoids the false alarm of insulator defects, improves the precision and stability of insulator defect detection, and provides a strong guarantee for the safe and stable operation of the power system. BRIEF DESCRIPTION OF DRAWINGS
[0011] Figure 1 is a flowchart of the insulator damage detection method in a preferred embodiment of the application; Figure 2 is a flowchart of the insulator damage detection method in another preferred embodiment of the application; Figure 3 is a flowchart of the insulator damage detection method in an example of the application; Figure 4 is a structural diagram of the text detection network in a preferred embodiment of the application; Figure 5 is a training framework diagram of the watermark positioning model in a preferred embodiment of the application; Figure 6 is a structural diagram of the electronic device in a preferred embodiment of the application. DETAILED DESCRIPTION
[0012] Embodiments of the application are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference signs represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the application, and cannot be understood as a limitation of the application.
[0013] In the description of the application, it should be understood that the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the application and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as a limitation of the application.
[0014] In the description of the application, unless otherwise specified and limited, it should be noted that the terms "mounting", "connection", "connection" should be understood broadly, for example, it can be a mechanical connection or an electrical connection, or a communication between two elements, or a direct connection, or an indirect connection through an intermediate medium, and those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0015] The execution subject of the insulator damage detection method provided by the application includes but is not limited to at least one of the electronic devices capable of being configured to execute the insulator damage detection method provided by the application, such as a server and a terminal. In other words, the insulator damage detection method can be executed by software or hardware installed in a terminal device or a server device, and 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, etc. The server can be a stand-alone server, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms.
[0016] The application provides an insulator damage detection method, in a preferred embodiment, please see Figure 1 and Figure 2 The method comprises the following steps: Step S1, acquiring an insulator inspection image.
[0017] In this embodiment, a plurality of insulator monitoring areas are arranged in the substation, and the inspection video of each insulator monitoring area is shot by the camera or the camera carried by the unmanned aerial vehicle during the inspection of the camera or the unmanned aerial vehicle fixedly arranged in each insulator monitoring area. A plurality of insulator inspection images are obtained by picture frame extraction processing from the inspection video. In a specific implementation, the execution subject of the insulator damage detection method can read the insulator inspection image from the database, or the execution subject can collect the insulator inspection image from the camera or the unmanned aerial vehicle camera fixedly arranged in the insulator monitoring area in real time.
[0018] Step S2, processing the insulator inspection image by using a damage target detection model to obtain a first detection result.
[0019] In the embodiment, the damage target detection model preferably, but not limited to, adopts an existing YOLO series network, such as Yolov8x (an existing target detection network). YOLO is the abbreviation of You Only Look Once, a real-time target detection network. A target detection sample set is constructed in advance, which includes an insulator inspection image and a detection label corresponding to the insulator inspection image. The detection label includes the damage category of the damage target region in the insulator inspection image, and the detection frame position information of each damage target region. The damage categories include insulator crack damage, insulator self-explosion, dirty discharge trace, surface contamination, creeping trace, and glaze surface shedding. The network of the damage target detection model is iteratively trained using the target detection sample set. During the training process, the cross-entropy loss is calculated according to the detection result of the damage target detection model and the detection label of the sample, and the network parameters of the damage target detection model are updated using the gradient descent method according to the cross-entropy loss, until the training times reach the preset maximum training times, the training is ended, and the damage target detection model is obtained.
[0020] In the embodiment, in order to effectively capture various damage features that may occur and improve the recognition accuracy and generalization ability of insulator damage, the target detection sample set preferably includes a plurality of positive samples and a plurality of negative samples. The positive sample represents an insulator inspection image in which there is more than one damage target (one damage target corresponds to one insulator damage region). The negative sample represents an insulator inspection image in which there is no damage target (i.e., no insulator damage region).
[0021] In the embodiment, the first detection result includes detection information of at least one damage target or is normal (indicating that the insulator in the insulator inspection image has no damage, i.e., there is no damage target or no insulator damage region). The detection information of each damage target includes a damage category (which is an external insulator crack damage or an insulator self-explosion or a dirty discharge trace or a surface contamination or a creeping trace or a damaged glaze surface shedding), a confidence probability of the damage category, and an insulator damage region corresponding to the damage target (i.e., the detection frame position information of the damage target). If there is no damage target in the insulator inspection image, the normal is output, or the second detection result in the example shown in Figure 3
[0022] Step S3, processing the insulator inspection image using the watermark positioning model to obtain the watermark region position information of the insulator inspection image.
[0023] In this embodiment, the watermark positioning model is not limited to drawing on the text detection network in the existing OCR (Optical Character Recognition) model, such as the text detection network of PP-OCRv3. PP-OCRv3 is the third version of the practical ultra-lightweight OCR model launched by the Baidu team, and its full name is Paddle-PipelineOCR v3. Preferably, in order to extract the watermark area location information with higher accuracy, the text detection network of PP-OCRv3 is improved, such as Figure 4 As shown, the PP-LCNetV3 network is used to replace the original MobileNetv3 backbone network in PP-OCRv3 to improve the feature extraction capability. The PP-LCNetV3 network (full name PaddlePaddle Lightweight CPU Network Version 3) is the third version of the lightweight convolutional neural network series launched by the Baidu team. It is a backbone network. The MobileNetv3 backbone network is a lightweight convolutional neural network series launched by Google. Specifically, the watermark area position information of the insulator inspection image includes the upper left corner coordinates and the lower right corner coordinates of the watermark detection box. Figure 3 In , an example of watermark detection box visualization is shown.
[0024] 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 a first pixel value, and the pixel value of the non-watermark pixel is a second pixel value. The first pixel value is not equal to the second pixel value, and the first pixel value may be the pixel value of a white pixel, and the second pixel value may be the pixel value of a black pixel.
[0025] In this embodiment, Figure 3 In the example shown, watermarks such as "September 7, 2024," "Saturday," and "18:08:46" are present in the insulator inspection image. These watermarks are primarily white or black. Therefore, the preset watermark pixel value condition is that the pixel value 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 An example of a watermark mask is given in [1]. In this example, the watermark is white pixels and the non-watermarked area is black pixels. OpenCV stands for Open Source Computer Vision Library, which means open source computer vision library.
[0026] In the embodiment, the non-watermark pixel points of the watermark region image which are white or close to white and the non-watermark pixel points of the watermark region image which are black or close to black may become noise pixel points in the watermark mask generation process and introduce interference. To reduce the influence of the noise pixel points, preferably, step S4 comprises: Step S4a: extracting a watermark region image from the insulator inspection image according to the watermark region position information; and performing text recognition on the watermark region image to obtain a plurality of recognized characters. Step S4b: obtaining an initial watermark mask by processing as follows: regarding a pixel point in the watermark region image whose pixel value meets a preset watermark pixel value condition as a watermark pixel point, assigning a first pixel value to the pixel value of the watermark pixel point; regarding a pixel point in the watermark region image whose pixel value does not meet the preset watermark pixel value condition as a non-watermark pixel point, assigning a second pixel value to the pixel value of the non-watermark pixel point; and obtaining the initial watermark mask. Step S4c: transforming each recognized character into a font and a font size of the watermark in the camera to obtain a character template of each recognized character; aligning each character template with a corresponding character in the initial watermark mask, deleting watermark pixel points outside an alignment region of the two, and filling missing watermark pixel points in the alignment region of the two, which is equivalent to correcting the initial watermark mask by using the character template, and obtaining a final watermark mask after the correction. In this way, the interference of the noise pixel points can be eliminated, and the subsequent damage detection accuracy can be improved.
[0027] Step S5: when an intersection-over-union ratio of an insulator damage region in the first detection result to a watermark region in the watermark mask is less than a preset coincidence threshold, that is, when the intersection-over-union ratio of the insulator damage region of at least one damage target (a region determined by the damage target detection box position information) in the first detection result to the watermark region in the watermark mask is less than the preset coincidence threshold, performing: Step S51: inputting the watermark mask and the insulator inspection image into a watermark removal model to obtain a watermark-removed image. Specifically, the watermark removal model comprises an image segmentation unit and an image inpainting model; the image segmentation unit segments a missing-watermark to-be-inpainted image (that is, a region composed of all non-watermark pixel points) from the insulator inspection image by using the watermark mask; and the image inpainting model processes the to-be-inpainted image by using a deep learning-based image inpainting network to obtain the watermark-removed image.
[0028] Step S52: processing the watermark-removed image by using a damage target detection model to obtain a second detection result, and outputting the second detection result. The second detection result comprises detection information of at least one damage target or is normal (indicating that the insulator in the insulator inspection image is not damaged).
[0029] Preferably, step S5 further comprises: when the Jaccard index of the insulator damage area in the first detection result and the watermark area in the watermark mask is greater than or equal to the preset coincidence threshold, that is, when the Jaccard index of the insulator damage area of all damage targets in the first detection result and the watermark area in the watermark mask is greater than or equal to the preset coincidence threshold, or the first detection result is normal, step S53 is executed, and step S53 is: prompting no damage.
[0030] In the embodiment, the preset coincidence threshold can be set according to experience, and is not limited to 0.5 or 0.6. The watermark is removed by steps S51 and S52 to retain the insulator area around the watermark, reduce false alarms caused by the insulator detection due to the watermark problem, and improve the utilization rate of features in the image.
[0031] In the embodiment, please refer to Figure 1 and Figure 2 , steps S3 and S4 constitute a watermark mask generation step, step S2 can be executed in parallel with the watermark mask generation step as shown in Figure 2 , the watermark mask generation step can be executed before step S2 as shown in Figure 1 , or the watermark mask generation step can be executed before step S2, which is not limited in the present application.
[0032] In the embodiment, the watermark area in the watermark mask is an area composed of all watermark pixel points in the watermark mask, as shown in the watermark mask example given in Figure 3 , the watermark area is an area composed of all white pixel points.
[0033] In the embodiment, for ease of implementation, the insulator damage area in the first detection result refers to the detection frame selected area of the damage target. There can be more than two damage targets in the first detection result, and step S5 is executed separately for each damage target.
[0034] In the embodiment, the image inpainting model in the watermark removal model can adopt an existing deep learning-based image inpainting network. For example, a DeepFillv2 network (second generation of free-form image inpainting network based on gated convolution) can be selected, which includes a generator and a discriminator. The training process of the image inpainting model includes: (1) Collect multiple original insulator inspection images without watermarks covering various states and backgrounds of insulators, construct a sample pair set based on the original insulator inspection images, and each sample pair includes an original insulator inspection image and a to-be-repaired image corresponding to the original insulator inspection image. The to-be-repaired image corresponding to the original insulator inspection image is obtained by: injecting a watermark into the original insulator inspection image through a text watermark injection method to obtain a watermark inspection image, obtaining a watermark mask of the watermark inspection image according to the above steps S3 and S4, and using the watermark mask to segment the to-be-repaired image without the watermark from the original insulator inspection image. The sample pair set is divided into a training set, a test set, and a validation set.
[0035] (2) Construct a DeepFillv2 network. The DeepFillv2 network includes a generator and a discriminator. The generator generates a reconstructed image without a watermark based on the to-be-repaired image, and the discriminator is used to determine whether the reconstructed image comes from the original insulator inspection image.
[0036] (3) Use the sample pairs in the training set to iteratively train the DeepFillv2 network and update the network parameters until a preset maximum number of training times is reached.
[0037] (4) Test and verify the generator of the DeepFillv2 network obtained in step (3) using the sample pairs in the test set and the validation set. When the test and verification pass, the generator obtained by training is used as an image repair model. If the test or verification fails, adjust the training parameters and return to continue steps (3) and (4).
[0038] To significantly improve the watermark positioning accuracy of the watermark positioning model, effectively exclude text interference in non-defect areas, ensure the reliability of insulator defect detection, and speed up the training efficiency of the watermark positioning model. In a preferred embodiment, the training method of the watermark positioning model comprises: Step A1, a preset text detection network is used to construct a first student model and a second student model, and a teacher model is determined.
[0039] In this embodiment, the first student model and the second student model both use a preset text detection network. The preset text detection network can be a text detection network in the existing PP-OCRv3 network. To improve feature extraction capability, preferably, the preset text detection network is a text detection network obtained by replacing the original MobileNetv3 backbone network in PP-OCRv3 with the PP-LCNetV3 network as shown in the table. Figure 4 The teacher model is the text detection network in the pre-trained PP-OCRv3 model.
[0040] Step A2, training the first student model and the second student model according to the co-teaching method with the teacher model, and selecting the first student model or the second student model as the watermark positioning model when a training stop condition is reached. The training stop condition is not limited to that the number of training rounds reaches a preset maximum number of training rounds.
[0041] In the embodiment, step A2 includes: Step A21, collecting a plurality of original inspection images with watermarks covering a plurality of states and backgrounds of insulators, and manually framing (or automatically framing by using a higher-precision trained text detection network model) a watermark detection frame in the original inspection images. Based on this, a watermark positioning sample set is constructed, each watermark positioning sample including an original inspection image and a watermark detection frame label corresponding to the original inspection image, the watermark detection frame label including position information of the framed watermark detection frame. The watermark positioning sample set is divided into a training set, a test set and a validation set.
[0042] Step A22, referring to Figure 5 , the training set in step A21 is used to synchronously train the first student model and the second student model in multiple rounds according to the co-teaching method, and the training set is synchronously input to the teacher model in multiple rounds, the first student model, the second student model and the teacher model output corresponding watermark detection results respectively, until a training stop condition is reached, the watermark detection result including a confidence degree of a target of watermark detection frame positioning being a watermark and watermark detection frame position information.
[0043] In each training, a total loss function value of the first student model is calculated, and the network parameters of the first student model are adjusted by using the gradient descent method according to the total loss function value; a total loss function value of the second student model is calculated, and the network parameters of the second student model are adjusted by using the gradient descent method according to the total loss function value.
[0044] The total loss function of the first student model in training includes a first real label loss , a peer loss and a first distillation loss , specifically: ; The first real label loss is obtained by calculating the cross-entropy loss or the bounding box regression loss between the watermark detection frame label of the sample and the watermark detection result of the sample obtained by the first student model .
[0045] The peer loss The total loss function of the first student model in the training includes the first real label loss, the peer loss, and the first distillation loss, specifically: The KL divergence loss of the calculated classification probability, or the bounding box regression loss is calculated.
[0046] The first distillation loss is: Wherein, the first student-teacher divergence loss ; Wherein, represents the watermark detection result of the sample obtained by the first student model, represents the watermark detection result of the sample obtained by the teacher model; represents an inflation function used to expand the feature area in the input original inspection image to include more context information; represents a binary cross-entropy loss function; represents a Dice loss function (Dice loss function); represents a balance hyperparameter used to control the balance between the binary cross-entropy loss and the Dice loss; represents the divergence from to the divergence from to to , used to measure the risk of the first student model deviating from the true distribution of the teacher model.
[0047] Similarly, the total loss function of the second student model in the training includes the second real label loss , the peer loss , and the second distillation loss , specifically: ; The second real label loss is obtained by calculating the cross-entropy loss or bounding box regression loss between the watermark detection box label of the sample and the watermark detection result of the sample obtained by the second student model .
[0048] The second distillation loss is: Wherein, the second student-teacher divergence loss ; Wherein, represents the watermark detection result of the sample obtained by the second student model, express arrive The divergence is used to describe the information loss of the teacher model 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.
[0049] In this embodiment, the first distillation loss and second distillation losses Add KL divergence loss function (i.e. and ) Optimize the knowledge distillation process of the teacher model, the first student model, and the second student model to make the result distributions of the three closer, improve training efficiency, and further improve the detection accuracy of the student model.
[0050] Step A23, use the test set and verification set in step A21 to test and verify the first student model and the second student model obtained after training in step A22: when the first student model or the second student model passes the test and verification, select the passed student model as the final watermark positioning model; when the first student model and the second student model both pass the test and verification, select the student model with the best performance from the first student model and the second student model as the final watermark positioning model; when both the first student model and the second student model fail the test and verification, adjust the training parameters and return to continue executing steps A22 and A23.
[0051] In the watermark localization model task of this application, the originally annotated watermark detection frame usually contains background or edge noise, resulting in blurred watermark edges. Therefore, in a preferred embodiment, the watermark localization model training method further includes: Set the dynamic shrinkage rate of the detection frame , dynamic shrinkage rate of the detection frame The size of is positively correlated with the number of training rounds of the watermark positioning model; In each training round of the watermark positioning model, the detection frame size of the watermark detection frame label of the sample is updated according to the dynamic shrinkage rate of the detection frame before participating in the training.
[0052] In each training round, the dynamic shrinkage rate of the detection box is Shrink the detection box of the watermark detection box label corresponding to the sample to generate a more compact internal area as a positive sample. , the positive sample area is wider, and the watermark positioning model is easier to learn the rough position of the watermark. As the number of training rounds increases The positive sample area is more strict, so that the watermark positioning model is forced to learn fine boundaries, and the shrinkage ratio of the detection frame is adaptively adjusted. The watermark positioning model can significantly improve the watermark positioning accuracy in a complex environment, effectively eliminate the text interference of non-defect areas, and ensure the reliability of insulator defect detection.
[0053] In the embodiment, preferably, the dynamic shrinkage ratio of the detection frame is The calculation formula is as follows: wherein, represents a proportionality coefficient; represents a bias coefficient, represents a current training round, represents a preset total training round. 、 The value range of each of the proportionality coefficient and the bias coefficient is greater than 0 and less than 1, The value of the proportionality coefficient is not limited to 0.4, The value of the bias coefficient is not limited to 0.2.
[0054] The insulator damage detection method provided by the application avoids misjudgment caused by watermark interference by combining YOLO, OCR algorithm and watermark removal algorithm, improves the accuracy and stability of insulator defect detection, and provides a strong guarantee for the safe and stable operation of the power system.
[0055] The application further discloses an insulator damage detection device for realizing the insulator damage detection method. An image acquisition module acquires an insulator inspection image. A first detection result acquisition module processes the insulator inspection image by using a damage target detection model to obtain a first detection result. A watermark region determination module processes the insulator inspection image by using a watermark positioning model to obtain watermark region position information of the insulator inspection image. A watermark mask generation module generates a watermark mask based on the watermark region position information; wherein the pixel value of a watermark pixel point in the watermark mask is a first pixel value, and the pixel value of a non-watermark pixel point in the watermark mask is a second pixel value. A detection result acquisition module executes the following when the intersection-over-union ratio of the insulator damage region in the first detection result and the watermark region in the watermark mask is less than a preset coincidence threshold: inputs the watermark mask and the insulator inspection image to a watermark removal model to obtain a watermark-removed image; processes the watermark-removed image by using the damage target detection model to obtain a second detection result, and outputs the second detection result.
[0056] In the embodiment, the image acquisition module, the first detection result acquisition module, the watermark region determination module, the watermark mask generation module, and the detection result acquisition module correspond to steps S1, S2, S3, S4, and S5 of the insulator damage detection method respectively, and details are not repeated here.
[0057] The application further discloses a computer program product, which comprises a computer program, and the computer program is executed by a processor to realize steps of the insulator damage detection method provided by the application. The computer program product should be understood as a software product mainly realizing the solution of the computer program product, such as a program product integrated in the cloud or a software library.
[0058] The application further discloses an electronic device, which comprises at least one processor, and a memory connected with the at least one processor in communication. The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the insulator damage detection method provided by the application.
[0059] As shown in Figure 6 Fig. 1 is a structural schematic diagram of an electronic device for the insulator damage detection method according to an embodiment of the application. The electronic device can comprise a processor 10, a memory 11, a communication bus 12, and a communication interface 13, and can further comprise a computer program stored in the memory 11 and executable on the processor 10, such as an insulator damage detection method program.
[0060] In some embodiments, the processor 10 can be composed of integrated circuits, for example, can be composed of a single packaged integrated circuit, or can be composed of multiple packaged integrated circuits with the same function or different functions, including one or more combinations of central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core of the electronic device, which connects various components of the electronic device through various interfaces and lines, executes programs or modules stored in the memory 11 (such as executing the insulator damage detection method), and calls data stored in the memory 11 to perform various functions of the electronic device and process data.
[0061] The memory 11 includes at least one type of readable storage medium, such as a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a disk, an optical disk, etc. The memory 11 can be an internal storage unit of the electronic device in some embodiments, such as a mobile hard disk of the electronic device. The memory 11 can also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device. Further, the memory 11 can include both the internal storage unit and the external storage device of the electronic device. The memory 11 can be used to store application software installed on the electronic device and various data, such as the code of the insulator damage detection method program, and can also be used to temporarily store data that has been output or will be output.
[0062] The communication bus 12 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The 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, the at least one processor 10, etc.
[0063] The communication interface 13 is used for communication between the electronic device and other devices, including a network interface and a user interface. Optionally, the network interface can include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used to establish a communication connection between the electronic device and other electronic devices. The user interface can be a display, an input unit (such as a keyboard), and optionally, the user interface can also be a standard wired interface, a wireless interface. Optionally, in some embodiments, the display can be an LED display, a liquid crystal display, a touch liquid crystal display, an OLED (Organic Light-Emitting Diode) touch, etc. The display can also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device and to display a visualized user interface.
[0064] Figure 6 Only the electronic device with components is shown, and those skilled in the art can understand that, Figure 6The illustrated structure does not constitute a limitation on the electronic device, and can include fewer or more components than those shown, or combine certain components, or arrange the components differently.
[0065] For example, although not shown, the electronic device can further include a power supply (such as a battery) to supply power to each component. Preferably, the power supply can be logically connected to the at least one processor 10 through a power management device, so that the power management device implements functions such as charge management, discharge management, and power consumption management. The power supply can also include one or more direct current or alternating current power supplies, a recharging device, a power supply failure detection circuit, a power supply converter or inverter, a power supply status indicator, and the like. The electronic device can also include various sensors, a Bluetooth module, a Wi-Fi module, and the like, which are not described here.
[0066] It should be understood that the embodiments are for illustration only and are not limited in scope by the structure described.
[0067] Further, the modules / units integrated in the electronic device, if implemented in the form of software function units and sold or used as independent products, can be stored in a computer readable storage medium. The computer readable storage medium can be volatile or non-volatile. For example, the computer readable medium can include any entity or device capable of carrying the computer program code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (ROM).
[0068] In the description of the present specification, the description of the terms "one embodiment", "some embodiments", "an example", "a specific example", "an implementation", "a preferred implementation", or "some examples" and the like means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present application. In the present specification, the illustrative description of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0069] Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the application, 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 comprises: Acquire insulator inspection images; The damaged target detection model is used to process the insulator inspection image to obtain the first detection result; The watermark positioning model is used to process the insulator inspection image to obtain the watermark area position information of the insulator inspection image; Generate a watermark mask based on the watermark area position information; wherein the pixel value of the watermark pixel point in the watermark mask is a first pixel value, and the pixel value of the non-watermark pixel point is a second pixel value; When the intersection-over-union ratio between the damaged insulator area in the first detection result and the watermark area in the watermark mask is less than a preset overlap threshold, execute: Input the watermark mask and the insulator inspection image into the watermark removal model to obtain the watermark-removed image; The damaged object detection model is used to process and remove the watermarked image, obtain a second detection result, and output the second detection result.
2. The method according to claim 1, wherein When the intersection-over-union ratio of the damaged area of the insulator in the first detection result and the watermark area in the watermark mask is greater than or equal to the preset overlap threshold, it is prompted that there is no damage.
3. The method according to claim 1 or 2, wherein: The generating of a watermark mask based on the watermark area position information includes: Extracting a watermark region image from the insulator inspection image according to the watermark region position information; The pixel points whose pixel values in the watermark area image meet the preset watermark pixel value conditions are used as watermark pixel points, and the pixel values of the watermark pixel points are assigned to the first pixel value; Pixels in the watermark area image whose pixel values do not meet the preset watermark pixel value condition are regarded as non-watermark pixels, and the pixel values of the non-watermark pixels are assigned to the second pixel value.
4. The method according to claim 1, wherein The training method of the watermark positioning model includes: Use the preset text detection network to build the first student model and the second student model respectively, and determine the teacher model; The teacher model is used to train the first student model and the second student model according to the collaborative mutual learning method. When the training stop condition is reached, the first student model or the second student model is selected as the watermark positioning model.
5. The method according to claim 4, wherein The total loss function of the first student model during training Including first true label loss , companion loss and first distillation loss ; The first distillation loss for: Among them, the first student-teacher divergence loss ; in, represents the watermark detection result of the sample obtained by the first student model, 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; represents the balanced hyperparameter; express arrive The divergence of express arrive The divergence of .
6. The method according to claim 4 or 5, characterized in that The training method of the watermark positioning model further includes: Set the dynamic shrinkage rate of the detection frame. The size of the dynamic shrinkage rate of the detection frame is positively correlated with the number of training rounds of the watermark positioning model. In each training round of the watermark positioning model, the detection frame size of the watermark detection frame label of the sample is updated according to the dynamic shrinkage rate of the detection frame before participating in the training.
7. The method according to claim 6, wherein Dynamic shrinkage rate of the detection frame The calculation formula is: in, represents the proportionality coefficient, represents the bias coefficient, Indicates the current training round, 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 to 7, characterized in that: The device comprises: Image acquisition module, acquiring insulator inspection images; A first detection result acquisition module processes the insulator inspection image using a damaged target detection model to obtain a first detection result; The watermark region determination module processes the insulator inspection image using the watermark positioning model to obtain the watermark region position information of the insulator inspection image; a watermark mask generating module, which generates a watermark mask based on the watermark region position information; wherein the pixel value of the watermark pixel point in the watermark mask is a first pixel value, and the pixel value of the non-watermark pixel point in the watermark mask is a second pixel value; The detection result acquisition module executes the following steps when the intersection-over-union ratio of the damaged insulator area in the first detection result and the watermark area in the watermark mask is less than a preset overlap threshold: inputting the watermark mask and the insulator inspection image into the watermark removal model to obtain a watermark-removed image; processing the watermark-removed image using the damaged target detection model to obtain a second detection result; and outputting the second detection result.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: The electronic device comprises: 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 according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image damage detection method, electronic equipment and storage medium
CN113744199A
Insulator defect identification method based on improved SSD algorithm
CN116188402A
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
Insulator defect detection method, device and equipment and storage medium
CN119067930A