Double-stage tower defect detection method and system based on enhanced negative sample suppression
By strengthening the two-stage tower defect detection method of negative sample suppression, the accuracy of pole defect detection in complex background is solved, higher detection accuracy and robustness are achieved, the defects of data enhancement technology are overcome, and the training process is optimized.
Patent Information
- Application Number
- CN202510720609.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-30
- Publication Date
- 2025-08-26
AI Technical Summary
In the prior art, in the detection of pole defects under complex backgrounds, negative samples have severe interference, resulting in insufficient detection accuracy, and the noise impact during data enhancement process, which makes negative samples unable to effectively suppress and affect detection accuracy.
A two-stage tower defect detection method based on enhanced negative sample suppression is adopted, including image preprocessing, defect thickness positioning and feature extraction, combined with negative sample suppression algorithm and mosaic enhancement technology, and the detection accuracy and robustness are improved through image aspect ratio maintenance and negative sample proportion control.
It effectively eliminates complex background interference, improves the accuracy and reliability of detection results, enhances the detection accuracy and generalization ability of the model on new data, prevents the shape of the target object from deforming, and optimizes the training effect.
Smart Images

Figure CN120543945A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of pole defect detection, and specifically relates to a method and system for double-stage pole tower defect detection based on enhanced negative sample suppression, and in particular to a double-stage pole tower defect detection algorithm based on enhanced negative sample suppression. Background Art
[0002] Under current technology, defects in power poles can pose numerous potential risks. Once a pole becomes defective, wires can break or fall off, leading to power outages. Such disruptions not only disrupt residents' daily lives and hinder industrial production, but can also disrupt social order. If such incidents occur near critical facilities such as hospitals and schools, the consequences are even more severe, potentially endangering lives and affecting the normal operation of critical social functions. Furthermore, defects in power poles can trigger electrical faults such as short circuits and arcing, potentially causing fires. The risk of fire is particularly elevated in dry and flammable environments, and once a fire occurs, it poses a significant threat to the surrounding environment, as well as to the safety of life and property. Furthermore, the collapse or breakage of power poles is highly likely to damage surrounding vegetation and buildings, creating numerous safety hazards and impacting the overall safety and stability of the region.
[0003] In view of the above risks, in order to achieve the effective strategy of "early detection and early prevention", defect target detection methods came into being.
[0004] In conventional defect detection tasks, regression methods are commonly used to directly predict the coordinates, confidence level, and class probability of the target's bounding box using convolutional neural networks. While regression methods have demonstrated excellent performance in some detection tasks, accurately predicting target locations, they are susceptible to interference from environmental factors when faced with complex environments, resulting in numerous limitations such as poor recognition accuracy and sensitivity to environmental disturbances.
[0005] To address the challenges posed by complex backgrounds for object detection, some algorithms, such as YOLO, have adopted data augmentation methods in recent years to mitigate background interference. These methods enrich the diversity of training data, enabling the model to more comprehensively learn target features, thereby improving the model's detection capabilities in complex backgrounds.
[0006] For example, patent document CN117197555A discloses a method for identifying and detecting key parts of transmission lines, which mainly includes the following steps: first, building a transmission line inspection data acquisition system to obtain transmission line image data, and preprocessing these image data to form an image data set; then, performing transmission line image data feature analysis based on the image data set to obtain the key part features of the transmission line; then, based on the key part features of the transmission line, constructing a transmission line key part identification and defect detection model based on YOLOv7, and using the image data set to iteratively train the model to finally obtain the optimal model; finally, obtaining the image to be tested, and using the optimal model to perform key part identification and defect detection on the transmission line image to be tested.
[0007] For example, patent document CN116485731A discloses a method, system, identification terminal, and drone for defect detection in distribution lines. This method utilizes a defect detection model based on the YOLO network to efficiently detect inspection images of distribution lines. During training, the number of positive samples is determined by calculating the Intersection over Union (IoU), a mechanism that helps to more accurately define the target area. Subsequently, the network uses a weighted loss function to screen positive and negative samples. This strategy not only speeds up the allocation of positive and negative samples but also avoids the introduction of additional parameters that require optimization.
[0008] For example, patent document CN112258446A discloses a method for detecting industrial part defects based on an improved YOLO algorithm. The method includes the following steps: collecting industrial part image data, selecting and partitioning datasets, annotating images, enhancing images, constructing and training models, and calculating defect lengths. This method can accurately and quickly identify defects and locate them in actual production.
[0009] Although these target detection algorithms can alleviate the impact of complex backgrounds on detection results to a certain extent, they still have the following technical defects:
[0010] 1. It cannot solve extremely complex background problems, because there may be interference elements in the background that are very similar to the target. At the same time, changes in natural factors such as lighting and weather will also interfere with detection.
[0011] 2. During the detection process, the existence of negative samples is an important factor that cannot be ignored. Taking pole tower detection as an example, objects with similar features such as trees and light poles may be mistakenly identified as targets during detection. These similar features pose a potential threat to the robustness and accuracy of the model.
[0012] 3. During the training process, image distortion caused by stretching causes the shape and proportion of the target object to change. This distortion not only affects the visual effect of the image, but also misleads the model in training, making it unable to accurately identify the target object.
[0013] 4. The data augmentation process itself may also introduce noise, further affecting the accuracy of detection.
[0014] 5. Generate new training images by randomly sampling from the dataset (such as conventional mosaic enhancement technology). However, this random sampling method will violate the original intention of fully suppressing negative samples in the early stage of the regression process, because the number and distribution of negative samples in the generated images are uncertain.
[0015] Therefore, how to effectively deal with the problem of target detection in complex backgrounds remains a key issue that needs to be solved urgently in the field of target detection. Summary of the Invention
[0016] In view of the defects in the prior art, the present invention aims to provide a method and system for double-stage tower defect detection based on enhanced negative sample suppression.
[0017] According to the present invention, a method for double-stage tower defect detection based on enhanced negative sample suppression is provided, comprising:
[0018] Step S1: preprocessing the tower image, i.e., performing a preprocessing operation on the input tower image, wherein the preprocessing operation includes an image aspect ratio preservation algorithm;
[0019] Step S2: coarsely locate the defects in the tower image, that is, preliminarily determine the approximate area where the tower defects may exist in the tower image after the pre-processing operation in step S1;
[0020] Step S3: fine positioning of the pole tower image defect, that is, based on the coarse positioning of the pole tower image defect in step S2, further determining the specific location of the pole tower defect;
[0021] Step S4: Extracting defect features from the tower image, i.e. extracting defect features from the defect area after fine positioning of defects in the tower image in step S3;
[0022] Step S5: tower image defect training and prediction, that is, using the tower defect features extracted in step S4 to train the neural network model and perform defect prediction.
[0023] Preferably, the image aspect ratio maintaining algorithm in step S1 is to enlarge each input tower image into a square image with equal length and width.
[0024] Preferably, the pre-processing operation in step S1 includes combining the combination boxes corresponding to the tower pictures, and the combination processing includes the following steps:
[0025] Step S101: intercepting the tower image that has completed image processing from a fixed area in a matrix manner;
[0026] Step S102: splicing the pole tower images captured in step S101 into a new pole tower image, wherein the new pole tower image includes a combination box corresponding to the pole tower image after image processing.
[0027] Preferably, the detailed positioning of defects in the tower image in step S3 specifically refers to performing secondary target detection on the tower image to detect defects in the tower and screen out similar features inside the tower.
[0028] Preferably, the training process in step S5 includes a negative sample suppression algorithm, and the negative sample suppression algorithm specifically includes the following steps:
[0029] Step S501: randomly read a certain number of images from the VOC dataset each time;
[0030] Step S502: performing image processing on the pictures read in step S501;
[0031] Step S503: Place the images processed in steps S501 and S502 in a fixed order.
[0032] Preferably, the image processing in step S502 includes the following steps:
[0033] Step S5021: Flip the image read in step S501;
[0034] Step S5022: performing scaling processing on the image read in step S501;
[0035] Step S5033: performing color gamut change processing on the image read in step S501.
[0036] Preferably, the prediction process in step S5 includes a mosaic enhancement process, and the mosaic enhancement process includes the following steps:
[0037] Step S510: setting a certain number of independent negative sample sets, wherein the sets include a large number of pole tower images that are similar to the target pole tower image features but are not the target object;
[0038] Step S511: setting a parameter α for the negative sample set in step S510, wherein the parameter α is used to control the number of negative samples in the mosaic enhanced generated image.
[0039] Preferably, in step S511, the parameter α can adjust the proportion of negative samples in the training image according to the actual training generation requirements, as shown in the following formula:
[0040]
[0041] epoch represents the number of training generations. In the early stages of training (epoch < 30), we assume parameter α = 2, which means that two negative sample images are mixed into the four original images to generate new images, thereby achieving the goal of quickly suppressing negative samples in the early stages of training. In the later stages of training (epoch ≥ 30), we assume parameter α = 1, which means that one negative sample image is mixed into the four original images to generate new images, thereby reducing the suppression of negative samples in the later stages of training.
[0042] According to the present invention, a system for dual-stage tower defect detection based on enhanced negative sample suppression is provided, comprising:
[0043] Module M1: tower image preprocessing, i.e. performing a preprocessing operation on the input tower image, wherein the preprocessing operation includes an image aspect ratio preservation algorithm;
[0044] Module M2: Coarse location of defects in tower images, that is, preliminarily determining the approximate area where tower defects may exist in the tower images after pre-processing in module M1;
[0045] Module M3: Fine positioning of tower defects, that is, based on the rough positioning of tower defects in module M2, further determine the specific location of tower defects;
[0046] Module M4: Extraction of defect features from tower images, i.e., extracting defect features from the defect areas after fine positioning of defects in tower images in module M3;
[0047] Module M5: Tower image defect training and prediction, that is, using the tower defect features extracted by module M4 to train the neural network model and perform defect prediction.
[0048] Preferably, the method for two-stage tower defect detection based on enhanced negative sample suppression is adopted to achieve multi-type defect detection of electric pole power equipment through two-stage defect detection with enhanced negative sample suppression.
[0049] According to the present invention, a device for double-stage tower defect detection based on enhanced negative sample suppression is provided, which realizes multi-type defect detection of electric pole power equipment through double-stage defect detection with enhanced negative sample suppression.
[0050] Compared with the prior art, the present invention has the following beneficial effects:
[0051] 1. The two-stage target detection algorithm proposed in this paper eliminates the interference of complex environmental background on pole defect detection in the coarse positioning stage, preventing features in the background similar to the defect target from affecting the detection accuracy; in the fine positioning stage, regression detection is performed on the internal features of the pole, reducing the model's sensitivity to similar features inside the pole, thereby improving the accuracy and reliability of the detection results.
[0052] 2. The enhanced negative sample suppression algorithm proposed in this paper suppresses feature objects similar to the detection target in the global scope during training, enabling the model to learn more robust feature representations, thereby enhancing the detection accuracy and generalization ability of the model on new data.
[0053] 3. The image aspect ratio preservation algorithm proposed in this invention expands the tower image into a square image of equal width and height, avoiding the distortion of the original aspect ratio caused by the forced downsampling of the YOLO model. At the same time, it ensures that the original proportional relationship is maintained during the image scaling process, preventing the shape of the target object from being deformed, thereby improving detection accuracy.
[0054] 4. The present invention can maintain the original authenticity of the image during both the neural network training and prediction stages, which not only helps the model accurately capture and learn target features, but also further improves the accuracy and effectiveness of the detection results.
[0055] 5. This invention overcomes the shortcomings of conventional data augmentation techniques by ensuring that the images generated during the data augmentation process contain a certain proportion of negative samples, helping the model more effectively learn the differences between the target and similar features, thereby enhancing the model's robustness and prediction accuracy. Furthermore, this invention can flexibly adjust the proportion of negative samples as needed to optimize training results. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Other features, objects and advantages of the present invention will become more apparent upon reading the detailed description of non-limiting embodiments with reference to the following drawings:
[0057] Figure 1 Schematic diagram of the aspect ratio preservation algorithm;
[0058] Figure 2 Schematic diagram of the dual-stage tower defect detection structure based on enhanced negative sample suppression;
[0059] Figure 3 This is a schematic diagram of the Mosaic enhancement process;
[0060] Figure 1 middle:
[0061] ganta_img means extracting the image containing defects from the defect area;
[0062] Calculate represents the calculation process;
[0063] New_lenth represents the width of the new grayscale image;
[0064] position(x,y) represents the horizontal coordinate x and vertical coordinate y of the upper left corner of the generated image;
[0065] padding_img represents the new grayscale image generated;
[0066] Figure 2 middle:
[0067] Inputimage represents the input image;
[0068] YoloV8(Detect) represents the processing process based on YOLOV8 model detection;
[0069] output image represents the output image;
[0070] Padding refers to the filling process;
[0071] Padding image represents the image after padding processing;
[0072] Output boxes represent the final detection box of the image;
[0073] Figure 3 middle:
[0074] pic1, 2, 3, 4 represent the first image, second image, third image, and fourth image respectively;
[0075] new image represents a newly generated image. DETAILED DESCRIPTION
[0076] The present invention will be described in detail below with reference to specific embodiments. The following examples will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those skilled in the art, several changes and improvements can be made without departing from the scope of the present invention. These all fall within the scope of protection of the present invention.
[0077] The present invention proposes a two-stage tower defect detection method based on enhanced negative sample suppression, which specifically includes the following steps:
[0078] Step S1: preprocessing the tower image, i.e., performing a preprocessing operation on the acquired tower image, wherein the preprocessing operation includes an image aspect ratio maintaining algorithm;
[0079] Furthermore, the image aspect ratio preservation algorithm in step S1 expands each acquired tower image into a square image of equal length and width, thereby solving the problem of the original aspect ratio being destroyed due to YOLO forced downsampling. The calculation formula is as follows:
[0080] new_width=(original_width / / target_multiple+1)*target_multiple
[0081] new_height=(original_height / / target_multiple+1)*target_multiple
[0082] new_lenth=max(new_height,new_width)
[0083] padding_img=new img(new_lenth,new_lenth))
[0084] left=(new_lenth-original_width) / / 2
[0085] top=(new_lenth-original_height) / / 2
[0086] out_img=paste(ganta_img,padding_img,(left,top))
[0087] Among them, the symbol / / represents the integer division operation;
[0088] New_width represents the width value of the new grayscale image you want to generate;
[0089] original_width represents the width of the original image;
[0090] target_multiple represents the target size. When generating a new grayscale image, it is hoped that the width and height values of the new grayscale image are multiples of the target size.
[0091] new_height represents the height value of the new grayscale image you want to generate;
[0092] original_height represents the height of the original image;
[0093] New_lenth represents the width of the new grayscale image;
[0094] Max represents the maximum value of the width and height of the new grayscale image to be extracted;
[0095] new_width represents the height value of the new grayscale image;
[0096] padding_img represents the new grayscale image generated;
[0097] new img(new_lenth, new_lenth) represents the size of the new grayscale image;
[0098] Left represents the horizontal coordinate of the center point of the image with the width of the new grayscale image as the side length;
[0099] Top is represented by the vertical coordinate of the center point of the image with the width of the new grayscale image as the side length;
[0100] out_img represents the output image;
[0101] paste means image pasting processing;
[0102] ganta_img means extracting the image containing defects from the defect area;
[0103] Furthermore, the step S1 further includes, after completing the tower image processing, combining the combination boxes corresponding to these images.
[0104] The combined processing comprises the following steps:
[0105] Step S101: Cut out the processed image from a fixed area in a matrix manner;
[0106] Step S102: stitching the images captured in step S101 into a new image, wherein the new image includes a combination box corresponding to the image after image processing.
[0107] Step S2: Coarsely locate the defects in the tower image, that is, preliminarily determine the approximate area where the tower defects may exist in the image after the pre-processing operation in step S1.
[0108] Furthermore, the rough positioning of the tower image defects in step S2 is performed by filtering out external environmental features that may interfere with the tower image as shown in the following code:
[0109] boxes=YOLOV8(IMAGE)
[0110] Among them, YOLOV8 represents the neural network model, boxes represents the coordinates of the upper left corner and lower right corner of the detection image, and IMAGE represents a single image.
[0111] Preferably, the process of coarsely locating defects in the tower image is to input a single image as the original image, perform tower detection using the YOLOV8 neural network model, and output the coordinates of the upper left corner and lower right corner of the tower detection.
[0112] Step S3: fine positioning of the pole tower image defect, that is, based on the coarse positioning of the pole tower image defect in step S2, further determining the specific location of the pole tower defect;
[0113] Furthermore, the detailed positioning of the tower image defects in step S3 specifically refers to performing secondary target detection on the tower image to detect tower defects and filter out similar features inside the tower, thereby further improving the accuracy of tower defect target detection:
[0114] final_boxes = YOLOV8(out_img)
[0115] Among them, final_boxes represents the final detection box.
[0116] Step S4: Extracting defect features from the tower image, i.e. extracting defect features from the defect area after fine positioning of defects in the tower image in step S3;
[0117] Furthermore, the extraction of defect features of the tower image in step S4 specifically refers to extracting the tower detected after fine positioning during the feature extraction process:
[0118] ganta_img = slice(boxes)
[0119] Among them, ganta_img represents the image containing defects extracted from the defect area;
[0120] Slice means using the tower coordinates to extract from the towers detected after fine positioning;
[0121] Specifically, the coordinates of the tower in the original image are obtained from the bounding boxes after fine positioning. The coordinates include: x, y, w, and h, where x represents the horizontal coordinate value of the tower, y represents the vertical coordinate value of the tower, w represents the width value of the tower, and h represents the height value of the tower.
[0122] Furthermore, the specific processing of slice:
[0123] slice(boxes)=img[y:y+h,x:x+w,:]
[0124] in,
[0125] Slice(boxes) means obtaining the regional coordinates of the tower in the original image from the bounding box (boxes) after fine positioning;
[0126] img[y:y+h, x:x+w] means extracting the specified area from the tower image (img);
[0127] y:y+h represents the image coordinates from the yth row to the y+hth row of the tower;
[0128] x:x+w represents the image coordinates from the xth column to the x+wth column of the tower.
[0129] Step S5: the tower image training and prediction stage, that is, using the defect features extracted in step S4 to train the neural network model, and then perform defect prediction processing.
[0130] Furthermore, the training process in step S5 includes a negative sample suppression algorithm, and the negative sample suppression algorithm specifically includes the following steps:
[0131] Step S501: randomly read a certain number of images from the VOC dataset each time;
[0132] Step S502: performing image processing on the pictures read in step S501;
[0133] Furthermore, the image processing in step S502 includes the following steps:
[0134] Step S5021: Flipping the image read in step S501, for example, flipping the original image left to right;
[0135] Step S5022: performing scaling processing on the image read in step S501, for example, scaling the size of the original image;
[0136] Step S5033: performing color gamut change processing on the image read in step S501, for example, changing the brightness, saturation, and hue of the original image;
[0137] Step S503: Place the pictures processed in steps S501 and S502 in a fixed order. For example, after processing, four pictures are obtained, the first picture is placed in the upper left corner, the second picture is placed in the lower left corner, the third picture is placed in the lower right corner, and the fourth picture is placed in the upper right corner.
[0138] Furthermore, in order to ensure that the image generated by mosaic enhancement contains a sufficient number of negative samples, the prediction process in step S5 includes a mosaic enhancement process, and the mosaic enhancement process includes the following steps:
[0139] Step S510: setting a certain number of independent negative sample sets, wherein the sets include a large number of tower images that are similar to the target tower image features but are not the target object;
[0140] Step S511: setting a parameter α for the negative sample set in step S510, wherein the parameter α is used to control the number of negative samples in the mosaic enhanced generated image.
[0141] Furthermore, in step S511, the parameter α can adjust the proportion of negative samples in the training image according to actual needs to achieve the best training effect, as shown in the following formula:
[0142]
[0143] Among them, epoch represents the number of generations of training.
[0144] Preferably, in the early stage of training (epoch < 30), it is assumed that the parameter α = 2, that is, two negative sample images are mixed into four original images to generate new images, thereby achieving the purpose of quickly suppressing negative samples in the early stage of training; in the late stage of training (epoch ≥ 30), it is assumed that the parameter α = 1, that is, one negative sample image is mixed into four original images to generate new images, thereby achieving the purpose of reducing and suppressing negative samples in the late stage of training.
[0145] Preferably, in the later stages of training, the value of α can be reduced to prevent overfitting.
[0146] Preferably, the setting of parameter α is closely related to the size of the negative sample set. Taking the conventional parameter α set for the standard negative sample set as a reference, a smaller α is set for a small negative sample set, and a larger α is set for a large negative sample set, so as to prevent the occurrence of overfitting problems that interfere with detection accuracy.
[0147] The present invention also provides a system for two-stage tower defect detection based on enhanced negative sample suppression. The system for two-stage tower defect detection based on enhanced negative sample suppression can be implemented by executing the process steps of the two-stage tower defect detection method based on enhanced negative sample suppression. That is, those skilled in the art can understand the two-stage tower defect detection method based on enhanced negative sample suppression as a preferred implementation of the two-stage tower defect detection system based on enhanced negative sample suppression.
[0148] Preferably, the system for dual-stage tower defect detection based on enhanced negative sample suppression provided by the present invention includes:
[0149] Module M1: tower image preprocessing, i.e. performing a preprocessing operation on the input tower image, wherein the preprocessing operation includes an image aspect ratio preservation algorithm;
[0150] Module M2: Coarse location of defects in tower images, that is, preliminarily determining the approximate area where tower defects may exist in the tower images after pre-processing in module M1;
[0151] Module M3: Fine positioning of tower defects, that is, based on the rough positioning of tower defects in module M2, further determine the specific location of tower defects;
[0152] Module M4: Extraction of defect features from tower images, i.e., extracting defect features from the defect areas after fine positioning of defects in tower images in module M3;
[0153] Module M5: Tower image defect training and prediction, that is, using the tower defect features extracted by module M4 to train the neural network model and perform defect prediction.
[0154] Preferably, the image aspect ratio maintaining algorithm in the module M1 is to enlarge each input tower image into a square image with equal length and width.
[0155] Preferably, the pre-processing operation in the module M1 includes combining the combination boxes corresponding to the tower pictures, and the combination processing includes the following modules:
[0156] Module M101: Cut out the tower image after image processing from a fixed area in a matrix manner;
[0157] Module M102: splicing the pole tower images captured in module M101 into a new pole tower image, wherein the new pole tower image includes a combination box corresponding to the pole tower image after image processing.
[0158] Preferably, the detailed positioning of defects in the tower image in the module M3 specifically refers to performing secondary target detection on the tower image, detecting defects in the tower, and screening out similar features inside the tower.
[0159] Preferably, the training process in the module M5 includes a negative sample suppression algorithm, and the negative sample suppression algorithm specifically includes the following modules:
[0160] Module M501: randomly reads a certain number of images from the VOC dataset each time;
[0161] Module M502: performs image processing on the images read by module M501;
[0162] Module M503: Place the images processed by modules M501 and M502 in a fixed order.
[0163] Preferably, the image processing in the module M502 includes the following modules:
[0164] Module M5021: Flips the image read by module M501;
[0165] Module M5022: performs scaling processing on the image read by module M501;
[0166] Module M5033: performs color gamut change processing on the image read by module M501.
[0167] Preferably, the prediction processing in the module M5 includes a mosaic enhancement process, and the mosaic enhancement process includes the following modules:
[0168] Module M510: Setting a certain number of independent negative sample sets, wherein the sets include a large number of pole tower images that are similar to the target pole tower image features but are not the target objects;
[0169] Module M511: Sets parameter α for the negative sample set in module M510, where parameter α is used to control the number of negative samples in the mosaic enhanced generated image.
[0170] Preferably, in the module M511, the parameter α can adjust the proportion of negative samples in the training image according to the actual training number requirements, as shown in the following formula:
[0171]
[0172] Among them, epoch represents the number of generations of training.
[0173] Preferably, in the early stage of training (epoch < 30), it is assumed that the parameter α = 2, that is, two negative sample images are mixed into four original images to generate new images, thereby achieving the purpose of quickly suppressing negative samples in the early stage of training; in the late stage of training (epoch ≥ 30), it is assumed that the parameter α = 1, that is, one negative sample image is mixed into four original images to generate new images, thereby achieving the purpose of reducing and suppressing negative samples in the late stage of training.
[0174] The present invention also provides a device for double-stage tower defect detection based on enhanced negative sample suppression, which realizes multi-type defect detection of electric pole power equipment through double-stage defect detection with enhanced negative sample suppression.
[0175] The above describes specific embodiments of the present invention. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art may make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. The embodiments of this application and the features in the embodiments may be combined with each other in any manner unless there is a conflict.
Claims
1. A two-stage tower defect detection method based on enhanced negative sample suppression, characterized in that: include: Step S1: preprocessing the tower image, i.e., performing a preprocessing operation on the input tower image, wherein the preprocessing operation includes an image aspect ratio preservation algorithm; Step S2: coarsely locate the defects in the tower image, that is, preliminarily determine the approximate area where the tower defects may exist in the tower image after the pre-processing operation in step S1; Step S3: fine positioning of the pole tower image defect, that is, based on the coarse positioning of the pole tower image defect in step S2, further determining the specific location of the pole tower defect; Step S4: Extracting defect features from the tower image, i.e. extracting defect features from the defect area after fine positioning of defects in the tower image in step S3; Step S5: tower image defect training and prediction, that is, using the tower defect features extracted in step S4 to train the neural network model and perform defect prediction.
2. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 1, characterized in that: The image aspect ratio maintaining algorithm in step S1 is to enlarge each input tower image into a square image with equal length and width.
3. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 1, characterized in that: The pre-processing operation in step S1 includes combining the combination boxes corresponding to the tower pictures, and the combination processing includes the following steps: Step S101: intercepting the tower image that has completed image processing from a fixed area in a matrix manner; Step S102: splicing the pole tower images captured in step S101 into a new pole tower image, wherein the new pole tower image includes a combination box corresponding to the pole tower image after image processing.
4. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 1, characterized in that: The detailed positioning of defects in the tower image in step S3 specifically refers to performing secondary target detection on the tower image to detect defects in the tower and screen out similar features inside the tower.
5. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 1, characterized in that: The training process in step S5 includes a negative sample suppression algorithm, which specifically includes the following steps: Step S501: randomly read a certain number of images from the VOC dataset each time; Step S502: performing image processing on the pictures read in step S501; Step S503: Place the images processed in steps S501 and S502 in a fixed order.
6. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 5, characterized in that: The image processing in step S502 includes the following steps: Step S5021: Flip the image read in step S501; Step S5022: performing scaling processing on the image read in step S501; Step S5033: performing color gamut change processing on the image read in step S501.
7. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 1, characterized in that: The prediction process in step S5 includes a mosaic enhancement process, and the mosaic enhancement process includes the following steps: Step S510: setting a certain number of independent negative sample sets, wherein the sets include a large number of pole tower images that are similar to the target pole tower image features but are not the target object; Step S511: setting a parameter α for the negative sample set in step S510, wherein the parameter α is used to control the number of negative samples in the mosaic enhanced generated image.
8. The method for dual-stage tower defect detection based on enhanced negative sample suppression according to claim 7, characterized in that: In step S511, the parameter α can adjust the proportion of negative samples in the training image according to the actual training number requirements, as shown in the following formula: Here, epoch represents the number of generations of training. In the early stage of training, epoch < 30, the parameter α is set to 2, and two negative sample images are mixed into the four original images to generate new images. In the later stage of training, epoch ≥ 30, the parameter α is set to 1, and one negative sample image is mixed into the four original images to generate new images.
9. A dual-stage tower defect detection system based on enhanced negative sample suppression, characterized in that: include: Module M1: tower image preprocessing, i.e. performing a preprocessing operation on the input tower image, wherein the preprocessing operation includes an image aspect ratio preservation algorithm; Module M2: Coarse location of defects in tower images, that is, preliminarily determining the approximate area where tower defects may exist in the tower images after pre-processing in module M1; Module M3: Fine positioning of tower defects, that is, based on the rough positioning of tower defects in module M2, further determine the specific location of tower defects; Module M4: Extraction of defect features from tower images, i.e., extracting defect features from the defect areas after fine positioning of defects in tower images in module M3; Module M5: Tower image defect training and prediction, that is, using the tower defect features extracted by module M4 to train the neural network model and perform defect prediction.
10. A device for dual-stage tower defect detection based on enhanced negative sample suppression, characterized in that: The method for two-stage tower defect detection based on enhanced negative sample suppression according to any one of claims 1 to 8 is adopted, and multi-type defect detection of electric pole power equipment is achieved through two-stage defect detection with enhanced negative sample suppression.
Citation Information
Patent Citations
Industrial part defect detection method based on improved YOLO algorithm
CN112258446A
Distribution line defect detection method and system, identification terminal and unmanned aerial vehicle
CN116485731A
Power transmission line key part identification and defect detection method
CN117197555A